auth

package
v1.5.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RigProjectID = "rig"

Functions

func GetProjectID

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

func WithClaims

func WithClaims(ctx context.Context, c Claims) context.Context

func WithProjectID

func WithProjectID(ctx context.Context, projectID string) context.Context

Types

type Claims

type Claims interface {
	jwt.Claims

	GetIssuer() string
	GetProjectID() string
	GetSubject() uuid.UUID
	GetSubjectType() SubjectType
	GetSessionID() uuid.UUID
}

func GetClaims

func GetClaims(ctx context.Context) (Claims, error)

type Oauth2Claims

type Oauth2Claims struct {
	Sub       string `json:"sub"`
	Iss       string `json:"iss"`
	Image     string `json:"image"`
	Email     string `json:"email"`
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
}

type State

type State struct {
	Rand         string
	ProjectID    string
	AppRedirect  string
	ProviderType model.OauthProvider
}

type SubjectType

type SubjectType int
const (
	SubjectTypeInvalid SubjectType = iota
	SubjectTypeUser
	SubjectTypeServiceAccount
)

Jump to

Keyboard shortcuts

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