From 46f7390cbea35474a81b9db37aa78f5f4ff4db49 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Mon, 25 Aug 2025 13:08:12 +0530 Subject: [PATCH] feat: add saml models --- ...0250825070005_create_account_saml_settings.rb | 16 ++++++++++++++++ .../20250825070824_create_saml_role_mappings.rb | 12 ++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 db/migrate/20250825070005_create_account_saml_settings.rb create mode 100644 db/migrate/20250825070824_create_saml_role_mappings.rb diff --git a/db/migrate/20250825070005_create_account_saml_settings.rb b/db/migrate/20250825070005_create_account_saml_settings.rb new file mode 100644 index 000000000..6c0575fec --- /dev/null +++ b/db/migrate/20250825070005_create_account_saml_settings.rb @@ -0,0 +1,16 @@ +class CreateAccountSamlSettings < ActiveRecord::Migration[7.1] + def change + create_table :account_saml_settings do |t| + t.references :account, null: false + t.boolean :enabled, default: false, null: false + t.string :sso_url + t.string :certificate_fingerprint + t.text :certificate + t.string :sp_entity_id + t.boolean :enforced_sso, default: false, null: false + t.json :attribute_mappings, default: {} + + t.timestamps + end + end +end diff --git a/db/migrate/20250825070824_create_saml_role_mappings.rb b/db/migrate/20250825070824_create_saml_role_mappings.rb new file mode 100644 index 000000000..f0ec78738 --- /dev/null +++ b/db/migrate/20250825070824_create_saml_role_mappings.rb @@ -0,0 +1,12 @@ +class CreateSamlRoleMappings < ActiveRecord::Migration[7.1] + def change + create_table :saml_role_mappings do |t| + t.references :account_saml_settings, null: false + t.string :saml_group_name, null: false + t.integer :role, default: 0, null: false + t.references :custom_role, null: true + + t.timestamps + end + end +end