Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AllColumnTypes = []ColumnType{ ColumnTypeBoolean, ColumnTypeString, ColumnTypeTimestamp, ColumnTypeUUID, }
AllColumnTypes is a slice of all ColumnType values
Functions ¶
This section is empty.
Types ¶
type Accessor ¶ added in v0.4.0
type Accessor struct {
ID uuid.UUID `json:"id"`
// Friendly ID, must be unique?
Name string `json:"name" validate:"notempty"`
// Description of the accessor
Description string `json:"description"`
// Version of the accessor
Version int `json:"version"`
// the columns that are accessed here
ColumnNames []string `json:"column_names" validate:"skip"`
// 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"`
// Configuration for selectors for this accessor
SelectorConfig UserSelectorConfig `json:"selector_config"`
}
Accessor represents a customer-defined view / permissions policy on a column
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:"notempty"`
Type ColumnType `json:"type"`
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 ColumnType ¶ added in v0.3.0
type ColumnType int
ColumnType is an enum for supported column types
const ( ColumnTypeInvalid ColumnType = 0 ColumnTypeBoolean ColumnType = 1 ColumnTypeString ColumnType = 100 ColumnTypeTimestamp ColumnType = 200 ColumnTypeUUID ColumnType = 300 )
ColumnType constants (leaving gaps intentionally to allow future related types to be grouped) NOTE: keep in sync with mapColumnType defined in TenantUserStoreConfig.tsx
func GetColumnType ¶ added in v0.6.0
func GetColumnType(i interface{}) ColumnType
GetColumnType returns the ColumnType for the given value
func (ColumnType) MarshalText ¶ added in v0.3.0
func (t ColumnType) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler (for JSON)
func (ColumnType) String ¶ added in v0.3.0
func (t ColumnType) String() string
just here for easier debugging
func (*ColumnType) UnmarshalText ¶ added in v0.3.0
func (t *ColumnType) UnmarshalText(b []byte) error
UnmarshalText implements encoding.TextMarshaler (for JSON)
func (*ColumnType) Validate ¶ added in v0.3.0
func (t *ColumnType) Validate() error
Validate implements Validateable
type Mutator ¶ added in v0.4.0
type Mutator struct {
ID uuid.UUID `json:"id"`
// Friendly ID, must be unique
Name string `json:"name" validate:"notempty"`
// Description of the mutator
Description string `json:"description"`
// Version of the mutator
Version int `json:"version"`
// The columns that are updated here
ColumnNames []string `json:"column_names" validate:"skip"`
// Decides who can update these columns
AccessPolicyID uuid.UUID `json:"access_policy_id" validate:"notnil"`
// Validates the data before it is written to the userstore
ValidationPolicyID uuid.UUID `json:"validation_policy_id" validate:"notnil"`
// Configuration for selectors for this mutator
SelectorConfig UserSelectorConfig `json:"selector_config"`
}
Mutator represents a customer-defined permissions policy for updating columns in userstore
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
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