diff options
author | Markus Koller <markus-koller@gmx.ch> | 2017-11-23 13:16:14 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-11-23 13:16:14 +0000 |
commit | 257fd5713485a05460a9170190100643199a7e48 (patch) | |
tree | afaaddcdc16ac407d72b7b4c0e96d951a141c268 /db | |
parent | a6cafbcbe8d6802a81055c3469312f889cd73c9a (diff) | |
download | gitlab-ce-257fd5713485a05460a9170190100643199a7e48.tar.gz |
Allow password authentication to be disabled entirely
Diffstat (limited to 'db')
4 files changed, 41 insertions, 1 deletions
diff --git a/db/migrate/20171106133143_rename_application_settings_password_authentication_enabled_to_password_authentication_enabled_for_web.rb b/db/migrate/20171106133143_rename_application_settings_password_authentication_enabled_to_password_authentication_enabled_for_web.rb new file mode 100644 index 00000000000..6d369e93361 --- /dev/null +++ b/db/migrate/20171106133143_rename_application_settings_password_authentication_enabled_to_password_authentication_enabled_for_web.rb @@ -0,0 +1,15 @@ +class RenameApplicationSettingsPasswordAuthenticationEnabledToPasswordAuthenticationEnabledForWeb < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + rename_column_concurrently :application_settings, :password_authentication_enabled, :password_authentication_enabled_for_web + end + + def down + cleanup_concurrent_column_rename :application_settings, :password_authentication_enabled_for_web, :password_authentication_enabled + end +end diff --git a/db/migrate/20171106133911_add_password_authentication_enabled_for_git_to_application_settings.rb b/db/migrate/20171106133911_add_password_authentication_enabled_for_git_to_application_settings.rb new file mode 100644 index 00000000000..b8aa600864e --- /dev/null +++ b/db/migrate/20171106133911_add_password_authentication_enabled_for_git_to_application_settings.rb @@ -0,0 +1,9 @@ +class AddPasswordAuthenticationEnabledForGitToApplicationSettings < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def change + add_column :application_settings, :password_authentication_enabled_for_git, :boolean, default: true, null: false + end +end diff --git a/db/post_migrate/20171106133144_cleanup_application_settings_password_authentication_enabled_rename.rb b/db/post_migrate/20171106133144_cleanup_application_settings_password_authentication_enabled_rename.rb new file mode 100644 index 00000000000..d54ff3d5f5e --- /dev/null +++ b/db/post_migrate/20171106133144_cleanup_application_settings_password_authentication_enabled_rename.rb @@ -0,0 +1,15 @@ +class CleanupApplicationSettingsPasswordAuthenticationEnabledRename < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + cleanup_concurrent_column_rename :application_settings, :password_authentication_enabled, :password_authentication_enabled_for_web + end + + def down + rename_column_concurrently :application_settings, :password_authentication_enabled_for_web, :password_authentication_enabled + end +end diff --git a/db/schema.rb b/db/schema.rb index bca8b96b2c1..d10561099b7 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -129,7 +129,6 @@ ActiveRecord::Schema.define(version: 20171121144800) do t.boolean "prometheus_metrics_enabled", default: false, null: false t.boolean "help_page_hide_commercial_content", default: false t.string "help_page_support_url" - t.boolean "password_authentication_enabled" t.integer "performance_bar_allowed_group_id" t.boolean "hashed_storage_enabled", default: false, null: false t.boolean "project_export_enabled", default: true, null: false @@ -149,6 +148,8 @@ ActiveRecord::Schema.define(version: 20171121144800) do t.boolean "throttle_authenticated_web_enabled", default: false, null: false t.integer "throttle_authenticated_web_requests_per_period", default: 7200, null: false t.integer "throttle_authenticated_web_period_in_seconds", default: 3600, null: false + t.boolean "password_authentication_enabled_for_web" + t.boolean "password_authentication_enabled_for_git", default: true end create_table "audit_events", force: :cascade do |t| |