Documentation
¶
Index ¶
- type DiscordProvider
- func (p *DiscordProvider) Exchange(ctx context.Context, code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)
- func (p *DiscordProvider) GetAuthURL(state string, opts ...oauth2.AuthCodeOption) string
- func (p *DiscordProvider) GetConfig() *oauth2.Config
- func (p *DiscordProvider) GetName() string
- func (p *DiscordProvider) GetUserInfo(ctx context.Context, token *oauth2.Token) (*models.OAuth2UserInfo, error)
- func (p *DiscordProvider) RequiresPKCE() bool
- type DiscordUser
- type GenericProvider
- func (p *GenericProvider) Exchange(ctx context.Context, code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)
- func (p *GenericProvider) GetAuthURL(state string, opts ...oauth2.AuthCodeOption) string
- func (p *GenericProvider) GetConfig() *oauth2.Config
- func (p *GenericProvider) GetName() string
- func (p *GenericProvider) GetUserInfo(ctx context.Context, token *oauth2.Token) (*models.OAuth2UserInfo, error)
- func (p *GenericProvider) RequiresPKCE() bool
- type GitHubEmailInfo
- type GitHubProvider
- func (p *GitHubProvider) Exchange(ctx context.Context, code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)
- func (p *GitHubProvider) GetAuthURL(state string, opts ...oauth2.AuthCodeOption) string
- func (p *GitHubProvider) GetConfig() *oauth2.Config
- func (p *GitHubProvider) GetName() string
- func (p *GitHubProvider) GetUserInfo(ctx context.Context, token *oauth2.Token) (*models.OAuth2UserInfo, error)
- func (p *GitHubProvider) RequiresPKCE() bool
- type GitHubUser
- type GoogleProvider
- func (p *GoogleProvider) Exchange(ctx context.Context, code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)
- func (p *GoogleProvider) GetAuthURL(state string, opts ...oauth2.AuthCodeOption) string
- func (p *GoogleProvider) GetConfig() *oauth2.Config
- func (p *GoogleProvider) GetName() string
- func (p *GoogleProvider) GetUserInfo(ctx context.Context, token *oauth2.Token) (*models.OAuth2UserInfo, error)
- func (p *GoogleProvider) RequiresPKCE() bool
- type GoogleUser
- type OAuth2Provider
- type OAuth2ProviderRegistry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiscordProvider ¶
type DiscordProvider struct {
// contains filtered or unexported fields
}
func NewDiscordProvider ¶
func NewDiscordProvider(config *models.OAuth2ProviderConfig) *DiscordProvider
func (*DiscordProvider) Exchange ¶
func (p *DiscordProvider) Exchange(ctx context.Context, code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)
func (*DiscordProvider) GetAuthURL ¶
func (p *DiscordProvider) GetAuthURL(state string, opts ...oauth2.AuthCodeOption) string
func (*DiscordProvider) GetConfig ¶
func (p *DiscordProvider) GetConfig() *oauth2.Config
func (*DiscordProvider) GetName ¶
func (p *DiscordProvider) GetName() string
func (*DiscordProvider) GetUserInfo ¶
func (p *DiscordProvider) GetUserInfo(ctx context.Context, token *oauth2.Token) (*models.OAuth2UserInfo, error)
func (*DiscordProvider) RequiresPKCE ¶
func (p *DiscordProvider) RequiresPKCE() bool
type DiscordUser ¶
type GenericProvider ¶
type GenericProvider struct {
// contains filtered or unexported fields
}
func NewGenericProvider ¶
func NewGenericProvider(name string, config *models.OAuth2ProviderConfig) *GenericProvider
func (*GenericProvider) Exchange ¶
func (p *GenericProvider) Exchange(ctx context.Context, code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)
func (*GenericProvider) GetAuthURL ¶
func (p *GenericProvider) GetAuthURL(state string, opts ...oauth2.AuthCodeOption) string
func (*GenericProvider) GetConfig ¶
func (p *GenericProvider) GetConfig() *oauth2.Config
func (*GenericProvider) GetName ¶
func (p *GenericProvider) GetName() string
func (*GenericProvider) GetUserInfo ¶
func (p *GenericProvider) GetUserInfo(ctx context.Context, token *oauth2.Token) (*models.OAuth2UserInfo, error)
func (*GenericProvider) RequiresPKCE ¶
func (p *GenericProvider) RequiresPKCE() bool
type GitHubEmailInfo ¶
type GitHubProvider ¶
type GitHubProvider struct {
// contains filtered or unexported fields
}
func NewGitHubProvider ¶
func NewGitHubProvider(config *models.OAuth2ProviderConfig) *GitHubProvider
func (*GitHubProvider) Exchange ¶
func (p *GitHubProvider) Exchange(ctx context.Context, code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)
func (*GitHubProvider) GetAuthURL ¶
func (p *GitHubProvider) GetAuthURL(state string, opts ...oauth2.AuthCodeOption) string
func (*GitHubProvider) GetConfig ¶
func (p *GitHubProvider) GetConfig() *oauth2.Config
func (*GitHubProvider) GetName ¶
func (p *GitHubProvider) GetName() string
func (*GitHubProvider) GetUserInfo ¶
func (p *GitHubProvider) GetUserInfo(ctx context.Context, token *oauth2.Token) (*models.OAuth2UserInfo, error)
func (*GitHubProvider) RequiresPKCE ¶
func (p *GitHubProvider) RequiresPKCE() bool
type GitHubUser ¶
type GoogleProvider ¶
type GoogleProvider struct {
// contains filtered or unexported fields
}
func NewGoogleProvider ¶
func NewGoogleProvider(config *models.OAuth2ProviderConfig) *GoogleProvider
func (*GoogleProvider) Exchange ¶
func (p *GoogleProvider) Exchange(ctx context.Context, code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)
func (*GoogleProvider) GetAuthURL ¶
func (p *GoogleProvider) GetAuthURL(state string, opts ...oauth2.AuthCodeOption) string
func (*GoogleProvider) GetConfig ¶
func (p *GoogleProvider) GetConfig() *oauth2.Config
func (*GoogleProvider) GetName ¶
func (p *GoogleProvider) GetName() string
func (*GoogleProvider) GetUserInfo ¶
func (p *GoogleProvider) GetUserInfo(ctx context.Context, token *oauth2.Token) (*models.OAuth2UserInfo, error)
func (*GoogleProvider) RequiresPKCE ¶
func (p *GoogleProvider) RequiresPKCE() bool
type GoogleUser ¶
type OAuth2Provider ¶
type OAuth2Provider interface {
GetName() string
GetConfig() *oauth2.Config
RequiresPKCE() bool
GetAuthURL(state string, opts ...oauth2.AuthCodeOption) string
Exchange(ctx context.Context, code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)
GetUserInfo(ctx context.Context, token *oauth2.Token) (*models.OAuth2UserInfo, error)
}
OAuth2Provider defines the interface for OAuth2 providers.
type OAuth2ProviderRegistry ¶
type OAuth2ProviderRegistry struct {
// contains filtered or unexported fields
}
func NewOAuth2ProviderRegistry ¶
func NewOAuth2ProviderRegistry(config *models.Config) *OAuth2ProviderRegistry
func (*OAuth2ProviderRegistry) Clear ¶
func (r *OAuth2ProviderRegistry) Clear()
func (*OAuth2ProviderRegistry) Get ¶
func (r *OAuth2ProviderRegistry) Get(name string) (OAuth2Provider, error)
func (*OAuth2ProviderRegistry) RefreshOAuth2Providers ¶
func (r *OAuth2ProviderRegistry) RefreshOAuth2Providers()
func (*OAuth2ProviderRegistry) Register ¶
func (r *OAuth2ProviderRegistry) Register(provider OAuth2Provider)
Click to show internal directories.
Click to hide internal directories.