Skip to content

Commit

Permalink
delete auth provider code, put identity provider behind feature flipp…
Browse files Browse the repository at this point in the history
…er (#667)
  • Loading branch information
labradford authored Aug 10, 2023
1 parent 45d7a9e commit 94cb4cd
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 268 deletions.
98 changes: 0 additions & 98 deletions app/controllers/auth_providers_controller.rb

This file was deleted.

1 change: 0 additions & 1 deletion app/models/account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ class Account < ApplicationRecord
include AccountCname
attr_readonly :tenant

has_one :auth_provider, dependent: :destroy
has_many :sites, dependent: :destroy
has_many :domain_names, dependent: :destroy
has_many :full_account_cross_searches,
Expand Down
11 changes: 0 additions & 11 deletions app/models/auth_provider.rb

This file was deleted.

41 changes: 0 additions & 41 deletions app/views/auth_providers/_form.html.erb

This file was deleted.

5 changes: 0 additions & 5 deletions app/views/auth_providers/_oidc.html.erb

This file was deleted.

5 changes: 0 additions & 5 deletions app/views/auth_providers/_saml.html.erb

This file was deleted.

6 changes: 0 additions & 6 deletions app/views/auth_providers/edit.html.erb

This file was deleted.

7 changes: 0 additions & 7 deletions app/views/auth_providers/new.html.erb

This file was deleted.

16 changes: 3 additions & 13 deletions app/views/hyrax/dashboard/sidebar/_configuration.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,12 @@
<span class="fa fa-gear"></span> <span class="sidebar-action-text"><%= t('hyrax.admin.sidebar.account') %></span>
<% end %>
<% if Flipflop.show_auth_provider_in_admin_dashboard? %>
<% if AuthProvider.count > 0 %>
<%= menu.nav_link(main_app.edit_auth_provider_path(AuthProvider.where(account_id: @current_account.id).first)) do %>
<span class="fa fa-key"></span> <span class="sidebar-action-text"><%= t('hyrax.admin.sidebar.auth_provider') %></span>
<% end %>
<% else %>
<%= menu.nav_link(main_app.new_auth_provider_path) do %>
<span class="fa fa-key"></span> <span class="sidebar-action-text"><%= t('hyrax.admin.sidebar.auth_provider') %></span>
<% end %>
<% if Flipflop.show_identity_provider_in_admin_dashboard? %>
<%= menu.nav_link(main_app.identity_providers_path) do %>
<span class="fa fa-key"></span> <span class="sidebar-action-text"><%= t('hyrax.admin.sidebar.identity_providers') %></span>
<% end %>
<% end %>
<%= menu.nav_link(main_app.identity_providers_path) do %>
<span class="fa fa-key"></span> <span class="sidebar-action-text"><%= t('hyrax.admin.sidebar.identity_providers') %></span>
<% end %>
<%= menu.nav_link(main_app.edit_site_labels_path) do %>
<span class="fa fa-institution"></span> <span class="sidebar-action-text"><%= t('hyrax.admin.sidebar.labels') %></span>
<% end %>
Expand Down
4 changes: 2 additions & 2 deletions config/features.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
default: true,
description: "Shows the Recently Uploaded tab on the homepage."

feature :show_auth_provider_in_admin_dashboard,
feature :show_identity_provider_in_admin_dashboard,
default: false,
description: "Shows the Auth Provider tab on the admin dashboard."
description: "Shows the Identity Provider tab on the admin dashboard."
end
16 changes: 16 additions & 0 deletions db/migrate/20230810193550_drop_auth_providers.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
class DropAuthProviders < ActiveRecord::Migration[5.2]
def change
drop_table :auth_providers do |t|
t.string "provider"
t.integer "account_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "oidc_client_id"
t.string "saml_client_id"
t.string "oidc_client_secret"
t.string "saml_client_secret"
t.string "oidc_idp_sso_service_url"
t.string "saml_idp_sso_service_url"
end
end
end
15 changes: 1 addition & 14 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2023_08_04_202804) do
ActiveRecord::Schema.define(version: 2023_08_10_193550) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down Expand Up @@ -46,19 +46,6 @@
t.index ["solr_endpoint_id"], name: "index_accounts_on_solr_endpoint_id", unique: true
end

create_table "auth_providers", force: :cascade do |t|
t.string "provider"
t.integer "account_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "oidc_client_id"
t.string "saml_client_id"
t.string "oidc_client_secret"
t.string "saml_client_secret"
t.string "oidc_idp_sso_service_url"
t.string "saml_idp_sso_service_url"
end

create_table "bookmarks", id: :serial, force: :cascade do |t|
t.integer "user_id", null: false
t.string "user_type"
Expand Down
9 changes: 0 additions & 9 deletions spec/factories/auth_providers.rb

This file was deleted.

56 changes: 0 additions & 56 deletions spec/models/auth_provider_spec.rb

This file was deleted.

0 comments on commit 94cb4cd

Please sign in to comment.