Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StreamServerInterceptor ¶
func StreamServerInterceptor(t Authenticator) grpc.StreamServerInterceptor
StreamServerInterceptor returns a gRPC stream server interceptor that wraps the incoming stream with an authenticator.
func UnaryServerInterceptor ¶
func UnaryServerInterceptor(t Authenticator) grpc.UnaryServerInterceptor
UnaryServerInterceptor returns a gRPC unary server interceptor that performs authentication using the provided Authenticator.
Types ¶
type Authenticator ¶ added in v0.4.6
Authenticator - Interface for oidc authenticator
type Authn ¶ added in v0.4.6
type Authn struct { // IssuerURL is the URL of the OIDC issuer. IssuerURL string // Audience is the intended audience of the tokens, typically the client ID. Audience string // JwksURI is the URL to fetch the JSON Web Key Set (JWKS) from. JwksURI string // JWKs holds the JWKS fetched from JwksURI for validating tokens. JWKs *keyfunc.JWKS // contains filtered or unexported fields }
Authn holds configuration for OIDC authentication, including issuer, audience, and key details.
func NewOidcAuthn ¶
NewOidcAuthn creates a new instance of Authn configured for OIDC authentication. It initializes the HTTP client with retry capabilities, sets up the OIDC issuer and audience, and attempts to fetch the JWKS keys from the issuer's JWKsURI.
func (*Authn) Authenticate ¶ added in v0.4.6
Authenticate validates the authentication token from the request context.
type Config ¶ added in v0.7.5
type Config struct { // Issuer is the OIDC provider's unique identifier URL. Issuer string `json:"issuer"` // JWKsURI is the URL to the JSON Web Key Set (JWKS) provided by the OIDC issuer. JWKsURI string `json:"jwks_uri"` }
Config holds OpenID Connect (OIDC) configuration details.