oauth-resource-server 0.2.0

OAuth 2.0 bearer-token resource server for Rust HTTP services: JWT access-token validation against a JWKS, RFC 9728 protected-resource metadata, RFC 6750 challenges, optional static API key, axum integration.
Documentation
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

[package]
edition = "2024"
rust-version = "1.89"
name = "oauth-resource-server"
version = "0.2.0"
build = false
include = [
    "src/**/*",
    "examples/**/*",
    "tests/**/*",
    "docs/**/*",
    "README.md",
    "LICENSE",
    "CHANGELOG.md",
]
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "OAuth 2.0 bearer-token resource server for Rust HTTP services: JWT access-token validation against a JWKS, RFC 9728 protected-resource metadata, RFC 6750 challenges, optional static API key, axum integration."
documentation = "https://docs.rs/oauth-resource-server"
readme = "README.md"
keywords = [
    "oauth",
    "jwt",
    "jwks",
    "axum",
    "authentication",
]
categories = [
    "authentication",
    "web-programming::http-server",
]
license = "MIT"
repository = "https://github.com/St0nefish/oauth-resource-server"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = [
    "--cfg",
    "docsrs",
]

[features]
axum = [
    "tower",
    "dep:axum",
]
default = ["rustls-tls"]
env = []
mcp = [
    "tower",
    "dep:http-body",
    "dep:bytes",
]
metrics = ["dep:metrics"]
native-tls = ["reqwest/native-tls"]
rustls-tls = ["reqwest/rustls-tls"]
rustls-tls-native-roots = ["reqwest/rustls-tls-native-roots"]
serde = ["serde/derive"]
testing = [
    "tokio/net",
    "tokio/io-util",
]
tower = [
    "dep:http",
    "dep:tower-layer",
    "dep:tower-service",
]

[lib]
name = "oauth_resource_server"
path = "src/lib.rs"

[[example]]
name = "axum_basic"
path = "examples/axum_basic.rs"
required-features = [
    "axum",
    "serde",
    "testing",
]

[[example]]
name = "env_config"
path = "examples/env_config.rs"
required-features = [
    "env",
    "axum",
]

[[example]]
name = "hyper"
path = "examples/hyper.rs"
required-features = ["testing"]

[[example]]
name = "multiple_sources"
path = "examples/multiple_sources.rs"
required-features = [
    "axum",
    "testing",
]

[[example]]
name = "standalone_validator"
path = "examples/standalone_validator.rs"
required-features = ["testing"]

[[test]]
name = "ambiguous_key_warning"
path = "tests/ambiguous_key_warning.rs"

[[test]]
name = "challenge_fallback_log"
path = "tests/challenge_fallback_log.rs"

[[test]]
name = "env_proxy_loopback"
path = "tests/env_proxy_loopback.rs"

[[test]]
name = "glob_import"
path = "tests/glob_import.rs"

[[test]]
name = "observability_logs"
path = "tests/observability_logs.rs"

[[test]]
name = "observability_metrics"
path = "tests/observability_metrics.rs"

[[test]]
name = "redacted_debug"
path = "tests/redacted_debug.rs"

[[test]]
name = "redacted_logs"
path = "tests/redacted_logs.rs"

[[test]]
name = "redacted_request_uri"
path = "tests/redacted_request_uri.rs"

[dependencies.axum]
version = "0.8"
features = ["json"]
optional = true
default-features = false

[dependencies.base64]
version = "0.23"

[dependencies.bytes]
version = "1.2"
optional = true

[dependencies.http]
version = "1"
optional = true

[dependencies.http-body]
version = "1"
optional = true

[dependencies.jsonwebtoken]
version = "9.2"

[dependencies.metrics]
version = "0.24"
optional = true

[dependencies.reqwest]
version = "0.12"
default-features = false

[dependencies.serde]
version = "1.0.152"

[dependencies.serde_json]
version = "1.0.64"

[dependencies.subtle]
version = "2.5"

[dependencies.thiserror]
version = "2"

[dependencies.tokio]
version = "1.15"
features = [
    "sync",
    "time",
    "rt",
]

[dependencies.tower-layer]
version = "0.3.3"
optional = true

[dependencies.tower-service]
version = "0.3.3"
optional = true

[dependencies.tracing]
version = "0.1.29"

[dependencies.zeroize]
version = "1.8"

[dev-dependencies.axum]
version = "0.8"
features = [
    "tokio",
    "http1",
]
default-features = false

[dev-dependencies.bytes]
version = "1"

[dev-dependencies.http-body-util]
version = "0.1"

[dev-dependencies.hyper]
version = "1"
features = [
    "server",
    "client",
    "http1",
]

[dev-dependencies.hyper-util]
version = "0.1"
features = ["tokio"]

[dev-dependencies.metrics-util]
version = "0.20"
features = ["debugging"]
default-features = false

[dev-dependencies.serde]
version = "1"

[dev-dependencies.serde_yaml_ng]
version = "0.10"

[dev-dependencies.tokio]
version = "1"
features = [
    "macros",
    "rt",
    "rt-multi-thread",
    "net",
    "io-util",
    "time",
    "sync",
    "test-util",
]

[dev-dependencies.tokio-rustls]
version = "0.26"
features = [
    "ring",
    "tls12",
]
default-features = false

[dev-dependencies.tower]
version = "0.5"
features = ["util"]

[dev-dependencies.tower-http]
version = "0.7"
features = ["cors"]

[dev-dependencies.tracing-subscriber]
version = "0.3"

[lints.rust.unexpected_cfgs]
level = "warn"
priority = 0
check-cfg = ["cfg(fuzzing)"]