Documentation ¶
Index ¶
- func GetTokenFromHTTPHeaders(headers http.Header) (string, error)
- func GetTokenFromHeader(ctx context.Context) (string, error)
- func NewServerInterceptor(authenticator Authenticator) rpc.ServerInterceptor
- func WithToken(ctx context.Context, token string) context.Context
- type Authenticator
- type AuthenticatorFunc
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTokenFromHTTPHeaders ¶
GetTokenFromHTTPHeaders gets the current authentication token from the HTTP headers, if there is one.
func GetTokenFromHeader ¶
GetTokenFromHeader gets the current authentication token, if there is one.
func NewServerInterceptor ¶
func NewServerInterceptor(authenticator Authenticator) rpc.ServerInterceptor
NewServerInterceptor returns a new ServerInterceptor.
Types ¶
type Authenticator ¶
Authenticator defines the interface used to authenticate a token.
type AuthenticatorFunc ¶
AuthenticatorFunc is a function that implements Authenticator
func (AuthenticatorFunc) Authenticate ¶
Authenticate implements Authenticator.
Click to show internal directories.
Click to hide internal directories.