metadata

package
v0.0.0-...-5c97e34 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Endpoints

type Endpoints struct {
	JwksURI               string
	RegistrationEndpoint  string
	AuthorizationEndpoint string
	TokenEndpoint         string
	RevocationEndpoint    string
}

type ServerMetadata

type ServerMetadata struct {
	Issuer                                             string             `json:"issuer"`
	AuthorizationEndpoint                              *string            `json:"authorization_endpoint,omitempty"`
	TokenEndpoint                                      *string            `json:"token_endpoint,omitempty"`
	JwksURI                                            *string            `json:"jwks_uri,omitempty"`
	RegistrationEndpoint                               *string            `json:"registration_endpoint,omitempty"`
	ScopesSupported                                    mapset.Set[string] `json:"scopes_supported,omitempty"`
	ResponseTypesSupported                             mapset.Set[string] `json:"response_types_supported"`
	ResponseModesSupported                             mapset.Set[string] `json:"response_modes_supported,omitempty"`
	GrantTypesSupported                                mapset.Set[string] `json:"grant_types_supported,omitempty"` // "... if omitted, the default value is ["authorization_code", "implicit"]..."
	TokenEndpointAuthMethodsSupported                  mapset.Set[string] `json:"token_endpoint_auth_methods_supported,omitempty"`
	TokenEndpointAuthSigningAlgValuesSupported         mapset.Set[string] `json:"token_endpoint_auth_signing_alg_values_supported,omitempty"`
	ServiceDocumentation                               *string            `json:"service_documentation,omitempty"`
	UILocalesSupported                                 mapset.Set[string] `json:"ui_locales_supported,omitempty"`
	OpPolicyURI                                        *string            `json:"op_policy_uri,omitempty"`
	OpTosURI                                           *string            `json:"op_tos_uri,omitempty"`
	RevocationEndpoint                                 *string            `json:"revocation_endpoint,omitempty"`
	RevocationEndpointAuthMethodsSupported             mapset.Set[string] `json:"revocation_endpoint_auth_methods_supported,omitempty"`
	RevocationEndpointAuthSigningAlgValuesSupported    mapset.Set[string] `json:"revocation_endpoint_auth_signing_alg_values_supported,omitempty"`
	IntrospectionEndpoint                              *string            `json:"introspection_endpoint,omitempty"`
	IntrospectionEndpointAuthMethodsSupported          mapset.Set[string] `json:"introspection_endpoint_auth_methods_supported,omitempty"`
	IntrospectionEndpointAuthSigningAlgValuesSupported mapset.Set[string] `json:"introspection_endpoint_auth_signing_alg_values_supported,omitempty"`
	CodeChallengeMethodsSupported                      mapset.Set[string] `json:"code_challenge_methods_supported,omitempty"`
}

func New

func New(issuer string, responseTypes ...string) *ServerMetadata

func (*ServerMetadata) SupportsCodeChallengeMethod

func (s *ServerMetadata) SupportsCodeChallengeMethod(method string) bool

func (*ServerMetadata) SupportsPKCE

func (s *ServerMetadata) SupportsPKCE() bool

func (*ServerMetadata) WithCodeChallengeMethods

func (s *ServerMetadata) WithCodeChallengeMethods(codeChallengeMethods ...string) *ServerMetadata

WithCodeChallengeMethods sets the code_challenge_methods_supported metadata field. (PKCE support)

func (*ServerMetadata) WithEndpoints

func (s *ServerMetadata) WithEndpoints(endpoints *Endpoints) *ServerMetadata

WithEndpoints populates endpoints and URLs, optionally prepending relative endpoints with the issuer.

func (*ServerMetadata) WithGrantTypes

func (s *ServerMetadata) WithGrantTypes(grantTypes ...string) *ServerMetadata

WithGrantType sets the grant_types_supported metadata field. Also adds the corresponding response_types_supported entry if applicable.

func (*ServerMetadata) WithResponseTypes

func (s *ServerMetadata) WithResponseTypes(responseTypes ...string) *ServerMetadata

WithResponseTypes sets the response_types_supported metadata field. Also adds the corresponding grant_types_supported entry if applicable.

func (*ServerMetadata) WithRevocationEndpointAuthMethodsSupported

func (s *ServerMetadata) WithRevocationEndpointAuthMethodsSupported(values ...string) *ServerMetadata

func (*ServerMetadata) WithScopes

func (s *ServerMetadata) WithScopes(scopes ...string) *ServerMetadata

func (*ServerMetadata) WithTokenEndpointAuthMethodsSupported

func (s *ServerMetadata) WithTokenEndpointAuthMethodsSupported(values ...string) *ServerMetadata

WithTokenEndpointAuthMethodsSupported sets the token_endpoint_auth_methods_supported metadata field.

Jump to

Keyboard shortcuts

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