pub enum AuthConfig {
Bearer {
tokens: Vec<String>,
scoped_tokens: Vec<BearerTokenConfig>,
},
Jwt {
issuer: String,
audience: String,
jwks_uri: String,
roles: Vec<RoleConfig>,
role_mapping: Option<RoleMappingConfig>,
},
OAuth {
issuer: String,
audience: String,
client_id: Option<String>,
client_secret: Option<String>,
token_validation: TokenValidationStrategy,
jwks_uri: Option<String>,
introspection_endpoint: Option<String>,
required_scopes: Vec<String>,
roles: Vec<RoleConfig>,
role_mapping: Option<RoleMappingConfig>,
},
}Expand description
Inbound authentication configuration.
Variants§
Bearer
Static bearer token authentication.
Fields
scoped_tokens: Vec<BearerTokenConfig>Tokens with per-token tool access control.
Jwt
JWT authentication via JWKS endpoint.
Fields
roles: Vec<RoleConfig>RBAC role definitions
role_mapping: Option<RoleMappingConfig>Map JWT claims to roles
OAuth
OAuth 2.1 authentication with auto-discovery and token introspection.
Discovers authorization server endpoints (JWKS URI, introspection endpoint) from the issuer URL via RFC 8414 metadata. Supports JWT validation, opaque token introspection, or both.
Fields
issuer: StringAuthorization server issuer URL (e.g. https://accounts.google.com).
Used for RFC 8414 metadata discovery.
client_secret: Option<String>OAuth client secret (required for token introspection).
Supports ${ENV_VAR} syntax.
token_validation: TokenValidationStrategyToken validation strategy.
required_scopes: Vec<String>Scopes a token must carry to access the proxy.
Every listed scope must be present in the token (AND semantics); requests whose token is missing any of them are rejected for all operations. Empty (the default) means no scope gate. Enforced at the MCP middleware level via the OAuth scope-enforcement layer.
roles: Vec<RoleConfig>RBAC role definitions.
role_mapping: Option<RoleMappingConfig>Map JWT/token claims to roles.
Trait Implementations§
Source§impl Debug for AuthConfig
impl Debug for AuthConfig
Source§impl<'de> Deserialize<'de> for AuthConfig
impl<'de> Deserialize<'de> for AuthConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for AuthConfig
impl RefUnwindSafe for AuthConfig
impl Send for AuthConfig
impl Sync for AuthConfig
impl Unpin for AuthConfig
impl UnsafeUnpin for AuthConfig
impl UnwindSafe for AuthConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more