auth

package
v0.0.2-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: Apache-2.0 Imports: 2 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AnonymousPrincipal = types.Principal{
	ID:   -1,
	UID:  types.AnonymousPrincipalUID,
	Type: enum.PrincipalTypeUser,
}

AnonymousPrincipal is an in-memory principal for users with no auth data. Authorizer is in charge of handling anonymous access.

Functions

func IsAnonymousSession

func IsAnonymousSession(session *Session) bool

Types

type EmptyMetadata

type EmptyMetadata struct{}

EmptyMetadata represents the state when the auth session doesn't have any extra metadata.

func (*EmptyMetadata) ImpactsAuthorization

func (m *EmptyMetadata) ImpactsAuthorization() bool

type Metadata

type Metadata interface {
	ImpactsAuthorization() bool
}

type Session

type Session struct {
	// Principal is the authenticated principal.
	Principal types.Principal

	// Metadata contains auth related information (access grants, tokenId, sshKeyId, ...)
	Metadata Metadata
}

Session contains information of the authenticated principal and auth related metadata.

type TokenMetadata

type TokenMetadata struct {
	TokenType enum.TokenType
	TokenID   int64
}

TokenMetadata contains information about the token that was used during auth.

func (*TokenMetadata) ImpactsAuthorization

func (m *TokenMetadata) ImpactsAuthorization() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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