check

package
v0.38.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPrincipal

func GetPrincipal(ctx context.Context, opts Options, log logger.Logger, c client.Client) (*auth.UserPrincipal, error)

GetPrincipal retrieves OIDC claims by sending the user through an authorization code flow. It spins up a temporary web server, sets the server's address as redirect URI in the authentication request and subsequently exchanges the authorization code for an ID token. NOTE: Make sure to configure your OIDC provider so that it accepts "http://localhost:9876" as redirect URI.

Types

type Claims

type Claims struct {
	Username string
	Groups   []string
}

type Options

type Options struct {
	ClientID                   string
	ClientSecret               string
	IssuerURL                  string
	SecretName                 string
	SecretNamespace            string
	Scopes                     []string
	ClaimUsername              string
	ClaimGroups                string
	OpenURL                    func(string) error
	InsecureSkipSignatureCheck bool
}

Jump to

Keyboard shortcuts

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