oidc

package
v0.1.148 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2025 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthOption added in v0.1.10

type AuthOption func(*AuthOptions)

func WithExpectedAudience added in v0.1.10

func WithExpectedAudience(x string) AuthOption

func WithExpectedIssuer added in v0.1.10

func WithExpectedIssuer(x string) AuthOption

func WithHeaderKey added in v0.1.10

func WithHeaderKey(x string) AuthOption

func WithPrefix added in v0.1.10

func WithPrefix(x string) AuthOption

type AuthOptions added in v0.1.10

type AuthOptions struct {
	HeaderKey        string
	Prefix           string
	ExpectedAudience string
	ExpectedIssuer   string
}

func ApplyAuthOptions added in v0.1.10

func ApplyAuthOptions(opts *AuthOptions, modifiers ...AuthOption) AuthOptions

type Blackbox

type Blackbox interface {
	// contains filtered or unexported methods
}

type Client

type Client interface {
	Blackbox
	AuthenticateOIDC(ctx context.Context, r *http.Request, opts AuthOptions) (*contract.AuthenticationResult, error)
	CreateOIDCToken(ctx context.Context, credentialsJSON []byte, audience string) (*oauth2.Token, error)
}

func NewClient

func NewClient() Client

type DefaultTool added in v0.1.11

type DefaultTool struct {
	T *contract.Tool[Client]
}

func NewTool

func NewTool(c Client, opts contract.ToolOptions[Client]) *DefaultTool

func (*DefaultTool) AuthenticateOIDC added in v0.1.11

func (d *DefaultTool) AuthenticateOIDC(ctx context.Context, r *http.Request, opts AuthOptions) (*contract.AuthenticationResult, error)

AuthenticateOIDC performs OIDC authentication using the provided AuthOptions.

func (*DefaultTool) CreateOIDCToken added in v0.1.11

func (d *DefaultTool) CreateOIDCToken(ctx context.Context, credentialsJSON []byte, audience string) (*oauth2.Token, error)

CreateOIDCToken generates an OIDC token using the given service account credentials.

Jump to

Keyboard shortcuts

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