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
Click to show internal directories.
Click to hide internal directories.