From: Tom Hughes Date: Tue, 17 Dec 2024 19:12:49 +0000 (+0000) Subject: Merge remote-tracking branch 'upstream/pull/5408' X-Git-Tag: live~307 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/18409c05ab43a2f818f6db911ae383eb0ebfb07d?hp=ca4ee6faa9378e7610356e36cbd4931a2657eeed Merge remote-tracking branch 'upstream/pull/5408' --- diff --git a/Gemfile.lock b/Gemfile.lock index 455ae2bda..0200f153e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -92,7 +92,7 @@ GEM autoprefixer-rails (10.4.19.0) execjs (~> 2) aws-eventstream (1.3.0) - aws-partitions (1.1019.0) + aws-partitions (1.1023.0) aws-sdk-core (3.214.0) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.992.0) @@ -101,7 +101,7 @@ GEM aws-sdk-kms (1.96.0) aws-sdk-core (~> 3, >= 3.210.0) aws-sigv4 (~> 1.5) - aws-sdk-s3 (1.176.0) + aws-sdk-s3 (1.176.1) aws-sdk-core (~> 3, >= 3.210.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.5) @@ -328,7 +328,7 @@ GEM in_threads (1.6.0) iniparse (1.5.0) io-console (0.8.0) - irb (1.14.1) + irb (1.14.2) rdoc (>= 4.0.0) reline (>= 0.4.2) jbuilder (2.13.0) @@ -353,7 +353,7 @@ GEM listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - logger (1.6.2) + logger (1.6.3) logstasher (2.1.5) activesupport (>= 5.2) request_store @@ -383,7 +383,7 @@ GEM nap (1.1.0) net-http (0.6.0) uri - net-imap (0.5.1) + net-imap (0.5.2) date net-protocol net-pop (0.1.2) @@ -393,7 +393,7 @@ GEM net-smtp (0.5.0) net-protocol nio4r (2.7.4) - nokogiri (1.17.1) + nokogiri (1.17.2) mini_portile2 (~> 2.8.2) racc (~> 1.4) oauth (1.1.0) @@ -509,7 +509,7 @@ GEM activesupport (>= 5.0.0) minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.6.1) + rails-html-sanitizer (1.6.2) loofah (~> 2.21) nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) rails-i18n (7.0.10) @@ -532,20 +532,20 @@ GEM rb-inotify (0.11.1) ffi (~> 1.0) rchardet (1.8.0) - rdoc (6.8.1) + rdoc (6.9.1) psych (>= 4.0.0) regexp_parser (2.9.3) - reline (0.5.12) + reline (0.6.0) io-console (~> 0.5) request_store (1.7.0) rack (>= 1.4) - rexml (3.3.9) + rexml (3.4.0) rinku (2.0.6) rotp (6.3.0) rouge (4.5.1) rtlcss (0.2.1) mini_racer (>= 0.6.3) - rubocop (1.69.1) + rubocop (1.69.2) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -555,7 +555,7 @@ GEM rubocop-ast (>= 1.36.2, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.36.2) + rubocop-ast (1.37.0) parser (>= 3.3.1.0) rubocop-capybara (2.21.0) rubocop (~> 1.41) @@ -589,7 +589,7 @@ GEM sawyer (0.9.2) addressable (>= 2.3.5) faraday (>= 0.17.3, < 3) - securerandom (0.4.0) + securerandom (0.4.1) selenium-webdriver (4.23.0) base64 (~> 0.2) logger (~> 1.4) @@ -631,7 +631,7 @@ GEM execjs (>= 0.3.0, < 3) thor (1.3.2) tilt (2.4.0) - timeout (0.4.2) + timeout (0.4.3) turbo-rails (2.0.11) actionpack (>= 6.0.0) railties (>= 6.0.0) diff --git a/app/controllers/oauth2_authorizations_controller.rb b/app/controllers/oauth2_authorizations_controller.rb index 415ab2775..9f86e8b18 100644 --- a/app/controllers/oauth2_authorizations_controller.rb +++ b/app/controllers/oauth2_authorizations_controller.rb @@ -7,4 +7,6 @@ class Oauth2AuthorizationsController < Doorkeeper::AuthorizationsController allow_all_form_action :only => :new authorize_resource :class => false + + before_action :check_database_writable end diff --git a/config/locales/en.yml b/config/locales/en.yml index a6fee55f4..1ad17e786 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1001,6 +1001,14 @@ en: wayside_shrine: "Wayside Shrine" wreck: "Wreck" "yes": "Historic Site" + information: + guidepost: "Guidepost" + board: "Information Board" + map: "Map" + office: "Tourist Office" + terminal: "Information Terminal" + sign: "Information Sign" + stele: "Information Stele" junction: "yes": "Junction" landuse: @@ -1073,6 +1081,8 @@ en: track: "Running Track" water_park: "Water Park" "yes": "Leisure" + lock: + "yes": "Lock" man_made: adit: "Adit" advertising: "Advertising" @@ -1413,6 +1423,17 @@ en: building_passage: "Building Passage" culvert: "Culvert" "yes": "Tunnel" + water: + lake: "Lake" + pond: "Pond" + reservoir: "Reservoir" + basin: "Water basin" + fishpond: "Fish Pond" + lagoon: "Lagoon" + wastewater: "Waste Water" + oxbow: "Oxbow" + stream_pool: "Stream Pool" + lock: "Lock" waterway: artificial: "Artificial Waterway" boatyard: "Boatyard" diff --git a/test/controllers/oauth2_authorizations_controller_test.rb b/test/controllers/oauth2_authorizations_controller_test.rb index 854f7cde5..012bfd7f4 100644 --- a/test/controllers/oauth2_authorizations_controller_test.rb +++ b/test/controllers/oauth2_authorizations_controller_test.rb @@ -102,6 +102,20 @@ class Oauth2AuthorizationsControllerTest < ActionDispatch::IntegrationTest assert_select "p", "The requested scope is invalid, unknown, or malformed." end + def test_new_db_readonly + application = create(:oauth_application, :scopes => "write_api") + + session_for(create(:user)) + + with_settings(:status => "database_readonly") do + get oauth_authorization_path(:client_id => application.uid, + :redirect_uri => application.redirect_uri, + :response_type => "code", + :scope => "write_api") + assert_redirected_to offline_path + end + end + def test_create application = create(:oauth_application, :scopes => "write_api") diff --git a/yarn.lock b/yarn.lock index 45a3058f7..28ca8971f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -48,10 +48,10 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@9.16.0": - version "9.16.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.16.0.tgz#3df2b2dd3b9163056616886c86e4082f45dbf3f4" - integrity sha512-tw2HxzQkrbeuvyj1tG2Yqq+0H9wGoI2IMk4EOsQeX+vmd75FtJAzf+gTA69WF+baUKRYQ3x2kbLE08js5OsTVg== +"@eslint/js@9.17.0": + version "9.17.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.17.0.tgz#1523e586791f80376a6f8398a3964455ecc651ec" + integrity sha512-Sxc4hqcs1kTu0iID3kcZDW3JHq2a77HO9P8CP6YEA/FpH3Ll8UXE2r/86Rz9YJLKme39S9vU5OWNjC6Xl0Cr3w== "@eslint/object-schema@^2.1.4": version "2.1.4" @@ -189,10 +189,10 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== -cross-spawn@^7.0.5: - version "7.0.5" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.5.tgz#910aac880ff5243da96b728bc6521a5f6c2f2f82" - integrity sha512-ZVJrKKYunU38/76t0RMOulHOnUcbU9GbpWKAOZ0mhjr7CX6FVrH+4FrAapSOekrgFQ3f/8gwMEuIft0aKq6Hug== +cross-spawn@^7.0.6: + version "7.0.6" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" + integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== dependencies: path-key "^3.1.0" shebang-command "^2.0.0" @@ -265,16 +265,16 @@ eslint-visitor-keys@^4.2.0: integrity sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw== eslint@^9.0.0: - version "9.16.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.16.0.tgz#66832e66258922ac0a626f803a9273e37747f2a6" - integrity sha512-whp8mSQI4C8VXd+fLgSM0lh3UlmcFtVwUQjyKCFfsp+2ItAIYhlq/hqGahGqHE6cv9unM41VlqKk2VtKYR2TaA== + version "9.17.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.17.0.tgz#faa1facb5dd042172fdc520106984b5c2421bb0c" + integrity sha512-evtlNcpJg+cZLcnVKwsai8fExnqjGPicK7gnUtlNuzu+Fv9bI0aLpND5T44VLQtoMEnI57LoXO9XAkIXwohKrA== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.12.1" "@eslint/config-array" "^0.19.0" "@eslint/core" "^0.9.0" "@eslint/eslintrc" "^3.2.0" - "@eslint/js" "9.16.0" + "@eslint/js" "9.17.0" "@eslint/plugin-kit" "^0.2.3" "@humanfs/node" "^0.16.6" "@humanwhocodes/module-importer" "^1.0.1" @@ -283,7 +283,7 @@ eslint@^9.0.0: "@types/json-schema" "^7.0.15" ajv "^6.12.4" chalk "^4.0.0" - cross-spawn "^7.0.5" + cross-spawn "^7.0.6" debug "^4.3.2" escape-string-regexp "^4.0.0" eslint-scope "^8.2.0" @@ -583,9 +583,9 @@ optionator@^0.9.3: type-check "^0.4.0" osm-community-index@^5.2.0: - version "5.8.0" - resolved "https://registry.yarnpkg.com/osm-community-index/-/osm-community-index-5.8.0.tgz#59fbf71ab9f359b307fcd0415fbce6f43dda94f6" - integrity sha512-7hg+D7u2vooujuihGTgKWDYjPUidlWuTjBrMP/drsHP/cVJI94ehsDulNkcKH0Od05n6vBl/ZyJJjdJvqcrMaA== + version "5.9.0" + resolved "https://registry.yarnpkg.com/osm-community-index/-/osm-community-index-5.9.0.tgz#cf70a560baca5ec029cd16eecab8c2aa84d6bbc2" + integrity sha512-/P09ig/iCtD17AvmihBcvz6617c1NCJkqNNk3G6veY4MBWH6Djhl+xz69FLOGy8Xt4jHV57zP1PU6UATqby5aQ== dependencies: diacritics "^1.3.0"