Documentation
¶
Index ¶
Constants ¶
const RegisterPath = "/oauth/register"
RegisterPath is the dynamic client registration endpoint.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OAuthClientRegistrar ¶
type OAuthClientRegistrar interface {
Execute(ctx context.Context, name string, redirectURIs []string) (*authservice.OAuthClient, error)
}
OAuthClientRegistrar registers OAuth clients.
type OAuthCodeExchanger ¶
type OAuthCodeExchanger interface {
Execute(ctx context.Context, code, verifier, clientID, redirectURI string) (*authservice.OAuthTokens, error)
}
OAuthCodeExchanger exchanges authorization codes for tokens.
type OAuthHTTPHandler ¶
type OAuthHTTPHandler struct {
// contains filtered or unexported fields
}
OAuthHTTPHandler serves the OAuth discovery, registration and token endpoints.
func NewOAuthHTTPHandler ¶
func NewOAuthHTTPHandler(urls OAuthURLs, limiter RequestLimiter, register OAuthClientRegistrar, exchange OAuthCodeExchanger, refresh OAuthTokenRefresher) *OAuthHTTPHandler
NewOAuthHTTPHandler serves the OAuth endpoints. limiter limits client registration, which needs no credentials, per client IP under the key RegisterPath.
func (*OAuthHTTPHandler) Register ¶
func (h *OAuthHTTPHandler) Register(router *mux.Router)
type OAuthTokenRefresher ¶
type OAuthTokenRefresher interface {
Execute(ctx context.Context, refreshToken, clientID string) (*authservice.OAuthTokens, error)
}
OAuthTokenRefresher rotates refresh tokens.
type OAuthURLs ¶
type OAuthURLs struct {
// Public is the base URL of the MCP server: the protected resource, the
// issuer and the host of the token and registration endpoints.
Public string
// UI is the base URL of the main UI, which serves /oauth/authorize. Empty
// leaves the authorization server metadata unserved.
UI string
}
OAuthURLs are the base URLs the OAuth metadata names.
type OIDCHTTPHandler ¶
type OIDCHTTPHandler struct {
// contains filtered or unexported fields
}
OIDCHTTPHandler provides plain HTTP endpoints for OIDC login/callback flows.
func NewOIDCHTTPHandler ¶
func NewOIDCHTTPHandler(startOIDCLogin *authservice.StartOIDCLogin, handleOIDCCallback *authservice.HandleOIDCCallback, frontendURL string, logger *logging.Logger, cookieConfig connectutil.CookieConfig, stateTTL time.Duration) *OIDCHTTPHandler
NewOIDCHTTPHandler creates a new OIDC HTTP handler. stateTTL is how long a started login stays valid.
func (*OIDCHTTPHandler) Register ¶
func (h *OIDCHTTPHandler) Register(router *mux.Router)