From 08ce18d93fb638a0444dffa0bd486ce10a198a79 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Wed, 30 Mar 2022 11:23:29 +0200 Subject: [PATCH] (db) distringuish between oid client configuration and client_auth_method --- app/models/open_id_connect_provider.rb | 6 ++--- ...141618_create_open_id_connect_providers.rb | 22 +++++++++---------- db/schema.rb | 22 +++++++++---------- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/app/models/open_id_connect_provider.rb b/app/models/open_id_connect_provider.rb index 39e4bf4c1..4069e00f1 100644 --- a/app/models/open_id_connect_provider.rb +++ b/app/models/open_id_connect_provider.rb @@ -18,14 +18,14 @@ class OpenIdConnectProvider < ApplicationRecord validates :prompt, inclusion: { in: %w[none login consent select_account], allow_nil: true } def config - OpenIdConnectProvider.columns.map(&:name).filter { |n| !n.start_with?('client_') && n != 'profile_url' }.map do |n| + OpenIdConnectProvider.columns.map(&:name).filter { |n| !n.start_with?('client__') && n != 'profile_url' }.map do |n| [n, send(n)] end.push(['client_options', client_config]).to_h end def client_config - OpenIdConnectProvider.columns.map(&:name).filter { |n| n.start_with?('client_') }.map do |n| - [n.sub('client_', ''), send(n)] + OpenIdConnectProvider.columns.map(&:name).filter { |n| n.start_with?('client__') }.map do |n| + [n.sub('client__', ''), send(n)] end.to_h end end diff --git a/db/migrate/20220328141618_create_open_id_connect_providers.rb b/db/migrate/20220328141618_create_open_id_connect_providers.rb index c2ede56f7..6a6b22cd1 100644 --- a/db/migrate/20220328141618_create_open_id_connect_providers.rb +++ b/db/migrate/20220328141618_create_open_id_connect_providers.rb @@ -18,17 +18,17 @@ class CreateOpenIdConnectProviders < ActiveRecord::Migration[5.2] t.string :uid_field t.string :extra_authorize_params t.string :allow_authorize_params - t.string :client_identifier - t.string :client_secret - t.string :client_redirect_uri - t.string :client_scheme - t.string :client_host - t.string :client_port - t.string :client_authorization_endpoint - t.string :client_token_endpoint - t.string :client_userinfo_endpoint - t.string :client_jwks_uri - t.string :client_end_session_endpoint + t.string :client__identifier + t.string :client__secret + t.string :client__redirect_uri + t.string :client__scheme + t.string :client__host + t.string :client__port + t.string :client__authorization_endpoint + t.string :client__token_endpoint + t.string :client__userinfo_endpoint + t.string :client__jwks_uri + t.string :client__end_session_endpoint t.string :profile_url t.timestamps diff --git a/db/schema.rb b/db/schema.rb index 197d2e96c..fcb7dd7d4 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -425,17 +425,17 @@ ActiveRecord::Schema.define(version: 2022_03_28_145017) do t.string "uid_field" t.string "extra_authorize_params" t.string "allow_authorize_params" - t.string "client_identifier" - t.string "client_secret" - t.string "client_redirect_uri" - t.string "client_scheme" - t.string "client_host" - t.string "client_port" - t.string "client_authorization_endpoint" - t.string "client_token_endpoint" - t.string "client_userinfo_endpoint" - t.string "client_jwks_uri" - t.string "client_end_session_endpoint" + t.string "client__identifier" + t.string "client__secret" + t.string "client__redirect_uri" + t.string "client__scheme" + t.string "client__host" + t.string "client__port" + t.string "client__authorization_endpoint" + t.string "client__token_endpoint" + t.string "client__userinfo_endpoint" + t.string "client__jwks_uri" + t.string "client__end_session_endpoint" t.string "profile_url" t.datetime "created_at", null: false t.datetime "updated_at", null: false