service

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2022 License: Apache-2.0 Imports: 16 Imported by: 6

Documentation

Index

Constants

View Source
const AuthContextKey = authContextKeyType("token")

AuthContextKey is a key used in RPC context to retrieve the token info with using context.Value.

View Source
const DefaultJWKSURL = "http://localhost:8080/.well-known/jwks.json"

DefaultJWKSURL is the default JWKS url pointing to a local authentication server.

Variables

This section is empty.

Functions

func StartGRPCServer

func StartGRPCServer(jwksURL string, opts ...StartGRPCServerOption) (sock net.Listener, srv *grpc.Server, err error)

Types

type AuthConfig

type AuthConfig struct {

	// Jwks contains a JSON Web Key Set, that is used if JWKS support is enabled. Otherwise a
	// stored public key will be used
	Jwks *keyfunc.JWKS

	AuthFunc grpc_auth.AuthFunc
	// contains filtered or unexported fields
}

func ConfigureAuth

func ConfigureAuth(opts ...AuthOption) *AuthConfig

ConfigureAuth creates a new AuthConfig, which can be used in gRPC middleware to provide an authentication layer.

type AuthOption

type AuthOption func(*AuthConfig)

AuthOption is a function-style option type to fine-tune authentication

func WithJWKSURL

func WithJWKSURL(url string) AuthOption

WithJWKSURL is an option to provide a URL that contains a JSON Web Key Set (JWKS). The JWKS will be used to validate tokens coming from RPC clients against public keys contains in the JWKS.

func WithPublicKey

func WithPublicKey(publicKey *ecdsa.PublicKey) AuthOption

WithPublicKey is an option to directly provide a ECDSA public key which is used to verify tokens coming from RPC clients.

type StartGRPCServerOption

type StartGRPCServerOption func(srv *grpc.Server)

Directories

Path Synopsis
aws
k8s

Jump to

Keyboard shortcuts

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