Documentation
¶
Overview ¶
Package interceptor contains gRPC client interceptors related to authentication and authorization.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthEnabledFunc ¶
AuthEnabledFunc is called once to determine if auth is enabled.
type Signature ¶
type Signature struct {
// contains filtered or unexported fields
}
Signature is a gRPC client interceptor which signs requests.
func NewSignature ¶
func NewSignature(identity string, signerFunc SignerFunc, renewSignerFunc SignerFunc, authEnabledFunc AuthEnabledFunc) *Signature
NewSignature returns a new Signature interceptor.
renewSignerFunc is a function which is called when the initial Signer is invalid (e.g. got a response with codes.Unauthenticated).
authEnabledFunc is called only once, on the first request to determine if auth is enabled. If the result is false, the interceptor will simply pass the following requests through.
func (*Signature) Stream ¶
func (c *Signature) Stream() grpc.StreamClientInterceptor
Stream returns a new streaming client interceptor which signs requests.
func (*Signature) Unary ¶
func (c *Signature) Unary() grpc.UnaryClientInterceptor
Unary returns a new unary client interceptor which signs requests.
type SignerFunc ¶
SignerFunc is a function which is called to get a signer.
type SkipInterceptorContextKey ¶
type SkipInterceptorContextKey struct{}
SkipInterceptorContextKey is a context key used to skip interceptor to avoid infinite recursion.