Documentation
¶
Index ¶
- func LoadPrivateKey(path urischeme.URIScheme) (interface{}, error)
- type AccessTokenType
- type Client
- type Config
- type GrantType
- type OAuthClientsConfig
- type OAuthSigner
- func (s *OAuthSigner) Close()
- func (s *OAuthSigner) GetAuthority() string
- func (s *OAuthSigner) GetClients() OAuthClientsConfig
- func (s *OAuthSigner) GetDeviceIDClaim() string
- func (s *OAuthSigner) GetDomain() string
- func (s *OAuthSigner) GetJWK() jwk.Key
- func (s *OAuthSigner) GetOwnerClaim() string
- func (s *OAuthSigner) GetValidator(clientID string) (*validator.Validator, bool)
- func (s *OAuthSigner) Sign(token jwt.Token) ([]byte, error)
- func (s *OAuthSigner) SignRaw(data []byte) ([]byte, error)
- type PrivateKeyJWTConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadPrivateKey ¶
Types ¶
type AccessTokenType ¶
type AccessTokenType string
const AccessTokenType_JWT AccessTokenType = "jwt"
type Client ¶
type Client struct { ID string `yaml:"id"` SecretFile urischeme.URIScheme `yaml:"secretFile"` Owner string `yaml:"owner"` AccessTokenLifetime time.Duration `yaml:"accessTokenLifetime"` AllowedGrantTypes []GrantType `yaml:"allowedGrantTypes"` AllowedAudiences []string `yaml:"allowedAudiences"` AllowedScopes []string `yaml:"allowedScopes"` JWTPrivateKey PrivateKeyJWTConfig `yaml:"jwtPrivateKey"` InsertTokenClaims map[string]interface{} `yaml:"insertTokenClaims"` // runtime Secret string `yaml:"-"` }
type Config ¶
type Config struct { PrivateKeyFile urischeme.URIScheme `yaml:"privateKeyFile" json:"privateKeyFile"` Domain string `yaml:"domain" json:"domain"` OwnerClaim string `yaml:"ownerClaim" json:"ownerClaim"` DeviceIDClaim string `yaml:"deviceIDClaim" json:"deviceIDClaim"` Clients OAuthClientsConfig `yaml:"clients" json:"clients"` }
func (*Config) GetAuthority ¶
type GrantType ¶
type GrantType string
const (
GrantTypeClientCredentials GrantType = "client_credentials"
)
type OAuthClientsConfig ¶
type OAuthClientsConfig []*Client
func (OAuthClientsConfig) Find ¶
func (c OAuthClientsConfig) Find(id string) *Client
type OAuthSigner ¶
type OAuthSigner struct {
// contains filtered or unexported fields
}
func New ¶
func New(ctx context.Context, config Config, getOpenIDConfiguration validator.GetOpenIDConfigurationFunc, customTokenIssuerClients map[string]pkgJwt.TokenIssuerClient, fileWatcher *fsnotify.Watcher, logger log.Logger, tracerProvider trace.TracerProvider) (*OAuthSigner, error)
func (*OAuthSigner) Close ¶
func (s *OAuthSigner) Close()
func (*OAuthSigner) GetAuthority ¶
func (s *OAuthSigner) GetAuthority() string
func (*OAuthSigner) GetClients ¶
func (s *OAuthSigner) GetClients() OAuthClientsConfig
func (*OAuthSigner) GetDeviceIDClaim ¶
func (s *OAuthSigner) GetDeviceIDClaim() string
func (*OAuthSigner) GetDomain ¶
func (s *OAuthSigner) GetDomain() string
func (*OAuthSigner) GetJWK ¶
func (s *OAuthSigner) GetJWK() jwk.Key
func (*OAuthSigner) GetOwnerClaim ¶
func (s *OAuthSigner) GetOwnerClaim() string
func (*OAuthSigner) GetValidator ¶
func (s *OAuthSigner) GetValidator(clientID string) (*validator.Validator, bool)
type PrivateKeyJWTConfig ¶
type PrivateKeyJWTConfig struct { Enabled bool `yaml:"enabled"` Authorization validator.Config `yaml:"authorization,omitempty"` }
func (*PrivateKeyJWTConfig) Validate ¶
func (c *PrivateKeyJWTConfig) Validate() error
Click to show internal directories.
Click to hide internal directories.