scim

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: MIT Imports: 5 Imported by: 17

Documentation

Index

Constants

View Source
const (
	UserTypeContractor = "Contractor"
	UserTypeEmployee   = "Employee"
	UserTypeExternal   = "External"
	UserTypeIntern     = "Intern"
	UserTypeTemp       = "Temp"
	UserTypeUnknown    = "Unknown"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Type          string `json:"Type,omitempty"`
	StreetAddress string `json:"StreetAddress,omitempty"`
	Locality      string `json:"Locality,omitempty"`
	Region        string `json:"Region,omitempty"`
	PostalCode    string `json:"postalCode,omitempty"`
	Country       string `json:"country,omitempty"`
	Formatted     string `json:"formatted,omitempty"`
	Primary       bool   `json:"primary,omitempty"`
}

Address is a SCIM struct used for street and mailing addresses.

func (*Address) InflateStreetAddress

func (addr *Address) InflateStreetAddress(force bool)

type Group

type Group struct {
	Display string `json:"display,omitempty"`
	Ref     string `json:"$ref,omitempty"`
	Value   string `json:"value,omitempty"`
}

type Item

type Item struct {
	Value   string `json:"value,omitempty"`
	Type    string `json:"type,omitempty"`
	Primary bool   `json:"primary,omitempty"`
}

Item is a SCIM struct used for email and phone numbers.

func GetOneItem

func GetOneItem(items []Item) Item

type Name

type Name struct {
	Formatted       string `json:"formatted,omitempty"`
	HonorificPrefix string `json:"honorificPrefix,omitempty"`
	GivenName       string `json:"givenName,omitempty"`
	MiddleName      string `json:"middleName,omitempty"`
	FamilyName      string `json:"familyName,omitempty"`
	HonorificSuffix string `json:"honorificSuffix,omitempty"`
}

Name is the SCIM user name struct.

func (*Name) BuildDisplayName

func (n *Name) BuildDisplayName(inclPrefix, inclMiddleName, inclSuffix bool) string

func (*Name) Inflate

func (n *Name) Inflate()

func (*Name) TrimSpace

func (n *Name) TrimSpace()

type User

type User struct {
	Schemas           []string  `json:"schemas,omitempty"`
	Active            bool      `json:"active,omitempty"`
	Addresses         []Address `json:"addresses,omitempty"`
	DisplayName       string    `json:"displayName,omitempty"`
	Emails            []Item    `json:"emails,omitempty"`
	ExternalID        string    `json:"externalId,omitempty"`
	Groups            []Group   `json:"groups,omitempty"`
	ID                string    `json:"id,omitempty"`
	Locale            string    `json:"locale,omitempty"`
	Name              Name      `json:"name,omitempty"`
	NickName          string    `json:"nickName,omitempty"`
	Password          string    `json:"password,omitempty"`
	ProfileURL        string    `json:"profileUrl,omitempty"`
	PhoneNumbers      []Item    `json:"phoneNumbers,omitempty"`
	PreferredLanguage string    `json:"preferredLanguage,omitempty"`
	Timezone          string    `json:"timezone,omitempty"`
	Title             string    `json:"title,omitempty"`
	UserName          string    `json:"userName,omitempty"`
	UserType          string    `json:"userType,omitempty"`
}

User is an object from the full user representation specified in the SCIM schema: http://www.simplecloud.info/specs/draft-scim-core-schema-01.html#anchor7 https://tools.ietf.org/html/rfc7643

func NewUser

func NewUser() User

func (*User) AddEmail

func (user *User) AddEmail(emailAddr string, isPrimary bool) error

AddEmail adds a canonical email address to the user. it lowercases and trims preceding and trailing spaces from the email address.

func (*User) DisplayNameAny

func (user *User) DisplayNameAny() string

func (*User) EmailAddress

func (user *User) EmailAddress() string

GetPrimaryEmail returns an email address or empty string. It prioritizes primary email addresses and then falls back to non-primary email address.

func (*User) InflateDisplayName

func (user *User) InflateDisplayName(inclPrefix, inclMiddleName, inclSuffix bool)

func (*User) PhoneNumber

func (user *User) PhoneNumber() string

type UserSet

type UserSet struct {
	Users []User `json:"users,omitempty"`
}

func NewUserSet

func NewUserSet() UserSet

func ReadFileUserSet

func ReadFileUserSet(filename string) (UserSet, error)

func (*UserSet) Count

func (set *UserSet) Count() int

func (*UserSet) GetByEmail

func (set *UserSet) GetByEmail(emailAddress string) *User

Jump to

Keyboard shortcuts

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