Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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"`
// Description of the accessor
Description string `json:"description"`
// Version of the accessor
Version int `json:"version"`
// Configuration for which user records to return
SelectorConfig UserSelectorConfig `json:"selector_config"`
// Purposes for which this accessor is used
Purposes []ResourceID `json:"purposes" validate:"skip"`
// List of userstore columns being accessed and the transformers to apply to each column
Columns []ColumnOutputConfig `json:"columns" validate:"skip"`
// 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"`
// Policy for token resolution in the case of transformers that tokenize data
TokenAccessPolicy ResourceID `json:"token_access_policy,omitempty" validate:"skip"`
}
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"`
Type DataType `json:"type"`
IsArray bool `json:"is_array"`
DefaultValue string `json:"default_value"`
IndexType ColumnIndexType `json:"index_type"`
}
Column represents a single field/column/value to be collected/stored/managed in the user data store of a tenant.
type ColumnAccessor ¶ added in v0.3.0
type ColumnAccessor struct {
ID uuid.UUID `json:"id" validate:"notnil"`
// Friendly ID, must be unique?
Name string `json:"name" validate:"notempty"`
// the columns that are accessed here
ColumnIDs []uuid.UUID `json:"column_ids" validate:"notnil"`
// makes decisions about who can access this particular view of this field
AccessPolicyID uuid.UUID `json:"access_policy_id" validate:"notnil"`
// transforms the value of this field before it is returned to the client
TransformationPolicyID uuid.UUID `json:"transformation_policy_id" validate:"notnil"`
}
ColumnAccessor represents a customer-defined view / permissions policy on a column
type ColumnAccessors ¶ added in v0.3.0
type ColumnAccessors []ColumnAccessor
ColumnAccessors is simply a slice of ColumnAccessor, and this type exists soley so that we can hang Scan() and Value() on it to make the db layer work.
type ColumnIndexType ¶ added in v0.6.0
type ColumnIndexType int
ColumnIndexType is an enum for supported column index types
const ( // ColumnIndexTypeNone is the default value ColumnIndexTypeNone ColumnIndexType = iota // ColumnIndexTypeIndexed indicates that the column should be indexed ColumnIndexTypeIndexed // ColumnIndexTypeUnique indicates that the column should be indexed and unique ColumnIndexTypeUnique )
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 DataType ¶ added in v0.6.4
type DataType int
DataType is an enum for supported data types
const ( DataTypeInvalid DataType = 0 DataTypeBoolean DataType = 1 DataTypeInteger DataType = 2 DataTypeString DataType = 100 DataTypeTimestamp DataType = 200 DataTypeUUID DataType = 300 //DataTypeJSONB DataType = 400 DataTypeAddress DataType = 401 )
DataType constants (leaving gaps intentionally to allow future related types to be grouped) 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"`
// 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"`
// The set of userstore columns to modify for each user record
Columns []ColumnInputConfig `json:"columns" validate:"skip"`
// Policy for whether the data for each user record can be updated
AccessPolicy ResourceID `json:"access_policy" validate:"skip"`
}
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"`
Description string `json:"description"`
}
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) StringValue ¶ added in v0.6.4
StringValue returns a string value for the specified key
type ResourceID ¶ added in v0.6.4
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"`
}
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