Skip to content

Commit

Permalink
Issue #3124281 by emyu01: Multiple grammatical errors in docs of Basi…
Browse files Browse the repository at this point in the history
…cAuth class in basic_auth module

(cherry picked from commit 14be331251cf504a272a0bcfd9ffb5bca117c4b1)
  • Loading branch information
xjm committed May 3, 2020
1 parent ae61bf0 commit 0586687
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions modules/basic_auth/src/Authentication/Provider/BasicAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,20 +143,20 @@ public function challengeException(Request $request, \Exception $previous) {

// A 403 is converted to a 401 here, but it doesn't matter what the
// cacheability was of the 403 exception: what matters here is that
// authentication credentials are missing, i.e. that this request was made
// as the anonymous user.
// Therefore, all we must do, is make this response:
// 1. vary by whether the current user has the 'anonymous' role or not. This
// authentication credentials are missing, i.e. this request was made
// as an anonymous user.
// Therefore, the following actions will be taken:
// 1. Verify whether the current user has the 'anonymous' role or not. This
// works fine because:
// - Thanks to \Drupal\basic_auth\PageCache\DisallowBasicAuthRequests,
// Page Cache never caches a response whose request has Basic Auth
// credentials.
// - Dynamic Page Cache will cache a different result for when the
// request is unauthenticated (this 401) versus authenticated (some
// other response)
// 2. have the 'config:user.role.anonymous' cache tag, because the only
// 2. Have the 'config:user.role.anonymous' cache tag, because the only
// reason this 401 would no longer be a 401 is if permissions for the
// 'anonymous' role change, causing that cache tag to be invalidated.
// 'anonymous' role change, causing the cache tag to be invalidated.
// @see \Drupal\Core\EventSubscriber\AuthenticationSubscriber::onExceptionSendChallenge()
// @see \Drupal\Core\EventSubscriber\ClientErrorResponseSubscriber()
// @see \Drupal\Core\EventSubscriber\FinishResponseSubscriber::onAllResponds()
Expand Down

0 comments on commit 0586687

Please sign in to comment.