algorithmcode of passwordAlgorithmrequiredHow it was hashed
Becomes the column password_algorithm_code of password_credential.
Written at commons/data/models/identity/concepts.ts:158
A password, kept only as a hash that carries its algorithm, its parameters and its salt
Model identity. Written in commons/data/models/identity/concepts.ts:154. Identified by credential.
algorithmcode of passwordAlgorithmrequiredHow it was hashed
Becomes the column password_algorithm_code of password_credential.
Written at commons/data/models/identity/concepts.ts:158
changedAtinstantrequiredWhen the password was set
Becomes the column changed_at of password_credential.
Written at commons/data/models/identity/concepts.ts:159
hashtextrequiredThe hash in the PHC string form; never the password, never reversible
Becomes the column hash of password_credential.
Written at commons/data/models/identity/concepts.ts:157
mustChangebooleanrequiredWhether the user must choose another at the next sign-in
Becomes the column must_change of password_credential.
Written at commons/data/models/identity/concepts.ts:160
credentialoneThe credential it is To credential. Written at commons/data/models/identity/concepts.ts:154
Projects to the table password_credential with the primary key credential_id.
| Column | Type | Null | Role | From |
|---|---|---|---|---|
changed_at | timestamp | false | attribute | passwordCredential.changedAt |
credential_id | text | false | reference | passwordCredential.credential |
hash | text | false | attribute | passwordCredential.hash |
must_change | boolean | false | attribute | passwordCredential.mustChange |
password_algorithm_code | text | false | reference | passwordCredential.algorithm |
CREATE TABLE IF NOT EXISTS "password_credential" (
"credential_id" VARCHAR NOT NULL PRIMARY KEY,
"hash" VARCHAR NOT NULL,
"password_algorithm_code" VARCHAR NOT NULL,
"changed_at" TIMESTAMPTZ NOT NULL,
"must_change" BOOLEAN NOT NULL,
CONSTRAINT "password_credential_credential_id_fk" FOREIGN KEY ("credential_id") REFERENCES "credential" ("credential_id"),
CONSTRAINT "password_credential_password_algorithm_code_fk" FOREIGN KEY ("password_algorithm_code") REFERENCES "password_algorithm" ("code")
);CREATE TABLE IF NOT EXISTS "password_credential" (
"credential_id" TEXT NOT NULL PRIMARY KEY,
"hash" TEXT NOT NULL,
"password_algorithm_code" TEXT NOT NULL,
"changed_at" TIMESTAMPTZ NOT NULL,
"must_change" BOOLEAN NOT NULL,
CONSTRAINT "password_credential_credential_id_fk" FOREIGN KEY ("credential_id") REFERENCES "credential" ("credential_id"),
CONSTRAINT "password_credential_password_algorithm_code_fk" FOREIGN KEY ("password_algorithm_code") REFERENCES "password_algorithm" ("code")
);CREATE TABLE IF NOT EXISTS "password_credential" (
"credential_id" TEXT NOT NULL PRIMARY KEY,
"hash" TEXT NOT NULL,
"password_algorithm_code" TEXT NOT NULL,
"changed_at" TEXT NOT NULL,
"must_change" INTEGER NOT NULL,
CONSTRAINT "password_credential_credential_id_fk" FOREIGN KEY ("credential_id") REFERENCES "credential" ("credential_id"),
CONSTRAINT "password_credential_password_algorithm_code_fk" FOREIGN KEY ("password_algorithm_code") REFERENCES "password_algorithm" ("code")
);Read and written from TypeScript with the types the model gives: import { passwordCredential } from "@intellectual-frontiers/data/sql/typed/models". Generated in commons/data/sql/typed/models/identity.auto.ts: do not edit.
import { from } from "@intellectual-frontiers/data/sql/typed";
import { passwordCredential } from "@intellectual-frontiers/data/sql/typed/models";
const rows = await from(passwordCredential).select((s) => ({ credentialId: s.passwordCredential.credentialId, hash: s.passwordCredential.hash })).run(runner);