Documentation ¶
Index ¶
- Constants
- func LoadPrivateKey(path urischeme.URIScheme) (interface{}, error)
- func NewHTTP(requestHandler *RequestHandler, logger log.Logger) http.Handler
- type APIsConfig
- type AccessTokenType
- type AllowedGrantType
- type AsymmetricKey
- type Client
- type ClientsConfig
- type Config
- type HTTPConfig
- type OAuthClientsConfig
- type OAuthSignerConfig
- type RequestHandler
- type Service
Constants ¶
View Source
const ( DeviceUserID = "1" DefaultScope = "openid profile email offline_access r:* w:*" )
View Source
const ( TokenScopeKey = "scope" TokenNicknameKey = "nickname" TokenNameKey = "name" TokenPictureKey = "picture" )
Variables ¶
This section is empty.
Functions ¶
func LoadPrivateKey ¶
Types ¶
type APIsConfig ¶
type APIsConfig struct {
HTTP HTTPConfig `yaml:"http" json:"http"`
}
Config represent application configuration
func (*APIsConfig) Validate ¶
func (c *APIsConfig) Validate() error
type AccessTokenType ¶
type AccessTokenType string
const AccessTokenType_JWT AccessTokenType = "jwt"
type AllowedGrantType ¶
type AllowedGrantType string
const ( AllowedGrantType_AUTHORIZATION_CODE AllowedGrantType = "authorization_code" AllowedGrantType_CLIENT_CREDENTIALS AllowedGrantType = "client_credentials" AllowedGrantType_PASSWORD AllowedGrantType = "password" AllowedGrantType_REFRESH_TOKEN AllowedGrantType = "refresh_token" )
type AsymmetricKey ¶
type Client ¶
type Client struct { ID string `yaml:"id"` ClientSecret string `yaml:"secret"` AuthorizationCodeLifetime time.Duration `yaml:"authorizationCodeLifetime"` AccessTokenLifetime time.Duration `yaml:"accessTokenLifetime"` CodeRestrictionLifetime time.Duration `yaml:"codeRestrictionLifetime"` RefreshTokenRestrictionLifetime time.Duration `yaml:"refreshTokenRestrictionLifetime"` ConsentScreenEnabled bool `yaml:"consentScreenEnabled"` RequireIssuedAuthorizationCode bool `yaml:"requireIssuedAuthorizationCode"` RequiredScope []string `yaml:"requiredScope"` RequiredResponseType string `yaml:"requiredResponseType"` RequiredRedirectURI string `yaml:"requiredRedirectURI"` }
type ClientsConfig ¶
type ClientsConfig struct {
OpenTelemetryCollector http.OpenTelemetryCollectorConfig `yaml:"openTelemetryCollector" json:"openTelemetryCollector"`
}
func (*ClientsConfig) Validate ¶ added in v2.4.0
func (c *ClientsConfig) Validate() error
type Config ¶
type Config struct { Log log.Config `yaml:"log" json:"log"` APIs APIsConfig `yaml:"apis" json:"apis"` Clients ClientsConfig `yaml:"clients" json:"clients"` OAuthSigner OAuthSignerConfig `yaml:"oauthSigner" json:"oauthSigner"` }
Config represents application configuration
type HTTPConfig ¶ added in v2.4.6
type HTTPConfig struct { Connection listener.Config `yaml:",inline" json:",inline"` Server server.Config `yaml:",inline" json:",inline"` }
func (*HTTPConfig) Validate ¶ added in v2.4.6
func (c *HTTPConfig) Validate() error
type OAuthClientsConfig ¶ added in v2.4.0
type OAuthClientsConfig []*Client
func (OAuthClientsConfig) Find ¶ added in v2.4.0
func (c OAuthClientsConfig) Find(id string) *Client
type OAuthSignerConfig ¶
type OAuthSignerConfig struct { IDTokenKeyFile urischeme.URIScheme `yaml:"idTokenKeyFile" json:"idTokenKeyFile"` AccessTokenKeyFile urischeme.URIScheme `yaml:"accessTokenKeyFile" json:"accessTokenKeyFile"` Domain string `yaml:"domain" json:"domain"` Clients OAuthClientsConfig `yaml:"clients" json:"clients"` }
func (*OAuthSignerConfig) Validate ¶
func (c *OAuthSignerConfig) Validate() error
type RequestHandler ¶
type RequestHandler struct {
// contains filtered or unexported fields
}
RequestHandler for handling incoming request
func NewRequestHandler ¶
func NewRequestHandler(ctx context.Context, config *Config, idTokenKey *rsa.PrivateKey, accessTokenKey interface{}) (*RequestHandler, error)
NewRequestHandler factory for new RequestHandler
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Server handle HTTP request
Click to show internal directories.
Click to hide internal directories.