context

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: BSD-3-Clause Imports: 4 Imported by: 12

Documentation

Index

Constants

View Source
const (
	RequestIDKey = "requestID"
	AccountIDKey = "accountID"
	UserIDKey    = "userID"
	PeerIDKey    = "peerID"
)
View Source
const (
	UserAuthContextKey key = iota
)

Variables

This section is empty.

Functions

func SetUserAuthInContext added in v0.37.0

func SetUserAuthInContext(ctx context.Context, userAuth UserAuth) context.Context

func SetUserAuthInRequest added in v0.37.0

func SetUserAuthInRequest(r *http.Request, userAuth UserAuth) *http.Request

Types

type UserAuth added in v0.37.0

type UserAuth struct {
	// The account id the user is accessing
	AccountId string
	// The account domain
	Domain string
	// The account domain category, TBC values
	DomainCategory string
	// Indicates whether this user was invited, TBC logic
	Invited bool
	// Indicates whether this is a child account
	IsChild bool

	// The user id
	UserId string
	// Last login time for this user
	LastLogin time.Time
	// The Groups the user belongs to on this account
	Groups []string

	// Indicates whether this user has authenticated with a Personal Access Token
	IsPAT bool
}

func GetUserAuthFromContext added in v0.37.0

func GetUserAuthFromContext(ctx context.Context) (UserAuth, error)

func GetUserAuthFromRequest added in v0.37.0

func GetUserAuthFromRequest(r *http.Request) (UserAuth, error)

Jump to

Keyboard shortcuts

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