auth

package
v0.6.30 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MissingTokenError = status.Error(
		codes.Unauthenticated,
		"missing token",
	)
	UnexpectedTokenTypeError = status.Error(
		codes.Unauthenticated,
		"unexpected token type",
	)
)

Functions

This section is empty.

Types

type Authentication

type Authentication interface {
	Authenticate() grpc.UnaryClientInterceptor
}

Authentication interface

type Interceptor

type Interceptor struct {
	// contains filtered or unexported fields
}

Interceptor is the interceptor for the authentication

func NewInterceptor

func NewInterceptor(tokenSource *oauth.TokenSource) (*Interceptor, error)

NewInterceptor creates a new authentication interceptor

func (*Interceptor) Authenticate

func (i *Interceptor) Authenticate() grpc.UnaryClientInterceptor

Authenticate returns a new unary client interceptor that adds authentication metadata to the context

func (*Interceptor) GetCtxTokenString

func (i *Interceptor) GetCtxTokenString(ctx context.Context) (string, error)

GetCtxTokenString tries to get the token string from the context metadata of the gRPC request

Jump to

Keyboard shortcuts

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