Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultJWKSPath = "/.well-known/jwks.json" DefaultDiscoveryPath = "/.well-known/openid-configuration" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(jwksURL string, opts ...ClientOption) *Client
func NewClientFromDiscovery ¶
func NewClientFromDiscovery(issuerURL string, opts ...ClientOption) (*Client, error)
type ClientOption ¶
type ClientOption func(*Client)
func WithCacheTTL ¶
func WithCacheTTL(d time.Duration) ClientOption
func WithHTTPClient ¶
func WithHTTPClient(hc *http.Client) ClientOption
type EndpointOption ¶
type EndpointOption func(*Endpoints)
func WithDiscoveryPath ¶
func WithDiscoveryPath(p string) EndpointOption
func WithIssuerURLOverride ¶
func WithIssuerURLOverride(url string) EndpointOption
func WithJWKSPath ¶
func WithJWKSPath(p string) EndpointOption
type Endpoints ¶
type Endpoints struct {
// contains filtered or unexported fields
}
Endpoints aggregates JWKS and OIDC Discovery handlers with their standard well-known paths, providing a single Register call.
func NewEndpoints ¶
func NewEndpoints(km *KeyManager, appCfg *conf.App, l logger.Logger, opts ...EndpointOption) *Endpoints
NewEndpoints creates an Endpoints that reads external_url from appCfg. If external_url is empty a warning is logged and the issuer URL in the OIDC Discovery response will be blank.
func (*Endpoints) Register ¶
func (e *Endpoints) Register(r RouteRegistrar)
Register mounts the JWKS and OIDC Discovery handlers onto r.
type KeyManager ¶
type KeyManager struct {
// contains filtered or unexported fields
}
func NewKeyManager ¶
func NewKeyManager(opts ...Option) (*KeyManager, error)
func NewKeyManagerFromConfig ¶
func NewKeyManagerFromConfig(cfg *conf.App) (*KeyManager, error)
NewKeyManagerFromConfig creates a KeyManager by reading JWT settings from the shared app configuration. It bridges conf.App.Jwt fields to jwks.Option so callers don't need to repeat the mapping logic.
func (*KeyManager) JWKSResponse ¶
func (km *KeyManager) JWKSResponse() *Response
func (*KeyManager) Signer ¶
func (km *KeyManager) Signer() *jwtpkg.Signer
func (*KeyManager) Verifier ¶
func (km *KeyManager) Verifier() *jwtpkg.Verifier
type RouteRegistrar ¶
RouteRegistrar is satisfied by *khttp.Server and *http.ServeMux.
Click to show internal directories.
Click to hide internal directories.