generic

package
v1.21.6 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "generic"

Variables

View Source
var (
	ErrMismatch             = errors.New("mismatch")
	ErrMissingClaim         = errors.New("missing claim")
	ErrMissingRequiredRole  = errors.New("missing required role")
	ErrMissingRequiredGroup = errors.New("missing required group")
)

Functions

This section is empty.

Types

type Provider

type Provider struct {
	Conf config.Config
}

func NewProvider

func NewProvider(_ context.Context, conf config.Config, _ *http.Client) (*Provider, error)

func (*Provider) CheckCommonName

func (p *Provider) CheckCommonName(session state.State, tokens *oidc.Tokens[*idtoken.Claims]) error

func (*Provider) CheckGroups

func (p *Provider) CheckGroups(tokens *oidc.Tokens[*idtoken.Claims]) error

func (*Provider) CheckIPAddress

func (p *Provider) CheckIPAddress(session state.State, tokens *oidc.Tokens[*idtoken.Claims]) error

func (*Provider) CheckRoles

func (p *Provider) CheckRoles(tokens *oidc.Tokens[*idtoken.Claims]) error

func (*Provider) CheckUser

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

func (*Provider) GetName

func (p *Provider) GetName() string

func (*Provider) GetProviderConfig

func (p *Provider) GetProviderConfig(conf config.Config) (types.ProviderConfig, error)

GetProviderConfig implements the github.com/JustARegularUsername/openvpn-auth-oauth2/internal/oauth2.Provider interface.

func (*Provider) GetRefreshToken

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

func (*Provider) GetUser

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

func (*Provider) Refresh

func (p *Provider) Refresh(ctx context.Context, logger *slog.Logger, relyingParty rp.RelyingParty, refreshToken string) (*oidc.Tokens[*idtoken.Claims], error)

Refresh initiates a non-interactive authentication against the sso provider.

func (*Provider) RevokeRefreshToken

func (p *Provider) RevokeRefreshToken(ctx context.Context, logger *slog.Logger, relyingParty rp.RelyingParty, refreshToken string) error

Jump to

Keyboard shortcuts

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