auth

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SourceAnonymous  = "anonymous"
	SourceLocalBasic = "local-basic"
	SourceLocalCSV   = "local-csv"
	SourceGen3Fence  = "gen3-fence"
	SourceGen3Mock   = "gen3-mock"
	SourcePlugin     = "plugin"
)

Variables

This section is empty.

Functions

func WithSession

func WithSession(ctx context.Context, session *Session) context.Context

Types

type Session

type Session struct {
	Mode              string
	Source            string
	Subject           string
	Claims            map[string]interface{}
	Resources         []string
	Privileges        map[string]map[string]bool
	AuthHeaderPresent bool
	AuthzEnforced     bool
}

Session is the canonical auth state propagated through request handling.

func FromContext

func FromContext(ctx context.Context) *Session

func NewSession

func NewSession(mode string) *Session

func (*Session) Clone

func (s *Session) Clone() *Session

func (*Session) SetAuthorizations

func (s *Session) SetAuthorizations(resources []string, privileges map[string]map[string]bool, enforced bool)

func (*Session) SetClaims

func (s *Session) SetClaims(claims map[string]interface{})

func (*Session) SetSource

func (s *Session) SetSource(source string)

func (*Session) SetSubject

func (s *Session) SetSubject(subject string)

Jump to

Keyboard shortcuts

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