<p></p>
<p dir="auto">We currently use <code class="notranslate">basic_authorization_header</code> extensively in our tests (around 200 times). It's typically used to check that a controller behaves correctly (i.e. differently than for requests that have no authorization).</p>
<p dir="auto">Since we're dropping basic_auth support in the API (by changing a config to disable it), it makes sense for us to remove all the code too, at some point soon after. Before that happens, we need to refactor these tests.</p>
<p dir="auto">The most obvious (to me) option is to move to using the <code class="notranslate">bearer_authorization_header</code> approach, with OAuth2 tokens, as already used in some tests. Unless anyone has a different idea?</p>
<p dir="auto">It might also be worth considering we should have a helper that sorts out creating the token and scopes automatically, since in these cases we're not interested in whether the token is correctly set up (that's tested elsewhere) but rather these tests are focussed on what happens when a particular user is doing something.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/issues/4801">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLNX2XE76V67J2C5NZ3ZCOATFAVCNFSM6AAAAABHYOT3SWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI4TQMRZGM3TKMY">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLLYHLPGOWJBJQWUAITZCOATFA5CNFSM6AAAAABHYOT3SWWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHIR7JN7E.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/issues/4801</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/issues/4801",
"url": "https://github.com/openstreetmap/openstreetmap-website/issues/4801",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>