From afbd7631254d7b5fc015dce8eb30ca507231acef Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Wed, 17 Feb 2021 12:54:28 +0100 Subject: [PATCH] Update Doorkeeper configuration [SCI-5497] --- config/initializers/doorkeeper.rb | 2 +- config/locales/en.yml | 7 +++++++ .../20210217114042_update_doorkeeper_table.rb | 12 ++++++++++++ db/structure.sql | 13 +++++++------ 4 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 db/migrate/20210217114042_update_doorkeeper_table.rb diff --git a/config/initializers/doorkeeper.rb b/config/initializers/doorkeeper.rb index ffd7015c1..3acb954fc 100644 --- a/config/initializers/doorkeeper.rb +++ b/config/initializers/doorkeeper.rb @@ -49,7 +49,7 @@ Doorkeeper.configure do # Define access token scopes for your provider # For more information go to # https://github.com/doorkeeper-gem/doorkeeper/wiki/Using-Scopes - # default_scopes :public + default_scopes :public # optional_scopes :write, :update # Change the way client credentials are retrieved from the request object. diff --git a/config/locales/en.yml b/config/locales/en.yml index ceaeadcdc..8a6bac494 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -78,6 +78,13 @@ en: failed_to_save: "Failed to create new user" doorkeeper: + errors: + messages: + invalid_request: + unknown: 'The request is missing a required parameter, includes an unsupported parameter value, or is otherwise malformed.' + missing_param: 'Missing required parameter: %{value}.' + not_support_pkce: 'Invalid code_verifier parameter. Server does not support pkce.' + request_not_authorized: 'Request need to be authorized. Required parameter for authorizing request is missing or invalid.' authorizations: buttons: authorize: "Authorize" diff --git a/db/migrate/20210217114042_update_doorkeeper_table.rb b/db/migrate/20210217114042_update_doorkeeper_table.rb new file mode 100644 index 000000000..a249591b8 --- /dev/null +++ b/db/migrate/20210217114042_update_doorkeeper_table.rb @@ -0,0 +1,12 @@ +class UpdateDoorkeeperTable < ActiveRecord::Migration[6.1] + def change + reversible do |dir| + dir.up do + change_column :oauth_access_grants, :scopes, :string, null: false, default: '' + end + dir.down do + change_column :oauth_access_grants, :scopes, :string + end + end + end +end diff --git a/db/structure.sql b/db/structure.sql index 989184ab0..7745597a3 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -922,7 +922,7 @@ CREATE TABLE public.oauth_access_grants ( redirect_uri text NOT NULL, created_at timestamp without time zone NOT NULL, revoked_at timestamp without time zone, - scopes character varying + scopes character varying DEFAULT ''::character varying NOT NULL ); @@ -4927,10 +4927,10 @@ CREATE INDEX index_repository_cells_on_repository_row_id ON public.repository_ce -- --- Name: index_repository_cells_on_value_type_and_value_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_repository_cells_on_value; Type: INDEX; Schema: public; Owner: - -- -CREATE INDEX index_repository_cells_on_value_type_and_value_id ON public.repository_cells USING btree (value_type, value_id); +CREATE INDEX index_repository_cells_on_value ON public.repository_cells USING btree (value_type, value_id); -- @@ -5711,10 +5711,10 @@ CREATE INDEX index_view_states_on_user_id ON public.view_states USING btree (use -- --- Name: index_view_states_on_viewable_type_and_viewable_id; Type: INDEX; Schema: public; Owner: - +-- Name: index_view_states_on_viewable; Type: INDEX; Schema: public; Owner: - -- -CREATE INDEX index_view_states_on_viewable_type_and_viewable_id ON public.view_states USING btree (viewable_type, viewable_id); +CREATE INDEX index_view_states_on_viewable ON public.view_states USING btree (viewable_type, viewable_id); -- @@ -7153,6 +7153,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20201126203713'), ('20201209165626'), ('20210128105457'), -('20210128105458'); +('20210128105458'), +('20210217114042');