feat: add role mappings for SAML configuration (#1210)

This commit is contained in:
Ömer Faruk Aydın
2023-08-11 19:07:39 +02:00
committed by GitHub
parent c7e1d30553
commit a6a124d2e6
8 changed files with 190 additions and 25 deletions

View File

@@ -0,0 +1,24 @@
import { Knex } from 'knex';
export async function up(knex: Knex): Promise<void> {
return knex.schema.createTable(
'saml_auth_providers_role_mappings',
(table) => {
table.uuid('id').primary().defaultTo(knex.raw('gen_random_uuid()'));
table
.uuid('saml_auth_provider_id')
.references('id')
.inTable('saml_auth_providers');
table.uuid('role_id').references('id').inTable('roles');
table.string('remote_role_name').notNullable();
table.unique(['saml_auth_provider_id', 'remote_role_name']);
table.timestamps(true, true);
}
);
}
export async function down(knex: Knex): Promise<void> {
return knex.schema.dropTable('saml_auth_providers_role_mappings');
}