identity

package
v0.0.0-...-4e7cb45 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoAccessCookie      = errors.New("an identity could not be established as there are no access cookie")
	ErrParsingAccessCookie = errors.New("an identity could not be established as there was an error parsing the access cookie")
)

Functions

This section is empty.

Types

type Actor

type Actor struct {
	ID  string
	PII []byte
}

type Guest

type Guest struct {
	Actor
}

func (Guest) Identity

func (guest Guest) Identity() Identity

type Identity

type Identity struct {
	Subject string
	Role    string
	Pii     []byte
}

func FromAccessCookie

func FromAccessCookie(context echo.Context) (Identity, error)

func NewGuest

func NewGuest() Identity

func (Identity) Actor

func (id Identity) Actor() Actor

func (Identity) AsGuest

func (id Identity) AsGuest(
	command cqrs.Command[Guest], context context.Context,
) (bool, error)

func (Identity) CanBeGuest

func (id Identity) CanBeGuest() bool

func (Identity) Guest

func (id Identity) Guest() Guest

func (Identity) IsGuest

func (id Identity) IsGuest() bool

Jump to

Keyboard shortcuts

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