Documentation ¶
Overview ¶
Package auth GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE
Index ¶
- Variables
- func ContextWithAuth(ctx context.Context, o Auth) context.Context
- func RegisterOAuthProvider(ctx context.Context, op OAuthProvider)
- type AccountExchanger
- type Auth
- type Authorizations
- type OAuthProvider
- type OAuthRegister
- type OIDC
- type Provider
- type ProviderInfo
- type Token
- type TokenExchange
- type UserInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrOAuthProviderNotFound = errors.New("OAuthProvider Not Found")
)
Functions ¶
func RegisterOAuthProvider ¶
func RegisterOAuthProvider(ctx context.Context, op OAuthProvider)
Types ¶
type AccountExchanger ¶
type Auth ¶
type Auth interface { ListAuthProvider() (list []*ProviderInfo) AuthCodeURL(ctx context.Context, name string, redirectURI string) (redirectTo *url.URL, err error) ExchangeToken(ctx context.Context, name string, code string) (token *Token, err error) }
func FromContext ¶
type Authorizations ¶
func ParseAuthorization ¶
func ParseAuthorization(s string) (auths Authorizations)
func (Authorizations) Add ¶
func (auths Authorizations) Add(k string, v string)
func (Authorizations) Get ¶
func (auths Authorizations) Get(k string) string
func (Authorizations) RuntimeDoc ¶
func (Authorizations) RuntimeDoc(names ...string) ([]string, bool)
func (Authorizations) String ¶
func (auths Authorizations) String() string
type OAuthProvider ¶
type OAuthRegister ¶
type OAuthRegister interface {
Register(op OAuthProvider)
}
type OIDC ¶
type OIDC struct { // OpenIDConnect Endpoint, when empty, oidc feature disabled. Endpoint string `flag:",omitempty"` }
type Provider ¶
type Provider struct { // Should be full callback URI // example https://host/authorize/callback/{name} RedirectURI string `flag:",omitempty"` AutoCreatedBy string `flag:",omitempty"` // contains filtered or unexported fields }
func (*Provider) InjectContext ¶
func (*Provider) SetAccountExchanger ¶
func (c *Provider) SetAccountExchanger(ae AccountExchanger)
func (*Provider) SetDefaults ¶
func (c *Provider) SetDefaults()
type ProviderInfo ¶
func (ProviderInfo) RuntimeDoc ¶
func (v ProviderInfo) RuntimeDoc(names ...string) ([]string, bool)
type Token ¶
type Token struct { AccessToken string `json:"access_token"` Token string `json:"token,omitempty"` RefreshToken string `json:"refresh_token,omitempty"` ExpiresIn int `json:"expires_in"` IssuedAt time.Time `json:"issued_at"` // Token type Type string `json:"type"` // ext ID string `json:"id,omitempty"` }
type TokenExchange ¶ added in v0.5.4
type TokenExchange struct { Type string `json:"type"` // When type totp Passcode string `json:"passcode,omitempty"` }
func (TokenExchange) RuntimeDoc ¶ added in v0.5.4
func (v TokenExchange) RuntimeDoc(names ...string) ([]string, bool)
Click to show internal directories.
Click to hide internal directories.