From: Tom Hughes Date: Fri, 6 Sep 2024 16:05:02 +0000 (+0100) Subject: Merge remote-tracking branch 'upstream/pull/5164' X-Git-Tag: live~705 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/1fce0c00f12ac6bbb56ad7c05c8c9f53c0d6edb3?hp=8b0c188841f88976ada0a9875ef1c0df666225b0 Merge remote-tracking branch 'upstream/pull/5164' --- diff --git a/app/views/oauth2_applications/_form.html.erb b/app/views/oauth2_applications/_form.html.erb index 51267c069..7fde3e0e7 100644 --- a/app/views/oauth2_applications/_form.html.erb +++ b/app/views/oauth2_applications/_form.html.erb @@ -3,5 +3,5 @@ <%= f.form_group :confidential do %> <%= f.check_box :confidential %> <% end %> -<%= f.collection_check_boxes :scopes, Oauth.scopes(:oauth2 => true, :privileged => current_user.administrator?), :name, :description %> +<%= f.collection_check_boxes :scopes, Oauth.scopes(:privileged => current_user.administrator?), :name, :description %> <%= f.primary %> diff --git a/app/views/site/about.html.erb b/app/views/site/about.html.erb index 6cc32edd0..56e82f8f8 100644 --- a/app/views/site/about.html.erb +++ b/app/views/site/about.html.erb @@ -27,9 +27,9 @@ -

<%= t "site.about.local_knowledge_title" %>

+

<%= t ".local_knowledge_title" %>

-

<%= t "site.about.local_knowledge_html" %>

+

<%= t ".local_knowledge_html" %>

@@ -38,17 +38,17 @@ -

<%= t "site.about.community_driven_title" %>

+

<%= t ".community_driven_title" %>

- <%= t "site.about.community_driven_1_html", :osm_blog_link => link_to(t("site.about.community_driven_osm_blog"), - t("site.about.community_driven_osm_blog_url")), - :user_diaries_link => link_to(t("site.about.community_driven_user_diaries"), - diary_entries_path), - :community_blogs_link => link_to(t("site.about.community_driven_community_blogs"), - t("site.about.community_driven_community_blogs_url")), - :osm_foundation_link => link_to(t("site.about.community_driven_osm_foundation"), - t("site.about.community_driven_osm_foundation_url")) %> + <%= t ".community_driven_1_html", :osm_blog_link => link_to(t(".community_driven_osm_blog"), + t(".community_driven_osm_blog_url")), + :user_diaries_link => link_to(t(".community_driven_user_diaries"), + diary_entries_path), + :community_blogs_link => link_to(t(".community_driven_community_blogs"), + t(".community_driven_community_blogs_url")), + :osm_foundation_link => link_to(t(".community_driven_osm_foundation"), + t(".community_driven_osm_foundation_url")) %>

@@ -58,12 +58,12 @@ -

<%= t "site.about.open_data_title" %>

+

<%= t ".open_data_title" %>

- <%= t "site.about.open_data_1_html", :open_data => tag.i(t("site.about.open_data_open_data")), - :copyright_license_link => link_to(t("site.about.open_data_copyright_license"), - copyright_path) %>

+ <%= t ".open_data_1_html", :open_data => tag.i(t(".open_data_open_data")), + :copyright_license_link => link_to(t(".open_data_copyright_license"), + copyright_path) %>

@@ -108,7 +108,7 @@ -

<%= t "site.about.partners_title" %>

+

<%= t ".partners_title" %>

<%= t "layouts.hosting_partners_2024_html", :fastly => link_to(t("layouts.partners_fastly"), "https://www.fastly.com/"), :corpmembers => link_to(t("layouts.partners_corpmembers"), "https://osmfoundation.org/wiki/Corporate_Members"), diff --git a/config/initializers/doorkeeper.rb b/config/initializers/doorkeeper.rb index c1d4e2f78..a2df9167f 100644 --- a/config/initializers/doorkeeper.rb +++ b/config/initializers/doorkeeper.rb @@ -225,7 +225,7 @@ Doorkeeper.configure do # https://doorkeeper.gitbook.io/guides/ruby-on-rails/scopes # default_scopes :public - optional_scopes(*Oauth::SCOPES, *Oauth::PRIVILEGED_SCOPES, *Oauth::OAUTH2_SCOPES) + optional_scopes(*Oauth::SCOPES, *Oauth::PRIVILEGED_SCOPES) # Allows to restrict only certain scopes for grant_type. # By default, all the scopes will be available for all the grant types. diff --git a/config/locales/en.yml b/config/locales/en.yml index e2f2de059..2634672f1 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1572,16 +1572,12 @@ en: history: History export: Export issues: Issues - data: Data - export_data: Export Data gps_traces: GPS Traces gps_traces_tooltip: Manage GPS traces user_diaries: User Diaries edit_with: Edit with %{editor} - tag_line: The Free Wiki World Map intro_header: Welcome to OpenStreetMap! intro_text: OpenStreetMap is a map of the world, created by people like you and free to use under an open license. - intro_2_create_account: "Create a user account" hosting_partners_2024_html: "Hosting is supported by %{fastly}, %{corpmembers}, and other %{partners}." partners_fastly: "Fastly" partners_corpmembers: "OSMF corporate members" @@ -1595,9 +1591,6 @@ en: about: About copyright: Copyright communities: Communities - community: Community - community_blogs: "Community Blogs" - community_blogs_title: "Blogs from members of the OpenStreetMap community" learn_more: "Learn More" more: More user_mailer: @@ -1907,7 +1900,6 @@ en: help: Help site: about: - next: Next heading_html: "%{copyright}OpenStreetMap %{br} contributors" copyright_symbol_html: "©" used_by_html: "%{name} provides map data for thousands of websites, mobile apps, and hardware devices" diff --git a/lib/oauth.rb b/lib/oauth.rb index a8f497621..679c564a6 100644 --- a/lib/oauth.rb +++ b/lib/oauth.rb @@ -1,8 +1,11 @@ module Oauth - SCOPES = %w[read_prefs write_prefs write_diary write_api read_gpx write_gpx write_notes].freeze + SCOPES = %w[ + read_prefs write_prefs write_diary + write_api read_gpx write_gpx write_notes write_redactions + consume_messages send_messages openid + ].freeze PRIVILEGED_SCOPES = %w[read_email skip_authorization].freeze MODERATOR_SCOPES = %w[write_redactions].freeze - OAUTH2_SCOPES = %w[write_redactions consume_messages send_messages openid].freeze class Scope attr_reader :name @@ -16,10 +19,9 @@ module Oauth end end - def self.scopes(oauth2: false, privileged: false) + def self.scopes(privileged: false) scopes = SCOPES scopes += PRIVILEGED_SCOPES if privileged - scopes += OAUTH2_SCOPES if oauth2 scopes.collect { |s| Scope.new(s) } end end