IF Commons GitHub

attributeDefinition

concept

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.

Governance: attributes

attributeDefinitionIdidentifierrequired

What 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

attributeKeytextrequired

The 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 attributeCategoryrequired

What it is an attribute of

Becomes the column category of attribute_definition.

Written at commons/data/models/identity-abac/mod.ts:37

definitiontextrequired

What the attribute means

Becomes the column definition of attribute_definition.

Written at commons/data/models/identity-abac/mod.ts:33

freshnessSecondsintegeroptional

How 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

resourceTypetextoptional

The 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 sensitivityLevelrequired

How sensitive its values are

Becomes the column sensitivity of attribute_definition.

Written at commons/data/models/identity-abac/mod.ts:42

sourcecode of attributeSourcerequired

Where its values come from

Becomes the column source of attribute_definition.

Written at commons/data/models/identity-abac/mod.ts:39

statuscode of useStatusrequired

Whether the attribute is in use

Becomes the column status of attribute_definition.

Written at commons/data/models/identity-abac/mod.ts:45

subjectKindscode of principalKindmany

The 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 attributeValueTyperequired

The type of its values

Becomes the column value_type of attribute_definition.

Written at commons/data/models/identity-abac/mod.ts:38

Governance: relationships

tenantoptional

The tenant that defined it; empty for the platform's To tenant. Written at commons/data/models/identity-abac/mod.ts:109

Logical: the table

Projects to the table attribute_definition with the primary key attribute_definition_id.

ColumnTypeNullRoleFrom
attribute_definition_idtextfalseattributeattributeDefinition.attributeDefinitionId
attribute_keytextfalseattributeattributeDefinition.attributeKey
categorytextfalseattributeattributeDefinition.category
definitiontextfalseattributeattributeDefinition.definition
freshness_secondsintegertrueattributeattributeDefinition.freshnessSeconds
resource_typetexttrueattributeattributeDefinition.resourceType
sensitivitytextfalseattributeattributeDefinition.sensitivity
sourcetextfalseattributeattributeDefinition.source
statustextfalseattributeattributeDefinition.status
tenant_idtexttruereferenceattributeDefinition.tenant
value_typetextfalseattributeattributeDefinition.valueType

Physical: SQL

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'))
);

Physical: the typed table

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);

Titles, headings, exports, tables, columns and requirements. Esc closes.