Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InterceptAPIKey ¶ added in v0.17.0
func InterceptAPIKey(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error)
InterceptAPIKey reads apikey from requests and puts the value into the context.
func NewAPIKeyInterceptor ¶
func NewAPIKeyInterceptor() grpc.UnaryServerInterceptor
NewAPIKeyInterceptor creates instance of apikey interceptor
Types ¶
type APIKeyCredentials ¶ added in v0.17.0
type APIKeyCredentials struct {
// contains filtered or unexported fields
}
APIKeyCredentials implements grpc/credentials.PerRPCCredentials for authenticating with the grpc server.
func NewAPIKeyCredentials ¶ added in v0.17.0
func NewAPIKeyCredentials(apikey string) *APIKeyCredentials
NewAPIKeyCredentials returns a new APIKeyCredentials
func (*APIKeyCredentials) GetRequestMetadata ¶ added in v0.17.0
func (creds *APIKeyCredentials) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error)
GetRequestMetadata gets the current request metadata, refreshing tokens if required.
func (*APIKeyCredentials) RequireTransportSecurity ¶ added in v0.17.0
func (creds *APIKeyCredentials) RequireTransportSecurity() bool
RequireTransportSecurity indicates whether the credentials requires transport security.
Click to show internal directories.
Click to hide internal directories.