payload

package
v0.0.0-...-0dc46f9 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIKey

type APIKey struct {
	ID          uuid.UUID `json:"id"`
	Name        string    `json:"name"`
	MaskedToken string    `json:"masked_token"`
}

func APIKeyFromEntity

func APIKeyFromEntity(a *entity.AuthAPIKey) *APIKey

type Auth

type Auth struct {
	ID        uuid.UUID  `json:"id"`
	Issuer    string     `json:"issuer"`
	Subject   string     `json:"subject"`
	Email     string     `json:"email"`
	Principal *Principal `json:"-" db:"-"`
}

func AuthFromEntity

func AuthFromEntity(a *entity.OIDCAuthorization) *Auth

type Group

type Group struct {
	ID                uuid.UUID     `json:"id"`
	Name              string        `json:"name"`
	Description       string        `json:"description"`
	AttachedRoles     []*Role       `json:"attached_roles"`
	HavingPermissions []*Permission `json:"having_permissions"`
}

func GroupFromEntity

func GroupFromEntity(g *entity.Group) *Group

type MappingRule

type MappingRule struct {
	ID              uuid.UUID `json:"id"`
	Name            string    `json:"name"`
	Description     string    `json:"description"`
	RuleType        int       `json:"rule_type"`
	Detail          string    `json:"detail"`
	Priority        int       `json:"priority"`
	AssociationType string    `json:"association_type"`
	AssociationID   string    `json:"association_id"`
}

func MappingRuleFromEntity

func MappingRuleFromEntity(rule *entity.MappingRule) *MappingRule

type Permission

type Permission struct {
	ID          uuid.UUID `json:"id"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
}

func PermissionFromEntity

func PermissionFromEntity(perm *entity.Permission) *Permission

type Principal

type Principal struct {
	ID          uuid.UUID `json:"id"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
}

func PrincipalFromEntity

func PrincipalFromEntity(pri *entity.Principal) *Principal

type PrincipalPayload

type PrincipalPayload struct {
	Principal         *Principal    `json:"principal"`
	Auth              *Auth         `json:"auth_oidc"`
	APIKeys           []*APIKey     `json:"auth_apikeys"`
	Groups            []*Group      `json:"groups"`
	AttachedRoles     []*Role       `json:"attached_roles"`
	HavingRoles       []*Role       `json:"having_roles"`
	HavingPermissions []*Permission `json:"having_permissions"`
}

func PrincipalPayloadFromEntity

func PrincipalPayloadFromEntity(pri *entity.Principal) *PrincipalPayload

type Role

type Role struct {
	ID                  uuid.UUID     `json:"id"`
	Name                string        `json:"name"`
	Description         string        `json:"description"`
	AttachedPermissions []*Permission `json:"attached_permissions"`
}

func RoleFromEntity

func RoleFromEntity(r *entity.Role) *Role

type SessionPrincipal

type SessionPrincipal struct {
	Email       string   `json:"email"`
	Groups      []string `json:"groups,omitempty"`
	Roles       []string `json:"roles,omitempty"`
	Permissions []string `json:"permissions,omitempty"`
}

Small Payload for Session Cookie

func SessionPrincipalFromEntity

func SessionPrincipalFromEntity(pri *entity.Principal) *SessionPrincipal

Jump to

Keyboard shortcuts

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