<p></p>
<p>So based on <a href="https://github.com/zmartzone/mod_oauth2">https://github.com/zmartzone/mod_oauth2</a> I'm now able to send requests to an Overpass instance, and the Bearer token would be validated on-the-fly using introspection. Also, successful lookups are cached in a local Redis (or shm, file, memcache) instance, to avoid excessive load on the Rails port. <g-emoji class="g-emoji" alias="+1" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f44d.png">👍</g-emoji></p>
<p>At one point I thought it might be helpful to have the subject info in the introspection response, e.g. to single out excessive users of a service.</p>
<p>Depending on privacy requirements we could return the user id, or use a more sophisticated approach based on a hashed user id, client id, and some server secret/or salt, maybe.</p>
<p>From doorkeeper.rb:</p>
<pre><code> custom_introspection_response do |token, context|
user = User.find(token.resource_owner_id)
{
"sub": ::Digest::SHA256.hexdigest(
user.id.to_s + token.application.try(:uid ) + SERVER_SECRET)
}
end
</code></pre>
<p>This is low prio at the moment, and more of a nice to have.</p>
<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/issues/3245#issuecomment-873366498">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLLSWA3FQTXPIBSYOLDTV3ABHANCNFSM47WPZ3VA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AAK2OLJTTMOUZHVKRRCR4JDTV3ABHA5CNFSM47WPZ3VKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOGQHIHYQ.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/issues/3245#issuecomment-873366498",
"url": "https://github.com/openstreetmap/openstreetmap-website/issues/3245#issuecomment-873366498",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>