Documentation ¶
Overview ¶
Package oauth2 holds utilities for bootstrapping an OAuth2 proxy from the metadata injected by a OAuth2 secret. Within an app, users can write:
middleware, err := oauth2.New(ctx, handler)
or
http.ListenAndServe(":8181", oauth2.NewOrDie(ctx, handler)))
This is modeled after the Bindings pattern.
Index ¶
- Constants
- func Middleware(ctx context.Context, wrapped http.Handler, verifier *oidc.IDTokenVerifier) http.Handler
- func New(ctx context.Context, handler http.Handler) (http.Handler, error)
- func NewOrDie(ctx context.Context, handler http.Handler) http.Handler
- func NewProvider(ctx context.Context, handler http.Handler) (http.Handler, error)
- func ReadClientID(root string) (string, error)
- func ReadIssuer(root string) (string, error)
- func StartOAuth2Proxy(ctx context.Context) error
- func WithAuthenticatedUser(ctx context.Context, user *User) context.Context
- type User
Constants ¶
View Source
const ( OAuth2ProxyCfg = "oauth2_proxy.cfg" IssuerName = "oidc_issuer" ClientIDName = "oidc_client_id" )
Variables ¶
This section is empty.
Functions ¶
func Middleware ¶
func NewProvider ¶
func ReadClientID ¶
func ReadIssuer ¶
func StartOAuth2Proxy ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.