github

package
v1.13.2 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "github"

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	*generic.Provider
}

func NewProvider

func NewProvider(conf config.Config) *Provider

func (*Provider) CheckOrgs added in v1.7.0

func (p *Provider) CheckOrgs(ctx context.Context, tokens *oidc.Tokens[*idtoken.Claims]) error

func (*Provider) CheckTeams added in v1.7.0

func (p *Provider) CheckTeams(ctx context.Context, tokens *oidc.Tokens[*idtoken.Claims]) error

func (*Provider) CheckUser

func (p *Provider) CheckUser(
	ctx context.Context, _ state.State, _ types.UserData, tokens *oidc.Tokens[*idtoken.Claims],
) error

func (*Provider) GetDefaultScopes added in v1.11.0

func (p *Provider) GetDefaultScopes() []string

func (*Provider) GetEndpoints added in v1.6.0

func (p *Provider) GetEndpoints(conf config.Config) (oauth2.Endpoint, error)

func (*Provider) GetName added in v1.6.0

func (p *Provider) GetName() string

func (*Provider) GetRefreshToken added in v1.13.0

func (p *Provider) GetRefreshToken(tokens *oidc.Tokens[*idtoken.Claims]) string

GetRefreshToken returns the oauth2.Token.AccessToken of the user, since it does not expire. OAuth2 App on GitHub doesn't provide a refresh token.

func (*Provider) GetUser

func (p *Provider) GetUser(ctx context.Context, tokens *oidc.Tokens[*idtoken.Claims]) (types.UserData, error)

func (*Provider) Refresh added in v1.13.0

func (p *Provider) Refresh(ctx context.Context, _ *slog.Logger, accessToken string, _ rp.RelyingParty) (string, error)

Refresh use the oauth2.Token.AccessToken from initial authentication and call the REST API if the user is still present inside the required groups.

Jump to

Keyboard shortcuts

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