oauth

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package oauth contains rpc AuthHandler for oauth/oidc JWT tokens.

Index

Constants

View Source
const (
	// CredentialsTypeOAuthWeb for jwt access tokens signed by oidc/oauth backend.
	CredentialsTypeOAuthWeb = rpc.CredentialsType("oauth-web-auth")
)

Variables

This section is empty.

Functions

func WithWebOAuthTokenAuthHandler

func WithWebOAuthTokenAuthHandler(opts WebOAuthOptions) rpc.ServerOption

WithWebOAuthTokenAuthHandler returns a rpc server option configured for the AuthHandler. The WebAuth handler will validate jwt access tokens signed by OIDC provider. The jwts are validated for the aud standard claim.

This allows auth handler allows for a dynamic set of signing keys provided through OIDC configuration endpoint.

Entity verification is deleged to the EntityVerifier method in the options.

Types

type WebOAuthOptions

type WebOAuthOptions struct {
	// Audience claim that must be within the "aud" JWT claims presented.
	AllowedAudiences []string

	// Key provider used to provide public keys to validate the jwt basid on its "kid" header.
	KeyProvider jwks.KeyProvider

	// Underlying Entity verifier after
	EntityVerifier func(ctx context.Context, entity string) (interface{}, error)
	Logger         golog.Logger
}

WebOAuthOptions options for the WebOauth handler.

Directories

Path Synopsis
Package testutils contains test helper methods for the rpc/oauth package
Package testutils contains test helper methods for the rpc/oauth package

Jump to

Keyboard shortcuts

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