Documentation ¶
Overview ¶
Package grpcutil contains functions for interacting with gRPC.
Index ¶
- Constants
- func JWTFromGRPCRequest(ctx context.Context) (rawjwt string, ok bool)
- func RequireSignedJWT(ctx context.Context, key []byte) error
- func SessionIDFromGRPCRequest(ctx context.Context) (sessionID string, ok bool)
- func StreamRequireSignedJWT(key string) grpc.StreamServerInterceptor
- func UnaryRequireSignedJWT(key string) grpc.UnaryServerInterceptor
- func WithOutgoingJWT(ctx context.Context, rawjwt string) context.Context
- func WithOutgoingSessionID(ctx context.Context, sessionID string) context.Context
- func WithStreamSignedJWT(key []byte) grpc.StreamClientInterceptor
- func WithUnarySignedJWT(key []byte) grpc.UnaryClientInterceptor
Constants ¶
const JWTMetadataKey = "jwt"
JWTMetadataKey is the key in the metadata.
const SessionIDMetadataKey = "sessionid"
SessionIDMetadataKey is the key in the metadata.
Variables ¶
This section is empty.
Functions ¶
func JWTFromGRPCRequest ¶
JWTFromGRPCRequest returns the JWT from the gRPC request.
func RequireSignedJWT ¶ added in v0.11.0
RequireSignedJWT requires a JWT in the gRPC metadata and that it be signed by the given key.
func SessionIDFromGRPCRequest ¶
SessionIDFromGRPCRequest returns the session id from the gRPC request.
func StreamRequireSignedJWT ¶ added in v0.11.0
func StreamRequireSignedJWT(key string) grpc.StreamServerInterceptor
StreamRequireSignedJWT requires a JWT in the gRPC metadata and that it be signed by the base64-encoded key.
func UnaryRequireSignedJWT ¶ added in v0.11.0
func UnaryRequireSignedJWT(key string) grpc.UnaryServerInterceptor
UnaryRequireSignedJWT requires a JWT in the gRPC metadata and that it be signed by the base64-encoded key.
func WithOutgoingJWT ¶
WithOutgoingJWT appends a metadata header for the JWT to a context.
func WithOutgoingSessionID ¶
WithOutgoingSessionID appends a metadata header for the session ID to a context.
func WithStreamSignedJWT ¶ added in v0.11.0
func WithStreamSignedJWT(key []byte) grpc.StreamClientInterceptor
WithStreamSignedJWT returns a StreamClientInterceptor that adds a JWT to requests.
func WithUnarySignedJWT ¶ added in v0.11.0
func WithUnarySignedJWT(key []byte) grpc.UnaryClientInterceptor
WithUnarySignedJWT returns a UnaryClientInterceptor that adds a JWT to requests.
Types ¶
This section is empty.