Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExchangeHandler ¶
type ExchangeHandler struct {
// contains filtered or unexported fields
}
ExchangeHandler handles the exchange of API keys for JWT tokens.
func NewExchangeHandler ¶
func NewExchangeHandler(jwtSigner TokenGenerator, store KeyVerifier) *ExchangeHandler
NewExchangeHandler creates a new ExchangeHandler with the provided token generator and key verifier.
func (*ExchangeHandler) Exchange ¶
func (h *ExchangeHandler) Exchange(w http.ResponseWriter, r *http.Request)
Exchange handles HTTP requests to exchange API keys for JWT tokens. It validates the API key and returns a JWT token for the associated organization.
type JWKSHandler ¶
type JWKSHandler struct {
// contains filtered or unexported fields
}
JWKSHandler handles serving JSON Web Key Set (JWKS) endpoints.
func NewJWKSHandler ¶
func NewJWKSHandler(jwtSigner PublicKeyProvider) *JWKSHandler
NewJWKSHandler creates a new JWKSHandler with the provided public key provider.
func (*JWKSHandler) ServeJWKS ¶
func (h *JWKSHandler) ServeJWKS(w http.ResponseWriter, r *http.Request)
ServeJWKS handles HTTP requests to serve the JSON Web Key Set (JWKS) containing public keys. It returns the public keys in JWKS format with appropriate caching headers.
type KeyVerifier ¶
KeyVerifier defines the interface for validating API keys and retrieving organization information.
type PublicKeyProvider ¶
type PublicKeyProvider interface {
GetPublicJWK() jose.JSONWebKey
}
PublicKeyProvider defines the interface for providing public keys in JWK format.
type TokenGenerator ¶
TokenGenerator defines the interface for generating authentication tokens.
type TokenRequest ¶
type TokenRequest struct {
APIKey string `json:"api_key"`
}
TokenRequest represents the request payload for token exchange.
type TokenResponse ¶
TokenResponse represents the response payload containing the generated token.