auth

package
v0.0.0-...-4747e9d Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	BearerSchema string = "Bearer "
	SigningKey          = "AUTH_SIGNING_KEY"

	// JWT/API Version constants
	V0 = 0
	V1 = 1
	V2 = 2

	APIVerString = "authentication.k8s.io/v2"
)

BearerSchema that this service is expecting

Variables

This section is empty.

Functions

func FilterGroupsOnClaims

func FilterGroupsOnClaims(groups []string, claims string) []string

FilterGroupsOnClaims returns groups that match at least one claim

func GenerateToken

func GenerateToken(user types.User, hclaims string, majVersion Version) (types.Token, error)

GenerateToken generates a full JWT groups and apps etc.

func ValidateToken

func ValidateToken(req *http.Request, apiVersion Version) (types.UserInfo, int, error)

ValidateToken validates JWT token provided by user and fills out the UserInfo structure from the data within

Types

type Version

type Version int

Version -- constrained type

Jump to

Keyboard shortcuts

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