Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use PSR7 interfaces internally in auth plugins.
Use PSR7 methods in the auth plugins. I've changed the return value for authentication adapters such that they can return a modified request. The test case using the CompatAuth stub ensure that the current behavior continues to work as well for backwards compatibility reasons.
- Loading branch information
Showing
8 changed files
with
122 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
/** | ||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org) | ||
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* | ||
* Licensed under The MIT License | ||
* Redistributions of files must retain the above copyright notice. | ||
* | ||
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* @link http://cakephp.org CakePHP(tm) Project | ||
* @since 3.3.0 | ||
* @license http://www.opensource.org/licenses/mit-license.php MIT License | ||
*/ | ||
namespace TestApp\Http; | ||
|
||
use Cake\Network\Http\Request; | ||
|
||
/** | ||
* Testing stub to ensure that auth providers | ||
* that mutate requests in place continue to work. | ||
* | ||
* @deprecated 3.3.0 Remove this compatibility behavior in 4.0.0 | ||
*/ | ||
class CompatAuth | ||
{ | ||
|
||
/** | ||
* Add Authorization header to the request via in-place mutation methods. | ||
* | ||
* @param \Cake\Network\Http\Request $request Request instance. | ||
* @param array $credentials Credentials. | ||
* @return \Cake\Network\Http\Request The updated request. | ||
*/ | ||
public function authentication(Request $request, array $credentials) | ||
{ | ||
$request->header('Authorization', 'Bearer abc123'); | ||
} | ||
|
||
/** | ||
* Proxy Authentication added via in-place mutation methods. | ||
* | ||
* @param \Cake\Network\Http\Request $request Request instance. | ||
* @param array $credentials Credentials. | ||
* @return \Cake\Network\Http\Request The updated request. | ||
*/ | ||
public function proxyAuthentication(Request $request, array $credentials) | ||
{ | ||
$request->header('Proxy-Authorization', 'Bearer abc123'); | ||
} | ||
|
||
} |