jwtgrpc

package
v0.253.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoAuthHeader is returned when the request did not contain an auth header.
	ErrNoAuthHeader = status.Errorf(codes.Unauthenticated, "no authorization header")

	// ErrParseJWT is returned when the header or JWT failed to parse correctly.
	ErrParseJWT = status.Errorf(codes.Unauthenticated, "invalid authorization header")

	// ErrAuthenticationFailed is returned when the jwt cannot be authenticated.
	ErrAuthenticationFailed = status.Errorf(codes.Unauthenticated, "authentication failed")

	// ErrClaimsValidationFailed is returned when the jwts claims are insufficient for the target method.
	ErrClaimsValidationFailed = status.Errorf(codes.PermissionDenied, "insufficient permissions")
)

Auth errors that are safe to return over the wire.

Functions

func GetBearerFromIncomingContext

func GetBearerFromIncomingContext(ctx context.Context) (string, error)

GetBearerFromIncomingContext extracts a Bearer auth header from incoming metadata.

Types

This section is empty.

Jump to

Keyboard shortcuts

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