1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-20 00:08:02 +01:00

task: added scim id to user (#6439)

SCIM synchronizations requires a stable id no matter how many changes
are made to username and email (our other unique fields). In addition,
exposing internal incremented database ids to an external service (our
current id field) feels insecure. Our plan is to create either a uuidv7
or ulid when scim operations are performed against the user, so the
external scim provisioner has a stable globally unique id to use to
refer to the users they're modifying.
This commit is contained in:
Christopher Kolstad 2024-03-05 14:48:19 +01:00 committed by GitHub
parent 5d00157b7c
commit a44c3a3fa7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,13 @@
exports.up = function(db, cb) {
db.runSql(`
ALTER TABLE users ADD COLUMN scim_id TEXT;
CREATE INDEX users_scim_id_uniq_idx ON users (scim_id) WHERE scim_id IS NOT NULL;
`, cb);
};
exports.down = function(db, cb) {
db.runSql(`
DROP INDEX users_scim_id_uniq_idx;
ALTER TABLE users DROP COLUMN scim_id;
`, cb);
};