feat: added saml parsing attributes and injecting to metadata of a user in org scoped

This commit is contained in:
=
2024-10-02 00:39:43 +05:30
parent 77e191d63e
commit 4928322cdb
15 changed files with 164 additions and 59 deletions
@@ -8,13 +8,12 @@ export async function up(knex: Knex): Promise<void> {
tb.uuid("id", { primaryKey: true }).defaultTo(knex.fn.uuid());
tb.string("key").notNullable();
tb.string("value").notNullable();
tb.uuid("userOrgMembershipId");
tb.foreign("userOrgMembershipId").references("id").inTable(TableName.OrgMembership).onDelete("CASCADE");
tb.uuid("identityOrgMembershipId");
tb.foreign("identityOrgMembershipId")
.references("id")
.inTable(TableName.IdentityOrgMembership)
.onDelete("CASCADE");
tb.uuid("orgId").notNullable();
tb.foreign("orgId").references("id").inTable(TableName.Organization).onDelete("CASCADE");
tb.uuid("userId");
tb.foreign("userId").references("id").inTable(TableName.Users).onDelete("CASCADE");
tb.uuid("identityId");
tb.foreign("identityId").references("id").inTable(TableName.Identity).onDelete("CASCADE");
tb.timestamps(true, true, true);
});
}
+3 -2
View File
@@ -11,8 +11,9 @@ export const IdentityMetadataSchema = z.object({
id: z.string().uuid(),
key: z.string(),
value: z.string(),
userOrgMembershipId: z.string().uuid().nullable().optional(),
identityOrgMembershipId: z.string().uuid().nullable().optional(),
orgId: z.string().uuid(),
userId: z.string().uuid().nullable().optional(),
identityId: z.string().uuid().nullable().optional(),
createdAt: z.date(),
updatedAt: z.date()
});