Documentation ¶
Overview ¶
Package interceptor provides a GRPC client interceptor that signs requests.
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 Interceptor ¶ added in v0.3.0
type Interceptor struct {
// contains filtered or unexported fields
}
Interceptor is a GRPC interceptor that provides Unary and Stream client interceptors.
func New ¶ added in v0.3.0
func New(options Options) *Interceptor
New creates a new client interceptor.
func (*Interceptor) Stream ¶ added in v0.3.0
func (i *Interceptor) Stream() grpc.StreamClientInterceptor
Stream returns a new streaming client interceptor which signs requests.
func (*Interceptor) Unary ¶ added in v0.3.0
func (i *Interceptor) Unary() grpc.UnaryClientInterceptor
Unary returns a new unary client interceptor which signs requests.
type Options ¶ added in v0.3.0
type Options struct { InfoWriter io.Writer AuthEnabledFunc AuthEnabledFunc GetUserKeyFunc UserKeyFunc RenewUserKeyFunc UserKeyFunc UserKeyProvider *client.KeyProvider ContextName string Identity string ClientName string // ServiceAccountBase64 is a static service account key in base64 format. // When specified, ContextName and Identity are ignored and retries are never attempted. ServiceAccountBase64 string }
Options are the options for the interceptor.
type SkipInterceptorContextKey ¶
type SkipInterceptorContextKey struct{}
SkipInterceptorContextKey is a context key used to skip interceptor to avoid infinite recursion.
type UserKeyFunc ¶ added in v0.3.0
type UserKeyFunc func(ctx context.Context, cc *grpc.ClientConn, options *Options) (message.Signer, error)
UserKeyFunc is a function that is called to read the initial user (non-service-account) key.