client

package
v0.11.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Metadata          *Metadata
	JWKS              jwk.Set
	IsLocalhostClient bool
}

func (*Client) IsRedirectURIAllowed added in v0.11.0

func (c *Client) IsRedirectURIAllowed(requestedURI string) bool

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(args ManagerArgs) *Manager

func (*Manager) GetClient

func (cm *Manager) GetClient(ctx context.Context, clientId string) (*Client, error)

func (*Manager) GetClientJWKS added in v0.11.1

func (cm *Manager) GetClientJWKS(ctx context.Context, clientId string) (jwk.Set, error)

GetClientJWKS resolves the keys published by an OAuth client independently of its token endpoint authentication method. Spaces client attestations use these keys even when the client does not use private_key_jwt at the token endpoint.

func (*Manager) GetClientJWKSWithRefresh added in v0.11.1

func (cm *Manager) GetClientJWKSWithRefresh(ctx context.Context, clientId string, forceRefresh bool) (jwk.Set, error)

GetClientJWKSWithRefresh resolves the keys published by an OAuth client, optionally bypassing both the client metadata and JWKS caches. A refresh is needed when a token signed by a newly rotated client key follows a cached lookup of the old key.

type ManagerArgs

type ManagerArgs struct {
	Cli    *http.Client
	Logger *slog.Logger
}

type Metadata

type Metadata struct {
	ClientID                    string        `json:"client_id"`
	ClientName                  string        `json:"client_name"`
	ClientURI                   string        `json:"client_uri"`
	LogoURI                     string        `json:"logo_uri"`
	TOSURI                      string        `json:"tos_uri"`
	PolicyURI                   string        `json:"policy_uri"`
	RedirectURIs                []string      `json:"redirect_uris"`
	GrantTypes                  []string      `json:"grant_types"`
	ResponseTypes               []string      `json:"response_types"`
	ApplicationType             string        `json:"application_type"`
	DpopBoundAccessTokens       bool          `json:"dpop_bound_access_tokens"`
	JWKSURI                     *string       `json:"jwks_uri,omitempty"`
	JWKS                        *MetadataJwks `json:"jwks,omitempty"`
	Scope                       string        `json:"scope"`
	TokenEndpointAuthMethod     string        `json:"token_endpoint_auth_method"`
	TokenEndpointAuthSigningAlg string        `json:"token_endpoint_auth_signing_alg"`
}

type MetadataJwks

type MetadataJwks struct {
	Keys []any `json:"keys"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL