providers

package
v1.44.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseProvider

type BaseProvider struct {
	// contains filtered or unexported fields
}

func (*BaseProvider) GetAuthURL

func (p *BaseProvider) GetAuthURL(state string) string

func (*BaseProvider) GetName

func (p *BaseProvider) GetName() string

func (*BaseProvider) GetToken

func (p *BaseProvider) GetToken(ctx context.Context, code string) (*oauth2.Token, error)

GetToken returns the token for the provider.

type Bitbucket

type Bitbucket struct {
	BaseProvider
	// contains filtered or unexported fields
}

func (*Bitbucket) FetchUserInfo

func (b *Bitbucket) FetchUserInfo(ctx context.Context, accessToken *oauth2.Token) (*UserInfo, error)

type GitHub

type GitHub struct {
	BaseProvider
	// contains filtered or unexported fields
}

func (*GitHub) FetchUserInfo

func (p *GitHub) FetchUserInfo(ctx context.Context, accessToken *oauth2.Token) (*UserInfo, error)

type OIDCProvider

type OIDCProvider struct {
	BaseProvider
	// contains filtered or unexported fields
}

func NewOIDCProvider

func NewOIDCProvider(ctx context.Context, name string, providerConfig config.OAuthClientProviderConfig, authServiceBaseURL url.URL) (*OIDCProvider, error)

func (*OIDCProvider) FetchUserInfo

func (p *OIDCProvider) FetchUserInfo(ctx context.Context, accessToken *oauth2.Token) (*UserInfo, error)

type Provider

type Provider interface {
	GetAuthURL(state string) string
	GetName() string
	GetToken(ctx context.Context, code string) (*oauth2.Token, error)
	FetchUserInfo(ctx context.Context, accessToken *oauth2.Token) (*UserInfo, error)
}

Provider defines the interface for OAuth client provider implementations. It provides methods to generate authorization URLs and retrieve provider metadata.

func NewBitbucketProvider

func NewBitbucketProvider(name string, providerConfig config.OAuthClientProviderConfig, authServiceBaseURL url.URL, endpoint oauth2.Endpoint) Provider

func NewGitHubProvider

func NewGitHubProvider(name string, providerConfig config.OAuthClientProviderConfig, authServiceBaseURL url.URL, endpoint oauth2.Endpoint) Provider

type UserInfo

type UserInfo struct {
	ID            string
	Name          string
	Login         string
	Email         string
	EmailVerified bool
	Provider      string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL