claims

package
v0.0.0-...-c57eb44 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2021 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claims

type Claims struct {
	jwt.StandardClaims
	Owner string `json:"owner"`
	Admin bool   `json:"admin"`
	Path  string `json:"path"`
}

Claims represents all the data found in JWT Claims

func FromCtx

func FromCtx(ctx context.Context) (*Claims, error)

FromCtx extract a user from a context

func (*Claims) ToCtx

func (c *Claims) ToCtx(in context.Context) context.Context

ToCtx creates a context containing a user key

func (*Claims) Validate

func (c *Claims) Validate() error

Validate data owner struct

Jump to

Keyboard shortcuts

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