Skip to content

Commit

Permalink
fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
steinkel committed Nov 19, 2024
2 parents 7d73629 + 6abfdc9 commit c7b846b
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Docs/Documentation/Authorization.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ At your Application::middleware add the authorization and request authorization

As usual create or update the Application::getAuthorizationService method:

````
public function getAuthorizationService(ServerRequestInterface $request, ResponseInterface $response)
```
public function getAuthorizationService(ServerRequestInterface $request): AuthorizationServiceInterface
{
$map = new MapResolver();
$map->map(
Expand Down
2 changes: 1 addition & 1 deletion src/Authentication/AuthenticationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ protected function getWebauthn2fAuthenticationChecker()
/**
* Get the configured u2f authentication checker
*
* @return \CakeDC\Auth\Authentication\Webauthn2FAuthenticationCheckerInterface
* @return \CakeDC\Auth\Authentication\U2fAuthenticationCheckerInterface
*/
protected function getU2fAuthenticationChecker()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function isEnabled()
/**
* Check if two factor authentication is required for a user
*
* @param array $user user data
* @param array<mixed>|null $user user data
* @return bool
*/
public function isRequired(?array $user = null)
Expand Down
2 changes: 1 addition & 1 deletion src/Authentication/DefaultU2fAuthenticationChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function isEnabled()
/**
* Check if two factor authentication is required for a user
*
* @param array $user user data
* @param array<mixed>|null $user user data
* @return bool
*/
public function isRequired(?array $user = null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function isEnabled()
/**
* Check if two factor authentication is required for a user
*
* @param array $user user data
* @param array<mixed>|null $user user data
* @return bool
*/
public function isRequired(?array $user = null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function isEnabled();
/**
* Check if two factor authentication is required for a user
*
* @param array $user user data
* @param array<mixed>|null $user user data
* @return bool
*/
public function isRequired(?array $user = null);
Expand Down
2 changes: 1 addition & 1 deletion src/Authentication/U2fAuthenticationCheckerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function isEnabled();
/**
* Check if two factor authentication is required for a user
*
* @param array $user user data
* @param array<mixed>|null $user user data
* @return bool
*/
public function isRequired(?array $user = null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function isEnabled();
/**
* Check if two factor authentication is required for a user
*
* @param array $user user data
* @param array<mixed>|null $user user data
* @return bool
*/
public function isRequired(?array $user = null);
Expand Down
6 changes: 3 additions & 3 deletions src/Rbac/Rbac.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,9 @@ protected function _matchOrAsterisk($possibleValues, $value, $allowEmpty = false
$possibleArray = (array)$possibleValues;

return $possibleValues === '*' ||
$value === $possibleValues ||
in_array($value, $possibleArray) ||
in_array(Inflector::camelize((string)$value, '-'), $possibleArray);
$value === $possibleValues ||
in_array($value, $possibleArray) ||
in_array(Inflector::camelize((string)$value, '-'), $possibleArray);
}

/**
Expand Down
2 changes: 2 additions & 0 deletions tests/TestCase/Authenticator/CookieAuthenticatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Authentication\Identifier\IdentifierCollection;
use Cake\Http\Response;
use Cake\TestSuite\TestCase;
use Cake\Utility\Security;
use CakeDC\Auth\Authenticator\CookieAuthenticator;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
Expand Down Expand Up @@ -71,6 +72,7 @@ public function testPersistIdentity($setCookie, $field, array $post, array $sess
'username' => 'johndoe',
'password' => '$2a$10$u05j8FjsvLBNdfhBhc21LOuVMpzpabVXQ9OpC2wO3pSO0q6t7HHMO',
]);
Security::setSalt('22f40226f5b51926aeb29995ebf0108eae3435e2');
$result = $authenticator->persistIdentity($request, $response, $identity);
$this->assertIsArray($result);
$this->assertArrayHasKey('request', $result);
Expand Down

0 comments on commit c7b846b

Please sign in to comment.