Project AuthenticationData Property
Project Authentication

Data property

Definition and configuration of data properties within Mindbricks project authentication, including basic, index, enum, relation, session, static join, formula, context, and filter settings.

MPO Version: 1.3.0

The definition of a data property within a data object. A data property is not just a storage field—it encapsulates the logic, behavior, and metadata associated with a specific piece of data. Through its settings, a data property can define relationships, context-aware values, session-based defaults, computed formulas, access filters, enums, and more. It serves as a powerful unit of business logic tightly integrated with the data model.

interface DataProperty = {
  basicSettings : PropertyBasicSettings;
  indexSettings : PropertyIndexSettings;
  enumSettings : PropertyEnumSettings;
  relationSettings : PropertyRelation;
  sessionSettings : PropertySessionSettings;
  staticJoin : PropertyStaticJoin;
  formulaSettings : PropertyFormulaSettings;
  contextSettings : PropertyContextSettings;
  filterSettings : PropertyFilterSettings;
}
FieldDescription
basicSettingsDefines the foundational attributes of the data property, such as its name, type, whether it's an array, and its general description.
indexSettingsControls how the property is indexed in storage systems to optimize lookup and uniqueness behaviors.
enumSettingsEnumerates the fixed set of values this property can take. Only used when the type is set to Enum.
relationSettingsDefines relationship mappings if the property refers to another data object, such as foreign keys or join references.
sessionSettingsSpecifies how the property's value can be derived from the session context, such as assigning userId automatically on record creation.
staticJoinDefines static join logic for enriching this property with data from other objects, useful for preloading dictionary or reference values.
formulaSettingsAllows the value of the property to be computed from a formula or script, typically used for derived or read-only fields.
contextSettingsProvides settings to dynamically set property values based on API execution context, such as input parameters or route metadata.
filterSettingsSpecifies whether and how the property can be used as a filter parameter in API queries or search operations.

PropertyBasicSettings

MPO Version: 1.3.0

Defines the core structure and behavior of a data property. Beyond basic typing, this section governs how the property participates in data integrity, mutability, API exposure, and logic-driven behaviors such as hashing or auto-increment. Use this section to establish the foundational logic and identity of the property within your data object.

interface PropertyBasicSettings = {
  name : String;
  type : DataTypes;
  isArray : Boolean;
  description : Text;
  isRequired : Boolean;
  allowUpdate : Boolean;
  requiredInUpdate : Boolean;
  allowAutoUpdate : Boolean;
  autoIncrement : Boolean;
  hashed : Boolean;
  defaultValues : PropertyDefaults;
}
FieldDescription
nameUnique identifier for the property within the data object. This name is used throughout route definitions, generated code, and logic expressions. Use camelCase formatting, avoid spaces and special characters, and ensure the name is unique within the same data object.
typeDefines the property's data type. Use a value from the DataTypes. The selected type impacts validation, storage schema, and frontend component inference.
isArrayIndicates if the property stores multiple values (array). Supported by databases like PostgreSQL and MongoDB. Default is false.
descriptionOptional textual description of the property's role in the domain. Useful for documentation and as a semantic hint across logic and UI components.
isRequiredIf true, this property must be provided when a new object is created. It is enforced during validation.
allowUpdateControls whether the property can be modified after creation. If false, updates to this field are ignored unless overridden explicitly.
requiredInUpdateIf true, the property must be present in update operations. Commonly used for fields that must be kept consistent across updates (e.g. version, status).
allowAutoUpdateIf true, this property will be automatically included in the update parameters for default routes unless custom logic is applied. Helps streamline generic update routes.
autoIncrementIf true, this property will be auto-generated by incrementing the latest existing value. Suitable for numeric IDs or sequences managed internally.
hashedIf true, the property's value will be hashed before storage. This is irreversible and is typically used for storing passwords or other sensitive values.
defaultValuesDefines default values to be used during create or update operations when the property is missing. Values must match the property's type and isArray setting in JSON format.

DataTypes

These are the standardized data types used in microservice data models and BFF data views in Mindbricks.

const DataTypes = {
  ID: "ID",
  String: "String",
  Text: "Text",
  Integer: "Integer",
  Boolean: "Boolean",
  Double: "Double",
  Float: "Float",
  Short: "Short",
  Object: "Object",
  Date: "Date",
  Enum: "Enum",
  GeoPoint: "GeoPoint",
  GeoRoute: "GeoRoute",
  GeoArea: "GeoArea",
};
EnumDescription
IDRepresents a unique identifier. Implemented as UUID in SQL databases and ObjectID in NoSQL databases.
StringRepresents short text values, typically capped at 255 characters.
TextRepresents long-form text content suitable for descriptions or rich text.
IntegerRepresents 4-byte integer values used for whole numbers.
BooleanRepresents logical values true or false.
DoubleRepresents 8-byte double-precision floating-point numbers.
FloatRepresents 4-byte single-precision floating-point numbers.
ShortRepresents 2-byte short integers, useful for flags.
ObjectRepresents a generic JSON object, useful for flexible data structures.
DateRepresents date-time values, stored as ISO 8601 strings in UTC timezone.
EnumRepresents a fixed set of string values. Enum options are defined as an array of strings and internally stored as a short string.
GeoPointRepesents a geography point on the earth. It is a POINT GeoJson object storing lon and lat values.
GeoRouteRepresents a geography route on the earth. It is a LINESTRING GeoJson object, with an array of lon and lat pairs.
GeoAreaRepresents a geography area on the earth. It is a POLYGON GeoJson object, with an array of lon and lat pairs. It hsould be closed as the last and first points should be equal. If not first point will be added automaticall as last point also.

PropertyDefaults

MPO Version: 1.3.0

Defines fallback values for create and update operations when the property is not explicitly provided. These settings ensure consistency and reduce frontend responsibility in form submission. Values must match the JSON representation of the property's type (DataTypes) and isArray setting. Examples: String→"text", Integer→123, Boolean→true, Date→"2024-01-01T00:00:00Z", Enum→"enumValueAsStr", Object→{}, or wrapped in arrays like ["text1","text2"] when isArray=true. Note that the Enum type is represented by string value here instead of the Integer index.

interface PropertyDefaults = {
  default : AnyComplex;
  defaultInUpdate : AnyComplex;
  alwaysCreateWithDefaultValue : Boolean;
}
FieldDescription
defaultDefault value applied in create operations if the property is not provided. Commonly used to set initial values like statuses, flags, or timestamps. Set to null when no meaningful default exists. Value must match the property's type and isArray setting in JSON format.
defaultInUpdateDefault value applied in update operations if the property is required in update but not explicitly provided in the request payload. Set to null when no meaningful default exists. Value must match the property's type and isArray setting in JSON format.
alwaysCreateWithDefaultValueIf true, the default value will always be used during creation, even if the client provides a value for this property. This is useful for enforcing system-controlled initialization—such as setting fields based on minimal authorization rights—that should only be modified later by users with elevated privileges.

PropertyIndexSettings

MPO Version: 1.3.0

Index configuration for the data property across supported storage and caching layers. This includes Elasticsearch indexing for query performance, relational database indexing for faster selection, and Redis-based optimizations for efficient cache invalidation and retrieval. Use these settings to control how the property contributes to performance, queryability, and caching logic.

interface PropertyIndexSettings = {
  indexedInElastic : Boolean;
  fulltextSearch : Boolean;
  indexedInDb : Boolean;
  unique : Boolean;
  clusterInRedis : Boolean;
  cacheSelect : Boolean;
  isSecondaryKey : Boolean;
}
FieldDescription
indexedInElasticDetermines whether the property is indexed in the Elasticsearch CQRS index. When enabled, this property can be used in DataView filters and search queries.
fulltextSearchIf set to true, Mindbricks will create an additional text index in elastic search other than the type based term query. Note that this feature is ignored if indexedInElastic is false. Text type data properties are alread have full text search.
indexedInDbSpecifies whether a native database index should be created for this property to accelerate selection queries. Recommended for frequently filtered or sorted fields.
uniqueIndicates whether the property's value must be unique across all records. Enabling this will enforce a uniqueness constraint at the database level.
clusterInRedisSpecifies whether the property should contribute to Redis cluster keys for partial cache invalidation. This improves cache sensitivity but may increase Redis storage.
cacheSelectDefines whether this property is used as a key in Redis entity cache for batch-select operations. Enables lookup by this value across cached entities.
isSecondaryKeyMarks the property as a secondary identifier, improving query performance on non-primary keys. Useful for access tokens, slugs, or alternative keys.

PropertyEnumSettings

MPO Version: 1.3.0

Enum configuration for the data property, applicable when the property type is set to Enum. While enum values are stored as integers in the database, defining the enum options here allows Mindbricks to enrich API responses with human-readable labels, easing interpretation and UI integration. If not defined, only the numeric value will be returned.

interface PropertyEnumSettings = {
  hasEnumOptions : Boolean;
  configuration : PropertyEnumSettingsConfig;
}
FieldDescription
hasEnumOptionsEnables support for named enum values when the property type is Enum.
configurationThe configuration object for enum options. Leave it null if hasEnumOptions is false.

PropertyEnumSettingsConfig

MPO Version: 1.3.0

Configuration settings for enum options in a data property. This object defines the symbolic names that the enum type property can have. These labels are used in generated documentation and API responses.

interface PropertyEnumSettingsConfig = {
  enumOptions : String[];
}
FieldDescription
enumOptionsAn ordered list of enum string values representing the symbolic values that the enum property can have.

PropertyRelation

MPO Version: 1.3.0

Defines the relationship configuration for the data property. This is used when the property acts as a foreign key referencing another data object. It allows setting up parent-child relationships, cascade behaviors, and enriches both code generation and documentation with relational semantics.

interface PropertyRelation = {
  hasRelation : Boolean;
  configuration : PropertyRelationConfig;
}
FieldDescription
hasRelationIndicates whether this property represents a foreign key relationship to another data object. If enabled, additional settings like the target object and key must be provided.
configurationThe configuration object for the property relation. Leave it null if hasRelation is false.

PropertyRelationConfig

MPO Version: 1.3.0

Configuration object for property relations. Defines the details of the foreign key relationship, including the relation name, target object, target key, parent/child semantics, delete behavior, and whether the relation is required. Used only if hasRelation is true.

interface PropertyRelationConfig = {
  relationName : String;
  relationTargetObject : DataObjectName;
  relationTargetKey : PropRefer;
  onDeleteAction : RelationOnDeleteAction;
  relationIsRequired : Boolean;
}
FieldDescription
relationNameA single-word, human-readable name that identifies the relationship. This name is used in generated code and documentation to represent joined data via this relation.
relationTargetObjectThe name of the data object this property relates to. This defines the target of the foreign key relationship.
relationTargetKeyThe property name (usually 'id') in the target object that this property references. This is the destination key for the relation.
onDeleteActionDetermines what action should be taken if the related (parent) object is deleted. Options include cascading the delete or nullifying this property.
relationIsRequiredDefines whether the relation is mandatory. If true, the property must always reference a valid record in the related data object.

RelationOnDeleteAction

Defines the available strategies for handling related records when a referenced (parent) object is deleted.

const RelationOnDeleteAction = {
  doDelete: "doDelete",
  setNull: "setNull",
};
EnumDescription
doDeleteAutomatically delete this object if the referenced target object is deleted. This is a cascading delete.
setNullSet this property to null when the referenced object is deleted, effectively removing the relation without deleting this object.

PropRefer

MPO Version: 1.3.0

Represents a reference to a property of a data object, optionally renaming it in the current context. It is a string data, however can store string pairs joined with ':'.The first part is the name ofthe property and the second part after ':' mark is how it will be renamed in the context. If no second partis provided, the property is named in the context with its original name. Renaming is useful for mapping remote object properties to local aliases or transforming naming for aggregation.

interface PropRefer = {
}
FieldDescription

PropertySessionSettings

MPO Version: 1.3.0

Defines how this property is populated from the session context. Session-driven properties are commonly used to associate records with the current user or tenant automatically during create/update operations.

interface PropertySessionSettings = {
  isSessionData : Boolean;
  configuration : PropertySessionSettingsConfig;
}
FieldDescription
isSessionDataIndicates whether this property is automatically populated from the session context. If true, additional configuration is required.
configurationThe configuration object for session mapping. Leave it null if isSessionData is false.

PropertySessionSettingsConfig

MPO Version: 1.3.0

Configuration object for session mapping. Defines the mapping between session properties and data object fields. This allows automatic population of data object properties from session data during create/update operations.

interface PropertySessionSettingsConfig = {
  sessionParam : String;
  isOwnerField : Boolean;
}
FieldDescription
sessionParamSpecifies the name of the session field to bind to this property. Defaults to the property name if not explicitly provided. For example, if the session contains userId, that can be mapped to this field.
isOwnerFieldMarks this property as the ownership field for the data object. When true, the property is used to enforce ownership-based access control (e.g., ensuring users can only modify their own records). This should be used when the property semantically identifies the owner of the record, typically a userId.

PropertyStaticJoin

MPO Version: 1.3.0

Static join settings define how this property's value is derived from another data object at the time of creation or update. This approach is useful when a field in the current object depends on a static value from a related object, and that value is not expected to change frequently. Unlike dynamic joins, static joins store the fetched value directly to allow for faster queries and avoid repeated lookups. A common use case is transferring tenant or client identifiers from a parent object into a child record. For example, when creating an email job for a specific user, the system can use the userId to join the User object, fetch its clientId, and statically assign it to the EmailJob object. This makes it easy to query email jobs by clientId without needing to join back to the User table at runtime. Note that, all static joins are executed before the property formula executions and the fetched data and read property (field) is written to the context like this.product and this.amount, so you can use these context data with in the calculated properties for either the same joint property or for another property.

interface PropertyStaticJoin = {
  isStaticJoin : Boolean;
  configuration : PropertyStaticJoinConfig;
}
FieldDescription
isStaticJoinIndicates whether this property should be populated from a static join with another data object. Static joins allow you to copy a fixed value from a related object (such as a foreign key reference) into this object at the time of creation or update. This enables fast lookups without needing runtime joins. Often used for propagating static values like tenantId, clientId, or status names. Enable this only when the source data is relatively stable and changes infrequently, as the joined value is stored statically and won't automatically update if the source changes.
configurationThe configuration object that defines the static join settings. Leave it null if the property is not a sttaic join.

PropertyStaticJoinConfig

MPO Version: 1.3.0

Configuration object for static joins. This object contains the settings that define how the static join is established, including the source object, the field to be joined, and the keys used for matching records. It is used in conjunction with the isStaticJoin property to enable static joins in data objects.

interface PropertyStaticJoinConfig = {
  jointSource : DataObjectName;
  jointRead : PropRefer;
  jointSourceKey : PropRefer;
  jointForeignKey : PropRefer;
}
FieldDescription
jointSourceThe name and optionally the service of the source object from which the value will be joined. If the source is in another service, Mindbricks will automatically use Elasticsearch indexing to perform the join.
jointReadThe name of the property in the source object whose value will be copied into the current property. Defaults to the same name as this property if not specified.
jointSourceKeyThe key in the source object used to identify the matching record. This is typically 'id' as the primary identifier of the source object. This field acts as the join source in the static join relationship.
jointForeignKeyThe property in the current object used as a reference to the source object (i.e., the foreign key). For example, if joining user.clientId via userId, the foreign key is 'userId'.

PropertyFormulaSettings

MPO Version: 1.3.0

Specifies formula-based logic for computing the value of a data property. Use this when the property should not be directly provided by the user but instead derived through predefined calculations during create or update operations. Note that formula caluclations are made at the final point of the data clause building, so you can acess other property values that are populated from other sources. The formulas are calculated in create and update api's, so these API's will automatically manage the calculated population of the related properties. If you need more complex calculations in API level, you can use dataClause settings of the API combined with Api actions.

interface PropertyFormulaSettings = {
  isCalculated : Boolean;
  configuration : PropertyFormulaSettingsConfig;
}
FieldDescription
isCalculatedIndicates whether this property is calculated using an MScript formula. When enabled, the property’s value will be automatically derived instead of supplied directly by the client.
configurationThe configuration object for formula-based calculation. Leave it null if isCalculated is false.

PropertyFormulaSettingsConfig

MPO Version: 1.3.0

Configuration object for formula-based calculation. Defines the primary formula and optional update formula for computed properties. This allows dynamic calculation of values during create or update operations.

interface PropertyFormulaSettingsConfig = {
  formula : MScript;
  updateFormula : MScript;
  calculateWhenInputHas : PropRefer[];
  calculateAfterInstance : Boolean;
}
FieldDescription
formulaThe primary MScript formula used to compute the property's value during creation or when no update-specific formula is defined. Use this.{property} syntax to access other values in the same request context.
updateFormulaOptional MScript formula to override the default formula during update operations. If omitted, the main formula will be used for updates as well.
calculateWhenInputHasList of field names that trigger recalculation during updates. If any of these fields appear in the input, the formula will be re-evaluated. This is useful for dependent computations.
calculateAfterInstanceIndicates whether the formula should be executed after the full instance is created or loaded. This is necessary when the formula depends on values not present in the input but available only after instantiation.

PropertyContextSettings

MPO Version: 1.3.0

Defines how this property is automatically populated from the request-time execution context. This is useful when the property value is fetched or computed externally before being written to the database—such as through API fetches, middleware injections, or upstream aggregations.

interface PropertyContextSettings = {
  isContextData : Boolean;
  configuration : PropertyContextSettingsConfig;
}
FieldDescription
isContextDataIndicates whether this property derives its value from the execution context during a request. This enables dynamic assignment of the property using data available only at runtime.
configurationThe configuration object for context mapping. Leave it null if isContextData is false.

PropertyContextSettingsConfig

MPO Version: 1.3.0

Configuration object for context mapping. Defines the mapping between context properties and data object fields. This allows automatic population of data object properties from context data during create/update operations.

interface PropertyContextSettingsConfig = {
  contextParam : String;
}
FieldDescription
contextParamSpecifies the key or path in the context object that holds the value for this property. Supports dot notation for nested context values (e.g., company.name).

PropertyFilterSettings

MPO Version: 1.3.0

Specifies if a data property should be exposed as a query parameter for filtering in auto-generated list endpoints. This allows users to filter records by this field when retrieving data via GET routes. The presence of this configuration determines how the backend interprets and applies client-side query filters.

interface PropertyFilterSettings = {
  isFilterParameter : Boolean;
  configuration : PropertyFilterSettingsConfig;
}
FieldDescription
isFilterParameterDetermines whether the property can be used as a query parameter in list (GET) API routes. If enabled, clients can use this property to filter results when calling endpoints like /customers. The filtering logic is automatically handled based on the property type.
configurationThe configuration object for filter settings. Leave it null if isFilterParameter is false.

PropertyFilterSettingsConfig

MPO Version: 1.3.0

Configuration object for filter settings. Defines the custom name of the filter parameter in the query string. This is useful when the external API should expose a different term than the internal field name.

interface PropertyFilterSettingsConfig = {
  filterName : String;
}
FieldDescription
filterNameCustom name of the filter parameter in the query string. Defaults to the property's name. This is useful when the external API should expose a different term than the internal field name.
Was this page helpful?
Built with Documentation.AI

Last updated today