Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
83e1359e
Commit
83e1359e
authored
Oct 17, 2013
by
Alex Pott
Browse files
Issue
#2107483
by StephaneQ: Make basic_auth() module and http_basic() auth setting consistent.
parent
6a89adcf
Changes
7
Hide whitespace changes
Inline
Side-by-side
core/lib/Drupal/Core/Authentication/AuthenticationProviderInterface.php
View file @
83e1359e
...
...
@@ -54,7 +54,7 @@ public function cleanup(Request $request);
* Handles an exception.
*
* In case exception has happened we allow authentication providers react.
* Used in \Drupal\Core\Authentication\Provider\
Http
Basic to set up headers to
* Used in \Drupal\Core\Authentication\Provider\Basic
Auth
to set up headers to
* prompt login.
*
* @param \Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent $event
...
...
core/modules/basic_auth/basic_auth.services.yml
View file @
83e1359e
services
:
authentication.
http_
basic
:
class
:
Drupal\basic_auth\Authentication\Provider\
Http
Basic
authentication.basic
_auth
:
class
:
Drupal\basic_auth\Authentication\Provider\Basic
Auth
arguments
:
[
'
@config.factory'
]
tags
:
-
{
name
:
authentication_provider
,
priority
:
100
}
core/modules/basic_auth/lib/Drupal/basic_auth/Authentication/Provider/
Http
Basic.php
→
core/modules/basic_auth/lib/Drupal/basic_auth/Authentication/Provider/Basic
Auth
.php
View file @
83e1359e
...
...
@@ -2,7 +2,7 @@
/**
* @file
* Contains \Drupal\basic_auth\Authentication\Provider\
Http
Basic.
* Contains \Drupal\basic_auth\Authentication\Provider\Basic
Auth
.
*/
namespace
Drupal\basic_auth\Authentication\Provider
;
...
...
@@ -19,7 +19,7 @@
/**
* HTTP Basic authentication provider.
*/
class
Http
Basic
implements
AuthenticationProviderInterface
{
class
Basic
Auth
implements
AuthenticationProviderInterface
{
/**
* The config factory.
...
...
core/modules/basic_auth/lib/Drupal/basic_auth/Tests/Authentication/
Http
BasicTest.php
→
core/modules/basic_auth/lib/Drupal/basic_auth/Tests/Authentication/Basic
Auth
Test.php
View file @
83e1359e
...
...
@@ -2,19 +2,19 @@
/**
* @file
* Contains \Drupal\basic_auth\Tests\Authentication\
Http
BasicTest.
* Contains \Drupal\basic_auth\Tests\Authentication\Basic
Auth
Test.
*/
namespace
Drupal\basic_auth\Tests\Authentication
;
use
Drupal\Core\Authentication\Provider\
Http
Basic
;
use
Drupal\Core\Authentication\Provider\Basic
Auth
;
use
Drupal\simpletest\WebTestBase
;
use
Symfony\Component\HttpFoundation\Request
;
/**
* Test for http basic authentication.
*/
class
Http
BasicTest
extends
WebTestBase
{
class
Basic
Auth
Test
extends
WebTestBase
{
/**
* Modules enabled for all tests.
...
...
@@ -25,8 +25,8 @@ class HttpBasicTest extends WebTestBase {
public
static
function
getInfo
()
{
return
array
(
'name'
=>
'
Http
Basic authentication'
,
'description'
=>
'Tests for
Http
Basic authentication provider.'
,
'name'
=>
'Basic
Auth
authentication'
,
'description'
=>
'Tests for Basic
Auth
authentication provider.'
,
'group'
=>
'Authentication'
,
);
}
...
...
@@ -34,7 +34,7 @@ public static function getInfo() {
/**
* Test http basic authentication.
*/
public
function
test
Http
Basic
()
{
public
function
testBasic
Auth
()
{
$account
=
$this
->
drupalCreateUser
();
$this
->
basicAuthGet
(
'router_test/test11'
,
$account
->
getUsername
(),
$account
->
pass_raw
);
...
...
@@ -48,7 +48,7 @@ public function testHttpBasic() {
$this
->
curlClose
();
$this
->
drupalGet
(
'router_test/test11'
);
$this
->
assertResponse
(
'401'
,
'Not authenticated on the route that allows only
http_
basic. Prompt to authenticate received.'
);
$this
->
assertResponse
(
'401'
,
'Not authenticated on the route that allows only basic
_auth
. Prompt to authenticate received.'
);
$this
->
drupalGet
(
'admin'
);
$this
->
assertResponse
(
'403'
,
'No authentication prompt for routes not explicitly defining authentication providers.'
);
...
...
core/modules/rest/config/rest.settings.yml
View file @
83e1359e
...
...
@@ -23,4 +23,4 @@ resources:
# entity:node:
# POST:
# supported_auth:
# -
http_
basic
# - basic
_auth
core/modules/rest/lib/Drupal/rest/Tests/AuthTest.php
View file @
83e1359e
...
...
@@ -39,7 +39,7 @@ public function testRead() {
$entity_type
=
'entity_test'
;
// Enable a test resource through GET method and basic HTTP authentication.
$this
->
enableService
(
'entity:'
.
$entity_type
,
'GET'
,
NULL
,
array
(
'
http_
basic'
));
$this
->
enableService
(
'entity:'
.
$entity_type
,
'GET'
,
NULL
,
array
(
'basic
_auth
'
));
// Create an entity programmatically.
$entity
=
$this
->
entityCreate
(
$entity_type
);
...
...
core/modules/system/tests/modules/router_test_directory/router_test.routing.yml
View file @
83e1359e
...
...
@@ -66,7 +66,7 @@ router_test.10:
router_test.11
:
path
:
'
/router_test/test11'
options
:
_auth
:
[
'
http_
basic'
]
_auth
:
[
'
basic
_auth
'
]
requirements
:
_user_is_logged_in
:
'
TRUE'
defaults
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment