domain

package
v0.0.0-...-fd23dd1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2019 License: OSL-3.0 Imports: 6 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Guest = &User{
	Name: "Guest",
	Type: GUEST,
}

Guest is our default guest user

Functions

This section is empty.

Types

type Auth

type Auth struct {
	TokenSource oauth2.TokenSource
	IDToken     *oidc.IDToken
}

type LoginEvent

type LoginEvent struct {
	Session *sessions.Session
}

LoginEvent

type LogoutEvent

type LogoutEvent struct {
	Session *sessions.Session
}

LogoutEvent

type TokenExtras

type TokenExtras map[string]string

func (*TokenExtras) Add

func (te *TokenExtras) Add(key string, value string)

func (*TokenExtras) Get

func (te *TokenExtras) Get(key string) (string, bool)

type User

type User struct {
	Sub          string
	Name         string
	Email        string
	Salutation   string
	FirstName    string
	LastName     string
	Street       string
	ZipCode      string
	City         string
	DateOfBirth  string
	Country      string
	CustomFields map[string]string
	Type         UserType
}

User is a basic authenticated user

func (User) Get

func (u User) Get(name string) string

type UserMapping

type UserMapping struct {
	Sub          string
	Name         string
	Email        string
	Salutation   string
	FirstName    string
	LastName     string
	Street       string
	ZipCode      string
	City         string
	DateOfBirth  string
	Country      string
	CustomFields []string
}

type UserMappingService

type UserMappingService struct {
	// contains filtered or unexported fields
}

func (*UserMappingService) GetMapping

func (ums *UserMappingService) GetMapping(config.Map) (UserMapping, error)

func (*UserMappingService) Inject

func (ums *UserMappingService) Inject(config *struct {
	IdTokenMapping config.Map `inject:"config:auth.mapping.idToken"`
})

func (*UserMappingService) MapToUser

func (ums *UserMappingService) MapToUser(claims map[string]interface{}, session *web.Session) *User

func (*UserMappingService) UserFromIDToken

func (ums *UserMappingService) UserFromIDToken(idToken *oidc.IDToken, session *web.Session) (*User, error)

type UserType

type UserType string

UserType such as guest or user

const (
	// GUEST user
	GUEST UserType = "guest"

	// USER is an authenticated user
	USER UserType = "user"
)

Jump to

Keyboard shortcuts

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