Documentation
¶
Index ¶
- Constants
- type AuthorityRegistration
- type Details
- type Registry
- func (r *Registry) Default(ctx context.Context) *Details
- func (r *Registry) Get(ctx context.Context, authorityID string) (*AuthorityRegistration, bool)
- func (r *Registry) Lookup(ctx context.Context, authorityID string) (*Details, error)
- func (r *Registry) Register(authority *AuthorityRegistration) error
- type RegistryData
Constants ¶
const (
AuthorityTypeOIDC = "oidc"
)
Supported Authority kind string values.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthorityRegistration ¶
type AuthorityRegistration struct {
ID string `yaml:"id"`
Name string `yaml:"name"`
AuthorityType string `yaml:"authority_type"`
Iss string `yaml:"iss"`
ClientID string `yaml:"client_id"`
ClientSecret string `yaml:"client_secret"`
Insecure bool `yaml:"insecure"`
Default bool `yaml:"default"`
Discover *bool `yaml:"discover"`
Scopes []string `yaml:"scopes"`
ResponseType string `yaml:"response_type"`
CodeChallengeMethod string `yaml:"code_challenge_method"`
RawMetadataEndpoint string `yaml:"metadata_endpoint"`
RawAuthorizationEndpoint string `yaml:"authorization_endpoint"`
JWKS *jose.JSONWebKeySet `yaml:"jwks"`
IdentityClaimName string `yaml:"identity_claim_name"`
IdentityAliases map[string]string `yaml:"identity_aliases,flow"`
IdentityAliasRequired bool `yaml:"identity_alias_required"`
// contains filtered or unexported fields
}
AuthorityRegistration defines an authority with its properties.
func (*AuthorityRegistration) Initialize ¶
func (ar *AuthorityRegistration) Initialize(ctx context.Context, logger logrus.FieldLogger) error
Initialize initializes the associated registration with the provided context.
func (*AuthorityRegistration) Validate ¶
func (ar *AuthorityRegistration) Validate() error
Validate validates the associated authority registration data and returns error if the data is not valid.
type Details ¶
type Details struct {
ID string
Name string
AuthorityType string
ClientID string
ClientSecret string
Insecure bool
Scopes []string
ResponseType string
CodeChallengeMethod string
Registration *AuthorityRegistration
AuthorizationEndpoint *url.URL
// contains filtered or unexported fields
}
Details hold detail information about authorities identified by ID.
func (*Details) IdentityClaimValue ¶
IdentityClaimValue returns the claim value of the provided claims from the claim defined at the associated registration.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry implements the registry for registered authorities.
func NewRegistry ¶
func NewRegistry(ctx context.Context, registrationConfFilepath string, logger logrus.FieldLogger) (*Registry, error)
NewRegistry creates a new authorizations Registry with the provided parameters.
func (*Registry) Default ¶
Default returns the default authority from the associated registry if any.
func (*Registry) Get ¶
Get returns the registered authorities registration for the provided client ID.
func (*Registry) Lookup ¶
Lookup returns and validates the authority Detail information for the provided parameters from the accociated authority registry.
func (*Registry) Register ¶
func (r *Registry) Register(authority *AuthorityRegistration) error
Register validates the provided authority registration and adds the authority to the accociated registry if valid. Returns error otherwise.
type RegistryData ¶
type RegistryData struct {
Authorities []*AuthorityRegistration `yaml:"authorities,flow"`
}
RegistryData is the base structure of our authority registration configuration file.