grpcauth

package
v1.85.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GRPCClientWithOauth2

func GRPCClientWithOauth2(
	source oauth2.TokenSource, creds credentials.TransportCredentials,
) []grpc.DialOption

GrpcWithOauth2 returns a grpc.DialOption to be used in calls to grpc.Dial,

func GRPCServerWithInsecureOauth2

func GRPCServerWithInsecureOauth2[T any](
	verifyKeys auth.Keys,
	authorizer auth.Authorizer[T],
) []grpc.ServerOption

GRPCServerWithInsecureOauth2 returns a set of grpc.ServerOption that configure the server to allow oauth2 requests only, without TLS credentials. This should only be used when an alternate method of securing the transport is used (i.e. TCP/TLS load balancer, etc.), or for debugging or local testing.

func GRPCServerWithInsecureOauth2Interceptors

func GRPCServerWithInsecureOauth2Interceptors(
	unary grpc.UnaryServerInterceptor,
	stream grpc.StreamServerInterceptor,
) []grpc.ServerOption

GRPCServerWithInsecureOauth2Interceptors is like GRPCServerWithOauth2Interceptors but without TLS credentials. This should only be used when the transport is secured externally (TCP/TLS load balancer, etc.), or for debugging or local testing.

func GRPCServerWithOauth2

func GRPCServerWithOauth2[T any](
	verifyKeys auth.Keys,
	authorizer auth.Authorizer[T],
	creds credentials.TransportCredentials,
) []grpc.ServerOption

GRPCServerWithOauth2 returns a set of grpc.ServerOption that configure the server to allow oauth2 requests only.

func GRPCServerWithOauth2Interceptors

func GRPCServerWithOauth2Interceptors(
	unary grpc.UnaryServerInterceptor,
	stream grpc.StreamServerInterceptor,
	creds credentials.TransportCredentials,
) []grpc.ServerOption

GRPCServerWithOauth2Interceptors returns the server options for an oauth2 server using the given interceptors. Callers that need to wrap the oauth2 interceptors (e.g. to cache verification/authorization) pass the wrapped interceptors here instead of using GRPCServerWithOauth2.

func Oauth2StreamInterceptor

func Oauth2StreamInterceptor[T any](
	verifyKeys auth.Keys, authorizer auth.Authorizer[T],
) grpc.StreamServerInterceptor

Oauth2StreamInterceptor returns the stream interceptor that authenticates and authorizes oauth2 requests and installs the resulting claims in the stream context. It is exposed so callers can wrap it (e.g. to add a cache in front of the per-RPC verification/authorization).

func Oauth2UnaryInterceptor

func Oauth2UnaryInterceptor[T any](
	verifyKeys auth.Keys, authorizer auth.Authorizer[T],
) grpc.UnaryServerInterceptor

Oauth2UnaryInterceptor returns the unary interceptor that authenticates and authorizes oauth2 requests and installs the resulting claims in the request context. It is exposed so callers can wrap it (e.g. to add a cache in front of the per-RPC verification/authorization).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL