Skip to content

Commit b8b8c7d

Browse files
Mixed changes: feature, fixes, and docs from community (#477)
* Mixed changes: feature, fixes, and docs from community * style: Improve code formatting and consistency in Auth0 and AuthenticationGuard classes * fix(deps): Update psalm/plugin-laravel to version ^2.12 * fix: Add ignoreFiles section for vendor directory in psalm configuration
1 parent a214412 commit b8b8c7d

File tree

7 files changed

+26
-42
lines changed

7 files changed

+26
-42
lines changed

.github/workflows/semgrep.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ A new property has been added to the `config/auth0.php` configuration file: `beh
249249

250250
#### Changes to Guard and Provider driver aliases
251251

252-
We identified an issue with using identical alias naming for both the Guard and Provider singletons under Laravel 10, which has required us to rename these aliases. As previous guidance had been to instantiate these using their class names, this should not be a breaking change in most cases. However, if you had used `auth0` as the name for either the Guard or the Provider drivers, kindly note that these have changed. Please use `auth0.guard` for the Guard driver and `auth0.provider`` for the Provider driver. This is a regrettable change but was necessary for adequate Laravel 10 support.
252+
We identified an issue with using identical alias naming for both the Guard and Provider singletons under Laravel 10, which has required us to rename these aliases. As previous guidance had been to instantiate these using their class names, this should not be a breaking change in most cases. However, if you had used `auth0` as the name for either the Guard or the Provider drivers, kindly note that these have changed. Please use `auth0.guard` for the Guard driver and `auth0.provider` for the Provider driver. This is a regrettable change but was necessary for adequate Laravel 10 support.
253253

254254
## [7.4.0](https://github.com/auth0/laravel-auth0/tree/7.4.0) (2022-12-12)
255255

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"pestphp/pest-plugin-laravel": "^2",
5555
"phpstan/phpstan": "^1",
5656
"phpstan/phpstan-strict-rules": "^1",
57-
"psalm/plugin-laravel": "^2.10",
57+
"psalm/plugin-laravel": "^2.12",
5858
"psr-mock/http": "^1",
5959
"rector/rector": "^1",
6060
"spatie/laravel-ray": "^1.40",

psalm.xml.dist

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
<projectFiles>
1313
<directory name="src"/>
1414
<directory name="deprecated"/>
15+
<ignoreFiles>
16+
<directory name="vendor"/>
17+
</ignoreFiles>
1518
</projectFiles>
1619

1720
<issueHandlers>

src/Auth0.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,21 @@
99
/**
1010
* Auth0 Laravel SDK service provider. Provides access to the SDK's methods.
1111
*
12+
* @method static \Auth0\SDK\Configuration\SdkConfiguration getConfiguration()
13+
* @method static null|object getCredentials()
14+
* @method static null|string getGuardConfigurationKey()
15+
* @method static \Auth0\SDK\Contract\Auth0Interface getSdk()
16+
* @method static \Auth0\SDK\Contract\API\ManagementInterface management()
17+
* @method static self setGuardConfigurationKey(null|string $guardConfigurationKey = null)
18+
* @method static \Auth0\SDK\Contract\Auth0Interface setSdk(\Auth0\SDK\Contract\Auth0Interface $sdk)
19+
* @method static self reset()
20+
* @method static self setConfiguration(\Auth0\SDK\Configuration\SdkConfiguration|array|null $configuration = null)
21+
*
22+
* @see Service
23+
* @see ServiceAbstract
24+
* @see Entities\InstanceEntityAbstract
25+
* @see InstanceEntityTrait
26+
*
1227
* @codeCoverageIgnore
1328
*
1429
* @deprecated 7.8.0 Use Auth0\Laravel\Service instead.

src/Guards/AuthenticationGuard.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Auth0\SDK\Utility\HttpResponse;
1414
use Illuminate\Auth\Events\{Login, Logout};
1515
use Illuminate\Contracts\Auth\Authenticatable;
16+
use Illuminate\Support\Traits\Macroable;
1617

1718
use Throwable;
1819

@@ -27,6 +28,8 @@
2728
*/
2829
final class AuthenticationGuard extends GuardAbstract implements AuthenticationGuardContract
2930
{
31+
use Macroable;
32+
3033
/**
3134
* @var string
3235
*/

src/Guards/AuthorizationGuard.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Auth0\Laravel\UserProviderContract;
99
use Auth0\SDK\Utility\HttpResponse;
1010
use Illuminate\Contracts\Auth\Authenticatable;
11+
use Illuminate\Support\Traits\Macroable;
1112

1213
use function is_array;
1314
use function is_string;
@@ -19,6 +20,8 @@
1920
*/
2021
final class AuthorizationGuard extends GuardAbstract implements AuthorizationGuardContract
2122
{
23+
use Macroable;
24+
2225
public function find(): ?CredentialEntityContract
2326
{
2427
if ($this->isImpersonating()) {

0 commit comments

Comments
 (0)