identity

package
v0.15.14 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const INTERNAL = "internal"

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

type Group struct {
	// external id of the group
	ID          string          `json:"id" dynamodbav:"id"`
	IdpID       string          `json:"idpId" dynamodbav:"idpId"`
	Name        string          `json:"name" dynamodbav:"name"`
	Description string          `json:"description" dynamodbav:"description"`
	Status      types.IdpStatus `json:"status" dynamodbav:"status"`
	Users       []string        `json:"users" dynamodbav:"users"`
	Source      string          `json:"source" dynamodbav:"source"`
	// CreatedAt is a read-only field after the request has been created.
	CreatedAt time.Time `json:"createdAt" dynamodbav:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt" dynamodbav:"updatedAt"`
}

func (*Group) DDBKeys

func (g *Group) DDBKeys() (ddb.Keys, error)

func (*Group) ToAPI

func (g *Group) ToAPI() types.Group

type IDPGroup

type IDPGroup struct {
	ID          string
	Name        string
	Description string
}

func (IDPGroup) ToInternalGroup

func (g IDPGroup) ToInternalGroup(source string) Group

type IDPUser

type IDPUser struct {
	// ID is the IDP id for this user
	ID        string
	FirstName string
	LastName  string
	Email     string
	// groups is a list of idp group ids, these will not match the internal dynamo ids
	Groups []string
}

IDPUser is a generic user type which should be returned by our IDP implementations

func (IDPUser) ToInternalUser

func (u IDPUser) ToInternalUser() User

type User

type User struct {
	// internal id of the user
	ID string `json:"id" dynamodbav:"id"`

	FirstName string   `json:"firstName" dynamodbav:"firstName"`
	LastName  string   `json:"lastName" dynamodbav:"lastName"`
	Email     string   `json:"email" dynamodbav:"email"`
	Groups    []string `json:"groups" dynamodbav:"groups"`

	Status types.IdpStatus `json:"status" dynamodbav:"status"`

	CreatedAt time.Time `json:"createdAt" dynamodbav:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt" dynamodbav:"updatedAt"`
}

func (*User) AddGroup

func (u *User) AddGroup(group string)

AddGroup adds the group to the list in memory if it is not already there, it does not update the database

func (*User) BelongsToGroup

func (u *User) BelongsToGroup(groupID string) bool

func (*User) DDBKeys

func (u *User) DDBKeys() (ddb.Keys, error)

func (*User) RemoveGroup

func (u *User) RemoveGroup(group string)

RemoveGroup removes the group from the list in memory, it does not update the database

func (*User) ToAPI

func (u *User) ToAPI() types.User

type UserNotFoundError

type UserNotFoundError struct {
	User string
}

func (UserNotFoundError) Error

func (e UserNotFoundError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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