auth

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicAuth

func BasicAuth(user, password string) string

func ChainedAuthFuncs

func ChainedAuthFuncs(fn ...grpc_auth.AuthFunc) grpc_auth.AuthFunc

func Equals

func Equals(s1, s2 string) bool

func NewBasicAuthClientIntereptors

func NewBasicAuthClientIntereptors(user, password string) interceptors.ClientInterceptors

func NewBearerClientInterceptors

func NewBearerClientInterceptors(token string) interceptors.ClientInterceptors

func NewServerInterceptors

func NewServerInterceptors(opts ...Option) interceptors.ServerInterceptors

Types

type BasicValidator

type BasicValidator func(ctx context.Context, user, password string) (context.Context, error)

type Option

type Option func(o *options)

func WithBasicValidators

func WithBasicValidators(validators ...BasicValidator) Option

func WithIgnoredMethods

func WithIgnoredMethods(methods ...string) Option

WithIgnoredMethods bypass auth for the given methods, it takes a list of fully qualified method name, e.g. /helloworld.Greeter/SayHello

func WithMethods

func WithMethods(methods ...string) Option

WithMethods change the behaviour to not protect by default, it takes a list of fully qualified method names to protect, e.g. /helloworld.Greeter/SayHello

func WithTokenValidators

func WithTokenValidators(validators ...TokenValidator) Option

func WithX509Validators

func WithX509Validators(validators ...X509Validator) Option

type TokenValidator

type TokenValidator func(ctx context.Context, token string) (context.Context, error)

type X509Validator

type X509Validator func(ctx context.Context, sans []string) (context.Context, error)

Jump to

Keyboard shortcuts

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