serverauth

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureValidToken

func EnsureValidToken(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

func ParseIdFromCtx

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

Types

type CustomClaims

type CustomClaims struct {
	Scope string `json:"scope"`
}

CustomClaims contains custom data we want from the token.

func (CustomClaims) HasScope

func (c CustomClaims) HasScope(expectedScope string) bool

func (CustomClaims) Validate

func (c CustomClaims) Validate(ctx context.Context) error

Validate does nothing for this example, but we need it to satisfy validator.CustomClaims interface.

Jump to

Keyboard shortcuts

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