Merge pull request #538 from luckyPipewrench/sso-upgrades

Multi-provider SSO with admin UI and SAML support
This commit is contained in:
soky srm
2026-01-12 15:38:59 +01:00
committed by GitHub
50 changed files with 3273 additions and 34 deletions

View 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

View 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

View File

@@ -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

View 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