auth

package
v1.0.4-gitspaces-beta Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

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 MembershipMetadata

type MembershipMetadata struct {
	SpaceID int64
	Role    enum.MembershipRole
}

MembershipMetadata contains information about an ephemeral membership grant.

func (*MembershipMetadata) ImpactsAuthorization

func (m *MembershipMetadata) 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