<p>This is a first pass at OAuth 2 support using doorkeeper.</p>
<p>I've kept the OAuth 2 configuration separate from the OAuth 1 configuration - it probably could be merged if we really wanted but hopefully we can get rid of OAuth 1 at some point...</p>
<p>The URL endpoints have been moved into <code>/oauth2/</code> to avoid conflicts with the OAuth 1 endpoints.</p>
<p>There's a test instance at <a rel="nofollow" href="https://oauth2.apis.dev.openstreetmap.org/">https://oauth2.apis.dev.openstreetmap.org/</a>.</p>
<p><span class="issue-keyword tooltipped tooltipped-se" aria-label="This pull request closes issue #1408.">Fixes</span> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="199357480" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/1408" data-hovercard-type="issue" data-hovercard-url="/openstreetmap/openstreetmap-website/issues/1408/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/issues/1408">#1408</a></p>
<hr>
<h4>You can view, comment on, or merge this pull request online at:</h4>
<p> <a href='https://github.com/openstreetmap/openstreetmap-website/pull/3177'>https://github.com/openstreetmap/openstreetmap-website/pull/3177</a></p>
<h4>Commit Summary</h4>
<ul>
<li>Add support for OAuth2 using doorkeeper</li>
<li>Add tests for OAuth2</li>
</ul>
<h4>File Changes</h4>
<ul>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-4f894049af3375c2bd4e608f546f8d4a0eed95464efcdea850993200db9fef5c">.rubocop.yml</a>
(3)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-29beaabe278fd17493296745cecb67919f0906b47b8246ab770f5517615d9ef7">.rubocop_todo.yml</a>
(4)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-d09ea66f8227784ff4393d88a19836f321c915ae10031d16c93d67e6283ab55f">Gemfile</a>
(4)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-89cade48462044ee1b672dc5f4c3ec250fbd29effcd8932096a23c1283c6731f">Gemfile.lock</a>
(6)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-debf59904131dc89a88ab44cbb1d6deaaa5a7d70c0507f674080df62f7c8e41f">app/abilities/ability.rb</a>
(3)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-38488bd50be0cf63517ec5ae3fd3c4e462b3fdda7201844b0ab3442b73b8c08d">app/abilities/api_capability.rb</a>
(50)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-380aab66173996fadff8576f19062da8bacc45be57582f15afb9fd46c411cbbf">app/controllers/api_controller.rb</a>
(12)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-766c34fd6533171eaf54300c153f89d6002c35c02cfc9c5b219251f85180ad07">app/controllers/application_controller.rb</a>
(4)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-6fb325fca5ad7a0cd7ce785091963714cde01a12aadee161adad49592f42e45a">app/controllers/oauth2_applications_controller.rb</a>
(28)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-eb8db9679a832ea753cdb89be6d0aaac12918e8ace5c83c28b68b74de21528d4">app/controllers/oauth2_authorizations_controller.rb</a>
(8)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-4a1eecda037dc99789f9a85eb17813086bba8ffc0e6f2fcc6277d58a53d5cd3e">app/controllers/oauth2_authorized_applications_controller.rb</a>
(8)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-428acb6c9bafa225cc8dfc426142534aa102be5d4291707ee2d43f528b7bea1e">app/models/access_token.rb</a>
(4)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-2ca3a978e5b6e4fee47713d116f75573a7768194f4b0f111deadd08f7a23dc04">app/models/client_application.rb</a>
(7)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-9802ca3c9c4cf89904fd44bc114e35ebdf2c5dd3d5b645491e2b253e1afef29b">app/models/user.rb</a>
(2)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-717868c3429f5ee5a7740cb73ad913ef90a060a81a9290cc4d0be961332f579d">app/views/oauth2_applications/_application.html.erb</a>
(23)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-a236bba5ea60795c2902cc0074b91644099de958cdd147a29f155cf0c9d9124d">app/views/oauth2_applications/_form.html.erb</a>
(5)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-4c695db3dfeb05c96fb2882fecf0c9ac4f425e0941a01e81f0d12f49fe6762b5">app/views/oauth2_applications/edit.html.erb</a>
(7)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-3bac75790b63037a261afea384a9b3d73052dd8b6bbc8dc4dc1c202f92897e61">app/views/oauth2_applications/index.html.erb</a>
(13)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-2cd547ef589ec31d55d4c5844cc0b98da10b41fbae6d1ea217229017c3c29fcd">app/views/oauth2_applications/new.html.erb</a>
(7)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-fa977139db32c3ffea779144366408efcdc8eff29a916cf4ef9e849af64437f1">app/views/oauth2_applications/not_found.html.erb</a>
(1)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-1a6d59ae9c0f1823a5a860c2b6563143beae3725d337a96e19c885c34ca284b2">app/views/oauth2_applications/show.html.erb</a>
(38)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-717434acba1e120b8b5bbb8629e7afe623f44f85d95d19eaf9fa0bf814d64f24">app/views/oauth2_authorizations/error.html.erb</a>
(5)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-a883ca6abfde69d2e3b1191317f5e544efcc5b7f9f3a17ab9369cbbac37f5d5a">app/views/oauth2_authorizations/new.html.erb</a>
(40)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-242ee70bfa92a1c1d636b2419cbb6d8fa319140d3ba9f41f9704b1047e21f0e8">app/views/oauth2_authorizations/show.html.erb</a>
(5)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-fd74075d1a55f2e77a09fd061551d468ed49b53621c5fffd366cfbf72590968a">app/views/oauth2_authorized_applications/_application.html.erb</a>
(15)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-f259f298435b93fbaefd8d55ccc8a855e9580edb496fe873bb2ce69b8729c98c">app/views/oauth2_authorized_applications/index.html.erb</a>
(14)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-3f056c5b33f8be8ff39055a0bb2bcd67e09728200c0cd0543bd9f40d9b82761b">app/views/users/account.html.erb</a>
(4)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-c7fc4e057f18c41db72e3ab775f9871e6bee4d7e2b0aba1fdbfb2ea209dd2141">config/initializers/doorkeeper.rb</a>
(464)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-44438ce218f5287c58d0017f965d888715635d94280669896f75841fbd7b4cd7">config/locales/en.yml</a>
(59)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-959bc9abc46a55332bb64d5155a79323afa75a50ec1a2137ddd22d926f62c6c5">config/routes.rb</a>
(6)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-a541306864d136f9f4545a0010866967829f609289deca138b42327ab445017a">db/migrate/20201004105659_create_doorkeeper_tables.rb</a>
(53)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-1dd5a8f580b9615769ddc19a64a98f455d9d20eb149c443f41d9d3c797d39b12">db/structure.sql</a>
(262)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-373d9a0dc0a0811fb3fb744cfed277eb94abc4cbc3dac74ff66ab787a06766be">lib/oauth.rb</a>
(19)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-48df02d8ae767051db91f12ae2e8ab059fafaf58cdbf8b11f874326d04cabf1d">test/controllers/oauth2_applications_controller_test.rb</a>
(221)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-bb46e859882ce085a07f3de140cd23f784784c885f95eb25abe3fe4085f11310">test/controllers/oauth2_authorizations_controller_test.rb</a>
(184)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-6eea82cf3b878886809267f80f845c4cc597dcc9eb973bc62d2343c6851e1289">test/controllers/oauth2_authorized_applications_controller_test.rb</a>
(63)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-1673f60d01ff1b1eaa3c70a6dae8c7c1b65f0a882523dab1ba3a428542d9729b">test/factories/oauth_access_grant.rb</a>
(9)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-e5e1e11dbef11fb955376608e3054f5d459844110ececfe525686092831aea1c">test/factories/oauth_access_token.rb</a>
(6)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-665e91619ed8cc70a9e8b5b6c52c4f2862b739593b15aded79bd9b21ad41f5a2">test/factories/oauth_applications.rb</a>
(8)
</li>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-be2380df62967bf0c5853f681509cf5cd907dd105dcf2635b7047d5eac33f69f">test/integration/oauth2_test.rb</a>
(170)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177/files#diff-ba37813ca277c227a74a372479b7b05b7f3ff085d890ab708f80d62573efdb7a">test/test_helper.rb</a>
(6)
</li>
</ul>
<h4>Patch Links:</h4>
<ul>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/3177.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/3177.patch</a></li>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/3177.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/3177.diff</a></li>
</ul>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3177">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLOHGYWOOAT7QKN2DSDTISGU5ANCNFSM4234LSSQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AAK2OLOYDUVOPVMDI6OJ2YLTISGU5A5CNFSM4234LSS2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4MYYJPUA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/3177",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/3177",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>