userstore

package
v0.7.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRetentionTimeoutImmediateDeletion added in v0.7.2

func GetRetentionTimeoutImmediateDeletion() time.Time

GetRetentionTimeoutImmediateDeletion returns the immediate deletion retention timeout

func GetRetentionTimeoutIndefinite added in v0.7.2

func GetRetentionTimeoutIndefinite() time.Time

GetRetentionTimeoutIndefinite returns the indefinite retention timeout

func NewAddressSet added in v0.7.2

func NewAddressSet(items ...Address) set.Set[Address]

NewAddressSet returns a set of addresses

Types

type Accessor added in v0.4.0

type Accessor struct {
	ID uuid.UUID `json:"id"`

	// Name of accessor, must be unique
	Name string `json:"name" validate:"length:1,128" required:"true"`

	// Description of the accessor
	Description string `json:"description"`

	// Version of the accessor
	Version int `json:"version"`

	// Specify whether to access live or soft-deleted data
	DataLifeCycleState DataLifeCycleState `json:"data_life_cycle_state"`

	// Configuration for which user records to return
	SelectorConfig UserSelectorConfig `json:"selector_config" required:"true"`

	// Purposes for which this accessor is used
	Purposes []ResourceID `json:"purposes" validate:"skip" required:"true"`

	// List of userstore columns being accessed and the transformers to apply to each column
	Columns []ColumnOutputConfig `json:"columns" validate:"skip" required:"true"`

	// Policy for what data is returned by this accessor, based on properties of the caller and the user records
	AccessPolicy ResourceID `json:"access_policy" validate:"skip" required:"true"`

	// Policy for token resolution in the case of transformers that tokenize data
	TokenAccessPolicy ResourceID `json:"token_access_policy,omitempty" validate:"skip"`

	IsSystem bool `` /* 155-byte string literal not displayed */
}

Accessor represents a customer-defined view and permissions policy on userstore data

type Address added in v0.6.3

type Address struct {
	Country            string `json:"country,omitempty"`
	Name               string `json:"name,omitempty"`
	Organization       string `json:"organization,omitempty"`
	StreetAddressLine1 string `json:"street_address_line_1,omitempty"`
	StreetAddressLine2 string `json:"street_address_line_2,omitempty"`
	DependentLocality  string `json:"dependent_locality,omitempty"`
	Locality           string `json:"locality,omitempty"`
	AdministrativeArea string `json:"administrative_area,omitempty"`
	PostCode           string `json:"post_code,omitempty"`
	SortingCode        string `json:"sorting_code,omitempty"`
}

Address is a native userstore type that represents a physical address

type Column added in v0.3.0

type Column struct {
	// Columns may be renamed, but their ID cannot be changed.
	ID           uuid.UUID       `json:"id"`
	Name         string          `json:"name" validate:"length:1,128" required:"true"`
	Type         DataType        `json:"type" required:"true"`
	IsArray      bool            `json:"is_array" required:"true"`
	DefaultValue string          `json:"default_value"`
	IndexType    ColumnIndexType `json:"index_type" required:"true"`
	IsSystem     bool            `` /* 149-byte string literal not displayed */
}

Column represents a single field/column/value to be collected/stored/managed in the user data store of a tenant.

func (*Column) Equals added in v0.6.0

func (c *Column) Equals(other *Column) bool

Equals returns true if the two columns are equal

type ColumnIndexType added in v0.6.0

type ColumnIndexType string

ColumnIndexType is an enum for supported column index types

const (
	// ColumnIndexTypeNone is the default value
	ColumnIndexTypeNone ColumnIndexType = "none"

	// ColumnIndexTypeIndexed indicates that the column should be indexed
	ColumnIndexTypeIndexed ColumnIndexType = "indexed"

	// ColumnIndexTypeUnique indicates that the column should be indexed and unique
	ColumnIndexTypeUnique ColumnIndexType = "unique"
)

type ColumnInputConfig added in v0.6.4

type ColumnInputConfig struct {
	Column    ResourceID `json:"column"`
	Validator ResourceID `json:"validator"`
}

ColumnInputConfig is a struct that contains a column and the validator to use for that column

type ColumnOutputConfig added in v0.6.4

type ColumnOutputConfig struct {
	Column      ResourceID `json:"column"`
	Transformer ResourceID `json:"transformer"`
}

ColumnOutputConfig is a struct that contains a column and the transformer to apply to that column

type DataLifeCycleState added in v0.7.2

type DataLifeCycleState string

DataLifeCycleState identifies the life-cycle state for a piece of data - either live or soft-deleted.

const (
	DataLifeCycleStateDefault     DataLifeCycleState = ""
	DataLifeCycleStateLive        DataLifeCycleState = "live"
	DataLifeCycleStateSoftDeleted DataLifeCycleState = "softdeleted"

	// maps to softdeleted
	DataLifeCycleStatePostDelete DataLifeCycleState = "postdelete"

	// maps to live
	DataLifeCycleStatePreDelete DataLifeCycleState = "predelete"
)

Supported data life cycle states

func (DataLifeCycleState) GetConcrete added in v0.7.2

func (dlcs DataLifeCycleState) GetConcrete() DataLifeCycleState

GetConcrete returns the concrete data life cycle state for the given data life cycle state

func (DataLifeCycleState) GetDefaultRetentionTimeout added in v0.7.2

func (dlcs DataLifeCycleState) GetDefaultRetentionTimeout() time.Time

GetDefaultRetentionTimeout returns the default retention timeout for the data life cycle state

func (DataLifeCycleState) IsLive added in v0.7.2

func (dlcs DataLifeCycleState) IsLive() bool

IsLive return true if the concrete data life cycle state is live

type DataType added in v0.6.4

type DataType string

DataType is an enum for supported data types

const (
	DataTypeInvalid         DataType = ""
	DataTypeAddress         DataType = "address"
	DataTypeBirthdate       DataType = "birthdate"
	DataTypeBoolean         DataType = "boolean"
	DataTypeDate            DataType = "date"
	DataTypeEmail           DataType = "email"
	DataTypeInteger         DataType = "integer"
	DataTypeE164PhoneNumber DataType = "e164_phonenumber"
	DataTypePhoneNumber     DataType = "phonenumber"
	DataTypeSSN             DataType = "ssn"
	DataTypeString          DataType = "string"
	DataTypeTimestamp       DataType = "timestamp"
	DataTypeUUID            DataType = "uuid"
)

DataType constants NOTE: keep in sync with mapDataType defined in TenantUserStoreConfig.tsx

type Mutator added in v0.4.0

type Mutator struct {
	ID uuid.UUID `json:"id"`

	// Name of mutator, must be unique
	Name string `json:"name" validate:"length:1,128" required:"true"`

	// Description of the mutator
	Description string `json:"description"`

	// Version of the mutator
	Version int `json:"version"`

	// Configuration for which user records to modify
	SelectorConfig UserSelectorConfig `json:"selector_config" required:"true"`

	// The set of userstore columns to modify for each user record
	Columns []ColumnInputConfig `json:"columns" validate:"skip" required:"true"`

	// Policy for whether the data for each user record can be updated
	AccessPolicy ResourceID `json:"access_policy" validate:"skip" required:"true"`

	IsSystem bool `` /* 152-byte string literal not displayed */
}

Mutator represents a customer-defined scope and permissions policy for updating userstore data

type Purpose added in v0.6.4

type Purpose struct {
	ID          uuid.UUID `json:"id"`
	Name        string    `json:"name" validate:"length:1,128" required:"true"`
	Description string    `json:"description"`
	IsSystem    bool      `` /* 152-byte string literal not displayed */
}

Purpose represents a customer-defined purpose for userstore columns

type Record

type Record map[string]interface{}

Record is a single "row" of data containing 0 or more Columns from userstore's schema The key is the name of the column

func (Record) BoolValue added in v0.6.4

func (r Record) BoolValue(key string) bool

BoolValue returns a boolean value for the specified key

func (Record) StringValue added in v0.6.4

func (r Record) StringValue(key string) string

StringValue returns a string value for the specified key

func (Record) UUIDValue added in v0.6.4

func (r Record) UUIDValue(key string) uuid.UUID

UUIDValue returns a UUID value for the specified key

type ResourceID added in v0.6.4

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

ResourceID is a struct that contains a name and ID, only one of which is required to be set

func (ResourceID) Validate added in v0.6.4

func (r ResourceID) Validate() error

Validate implements Validateable

type UserSelectorConfig added in v0.5.0

type UserSelectorConfig struct {
	WhereClause string `json:"where_clause" validate:"notempty" example:"{id} = ANY (?)"`
}

UserSelectorConfig is the configuration for a UserSelector

type UserSelectorValues added in v0.5.0

type UserSelectorValues []interface{}

UserSelectorValues are the values passed for the UserSelector of an accessor or mutator

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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