fix(drupal): grant the OAuth consent permission during provisioning - #164
fix(drupal): grant the OAuth consent permission during provisioning#164Decipher wants to merge 1 commit into
Conversation
|
Warning Review limit reachedNext included review available in 59 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## fix/vue-jest-deasync-install #164 +/- ##
================================================================
- Coverage 91.02% 90.70% -0.32%
================================================================
Files 13 13
Lines 2217 2217
Branches 104 104
================================================================
- Hits 2018 2011 -7
- Misses 196 201 +5
- Partials 3 5 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The failure
simple_oauth guards the consent form with
grant simple_oauth codes(
Oauth2AuthorizeForm.php:140,Oauth2AuthorizeController.php:177).Provisioning grants
access druxt resourcesto anonymous and nothing else,so pressing Allow returns to the form with:
Anonymous JSON:API works, the site looks healthy, and only login fails. It is
the same shape as the two consumer bugs this script already guards against
(empty
client_id, emptygrant_types).The fix
drush('role:perm:add authenticated %s', 'grant simple_oauth codes')php-evalthat reads the permission back and throwsvalidate()call: a silent OAuth failure has shipped twice alreadyVerification
Against a live provisioned site (Drupal 11.4.5, simple_oauth 6.1.1):
provisionfails loudlyThe existing site was not reprovisioned: another session is using that
backend, so the grant and the guard were exercised against it directly rather
than through a destructive reinstall.
npm run lint:js,lint:cspellandlint:privateare clean.Not included
scripts/check-oauth.mjscannot see this: it probes over HTTP as ananonymous client, and the permission only bites once a user has signed in.
The assertion belongs where the permission is set, which is where it now is.
Found while verifying token refresh for the druxt-auth docs; the module's own
README gains the matching setup step in that repo.