mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 12:04:08 +00:00
Merge pull request #538 from luckyPipewrench/sso-upgrades
Multi-provider SSO with admin UI and SAML support
This commit is contained in:
22
db/migrate/20251228181150_create_flipper_tables.rb
Normal file
22
db/migrate/20251228181150_create_flipper_tables.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
class CreateFlipperTables < ActiveRecord::Migration[7.2]
|
||||
def up
|
||||
create_table :flipper_features do |t|
|
||||
t.string :key, null: false
|
||||
t.timestamps null: false
|
||||
end
|
||||
add_index :flipper_features, :key, unique: true
|
||||
|
||||
create_table :flipper_gates do |t|
|
||||
t.string :feature_key, null: false
|
||||
t.string :key, null: false
|
||||
t.text :value
|
||||
t.timestamps null: false
|
||||
end
|
||||
add_index :flipper_gates, [ :feature_key, :key, :value ], unique: true, length: { value: 255 }
|
||||
end
|
||||
|
||||
def down
|
||||
drop_table :flipper_gates
|
||||
drop_table :flipper_features
|
||||
end
|
||||
end
|
||||
21
db/migrate/20251228181429_create_sso_providers.rb
Normal file
21
db/migrate/20251228181429_create_sso_providers.rb
Normal file
@@ -0,0 +1,21 @@
|
||||
class CreateSsoProviders < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
create_table :sso_providers, id: :uuid do |t|
|
||||
t.string :strategy, null: false
|
||||
t.string :name, null: false
|
||||
t.string :label, null: false
|
||||
t.string :icon
|
||||
t.boolean :enabled, null: false, default: true
|
||||
t.string :issuer
|
||||
t.string :client_id
|
||||
t.string :client_secret
|
||||
t.string :redirect_uri
|
||||
t.jsonb :settings, null: false, default: {}
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :sso_providers, :name, unique: true
|
||||
add_index :sso_providers, :enabled
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,6 @@
|
||||
class AddIssuerToOidcIdentities < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
add_column :oidc_identities, :issuer, :string
|
||||
add_index :oidc_identities, :issuer
|
||||
end
|
||||
end
|
||||
18
db/migrate/20260103170412_create_sso_audit_logs.rb
Normal file
18
db/migrate/20260103170412_create_sso_audit_logs.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
class CreateSsoAuditLogs < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
create_table :sso_audit_logs, id: :uuid do |t|
|
||||
t.references :user, type: :uuid, foreign_key: true, null: true
|
||||
t.string :event_type, null: false
|
||||
t.string :provider
|
||||
t.string :ip_address
|
||||
t.string :user_agent
|
||||
t.jsonb :metadata, null: false, default: {}
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :sso_audit_logs, :event_type
|
||||
add_index :sso_audit_logs, :created_at
|
||||
add_index :sso_audit_logs, [ :user_id, :created_at ]
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user