attributeDefinitionIdidentifierrequiredWhat identifies the attribute, made by the application
Becomes the column attribute_definition_id of attribute_definition.
Written at commons/data/models/identity-abac/mod.ts:35
An attribute that decisions may use, with its type, where its values come from and how old they may be
Model identityAbac. Written in commons/data/models/identity-abac/mod.ts:32. Identified by attributeDefinitionId.
attributeDefinitionIdidentifierrequiredWhat identifies the attribute, made by the application
Becomes the column attribute_definition_id of attribute_definition.
Written at commons/data/models/identity-abac/mod.ts:35
attributeKeytextrequiredThe attribute as `category.name`, unique
Becomes the column attribute_key of attribute_definition.
Written at commons/data/models/identity-abac/mod.ts:36
categorycode of attributeCategoryrequiredWhat it is an attribute of
Becomes the column category of attribute_definition.
Written at commons/data/models/identity-abac/mod.ts:37
definitiontextrequiredWhat the attribute means
Becomes the column definition of attribute_definition.
Written at commons/data/models/identity-abac/mod.ts:33
freshnessSecondsintegeroptionalHow old a stored value may be before it reads as unknown
Becomes the column freshness_seconds of attribute_definition.
Written at commons/data/models/identity-abac/mod.ts:43
resourceTypetextoptionalThe kind of resource it applies to
Becomes the column resource_type of attribute_definition.
Written at commons/data/models/identity-abac/mod.ts:41
sensitivitycode of sensitivityLevelrequiredHow sensitive its values are
Becomes the column sensitivity of attribute_definition.
Written at commons/data/models/identity-abac/mod.ts:42
sourcecode of attributeSourcerequiredWhere its values come from
Becomes the column source of attribute_definition.
Written at commons/data/models/identity-abac/mod.ts:39
statuscode of useStatusrequiredWhether the attribute is in use
Becomes the column status of attribute_definition.
Written at commons/data/models/identity-abac/mod.ts:45
subjectKindscode of principalKindmanyThe kinds of principal it applies to; every kind where none is said
Becomes the column subject_kinds of attribute_definition.
Written at commons/data/models/identity-abac/mod.ts:40
valueTypecode of attributeValueTyperequiredThe type of its values
Becomes the column value_type of attribute_definition.
Written at commons/data/models/identity-abac/mod.ts:38
tenantoptionalThe tenant that defined it; empty for the platform's To tenant. Written at commons/data/models/identity-abac/mod.ts:109
Projects to the table attribute_definition with the primary key attribute_definition_id.
| Column | Type | Null | Role | From |
|---|---|---|---|---|
attribute_definition_id | text | false | attribute | attributeDefinition.attributeDefinitionId |
attribute_key | text | false | attribute | attributeDefinition.attributeKey |
category | text | false | attribute | attributeDefinition.category |
definition | text | false | attribute | attributeDefinition.definition |
freshness_seconds | integer | true | attribute | attributeDefinition.freshnessSeconds |
resource_type | text | true | attribute | attributeDefinition.resourceType |
sensitivity | text | false | attribute | attributeDefinition.sensitivity |
source | text | false | attribute | attributeDefinition.source |
status | text | false | attribute | attributeDefinition.status |
tenant_id | text | true | reference | attributeDefinition.tenant |
value_type | text | false | attribute | attributeDefinition.valueType |
CREATE TABLE IF NOT EXISTS "attribute_definition" (
"attribute_definition_id" VARCHAR NOT NULL PRIMARY KEY,
"attribute_key" VARCHAR NOT NULL,
"category" VARCHAR NOT NULL,
"value_type" VARCHAR NOT NULL,
"source" VARCHAR NOT NULL,
"resource_type" VARCHAR,
"sensitivity" VARCHAR NOT NULL,
"freshness_seconds" INTEGER,
"definition" VARCHAR NOT NULL,
"status" VARCHAR NOT NULL,
"tenant_id" VARCHAR,
CONSTRAINT "attribute_definition_tenant_id_fk" FOREIGN KEY ("tenant_id") REFERENCES "tenant" ("tenant_id"),
CONSTRAINT "attribute_definition_attribute_key_uq" UNIQUE ("attribute_key"),
CONSTRAINT "attribute_definition_category_ck" CHECK ("category" IN ('subject', 'resource', 'environment', 'action')),
CONSTRAINT "attribute_definition_value_type_ck" CHECK ("value_type" IN ('text', 'integer', 'boolean', 'instant', 'text_set')),
CONSTRAINT "attribute_definition_source_ck" CHECK ("source" IN ('stored', 'request', 'posture', 'directory', 'derived')),
CONSTRAINT "attribute_definition_sensitivity_ck" CHECK ("sensitivity" IN ('public', 'internal', 'confidential', 'restricted')),
CONSTRAINT "attribute_definition_status_ck" CHECK ("status" IN ('active', 'retired'))
);CREATE TABLE IF NOT EXISTS "attribute_definition" (
"attribute_definition_id" TEXT NOT NULL PRIMARY KEY,
"attribute_key" TEXT NOT NULL,
"category" TEXT NOT NULL,
"value_type" TEXT NOT NULL,
"source" TEXT NOT NULL,
"resource_type" TEXT,
"sensitivity" TEXT NOT NULL,
"freshness_seconds" INTEGER,
"definition" TEXT NOT NULL,
"status" TEXT NOT NULL,
"tenant_id" TEXT,
CONSTRAINT "attribute_definition_tenant_id_fk" FOREIGN KEY ("tenant_id") REFERENCES "tenant" ("tenant_id"),
CONSTRAINT "attribute_definition_attribute_key_uq" UNIQUE ("attribute_key"),
CONSTRAINT "attribute_definition_category_ck" CHECK ("category" IN ('subject', 'resource', 'environment', 'action')),
CONSTRAINT "attribute_definition_value_type_ck" CHECK ("value_type" IN ('text', 'integer', 'boolean', 'instant', 'text_set')),
CONSTRAINT "attribute_definition_source_ck" CHECK ("source" IN ('stored', 'request', 'posture', 'directory', 'derived')),
CONSTRAINT "attribute_definition_sensitivity_ck" CHECK ("sensitivity" IN ('public', 'internal', 'confidential', 'restricted')),
CONSTRAINT "attribute_definition_status_ck" CHECK ("status" IN ('active', 'retired'))
);CREATE TABLE IF NOT EXISTS "attribute_definition" (
"attribute_definition_id" TEXT NOT NULL PRIMARY KEY,
"attribute_key" TEXT NOT NULL,
"category" TEXT NOT NULL,
"value_type" TEXT NOT NULL,
"source" TEXT NOT NULL,
"resource_type" TEXT,
"sensitivity" TEXT NOT NULL,
"freshness_seconds" INTEGER,
"definition" TEXT NOT NULL,
"status" TEXT NOT NULL,
"tenant_id" TEXT,
CONSTRAINT "attribute_definition_tenant_id_fk" FOREIGN KEY ("tenant_id") REFERENCES "tenant" ("tenant_id"),
CONSTRAINT "attribute_definition_attribute_key_uq" UNIQUE ("attribute_key"),
CONSTRAINT "attribute_definition_category_ck" CHECK ("category" IN ('subject', 'resource', 'environment', 'action')),
CONSTRAINT "attribute_definition_value_type_ck" CHECK ("value_type" IN ('text', 'integer', 'boolean', 'instant', 'text_set')),
CONSTRAINT "attribute_definition_source_ck" CHECK ("source" IN ('stored', 'request', 'posture', 'directory', 'derived')),
CONSTRAINT "attribute_definition_sensitivity_ck" CHECK ("sensitivity" IN ('public', 'internal', 'confidential', 'restricted')),
CONSTRAINT "attribute_definition_status_ck" CHECK ("status" IN ('active', 'retired'))
);Read and written from TypeScript with the types the model gives: import { attributeDefinition } from "@intellectual-frontiers/data/sql/typed/models". Generated in commons/data/sql/typed/models/identity-abac.auto.ts: do not edit.
import { from } from "@intellectual-frontiers/data/sql/typed";
import { attributeDefinition } from "@intellectual-frontiers/data/sql/typed/models";
const rows = await from(attributeDefinition).select((s) => ({ attributeDefinitionId: s.attributeDefinition.attributeDefinitionId, attributeKey: s.attributeDefinition.attributeKey })).run(runner);