authcontext

package
v0.0.0-...-0888c38 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewContext

func NewContext(ctx context.Context, s *AuthContext) context.Context

NewContext returns a new context with session context.

Types

type AuthContext

type AuthContext struct {
	AuthToken string
	Claims    *jwtpb.JWTClaims
	Path      string
}

AuthContext stores sessions specific information.

func FromContext

func FromContext(ctx context.Context) (*AuthContext, error)

FromContext returns a session context from the passed in Context.

func New

func New() *AuthContext

New creates a new sesion context.

func (*AuthContext) UseJWTAuth

func (s *AuthContext) UseJWTAuth(signingKey string, tokenString string, audience string) error

UseJWTAuth takes a token and sets claims, etc.

func (*AuthContext) ValidClaims

func (s *AuthContext) ValidClaims() bool

ValidClaims returns true if the user is logged in and valid.

Jump to

Keyboard shortcuts

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