|
53830
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelpDOCKERDEV (docker)DEV (docker)APP (-zsh)*3-zsh'4юA 1%щ 8 Mon 20 Apr 11:29:52.181• *4screenpipe"• x5/***/* Determine if the current API token is missing a given scope.public function tokenCant(string $scope): boolreturn ! Sthis->tokenCan($scope);DEV}/*** Create a new personal access token for the user.* @param string(] $scopes*/public function createToken(string Sname, array $scopes = []): PersonalAccessTokenResult{return app(PersonalAccessTokenFactory::class)->make(Sthis->getAuthIdentifier(), Sname, $scopes, Sthis->getProviderName());/*** Get the user provider name.* @throws \LogicException*/public function getProviderName(): stringSproviders = collect(config('auth.guards'))->where('driver', 'passport')->pluck('provider')->all();foreach (config('auth.providers') as Sprovider = Sconfig) {if (in_array(Sprovider, $providers) && Sconfig['driver'] === 'eloquent' && is_a($this, $config['model'])) {return Sprovider;}}throw new LogicException('Unable to determine authentication provider for this model from configuration.');return Sthis->accessToken ? Sthis->accessToken->can($scope) : false;129c35public function withAccessToken(?ScopeAuthorizable SaccessToken): staticpublic function withAccessToken(TransientToken SaccessToken): staticroot@docker_lamp_1:/home/jiminny#...
|
iTerm2
|
NULL
|
NULL
|
53830
|
|
53831
|
VIeWWinaowrTavsco.sProjecty© Opportunity.php© Part VIeWWinaowrTavsco.sProjecty© Opportunity.php© Participant.php© Partner.php© Permission.phpC Phonenumber.ongPlayoacklneme.ono© Playbook.phpC) Playbookcategorv.php© Playlist.phpC) RateLimit.php© Region.phpC) Role.php© RoleChangeEvent.php(c) Sconegrouo,ono© Session.php(C) SlackBot.oho(C) SocialAccount.oho(C) Stade oho© Task.phpC Team.php© TeamAiContext.php© TeamDomain.php© TeamFeature.php© TeamSettings.php© TextRelay.php© Track.php© TranscriptionModel.php© TranscriptionModelLocale.php© TranscriptionProvider.phpc User.php© UserSettings.php© Vocabulary.phpc) VocabularyPronunciation.php© VoiceAccess.php(c)VolceconsentPrefix.onoNotitications• → Observers> O Policiesv Providers@ ActivitvServiceProvider.ohn@ AniServiceProvider.nhn@ AnnServiceProvider.nhnC) AuthServiceProvider.nhn@ RroadcastServiceProvider.ohn© CalendarServiceProvider.php@ CreateParticipantsServiceProvideC) CrmServiceProvider nhnl© EncryptionServiceProvider.php(c CvontCorvicoDrovidor nhnl© HubspotJournalServiceProvider.p© HubspotWebhookServiceProvideA limC) AooServiceProvider.ongC) AutomatedReport.phonamespace Jiminny Models;liminnu Models VIsenamethod stringl] getRoles() laratrust's annotation* @property int $id* @property mixed Suuidx oohopent scring snamex olooent surind semalt* doroperty string null ssecondary emaz* doroperty string null spassword•doroperty string null sohoto pachiGoropertu bool Suses two factor auth•doropertu strinolnuur sauthu 10Gpropertu strinalnulz scountru code• doropertu int.nulz Sregion 1di• doropertu strinalnulz ssecondaru phone• Aoropertu strinalnull Scaller id* coronentu int nuu sion tite io.• Aoronentu strinalnull Stwo facton reset code• Goronertu int Steam id• Gorobertu intlnull Sarounidi* Goronertu strinalnull Stimezone* @property string $language* Annonentu ctrinalnull Cconfononco numhon* @property stringlnull $conference_pin* @property string|null $conference_slug* Apropenty string Sconference join preference* Annonentu bool Sconfonenco ¿oin nomindon* doropertu scring sconterence recoraannounce* Apropentu int $conference record preference* doroperty int sconference banawidch* opropertu int sconference start weocam• ∞.100% 5Mon ZU AOr 11-29:02service.pnpkouteservicerrovider.ong© Partner.phpouseronpxC) Reportcontroller.pnp©syncuserrllotcompanyListener.gA67 X1 X7outright wrong! Also, we don't support using the $team argument.Security patch review and testing guidanceYour custom trant- onlv nandles ranszent okenpublic tunction token(): ?uransientloken // hardcoded to Transientloken onlypublic function tokenCan(string $scope): boolpublic function withAccessToken(TransientToken $accessToken): staticThe risk with rassport 13.6 13.7.XPassport's upstream HasApiTokens trait likely changedits token return type orwithaccesstokeno signaureinte oumo. you cusiom aluoins Transientlokeneverywhere — if Passport 13.7.x now expects Token TransientToken (or introduced a newcontract/interrace for the access token), your trait sllently ignores that and could cause typeerrors at runtime.Check immediatelv:# What does Passport's own HasAptlokens expect now?cat vendor/laravel/passport/src/HasApiTokens.php# Diff it against your custom traitvendor/laravel/passport/src/HasApiTokens.phpapp/Traits/HasApiTokens.phpAuso check ie contacutererences:bashcat vendor/laravel/passport/src/Contracts/OAuthenticatable.phpBoth User and Partner models implement Authenticatable and use vour custom trait —co it the intertace chanœed hoth are aftectediWhat to look for in the diff: any change to the return type of token , the parameter type ofwa thAccesstokeno.or1t Passnort now exnecis loken the tull Hloduent moce! in naceswhere you re only handling TransientToken. That's the one gap this custom trait creates thatthe version bumb coule exboseReplv.…...CannotAh...
|
iTerm2
|
NULL
|
NULL
|
53831
|
|
53832
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelpDOCKERDEV (docker)DEV (docker)APP (-zsh)*3-zsh'4юA 1%щ 8 Mon 20 Apr 11:29:53.181• *4screenpipe"• x5/***/* Determine if the current API token is missing a given scope.public function tokenCant(string $scope): boolreturn ! Sthis->tokenCan($scope);DEV}/*** Create a new personal access token for the user.* @param string(] $scopes*/public function createToken(string Sname, array $scopes = []): PersonalAccessTokenResult{return app(PersonalAccessTokenFactory::class)->make(Sthis->getAuthIdentifier(), Sname, $scopes, Sthis->getProviderName());/*** Get the user provider name.* @throws \LogicException*/public function getProviderName(): stringSproviders = collect(config('auth.guards'))->where('driver', 'passport')->pluck('provider')->all();foreach (config('auth.providers') as Sprovider = Sconfig) {if (in_array(Sprovider, $providers) && Sconfig['driver'] === 'eloquent' && is_a($this, $config['model'])) {return Sprovider;}}throw new LogicException('Unable to determine authentication provider for this model from configuration.');return Sthis->accessToken ? Sthis->accessToken->can($scope) : false;129c35public function withAccessToken(?ScopeAuthorizable SaccessToken): staticpublic function withAccessToken(TransientToken SaccessToken): staticroot@docker_lamp_1:/home/jiminny#...
|
iTerm2
|
NULL
|
NULL
|
53832
|
|
53833
|
root@docker_lamp_1:/home/jiminny# diff \
vendor/ root@docker_lamp_1:/home/jiminny# diff \
vendor/laravel/passport/src/HasApiTokens.php \
app/Traits/HasApiTokens.php
3c3
< namespace Laravel\Passport;
---
> namespace Jiminny\Traits;
5,9c5
< use Illuminate\Database\Eloquent\Builder;
< use Illuminate\Database\Eloquent\Relations\HasMany;
< use Illuminate\Database\Eloquent\Relations\MorphMany;
< use Laravel\Passport\Contracts\ScopeAuthorizable;
< use LogicException;
---
> use Laravel\Passport\TransientToken;
11,13d6
< /**
< * @phpstan-require-implements \Laravel\Passport\Contracts\OAuthenticatable
< */
18,44d10
< */
< protected ?ScopeAuthorizable $accessToken = null;
<
< /**
< * Get all of the user's registered OAuth clients.
< *
< * @deprecated Use oauthApps()
< *
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Client, $this>
< */
< public function clients(): HasMany
< {
< return $this->hasMany(Passport::clientModel(), 'user_id');
< }
<
< /**
< * Get all of the user's registered OAuth applications.
< *
< * @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, $this>
< */
< public function oauthApps(): MorphMany
< {
< return $this->morphMany(Passport::clientModel(), 'owner');
< }
<
< /**
< * Get all of the access tokens for the user.
46c12
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, $this>
---
> * @var Laravel\Passport\TransientToken
48,62c14
< public function tokens(): HasMany
< {
< return $this->hasMany(Passport::tokenModel(), 'user_id', $this->getAuthIdentifierName())
< ->where(function (Builder $query): void {
< $query->whereHas('client', function (Builder $query): void {
< $query->where(function (Builder $query): void {
< $provider = $this->getProviderName();
<
< $query->when($provider === config('auth.guards.api.provider'), function (Builder $query): void {
< $query->orWhereNull('provider');
< })->orWhere('provider', $provider);
< });
< });
< });
< }
---
> protected $accessToken;
65c17
< * Get the access token currently associated with the user.
---
> * Get the current access token being used by the user.
67,75c19
< public function token(): ?ScopeAuthorizable
< {
< return $this->currentAccessToken();
< }
<
< /**
< * Get the access token currently associated with the user.
< */
< public function currentAccessToken(): ?ScopeAuthorizable
---
> public function token(): ?TransientToken
85,123c29
< return $this->accessToken && $this->accessToken->can($scope);
< }
<
< /**
< * Determine if the current API token is missing a given scope.
< */
< public function tokenCant(string $scope): bool
< {
< return ! $this->tokenCan($scope);
< }
<
< /**
< * Create a new personal access token for the user.
< *
< * @param string[] $scopes
< */
< public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult
< {
< return app(PersonalAccessTokenFactory::class)->make(
< $this->getAuthIdentifier(), $name, $scopes, $this->getProviderName()
< );
< }
<
< /**
< * Get the user provider name.
< *
< * @throws \LogicException
< */
< public function getProviderName(): string
< {
< $providers = collect(config('auth.guards'))->where('driver', 'passport')->pluck('provider')->all();
<
< foreach (config('auth.providers') as $provider => $config) {
< if (in_array($provider, $providers) && $config['driver'] === 'eloquent' && is_a($this, $config['model'])) {
< return $provider;
< }
< }
<
< throw new LogicException('Unable to determine authentication provider for this model from configuration.');
---
> return $this->accessToken ? $this->accessToken->can($scope) : false;
129c35
< public function withAccessToken(?ScopeAuthorizable $accessToken): static
---
> public function withAccessToken(TransientToken $accessToken): static
root@docker_lamp_1:/home/jiminny#
DOCKER
Close Tab
DEV (docker)
Close Tab
APP (-zsh)
Close Tab
-zsh
Close Tab
screenpipe"
Close Tab
⌥⌘1
DEV (docker)...
|
iTerm2
|
DEV (docker)
|
NULL
|
53833
|
|
53834
|
root@docker_lamp_1:/home/jiminny# diff \
vendor/ root@docker_lamp_1:/home/jiminny# diff \
vendor/laravel/passport/src/HasApiTokens.php \
app/Traits/HasApiTokens.php
3c3
< namespace Laravel\Passport;
---
> namespace Jiminny\Traits;
5,9c5
< use Illuminate\Database\Eloquent\Builder;
< use Illuminate\Database\Eloquent\Relations\HasMany;
< use Illuminate\Database\Eloquent\Relations\MorphMany;
< use Laravel\Passport\Contracts\ScopeAuthorizable;
< use LogicException;
---
> use Laravel\Passport\TransientToken;
11,13d6
< /**
< * @phpstan-require-implements \Laravel\Passport\Contracts\OAuthenticatable
< */
18,44d10
< */
< protected ?ScopeAuthorizable $accessToken = null;
<
< /**
< * Get all of the user's registered OAuth clients.
< *
< * @deprecated Use oauthApps()
< *
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Client, $this>
< */
< public function clients(): HasMany
< {
< return $this->hasMany(Passport::clientModel(), 'user_id');
< }
<
< /**
< * Get all of the user's registered OAuth applications.
< *
< * @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, $this>
< */
< public function oauthApps(): MorphMany
< {
< return $this->morphMany(Passport::clientModel(), 'owner');
< }
<
< /**
< * Get all of the access tokens for the user.
46c12
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, $this>
---
> * @var Laravel\Passport\TransientToken
48,62c14
< public function tokens(): HasMany
< {
< return $this->hasMany(Passport::tokenModel(), 'user_id', $this->getAuthIdentifierName())
< ->where(function (Builder $query): void {
< $query->whereHas('client', function (Builder $query): void {
< $query->where(function (Builder $query): void {
< $provider = $this->getProviderName();
<
< $query->when($provider === config('auth.guards.api.provider'), function (Builder $query): void {
< $query->orWhereNull('provider');
< })->orWhere('provider', $provider);
< });
< });
< });
< }
---
> protected $accessToken;
65c17
< * Get the access token currently associated with the user.
---
> * Get the current access token being used by the user.
67,75c19
< public function token(): ?ScopeAuthorizable
< {
< return $this->currentAccessToken();
< }
<
< /**
< * Get the access token currently associated with the user.
< */
< public function currentAccessToken(): ?ScopeAuthorizable
---
> public function token(): ?TransientToken
85,123c29
< return $this->accessToken && $this->accessToken->can($scope);
< }
<
< /**
< * Determine if the current API token is missing a given scope.
< */
< public function tokenCant(string $scope): bool
< {
< return ! $this->tokenCan($scope);
< }
<
< /**
< * Create a new personal access token for the user.
< *
< * @param string[] $scopes
< */
< public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult
< {
< return app(PersonalAccessTokenFactory::class)->make(
< $this->getAuthIdentifier(), $name, $scopes, $this->getProviderName()
< );
< }
<
< /**
< * Get the user provider name.
< *
< * @throws \LogicException
< */
< public function getProviderName(): string
< {
< $providers = collect(config('auth.guards'))->where('driver', 'passport')->pluck('provider')->all();
<
< foreach (config('auth.providers') as $provider => $config) {
< if (in_array($provider, $providers) && $config['driver'] === 'eloquent' && is_a($this, $config['model'])) {
< return $provider;
< }
< }
<
< throw new LogicException('Unable to determine authentication provider for this model from configuration.');
---
> return $this->accessToken ? $this->accessToken->can($scope) : false;
129c35
< public function withAccessToken(?ScopeAuthorizable $accessToken): static
---
> public function withAccessToken(TransientToken $accessToken): static
root@docker_lamp_1:/home/jiminny#
DOCKER
Close Tab
DEV (docker)
Close Tab
APP (-zsh)
Close Tab
-zsh
Close Tab
screenpipe"
Close Tab
⌥⌘1
DEV (docker)...
|
iTerm2
|
DEV (docker)
|
NULL
|
53834
|
|
53835
|
root@docker_lamp_1:/home/jiminny# diff \
vendor/ root@docker_lamp_1:/home/jiminny# diff \
vendor/laravel/passport/src/HasApiTokens.php \
app/Traits/HasApiTokens.php
3c3
< namespace Laravel\Passport;
---
> namespace Jiminny\Traits;
5,9c5
< use Illuminate\Database\Eloquent\Builder;
< use Illuminate\Database\Eloquent\Relations\HasMany;
< use Illuminate\Database\Eloquent\Relations\MorphMany;
< use Laravel\Passport\Contracts\ScopeAuthorizable;
< use LogicException;
---
> use Laravel\Passport\TransientToken;
11,13d6
< /**
< * @phpstan-require-implements \Laravel\Passport\Contracts\OAuthenticatable
< */
18,44d10
< */
< protected ?ScopeAuthorizable $accessToken = null;
<
< /**
< * Get all of the user's registered OAuth clients.
< *
< * @deprecated Use oauthApps()
< *
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Client, $this>
< */
< public function clients(): HasMany
< {
< return $this->hasMany(Passport::clientModel(), 'user_id');
< }
<
< /**
< * Get all of the user's registered OAuth applications.
< *
< * @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, $this>
< */
< public function oauthApps(): MorphMany
< {
< return $this->morphMany(Passport::clientModel(), 'owner');
< }
<
< /**
< * Get all of the access tokens for the user.
46c12
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, $this>
---
> * @var Laravel\Passport\TransientToken
48,62c14
< public function tokens(): HasMany
< {
< return $this->hasMany(Passport::tokenModel(), 'user_id', $this->getAuthIdentifierName())
< ->where(function (Builder $query): void {
< $query->whereHas('client', function (Builder $query): void {
< $query->where(function (Builder $query): void {
< $provider = $this->getProviderName();
<
< $query->when($provider === config('auth.guards.api.provider'), function (Builder $query): void {
< $query->orWhereNull('provider');
< })->orWhere('provider', $provider);
< });
< });
< });
< }
---
> protected $accessToken;
65c17
< * Get the access token currently associated with the user.
---
> * Get the current access token being used by the user.
67,75c19
< public function token(): ?ScopeAuthorizable
< {
< return $this->currentAccessToken();
< }
<
< /**
< * Get the access token currently associated with the user.
< */
< public function currentAccessToken(): ?ScopeAuthorizable
---
> public function token(): ?TransientToken
85,123c29
< return $this->accessToken && $this->accessToken->can($scope);
< }
<
< /**
< * Determine if the current API token is missing a given scope.
< */
< public function tokenCant(string $scope): bool
< {
< return ! $this->tokenCan($scope);
< }
<
< /**
< * Create a new personal access token for the user.
< *
< * @param string[] $scopes
< */
< public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult
< {
< return app(PersonalAccessTokenFactory::class)->make(
< $this->getAuthIdentifier(), $name, $scopes, $this->getProviderName()
< );
< }
<
< /**
< * Get the user provider name.
< *
< * @throws \LogicException
< */
< public function getProviderName(): string
< {
< $providers = collect(config('auth.guards'))->where('driver', 'passport')->pluck('provider')->all();
<
< foreach (config('auth.providers') as $provider => $config) {
< if (in_array($provider, $providers) && $config['driver'] === 'eloquent' && is_a($this, $config['model'])) {
< return $provider;
< }
< }
<
< throw new LogicException('Unable to determine authentication provider for this model from configuration.');
---
> return $this->accessToken ? $this->accessToken->can($scope) : false;
129c35
< public function withAccessToken(?ScopeAuthorizable $accessToken): static
---
> public function withAccessToken(TransientToken $accessToken): static
root@docker_lamp_1:/home/jiminny# cat vendor/laravel/passport/src/Contracts/OAuthenticatable.php
<?php
namespace Laravel\Passport\Contracts;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Laravel\Passport\PersonalAccessTokenResult;
interface OAuthenticatable extends Authenticatable
{
/**
* Get all the user's registered OAuth applications.
*
* @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, \Illuminate\Foundation\Auth\User>
*/
public function oauthApps(): MorphMany;
/**
* Get all the access tokens for the user.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, \Illuminate\Foundation\Auth\User>
*/
public function tokens(): HasMany;
/**
* Determine if the current API token has a given scope.
*/
public function tokenCan(string $scope): bool;
/**
* Determine if the current API token is missing a given scope.
*/
public function tokenCant(string $scope): bool;
/**
* Create a new personal access token for the user.
*
* @param string[] $scopes
*/
public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult;
/**
* Get the access token currently associated with the user.
*/
public function currentAccessToken(): ?ScopeAuthorizable;
/**
* Set the current access token for the user.
*/
public function withAccessToken(?ScopeAuthorizable $accessToken): static;
/**
* Get the user provider name.
*/
public function getProviderName(): string;
}
root@docker_lamp_1:/home/jiminny#
DOCKER
Close Tab
DEV (docker)
Close Tab
APP (-zsh)
Close Tab
-zsh
Close Tab
screenpipe"
Close Tab
⌥⌘1
DEV (docker)...
|
iTerm2
|
DEV (docker)
|
NULL
|
53835
|
|
53836
|
root@docker_lamp_1:/home/jiminny# diff \
vendor/ root@docker_lamp_1:/home/jiminny# diff \
vendor/laravel/passport/src/HasApiTokens.php \
app/Traits/HasApiTokens.php
3c3
< namespace Laravel\Passport;
---
> namespace Jiminny\Traits;
5,9c5
< use Illuminate\Database\Eloquent\Builder;
< use Illuminate\Database\Eloquent\Relations\HasMany;
< use Illuminate\Database\Eloquent\Relations\MorphMany;
< use Laravel\Passport\Contracts\ScopeAuthorizable;
< use LogicException;
---
> use Laravel\Passport\TransientToken;
11,13d6
< /**
< * @phpstan-require-implements \Laravel\Passport\Contracts\OAuthenticatable
< */
18,44d10
< */
< protected ?ScopeAuthorizable $accessToken = null;
<
< /**
< * Get all of the user's registered OAuth clients.
< *
< * @deprecated Use oauthApps()
< *
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Client, $this>
< */
< public function clients(): HasMany
< {
< return $this->hasMany(Passport::clientModel(), 'user_id');
< }
<
< /**
< * Get all of the user's registered OAuth applications.
< *
< * @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, $this>
< */
< public function oauthApps(): MorphMany
< {
< return $this->morphMany(Passport::clientModel(), 'owner');
< }
<
< /**
< * Get all of the access tokens for the user.
46c12
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, $this>
---
> * @var Laravel\Passport\TransientToken
48,62c14
< public function tokens(): HasMany
< {
< return $this->hasMany(Passport::tokenModel(), 'user_id', $this->getAuthIdentifierName())
< ->where(function (Builder $query): void {
< $query->whereHas('client', function (Builder $query): void {
< $query->where(function (Builder $query): void {
< $provider = $this->getProviderName();
<
< $query->when($provider === config('auth.guards.api.provider'), function (Builder $query): void {
< $query->orWhereNull('provider');
< })->orWhere('provider', $provider);
< });
< });
< });
< }
---
> protected $accessToken;
65c17
< * Get the access token currently associated with the user.
---
> * Get the current access token being used by the user.
67,75c19
< public function token(): ?ScopeAuthorizable
< {
< return $this->currentAccessToken();
< }
<
< /**
< * Get the access token currently associated with the user.
< */
< public function currentAccessToken(): ?ScopeAuthorizable
---
> public function token(): ?TransientToken
85,123c29
< return $this->accessToken && $this->accessToken->can($scope);
< }
<
< /**
< * Determine if the current API token is missing a given scope.
< */
< public function tokenCant(string $scope): bool
< {
< return ! $this->tokenCan($scope);
< }
<
< /**
< * Create a new personal access token for the user.
< *
< * @param string[] $scopes
< */
< public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult
< {
< return app(PersonalAccessTokenFactory::class)->make(
< $this->getAuthIdentifier(), $name, $scopes, $this->getProviderName()
< );
< }
<
< /**
< * Get the user provider name.
< *
< * @throws \LogicException
< */
< public function getProviderName(): string
< {
< $providers = collect(config('auth.guards'))->where('driver', 'passport')->pluck('provider')->all();
<
< foreach (config('auth.providers') as $provider => $config) {
< if (in_array($provider, $providers) && $config['driver'] === 'eloquent' && is_a($this, $config['model'])) {
< return $provider;
< }
< }
<
< throw new LogicException('Unable to determine authentication provider for this model from configuration.');
---
> return $this->accessToken ? $this->accessToken->can($scope) : false;
129c35
< public function withAccessToken(?ScopeAuthorizable $accessToken): static
---
> public function withAccessToken(TransientToken $accessToken): static
root@docker_lamp_1:/home/jiminny# cat vendor/laravel/passport/src/Contracts/OAuthenticatable.php
<?php
namespace Laravel\Passport\Contracts;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Laravel\Passport\PersonalAccessTokenResult;
interface OAuthenticatable extends Authenticatable
{
/**
* Get all the user's registered OAuth applications.
*
* @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, \Illuminate\Foundation\Auth\User>
*/
public function oauthApps(): MorphMany;
/**
* Get all the access tokens for the user.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, \Illuminate\Foundation\Auth\User>
*/
public function tokens(): HasMany;
/**
* Determine if the current API token has a given scope.
*/
public function tokenCan(string $scope): bool;
/**
* Determine if the current API token is missing a given scope.
*/
public function tokenCant(string $scope): bool;
/**
* Create a new personal access token for the user.
*
* @param string[] $scopes
*/
public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult;
/**
* Get the access token currently associated with the user.
*/
public function currentAccessToken(): ?ScopeAuthorizable;
/**
* Set the current access token for the user.
*/
public function withAccessToken(?ScopeAuthorizable $accessToken): static;
/**
* Get the user provider name.
*/
public function getProviderName(): string;
}
root@docker_lamp_1:/home/jiminny#
DOCKER
Close Tab
DEV (docker)
Close Tab
APP (-zsh)
Close Tab
-zsh
Close Tab
screenpipe"
Close Tab
⌥⌘1
DEV (docker)...
|
iTerm2
|
DEV (docker)
|
NULL
|
53836
|
|
53837
|
iTerm2•Shell Edit ViewSessionScripts Profiles Wind iTerm2•Shell Edit ViewSessionScripts Profiles WindowHelp… — жc 8 Mon 20 Apr 11:30:04DOCKERS- 981DEV (docker)DEV (docker)APP (-zsh)*3-zsh* @return \Illuminate\Database\Eloquent\Relations \MorphMany<\Laravel\Passport\Client, \Illuminate\Foundation\Auth\User>*/public function oauthApps(: MorphMany;/*** Get all the access tokens for the user.* @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, \Illuminate\Foundation\Auth\User>*/public function tokens(: HasMany;/***/* Determine if the current API token has a given scope.public function tokenCan(string $scope): bool;/*** Determine if the current API token is missing a given scope.*/public function tokenCant(string $scope): bool;/*** Create a new personal access token for the user.* @param string(] $scopes*/public function createToken(string $name, array $scopes = (]): PersonalAccessTokenResult;/***/* Get the access token currently associated with the user.public function currentAccessToken(): ?ScopeAuthorizable;/***/* Set the current access token for the user.public function withAccessToken(?ScopeAuthorizable SaccessToken): static;/*** Get the user provider name.*/public function getProviderName(): string;rootedocker_1amp_1: /home/jiminny#• ₴4screenpipe"181*5DEV...
|
iTerm2
|
NULL
|
NULL
|
53837
|
|
53838
|
FV faVsco.js?9 masterProledey© Opportunity.php© Pa FV faVsco.js?9 masterProledey© Opportunity.php© Participant.php© Partner.php© Permission.phpC Phonenumber.ongc) Playoacklneme.ono© Playbook.phpC) Playbookcategorv.php© Playlist.phpC) RateLimit.php© Region.phpC) Role.php@ RoleChangeEvent.phpc) ScoveGrouo.ono© Session.php(C) SlackBot.oho(C) SocialAccount.oho(C) Stade oho© Task.phpC Team.php© TeamAiContext.php© TeamDomain.php© TeamFeature.php© TeamSettings.php© TextRelay.php© Track.php© TranscriptionModel.php© TranscriptionModelLocale.php© TranscriptionProvider.phpc User.php© UserSettings.php© Vocabulary.phpc) VocabularyPronunciation.php© VoiceAccess.php(c)VolceconsentPrefix.onoNotitications• → Observers> O Policiesv Providers@ ActivitvServiceProvider.ohn@ AniServiceProvider.nhn@ AnnServiceProvider.nhnC) AuthServiceProvider.nhn@ RroadcastServiceProvider.ohn© CalendarServiceProvider.php@ CreateParticipantsServiceProvide(C) CrmServiceProvider.nhn© EncryptionServiceProvider.php(c CvontCorvicoDrovidor nhnl© HubspotJournalServiceProvider.p© HubspotWebhookServiceProvideA limC) AooServiceProvider.ongC) AutomatedReport.phonamespace Jiminny Models;liminnu Models VIsenamethod stringl] getRoles() laratrust's annotation* @property int $id* @property mixed Suuidx ocopent scring snamex olooent surind semalt* doroperty string null ssecondary emaz* doroperty string null spassword•doroperty string null sohoto pachiGoropertu bool Suses two factor authl•doropertu strinolnuur sauthu 10Gpropertu strinalnulz scountru code• doropertu int.nulz Sregion 1di• doropertu strinalnulz ssecondaru phone• Aoropertu strinalnull Scaller id• coronentu int nuu sion title 1di• Aoronentu strinalnull Stwo facton reset code• Goronertu int Steam id• Gorobertu intlnull Sarounidi* Goronertu strinalnull Stimezone* Oproperty string $language* Annonentu ctrinalnull Cconfononco numhon* @property stringlnull $conference_pin* @property string|null $conference_slug* Apropenty string Sconference join preference* Annonentu bool Sconfonenco ¿oin nomindon* doropertu scring sconterence recoraannounce* Apropentu int $conference record preference* doroperty int sconference banawidch* opropertu int sconference start weocamMON ZU AOr 11:30:04service.pnpkouteservicerrovider.ong© Partner.php© User.php XC) Reportcontroller.pnp©syncuserrllotcompanyListener.gA67 X1 X7outright wrong! Also, we don't support using the $team argument.Security patch review and testing guidanceYour custom trant• onlv nandles ranszent okenpublic function token(): ?Transientloken// hardcoded to Transientloken onlypublic function tokenCan(string $scope): boolpublic function withAccessToken(TransientToken $accessToken): staticThe risk with rassport 13.6 13.7.XPassport's upstream HasApiTokens trait likely changedits token return type orwithaccesstokeno signaureinte oumo. you cusiom aluoins Transientlokeneverywhere — if Passport 13.7.x now expects Token TransientToken (or introduced a newcontract/interrace for the access token), your trait sllently ignores that and could cause typeerrors at runtime.Check immediatelv:# What does Passport's own HasApilokens expect now?cat vendor/laravel/passport/src/HasApiTokens.php# Diff it against your custom traitvendor/laravel/passport/src/HasApiTokens.phpapp/Traits/HasApiTokens.phpAuso check ie contacutererences:bashcat vendor/laravel/passport/src/Contracts/OAuthenticatable.phpBoth User and Partner models implement Authenticatable and use vour custom trait —co it the intertace chanœed hoth are aftectediWhat to look for in the diff: any change to the return type of token , the parameter type ofwathAccesstokeno.or1t Passnort now exnecis loken the tull Hloduent moce in naceswhere you re only handling TransientToken. That's the one gap this custom trait creates thatthe version bumb coule exboseReplv…CannotAhClaude ic Aland can make mictakes Plasce double-check recnoncac)...
|
iTerm2
|
NULL
|
NULL
|
53838
|
|
53839
|
iTerm2Shell Edit ViewSessionScriptsProfilesWindowH iTerm2Shell Edit ViewSessionScriptsProfilesWindowHelpDOCKER381DEV (docker)$82DEV (docker)APP (-zsh)*3-zsh* @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, \Illuminate\Foundation\Auth\User>*/public function oauthApps: MorphMany;/*** Get all the access tokens for the user.* @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, \Illuminate\Foundation\Auth\User>*/public function tokens(: HasMany;/***/* Determine if the current API token has a given scope.public function tokenCan(string $scope): bool;/***/* Determine if the current API token is missing a given scope.public function tokenCant(string $scope): bool;/*** Create a new personal access token for the user.* @param string(] $scopes*/public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult;/***/* Get the access token currently associated with the user.public function currentAccessToken(): ?ScopeAuthorizable;/***/* Set the current access token for the user.public function withAccessToken(?ScopeAuthorizable SaccessToken): static;/*** Get the user provider name.*/public function getProviderName(): string;rootedocker_1 amp_1:/home/jiminny#'$ • A 7 1%щ 8 Mon 20 Apr 11:30:06.181• *4screenpipe"• *5 |+DEV...
|
iTerm2
|
NULL
|
NULL
|
53839
|
|
53840
|
VIeWWindowrTavsco.sProjecty© Opportunity.php© Part VIeWWindowrTavsco.sProjecty© Opportunity.php© Participant.php© Partner.php© Permission.phpC Phonenumber.ongc) Playoacklneme.ono© Playbook.phpC) Playbookcategorv.php©Playlist.phpC) RateLimit.php© Region.phpC) Role.php©RoleChangeEvent.phpc) ScoveGrouo.ono© Session.php(C) SlackBot.oho© SocialAccount.php© Stage.php© Taskphp© Team.php© TeamAiContext.php© TeamDomain.php© TeamFeature.php© TeamSettings.php© TextRelay.php© Track.php© TranscriptionModel.php© TranscriptionModelLocale.php© TranscriptionProvider.phpc User.php© UserSettings.php© Vocabulary.phpc) VocabularyPronunciation.php© VoiceAccess.php(c)VolceconsentPrefix.onoNotitications• → Observers> Eo Policiesv Providers©ActivityServiceProvider.php@ AniServiceProvider.nhn© AppServiceProvider.phpC) AuthServiceProvider.nhn© BroadcastServiceProvider.php© CalendarServiceProvider.php© CreateParticipantsServiceProvideC) CrmServiceProvider nhnl© EncryptionServiceProvider.php© EventServiceProvider.php© HubspotJournalServiceProvider.p© HubspotWebhookServiceProviderA limiAppServiceProvider.phpC) AutomatedReport.phonamespace Jiminny \Models;Jiminny \Models\Useramethod string[] getRoles() laratrust's annotation* @property int $id ]* @property mixed $uvidx oohopent scring snamex olooent surind semalt* doroperty string null ssecondaryemaz* doroperty string null spasswora•doroperty string null sonoto pachAproperty bool $uses_two_factor_auth•doropertu strinolnuur sauthu 10@property string|null $country_code• doropertu int.nulz Sregion 1di• doropertu strinalnulz ssecondaru phone@property string|null $caller_id* Goronentu int nuu sion titie 1di@property string|null $two_factor_reset_code• Goronertu int Steam id@property int/null $group_id* @property string|null $timezone* @property string $language* @property string|null Sconference_number* @property string|null $conference_pin* @property string|null $conference_slug* @property string $conference_join_preference* Apropertu bool Sconference join reminder |* doroperty scring sconterence recora announce* @property int Sconference_record_preference* doroperty int sconference banawidch* opropertu int sconference start weocam100% S2Mon 20 Apr 11:30:08Security patch review and testing guidanceservice.pnp© RouteServiceProvider.php© Field.php© Partner.php© FieldRepository.php© ReportController.php© User.php x © SyncUserPilotCompanyListener.frinstalledevent.phpCreateAcuivityLoggedevent.ong(c) CreateSharedEvent.phgPASTEDPASTED- A67 X1 X1outright wrong! Also, we don't support using the $team argument.namespace Laravel(Passport\Contractsuse Illuminate|Contracts|Auth\Authenticatable;use Illuminate|Database|Eloquent|Relations\HasMany;use Illuminate\Database\Eloquent\Relations\MorphMany:use Larave/Passport/Personal Access TokenResult;Show moreThis is a real problem. YourReply...CannotAhClaude is Al and can make mistakes. Please double-check responses....
|
iTerm2
|
NULL
|
NULL
|
53840
|
|
53841
|
VIewWinaowrTavsco.sProject© Opportunity.php© Parti VIewWinaowrTavsco.sProject© Opportunity.php© Participant.php© Partner.php© Permission.phpC Phonenumber.ongc) Playoacklneme.ono© Playbook.phpC) Playbookcategorv.php© Playlist.phpC) RateLimit.php© Region.phpC) Role.php© RoleChangeEvent.php(c) Sconegrouo,ono© Session.php(C) SlackBot.oho(C) SocialAccount.oho(C) Stade oho© Task.phpC Team.php© TeamAiContext.php© TeamDomain.php© TeamFeature.php© TeamSettings.php© TextRelay.php© Track.php© TranscriptionModel.php© TranscriptionModelLocale.php© TranscriptionProvider.phpc User.php© UserSettings.php© Vocabulary.phpc) VocabularyPronunciation.php© VoiceAccess.php(c)VolceconsentPrefix.onoNotitications• → Observers> O Policiesv Providers@ ActivitvServiceProvider.ohn@ AniServiceProvider.nhn@ AnnServiceProvider.nhnC) AuthServiceProvider.nhn@ RroadcastServiceProvider.ohn© CalendarServiceProvider.php@ CreateParticipantsServiceProvide(C) CrmServiceProvider.nhn© EncryptionServiceProvider.php(c CvontCorvicoDrovidor nhnl© HubspotJournalServiceProvider.p© HubspotWebhookServiceProvideA limC) AooServiceProvider.ongC) AutomatedReport.phonamespace Jiminny Models;Liminnu Models VIsenamethod stringl] getRoles() laratrust's annotation* @property int $id* @property mixed Suuidx oohopent scring snamex olooent surind semalt* doroperty string null ssecondary emaz* doroperty string null spassword•doroperty string null sonoto pachGoropertu bool Suses two factor auth•doropertu strinolnuur sauthu 10Gpropertu strinalnulz scountru code• doropertu int nulz Sregion 1di• doropertu strinalnulz ssecondaru phone• Aoropertu strinalnull Scaller id* Goronentu int nuu sion titie 1di• Aoronentu strinalnull Stwo facton reset code• Goronertu int Steam id• Gorobertu intlnull Sarounidi* Goronertu strinalnull Stimezone* Oproperty string $language* Annonentu ctrinalnull Cconfononco numhon* @property stringlnull $conference_pin* @property string|null $conference_slug* Apropenty string Sconference join preference* Annonentu bool Sconfonenco ¿oin nomindon* doropertu scring sconterence recoraannounce* Apropentu int $conference record preference* doroperty int sconference banawidch* opropertu int sconference start weocam100% LzMon 20 A0r 11:30-23Security patch review and testing guidanceservice.pnpkouteservicerrovider.ong© Partner.php© User.php XC) Reportcontroller.pnp©syncuserrllotcompanyListener.gA67 X1 X7outright wrong! Also, we don't support using the $team argument.This is a real problem. Your custom trait is missing methods that OAuthenticatable nowrequires as part of the intertace contract. Both User and Partner implementOAuthenticatable but your trait doesn t ruinl itrully.What's missing trom your Jiminny Traits \HasApiTokens vs what the intertace requires:MethodIntertace requiresYour traitoauthAppsMorphManymissingtokensoHasManvmissinetokencant.olboolmissingcreateTokenoPorconalAccoccTokonPocultmissinecurrentAccessTokeno?ScopeAuthorizablemissingwithAccecsTokenO?ScopeAuthorizableA wrong - TransientToken (non-nuladle)nuladle)getProviderNamestringmissingIhe immediate risk is withAccessToken() — rassport internals call this and now pass ?ScopeAuthorizable, but vour signature only accepts a non-nullable TransientToken. Thiswill throw a fatal type error at runtime whenever rassport tries to set or clear the access token.Why it hasn't blown up yet — PHP resolves trait method precedence at class definition time.and Laravel\ Passport\ HasApiTokens isalso use d bv the models (via the trait). so Passport'sown trait methods may be filling the gaps. Check which trait wins:grep -n "use HasApiTokens" app/Models/User.php app/Models/Partner.php app/Traits/HasAp# Does User use Jiminny's or Passport's?grep -rn "HasApiTokens" app/Models/User.phpIf User only use s Jiminny\Traits\HasApiTc J :,then oauthApps() , tokens() ,createToken.getProviderName. tokenCant.and currentAccessTokenareallReplv.…...CannotAh...
|
iTerm2
|
NULL
|
NULL
|
53841
|
|
53842
|
iTerm2Shell Edit ViewSessionScriptsProfilesWindowH iTerm2Shell Edit ViewSessionScriptsProfilesWindowHelpDOCKERDEV (docker)$82DEV (docker)APP (-zsh)*3-zsh* @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, \Illuminate\Foundation\Auth\User>*/public function oauthApps: MorphMany;/*** Get all the access tokens for the user.* @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, \Illuminate\Foundation\Auth\User>*/public function tokens(: HasMany;/***/* Determine if the current API token has a given scope.public function tokenCan(string $scope): bool;/*** Determine if the current API token is missing a given scope.*/public function tokenCant(string $scope): bool;/*** Create a new personal access token for the user.* @param string(] $scopes*/public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult;/***/* Get the access token currently associated with the user.public function currentAccessToken(): ?ScopeAuthorizable;/***/* Set the current access token for the user.public function withAccessToken(?ScopeAuthorizable SaccessToken): static;/*** Get the user provider name.*/public function getProviderName(): string;rootedocker_1 amp_1:/home/jiminny#' • A 7 1%щ 8 Mon 20 Apr 11:30:35.• *4screenpipe"**5 |DEV...
|
iTerm2
|
NULL
|
NULL
|
53842
|
|
53843
|
VIewWinaowrTavsco.sProject© Opportunity.php© Parti VIewWinaowrTavsco.sProject© Opportunity.php© Participant.php© Partner.php© Permission.phpC Phonenumber.ongc) Playoacklneme.ono© Playbook.phpC) Playbookcategorv.php© Playlist.phpC) RateLimit.php© Region.phpC) Role.php© RoleChangeEvent.php(c) Sconegrouo,ono© Session.php(C) SlackBot.oho(C) SocialAccount.oho(C) Stade oho© Task.phpC Team.php© TeamAiContext.php© TeamDomain.php© TeamFeature.php© TeamSettings.php© TextRelay.php© Track.php© TranscriptionModel.php© TranscriptionModelLocale.php© TranscriptionProvider.phpc User.php© UserSettings.php© Vocabulary.phpc) VocabularyPronunciation.php© VoiceAccess.php(c)VolceconsentPrefix.onoNotitications• → Observers> O Policiesv Providers@ ActivitvServiceProvider.ohn@ AniServiceProvider.nhn@ AnnServiceProvider.nhnC) AuthServiceProvider.nhn@ RroadcastServiceProvider.ohn© CalendarServiceProvider.php© CreateParticipantsServiceProvide(C) CrmServiceProvider.nhn© EncryptionServiceProvider.php(c CvontCorvicoDrovidor nhnl© HubspotJournalServiceProvider.p© HubspotWebhookServiceProvideA limC) AooServiceProvider.ongC) AutomatedReport.phonamespace Jiminny Models;Liminnu Models VIsenamethod stringl] getRoles() laratrust's annotation* @property int $id* @property mixed Suuidx oohopent scring snamex olooent surind semalt* doroperty string null ssecondary emaz* doroperty string null spassword•doroperty string null sonoto pachGoropertu bool Suses two factor auth•doropertu strinolnuur sauthu 10Gpropertu strinalnulz scountru code• doropertu int nulz Sregion 1di• doropertu strinalnulz ssecondaru phone• Aoropertu strinalnull Scaller id* Goronentu int nuu sion titie 1di• Aoronentu strinalnull Stwo facton reset code• Goronertu int Steam id• Gorobertu intlnull Sarounidi* Goronertu strinalnull Stimezone* Oproperty string $language* Annonentu ctrinalnull Cconfononco numhen* @property stringlnull $conference_pin* @property string|null $conference_slug* Apropenty string Sconference join preference* Annonentu bool Sconfonenco ¿oin nomindon* doropertu scring sconterence recoraannounce* Apropentu int $conference record preference* doroperty int sconference banawidch* opropertu int sconference start weocam100% LzMOn 2U A0r 11:30.30Security patch review and testing guidanceservice.pnpkouteservicerrovider.ongC) FieldRepository.ongC) Reportcontroller.pnp© Partner.php© User.php X©syncuserrllotcompanyListener.gA67 X1 X7outright wrong! Also, we don't support using the $team argument.This is a real problem. Your custom trait is missing methods that OAuthenticatable nowrequires as part of the intertace contract. Both User and Partner implementOAuthenticatable but your trait doesn t ruinl itrully.What's missing trom your Jiminny Traits \HasApiTokens vs what the intertace requires:MethodIntertace requiresYour traitoauthAppsMorphManymissingtokens()HasManvmissinetokencant.olboolmissingcreateTokenoPorconalAccoccTokonPocultmissin?currentAccessTokeno?ScopeAuthorizablemissingwithAccecsTokenO?ScopeAuthorizableA wrong - TransientToken (non-nuladle)nuladle)getProviderNamestringmissingIhe immediate risk is withAccessToken() — rassport internals call this and now pass ?ScopeAuthorizable, but vour signature only accepts a non-nullable TransientToken. Thiswill throw a fatal type error at runtime whenever rassport tries to set or clear the access token.Why it hasn't blown up yet — PHP resolves trait method precedence at class definition time.ana Laravel Passport Hasapilokens isaso use advnemoces Matheuau. so rassoor'sown trait methods may be filling the gaps. Check which trait wins:grep -n "use HasApiTokens" app/Models/User.php app/Models/Partner.php app/Traits/HasAp# Does User use Jiminny's or Passport's?grep -rn "HasApiTokens" app/Models/User.phpIf User only use s Jiminny\Traits\HasApiTc J :,then oauthApps() , tokens() ,createToken.getProviderName.tokenCant.and currentAccessToken areallReplv…Sonnet 4.6 v...
|
iTerm2
|
NULL
|
NULL
|
53843
|
|
53844
|
root@docker_lamp_1:/home/jiminny# diff \
vendor/ root@docker_lamp_1:/home/jiminny# diff \
vendor/laravel/passport/src/HasApiTokens.php \
app/Traits/HasApiTokens.php
3c3
< namespace Laravel\Passport;
---
> namespace Jiminny\Traits;
5,9c5
< use Illuminate\Database\Eloquent\Builder;
< use Illuminate\Database\Eloquent\Relations\HasMany;
< use Illuminate\Database\Eloquent\Relations\MorphMany;
< use Laravel\Passport\Contracts\ScopeAuthorizable;
< use LogicException;
---
> use Laravel\Passport\TransientToken;
11,13d6
< /**
< * @phpstan-require-implements \Laravel\Passport\Contracts\OAuthenticatable
< */
18,44d10
< */
< protected ?ScopeAuthorizable $accessToken = null;
<
< /**
< * Get all of the user's registered OAuth clients.
< *
< * @deprecated Use oauthApps()
< *
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Client, $this>
< */
< public function clients(): HasMany
< {
< return $this->hasMany(Passport::clientModel(), 'user_id');
< }
<
< /**
< * Get all of the user's registered OAuth applications.
< *
< * @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, $this>
< */
< public function oauthApps(): MorphMany
< {
< return $this->morphMany(Passport::clientModel(), 'owner');
< }
<
< /**
< * Get all of the access tokens for the user.
46c12
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, $this>
---
> * @var Laravel\Passport\TransientToken
48,62c14
< public function tokens(): HasMany
< {
< return $this->hasMany(Passport::tokenModel(), 'user_id', $this->getAuthIdentifierName())
< ->where(function (Builder $query): void {
< $query->whereHas('client', function (Builder $query): void {
< $query->where(function (Builder $query): void {
< $provider = $this->getProviderName();
<
< $query->when($provider === config('auth.guards.api.provider'), function (Builder $query): void {
< $query->orWhereNull('provider');
< })->orWhere('provider', $provider);
< });
< });
< });
< }
---
> protected $accessToken;
65c17
< * Get the access token currently associated with the user.
---
> * Get the current access token being used by the user.
67,75c19
< public function token(): ?ScopeAuthorizable
< {
< return $this->currentAccessToken();
< }
<
< /**
< * Get the access token currently associated with the user.
< */
< public function currentAccessToken(): ?ScopeAuthorizable
---
> public function token(): ?TransientToken
85,123c29
< return $this->accessToken && $this->accessToken->can($scope);
< }
<
< /**
< * Determine if the current API token is missing a given scope.
< */
< public function tokenCant(string $scope): bool
< {
< return ! $this->tokenCan($scope);
< }
<
< /**
< * Create a new personal access token for the user.
< *
< * @param string[] $scopes
< */
< public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult
< {
< return app(PersonalAccessTokenFactory::class)->make(
< $this->getAuthIdentifier(), $name, $scopes, $this->getProviderName()
< );
< }
<
< /**
< * Get the user provider name.
< *
< * @throws \LogicException
< */
< public function getProviderName(): string
< {
< $providers = collect(config('auth.guards'))->where('driver', 'passport')->pluck('provider')->all();
<
< foreach (config('auth.providers') as $provider => $config) {
< if (in_array($provider, $providers) && $config['driver'] === 'eloquent' && is_a($this, $config['model'])) {
< return $provider;
< }
< }
<
< throw new LogicException('Unable to determine authentication provider for this model from configuration.');
---
> return $this->accessToken ? $this->accessToken->can($scope) : false;
129c35
< public function withAccessToken(?ScopeAuthorizable $accessToken): static
---
> public function withAccessToken(TransientToken $accessToken): static
root@docker_lamp_1:/home/jiminny# cat vendor/laravel/passport/src/Contracts/OAuthenticatable.php
<?php
namespace Laravel\Passport\Contracts;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Laravel\Passport\PersonalAccessTokenResult;
interface OAuthenticatable extends Authenticatable
{
/**
* Get all the user's registered OAuth applications.
*
* @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, \Illuminate\Foundation\Auth\User>
*/
public function oauthApps(): MorphMany;
/**
* Get all the access tokens for the user.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, \Illuminate\Foundation\Auth\User>
*/
public function tokens(): HasMany;
/**
* Determine if the current API token has a given scope.
*/
public function tokenCan(string $scope): bool;
/**
* Determine if the current API token is missing a given scope.
*/
public function tokenCant(string $scope): bool;
/**
* Create a new personal access token for the user.
*
* @param string[] $scopes
*/
public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult;
/**
* Get the access token currently associated with the user.
*/
public function currentAccessToken(): ?ScopeAuthorizable;
/**
* Set the current access token for the user.
*/
public function withAccessToken(?ScopeAuthorizable $accessToken): static;
/**
* Get the user provider name.
*/
public function getProviderName(): string;
}
root@docker_lamp_1:/home/jiminny#
DOCKER
Close Tab
DEV (docker)
Close Tab
APP (-zsh)
Close Tab
-zsh
Close Tab
screenpipe"
Close Tab
⌥⌘1
DEV (docker)...
|
iTerm2
|
DEV (docker)
|
NULL
|
53844
|
|
53845
|
root@docker_lamp_1:/home/jiminny# diff \
vendor/ root@docker_lamp_1:/home/jiminny# diff \
vendor/laravel/passport/src/HasApiTokens.php \
app/Traits/HasApiTokens.php
3c3
< namespace Laravel\Passport;
---
> namespace Jiminny\Traits;
5,9c5
< use Illuminate\Database\Eloquent\Builder;
< use Illuminate\Database\Eloquent\Relations\HasMany;
< use Illuminate\Database\Eloquent\Relations\MorphMany;
< use Laravel\Passport\Contracts\ScopeAuthorizable;
< use LogicException;
---
> use Laravel\Passport\TransientToken;
11,13d6
< /**
< * @phpstan-require-implements \Laravel\Passport\Contracts\OAuthenticatable
< */
18,44d10
< */
< protected ?ScopeAuthorizable $accessToken = null;
<
< /**
< * Get all of the user's registered OAuth clients.
< *
< * @deprecated Use oauthApps()
< *
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Client, $this>
< */
< public function clients(): HasMany
< {
< return $this->hasMany(Passport::clientModel(), 'user_id');
< }
<
< /**
< * Get all of the user's registered OAuth applications.
< *
< * @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, $this>
< */
< public function oauthApps(): MorphMany
< {
< return $this->morphMany(Passport::clientModel(), 'owner');
< }
<
< /**
< * Get all of the access tokens for the user.
46c12
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, $this>
---
> * @var Laravel\Passport\TransientToken
48,62c14
< public function tokens(): HasMany
< {
< return $this->hasMany(Passport::tokenModel(), 'user_id', $this->getAuthIdentifierName())
< ->where(function (Builder $query): void {
< $query->whereHas('client', function (Builder $query): void {
< $query->where(function (Builder $query): void {
< $provider = $this->getProviderName();
<
< $query->when($provider === config('auth.guards.api.provider'), function (Builder $query): void {
< $query->orWhereNull('provider');
< })->orWhere('provider', $provider);
< });
< });
< });
< }
---
> protected $accessToken;
65c17
< * Get the access token currently associated with the user.
---
> * Get the current access token being used by the user.
67,75c19
< public function token(): ?ScopeAuthorizable
< {
< return $this->currentAccessToken();
< }
<
< /**
< * Get the access token currently associated with the user.
< */
< public function currentAccessToken(): ?ScopeAuthorizable
---
> public function token(): ?TransientToken
85,123c29
< return $this->accessToken && $this->accessToken->can($scope);
< }
<
< /**
< * Determine if the current API token is missing a given scope.
< */
< public function tokenCant(string $scope): bool
< {
< return ! $this->tokenCan($scope);
< }
<
< /**
< * Create a new personal access token for the user.
< *
< * @param string[] $scopes
< */
< public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult
< {
< return app(PersonalAccessTokenFactory::class)->make(
< $this->getAuthIdentifier(), $name, $scopes, $this->getProviderName()
< );
< }
<
< /**
< * Get the user provider name.
< *
< * @throws \LogicException
< */
< public function getProviderName(): string
< {
< $providers = collect(config('auth.guards'))->where('driver', 'passport')->pluck('provider')->all();
<
< foreach (config('auth.providers') as $provider => $config) {
< if (in_array($provider, $providers) && $config['driver'] === 'eloquent' && is_a($this, $config['model'])) {
< return $provider;
< }
< }
<
< throw new LogicException('Unable to determine authentication provider for this model from configuration.');
---
> return $this->accessToken ? $this->accessToken->can($scope) : false;
129c35
< public function withAccessToken(?ScopeAuthorizable $accessToken): static
---
> public function withAccessToken(TransientToken $accessToken): static
root@docker_lamp_1:/home/jiminny# cat vendor/laravel/passport/src/Contracts/OAuthenticatable.php
<?php
namespace Laravel\Passport\Contracts;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Laravel\Passport\PersonalAccessTokenResult;
interface OAuthenticatable extends Authenticatable
{
/**
* Get all the user's registered OAuth applications.
*
* @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, \Illuminate\Foundation\Auth\User>
*/
public function oauthApps(): MorphMany;
/**
* Get all the access tokens for the user.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, \Illuminate\Foundation\Auth\User>
*/
public function tokens(): HasMany;
/**
* Determine if the current API token has a given scope.
*/
public function tokenCan(string $scope): bool;
/**
* Determine if the current API token is missing a given scope.
*/
public function tokenCant(string $scope): bool;
/**
* Create a new personal access token for the user.
*
* @param string[] $scopes
*/
public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult;
/**
* Get the access token currently associated with the user.
*/
public function currentAccessToken(): ?ScopeAuthorizable;
/**
* Set the current access token for the user.
*/
public function withAccessToken(?ScopeAuthorizable $accessToken): static;
/**
* Get the user provider name.
*/
public function getProviderName(): string;
}
root@docker_lamp_1:/home/jiminny# grep -n "use HasApiTokens" app/Models/User.php app/Models/Partner.php app/Traits/HasApiTokens.php
app/Models/User.php:243: use HasApiTokens;
app/Models/Partner.php:78: use HasApiTokens;
root@docker_lamp_1:/home/jiminny#
DOCKER
Close Tab
DEV (docker)
Close Tab
APP (-zsh)
Close Tab
-zsh
Close Tab
screenpipe"
Close Tab
⌥⌘1
DEV (docker)...
|
iTerm2
|
DEV (docker)
|
NULL
|
53845
|
|
53846
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelpDOCKER• 81public function oauthApps(: MorphMany;DEV (docker)DEV (docker)APP (-zsh)*3-zsh• ₴4100% (47 8 Mon 20 Apr 11:30:42T81screenpipe™• ₴5/*** Get all the access tokens for the user.** @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, \Illuminate\Foundation\Auth\User>*/public function tokens(): HasMany;/*** Determine if the current API token has a given scope.*/public function tokenCan(string $scope): bool;/***/* Determine if the current API token is missing a given scope.public function tokenCant(string $scope): bool;/*** Create a new personal access token for the user.** @param string[]Sscopes*/public function createToken(string Sname, array $scopes = O): PersonalAccessTokenResult;/***/* Get the access token currently associated with the user.public function currentAccessToken(): ?ScopeAuthorizable;/***/* Set the current access token for the user.public function withAccessToken(?ScopeAuthorizable SaccessToken): static;/*** Get the user provider name.*/public function getProviderName(): string;}root@docker_lamp_1:/home/jiminny#grep-n "use HasApiTokens" app/Models/User.php app/Models/Partner.php app/Traits/HasApiTokens.phpapp/Models/User.php:243:use HasApiTokens;app/Models/Partner.php:78:use HasApiTokens;root@docker_lamp_1:/home/jiminny#DEV...
|
iTerm2
|
NULL
|
NULL
|
53846
|
|
53847
|
VIeWWinaowrTavsco.sProjecty© Opportunity.php© Part VIeWWinaowrTavsco.sProjecty© Opportunity.php© Participant.php© Partner.php© Permission.phpC Phonenumber.ongPlayoacklneme.ono© Playbook.phpC) Playbookcategorv.php© Playlist.phpC) RateLimit.php© Region.phpC) Role.php© RoleChangeEvent.php(c) Sconegrouo,ono© Session.php(C) SlackBot.oho(C) SocialAccount.oho(C) Stade oho© Task.phpC Team.php© TeamAiContext.php© TeamDomain.php© TeamFeature.php© TeamSettings.php© TextRelay.php© Track.php© TranscriptionModel.php© TranscriptionModelLocale.php© TranscriptionProvider.phpc User.php© UserSettings.php© Vocabulary.phpc) VocabularyPronunciation.php© VoiceAccess.php(c)VolceconsentPrefix.onoNotitications• → Observers> O Policiesv Providers@ ActivitvServiceProvider.ohn@ AniServiceProvider.nhn@ AnnServiceProvider.nhnC) AuthServiceProvider.nhn@ RroadcastServiceProvider.ohn© CalendarServiceProvider.php@ CreateParticipantsServiceProvideC) CrmServiceProvider nhnl© EncryptionServiceProvider.php(c CvontCorvicoDrovidor nhnl© HubspotJournalServiceProvider.p© HubspotWebhookServiceProvideA limC) AooServiceProvider.ongC) AutomatedReport.phonamespace Jiminny Models;liminnu Models VIsenamethod stringl] getRoles() laratrust's annotation* @property int $id* @property mixed Suuidx ocopent scring snamex olooent surind semalt* doroperty string null ssecondary emaz* doroperty string null spassword•doroperty string null sonoto pachGoropertu bool Suses two factor auth•doropertu strinolnuur sauthu 10Gpropertu strinalnulz scountru code• doropertu int.nulz Sregion 1di• doropertu strinalnulz ssecondaru phone• Aoropertu strinalnull Scaller id* Goronentu int nuu sion titie 1di• Aoronentu strinalnull Stwo factor reset code• Goronertu int Steam id• Gorobertu intlnull Sarounidi* Goronertu strinalnull Stimezone* @property string $language* Annonentu ctrinalnull Cconfononco numhen* @property stringlnull $conference_pin* @property string|null $conference_slug* Apropenty string Sconference join preference* Annonentu bool Sconfonenco ¿oin nomindon* doropertu scring sconterence recoraannounce* Apropentu int $conference record preference* doroperty int sconference banawidch* opropertu int sconference start weocam100% S2Mon 20 AOr 11:30.43Security patch review and testing guidanceservice.pnpkouteservicerrovider.ongC) FieldRepository.ongC) Reportcontroller.pnp© Partner.php© User.php X©syncuserrllotcompanyListener.gA67 X1 X7outright wrong! Also, we don't support using the $team argument.This is a real problem. Your custom trait is missing methods that OAuthenticatable nowrequires as part of the intertace contract. Both User and Partner implementOAuthenticatable but your trait doesn truini itrully.What's missing trom your Jiminny Traits \HasApiTokens vs what the intertace requires:MethodIntertace reguiresYour traitoauthAppsMorphManymissingtokens()HasManvmissinetokencant.olboolmissingcreateTokenoPorconalAccoccTokonPocultX missingcurrentAccessTokeno?ScopeAuthorizablemissingwithAccecsTokenO?ScopeAuthorizableA wrong - TransientToken (non-nuladle)nuladle)getProviderNamestringmissingIhe immediate risk is withAccessToken() — rassport internals call this and now pass ?ScopeAuthorizable, but vour signature only accepts a non-nullable TransientToken. Thiswill throw a fatal type error at runtime whenever rassport tries to set or clear the access token.Why it hasn't blown up yet — PHP resolves trait method precedence at class definition time.ana Laravel Passport Hasapilokens isaso use advnemoces Matheuau. so rassoor'sown trait methods may be filling the gaps. Check which trait wins:grep -n "use HasApiTokens" app/Models/User.php app/Models/Partner.php app/Traits Copy# Does User use Jiminny's or Passport's?grep -rn "HasApiTokens" app/Models/User.phpIf User only use s Jiminny\Traits\HasApiTc J :,then oauthApps() , tokens(),createToken.getProviderName.tokenCant.and currentAccessToken areallReplv…Sonnet 4.6 vClaude ic Aland can make mistakes Plosce double-chock recnoncac)...
|
iTerm2
|
NULL
|
NULL
|
53847
|
|
53848
|
iTerm2ShellEdit|ViewSessionScriptsProfilesWindowHe iTerm2ShellEdit|ViewSessionScriptsProfilesWindowHelp100% C47 8 Mon 20 Apr 11:30:43DOCKER₴81public function oauthApps(: MorphMany;DEV (docker)DEV (docker)APP (-zsh)T₴1|*3-zsh• ₴4screenpipe• *5/*** Get all the access tokens for the user.** @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, \Illuminate\Foundation\Auth\User>*/public function tokens(): HasMany;/*** Determine if the current API token has a given scope.*/public function tokenCan(string $scope): bool;/***/* Determine if the current API token is missing a given scope.public function tokenCant(string $scope): bool;/*** Create a new personal access token for the user.** @param string[]Sscopes*/public function createToken(string Sname, array $scopes = O): PersonalAccessTokenResult;/***/* Get the access token currently associated with the user.public function currentAccessToken(): ?ScopeAuthorizable;/***/* Set the current access token for the user.public function withAccessToken(?ScopeAuthorizable SaccessToken): static;/*** Get the user provider name.*/public function getProviderName(): string;}root@docker_lamp_1:/home/jiminny#grep-n "use HasApiTokens" app/Models/User.php app/Models/Partner.php app/Traits/HasApiTokens.phpapp/Models/User.php:243:use HasApiTokens;app/Models/Partner.php:78:use HasApiTokens;root@docker_lamp_1:/home/jiminny# ]DEV...
|
iTerm2
|
NULL
|
NULL
|
53848
|
|
53849
|
root@docker_lamp_1:/home/jiminny# diff \
vendor/ root@docker_lamp_1:/home/jiminny# diff \
vendor/laravel/passport/src/HasApiTokens.php \
app/Traits/HasApiTokens.php
3c3
< namespace Laravel\Passport;
---
> namespace Jiminny\Traits;
5,9c5
< use Illuminate\Database\Eloquent\Builder;
< use Illuminate\Database\Eloquent\Relations\HasMany;
< use Illuminate\Database\Eloquent\Relations\MorphMany;
< use Laravel\Passport\Contracts\ScopeAuthorizable;
< use LogicException;
---
> use Laravel\Passport\TransientToken;
11,13d6
< /**
< * @phpstan-require-implements \Laravel\Passport\Contracts\OAuthenticatable
< */
18,44d10
< */
< protected ?ScopeAuthorizable $accessToken = null;
<
< /**
< * Get all of the user's registered OAuth clients.
< *
< * @deprecated Use oauthApps()
< *
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Client, $this>
< */
< public function clients(): HasMany
< {
< return $this->hasMany(Passport::clientModel(), 'user_id');
< }
<
< /**
< * Get all of the user's registered OAuth applications.
< *
< * @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, $this>
< */
< public function oauthApps(): MorphMany
< {
< return $this->morphMany(Passport::clientModel(), 'owner');
< }
<
< /**
< * Get all of the access tokens for the user.
46c12
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, $this>
---
> * @var Laravel\Passport\TransientToken
48,62c14
< public function tokens(): HasMany
< {
< return $this->hasMany(Passport::tokenModel(), 'user_id', $this->getAuthIdentifierName())
< ->where(function (Builder $query): void {
< $query->whereHas('client', function (Builder $query): void {
< $query->where(function (Builder $query): void {
< $provider = $this->getProviderName();
<
< $query->when($provider === config('auth.guards.api.provider'), function (Builder $query): void {
< $query->orWhereNull('provider');
< })->orWhere('provider', $provider);
< });
< });
< });
< }
---
> protected $accessToken;
65c17
< * Get the access token currently associated with the user.
---
> * Get the current access token being used by the user.
67,75c19
< public function token(): ?ScopeAuthorizable
< {
< return $this->currentAccessToken();
< }
<
< /**
< * Get the access token currently associated with the user.
< */
< public function currentAccessToken(): ?ScopeAuthorizable
---
> public function token(): ?TransientToken
85,123c29
< return $this->accessToken && $this->accessToken->can($scope);
< }
<
< /**
< * Determine if the current API token is missing a given scope.
< */
< public function tokenCant(string $scope): bool
< {
< return ! $this->tokenCan($scope);
< }
<
< /**
< * Create a new personal access token for the user.
< *
< * @param string[] $scopes
< */
< public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult
< {
< return app(PersonalAccessTokenFactory::class)->make(
< $this->getAuthIdentifier(), $name, $scopes, $this->getProviderName()
< );
< }
<
< /**
< * Get the user provider name.
< *
< * @throws \LogicException
< */
< public function getProviderName(): string
< {
< $providers = collect(config('auth.guards'))->where('driver', 'passport')->pluck('provider')->all();
<
< foreach (config('auth.providers') as $provider => $config) {
< if (in_array($provider, $providers) && $config['driver'] === 'eloquent' && is_a($this, $config['model'])) {
< return $provider;
< }
< }
<
< throw new LogicException('Unable to determine authentication provider for this model from configuration.');
---
> return $this->accessToken ? $this->accessToken->can($scope) : false;
129c35
< public function withAccessToken(?ScopeAuthorizable $accessToken): static
---
> public function withAccessToken(TransientToken $accessToken): static
root@docker_lamp_1:/home/jiminny# cat vendor/laravel/passport/src/Contracts/OAuthenticatable.php
<?php
namespace Laravel\Passport\Contracts;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Laravel\Passport\PersonalAccessTokenResult;
interface OAuthenticatable extends Authenticatable
{
/**
* Get all the user's registered OAuth applications.
*
* @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, \Illuminate\Foundation\Auth\User>
*/
public function oauthApps(): MorphMany;
/**
* Get all the access tokens for the user.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, \Illuminate\Foundation\Auth\User>
*/
public function tokens(): HasMany;
/**
* Determine if the current API token has a given scope.
*/
public function tokenCan(string $scope): bool;
/**
* Determine if the current API token is missing a given scope.
*/
public function tokenCant(string $scope): bool;
/**
* Create a new personal access token for the user.
*
* @param string[] $scopes
*/
public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult;
/**
* Get the access token currently associated with the user.
*/
public function currentAccessToken(): ?ScopeAuthorizable;
/**
* Set the current access token for the user.
*/
public function withAccessToken(?ScopeAuthorizable $accessToken): static;
/**
* Get the user provider name.
*/
public function getProviderName(): string;
}
root@docker_lamp_1:/home/jiminny# grep -n "use HasApiTokens" app/Models/User.php app/Models/Partner.php app/Traits/HasApiTokens.php
app/Models/User.php:243: use HasApiTokens;
app/Models/Partner.php:78: use HasApiTokens;
root@docker_lamp_1:/home/jiminny#
DOCKER
Close Tab
DEV (docker)
Close Tab
APP (-zsh)
Close Tab
-zsh
Close Tab
screenpipe"
Close Tab
⌥⌘1
DEV (docker)...
|
iTerm2
|
DEV (docker)
|
NULL
|
53849
|
|
53850
|
root@docker_lamp_1:/home/jiminny# diff \
vendor/ root@docker_lamp_1:/home/jiminny# diff \
vendor/laravel/passport/src/HasApiTokens.php \
app/Traits/HasApiTokens.php
3c3
< namespace Laravel\Passport;
---
> namespace Jiminny\Traits;
5,9c5
< use Illuminate\Database\Eloquent\Builder;
< use Illuminate\Database\Eloquent\Relations\HasMany;
< use Illuminate\Database\Eloquent\Relations\MorphMany;
< use Laravel\Passport\Contracts\ScopeAuthorizable;
< use LogicException;
---
> use Laravel\Passport\TransientToken;
11,13d6
< /**
< * @phpstan-require-implements \Laravel\Passport\Contracts\OAuthenticatable
< */
18,44d10
< */
< protected ?ScopeAuthorizable $accessToken = null;
<
< /**
< * Get all of the user's registered OAuth clients.
< *
< * @deprecated Use oauthApps()
< *
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Client, $this>
< */
< public function clients(): HasMany
< {
< return $this->hasMany(Passport::clientModel(), 'user_id');
< }
<
< /**
< * Get all of the user's registered OAuth applications.
< *
< * @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, $this>
< */
< public function oauthApps(): MorphMany
< {
< return $this->morphMany(Passport::clientModel(), 'owner');
< }
<
< /**
< * Get all of the access tokens for the user.
46c12
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, $this>
---
> * @var Laravel\Passport\TransientToken
48,62c14
< public function tokens(): HasMany
< {
< return $this->hasMany(Passport::tokenModel(), 'user_id', $this->getAuthIdentifierName())
< ->where(function (Builder $query): void {
< $query->whereHas('client', function (Builder $query): void {
< $query->where(function (Builder $query): void {
< $provider = $this->getProviderName();
<
< $query->when($provider === config('auth.guards.api.provider'), function (Builder $query): void {
< $query->orWhereNull('provider');
< })->orWhere('provider', $provider);
< });
< });
< });
< }
---
> protected $accessToken;
65c17
< * Get the access token currently associated with the user.
---
> * Get the current access token being used by the user.
67,75c19
< public function token(): ?ScopeAuthorizable
< {
< return $this->currentAccessToken();
< }
<
< /**
< * Get the access token currently associated with the user.
< */
< public function currentAccessToken(): ?ScopeAuthorizable
---
> public function token(): ?TransientToken
85,123c29
< return $this->accessToken && $this->accessToken->can($scope);
< }
<
< /**
< * Determine if the current API token is missing a given scope.
< */
< public function tokenCant(string $scope): bool
< {
< return ! $this->tokenCan($scope);
< }
<
< /**
< * Create a new personal access token for the user.
< *
< * @param string[] $scopes
< */
< public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult
< {
< return app(PersonalAccessTokenFactory::class)->make(
< $this->getAuthIdentifier(), $name, $scopes, $this->getProviderName()
< );
< }
<
< /**
< * Get the user provider name.
< *
< * @throws \LogicException
< */
< public function getProviderName(): string
< {
< $providers = collect(config('auth.guards'))->where('driver', 'passport')->pluck('provider')->all();
<
< foreach (config('auth.providers') as $provider => $config) {
< if (in_array($provider, $providers) && $config['driver'] === 'eloquent' && is_a($this, $config['model'])) {
< return $provider;
< }
< }
<
< throw new LogicException('Unable to determine authentication provider for this model from configuration.');
---
> return $this->accessToken ? $this->accessToken->can($scope) : false;
129c35
< public function withAccessToken(?ScopeAuthorizable $accessToken): static
---
> public function withAccessToken(TransientToken $accessToken): static
root@docker_lamp_1:/home/jiminny# cat vendor/laravel/passport/src/Contracts/OAuthenticatable.php
<?php
namespace Laravel\Passport\Contracts;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Laravel\Passport\PersonalAccessTokenResult;
interface OAuthenticatable extends Authenticatable
{
/**
* Get all the user's registered OAuth applications.
*
* @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, \Illuminate\Foundation\Auth\User>
*/
public function oauthApps(): MorphMany;
/**
* Get all the access tokens for the user.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, \Illuminate\Foundation\Auth\User>
*/
public function tokens(): HasMany;
/**
* Determine if the current API token has a given scope.
*/
public function tokenCan(string $scope): bool;
/**
* Determine if the current API token is missing a given scope.
*/
public function tokenCant(string $scope): bool;
/**
* Create a new personal access token for the user.
*
* @param string[] $scopes
*/
public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult;
/**
* Get the access token currently associated with the user.
*/
public function currentAccessToken(): ?ScopeAuthorizable;
/**
* Set the current access token for the user.
*/
public function withAccessToken(?ScopeAuthorizable $accessToken): static;
/**
* Get the user provider name.
*/
public function getProviderName(): string;
}
root@docker_lamp_1:/home/jiminny# grep -n "use HasApiTokens" app/Models/User.php app/Models/Partner.php app/Traits/HasApiTokens.php
app/Models/User.php:243: use HasApiTokens;
app/Models/Partner.php:78: use HasApiTokens;
root@docker_lamp_1:/home/jiminny#
DOCKER
Close Tab
DEV (docker)
Close Tab
APP (-zsh)
Close Tab
-zsh
Close Tab
screenpipe"
Close Tab
⌥⌘1
DEV (docker)...
|
iTerm2
|
DEV (docker)
|
NULL
|
53850
|
|
53851
|
root@docker_lamp_1:/home/jiminny# diff \
vendor/ root@docker_lamp_1:/home/jiminny# diff \
vendor/laravel/passport/src/HasApiTokens.php \
app/Traits/HasApiTokens.php
3c3
< namespace Laravel\Passport;
---
> namespace Jiminny\Traits;
5,9c5
< use Illuminate\Database\Eloquent\Builder;
< use Illuminate\Database\Eloquent\Relations\HasMany;
< use Illuminate\Database\Eloquent\Relations\MorphMany;
< use Laravel\Passport\Contracts\ScopeAuthorizable;
< use LogicException;
---
> use Laravel\Passport\TransientToken;
11,13d6
< /**
< * @phpstan-require-implements \Laravel\Passport\Contracts\OAuthenticatable
< */
18,44d10
< */
< protected ?ScopeAuthorizable $accessToken = null;
<
< /**
< * Get all of the user's registered OAuth clients.
< *
< * @deprecated Use oauthApps()
< *
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Client, $this>
< */
< public function clients(): HasMany
< {
< return $this->hasMany(Passport::clientModel(), 'user_id');
< }
<
< /**
< * Get all of the user's registered OAuth applications.
< *
< * @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, $this>
< */
< public function oauthApps(): MorphMany
< {
< return $this->morphMany(Passport::clientModel(), 'owner');
< }
<
< /**
< * Get all of the access tokens for the user.
46c12
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, $this>
---
> * @var Laravel\Passport\TransientToken
48,62c14
< public function tokens(): HasMany
< {
< return $this->hasMany(Passport::tokenModel(), 'user_id', $this->getAuthIdentifierName())
< ->where(function (Builder $query): void {
< $query->whereHas('client', function (Builder $query): void {
< $query->where(function (Builder $query): void {
< $provider = $this->getProviderName();
<
< $query->when($provider === config('auth.guards.api.provider'), function (Builder $query): void {
< $query->orWhereNull('provider');
< })->orWhere('provider', $provider);
< });
< });
< });
< }
---
> protected $accessToken;
65c17
< * Get the access token currently associated with the user.
---
> * Get the current access token being used by the user.
67,75c19
< public function token(): ?ScopeAuthorizable
< {
< return $this->currentAccessToken();
< }
<
< /**
< * Get the access token currently associated with the user.
< */
< public function currentAccessToken(): ?ScopeAuthorizable
---
> public function token(): ?TransientToken
85,123c29
< return $this->accessToken && $this->accessToken->can($scope);
< }
<
< /**
< * Determine if the current API token is missing a given scope.
< */
< public function tokenCant(string $scope): bool
< {
< return ! $this->tokenCan($scope);
< }
<
< /**
< * Create a new personal access token for the user.
< *
< * @param string[] $scopes
< */
< public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult
< {
< return app(PersonalAccessTokenFactory::class)->make(
< $this->getAuthIdentifier(), $name, $scopes, $this->getProviderName()
< );
< }
<
< /**
< * Get the user provider name.
< *
< * @throws \LogicException
< */
< public function getProviderName(): string
< {
< $providers = collect(config('auth.guards'))->where('driver', 'passport')->pluck('provider')->all();
<
< foreach (config('auth.providers') as $provider => $config) {
< if (in_array($provider, $providers) && $config['driver'] === 'eloquent' && is_a($this, $config['model'])) {
< return $provider;
< }
< }
<
< throw new LogicException('Unable to determine authentication provider for this model from configuration.');
---
> return $this->accessToken ? $this->accessToken->can($scope) : false;
129c35
< public function withAccessToken(?ScopeAuthorizable $accessToken): static
---
> public function withAccessToken(TransientToken $accessToken): static
root@docker_lamp_1:/home/jiminny# cat vendor/laravel/passport/src/Contracts/OAuthenticatable.php
<?php
namespace Laravel\Passport\Contracts;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Laravel\Passport\PersonalAccessTokenResult;
interface OAuthenticatable extends Authenticatable
{
/**
* Get all the user's registered OAuth applications.
*
* @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, \Illuminate\Foundation\Auth\User>
*/
public function oauthApps(): MorphMany;
/**
* Get all the access tokens for the user.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, \Illuminate\Foundation\Auth\User>
*/
public function tokens(): HasMany;
/**
* Determine if the current API token has a given scope.
*/
public function tokenCan(string $scope): bool;
/**
* Determine if the current API token is missing a given scope.
*/
public function tokenCant(string $scope): bool;
/**
* Create a new personal access token for the user.
*
* @param string[] $scopes
*/
public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult;
/**
* Get the access token currently associated with the user.
*/
public function currentAccessToken(): ?ScopeAuthorizable;
/**
* Set the current access token for the user.
*/
public function withAccessToken(?ScopeAuthorizable $accessToken): static;
/**
* Get the user provider name.
*/
public function getProviderName(): string;
}
root@docker_lamp_1:/home/jiminny# grep -n "use HasApiTokens" app/Models/User.php app/Models/Partner.php app/Traits/HasApiTokens.php
app/Models/User.php:243: use HasApiTokens;
app/Models/Partner.php:78: use HasApiTokens;
root@docker_lamp_1:/home/jiminny# # Does User use Jiminny's or Passport's?
grep -rn "HasApiTokens" app/Models/User.php
43:use Laravel\Passport\HasApiTokens;
243: use HasApiTokens;
root@docker_lamp_1:/home/jiminny#
DOCKER
Close Tab
DEV (docker)
Close Tab
APP (-zsh)
Close Tab
-zsh
Close Tab
screenpipe"
Close Tab
⌥⌘1
DEV (docker)...
|
iTerm2
|
DEV (docker)
|
NULL
|
53851
|
|
53852
|
root@docker_lamp_1:/home/jiminny# diff \
vendor/ root@docker_lamp_1:/home/jiminny# diff \
vendor/laravel/passport/src/HasApiTokens.php \
app/Traits/HasApiTokens.php
3c3
< namespace Laravel\Passport;
---
> namespace Jiminny\Traits;
5,9c5
< use Illuminate\Database\Eloquent\Builder;
< use Illuminate\Database\Eloquent\Relations\HasMany;
< use Illuminate\Database\Eloquent\Relations\MorphMany;
< use Laravel\Passport\Contracts\ScopeAuthorizable;
< use LogicException;
---
> use Laravel\Passport\TransientToken;
11,13d6
< /**
< * @phpstan-require-implements \Laravel\Passport\Contracts\OAuthenticatable
< */
18,44d10
< */
< protected ?ScopeAuthorizable $accessToken = null;
<
< /**
< * Get all of the user's registered OAuth clients.
< *
< * @deprecated Use oauthApps()
< *
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Client, $this>
< */
< public function clients(): HasMany
< {
< return $this->hasMany(Passport::clientModel(), 'user_id');
< }
<
< /**
< * Get all of the user's registered OAuth applications.
< *
< * @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, $this>
< */
< public function oauthApps(): MorphMany
< {
< return $this->morphMany(Passport::clientModel(), 'owner');
< }
<
< /**
< * Get all of the access tokens for the user.
46c12
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, $this>
---
> * @var Laravel\Passport\TransientToken
48,62c14
< public function tokens(): HasMany
< {
< return $this->hasMany(Passport::tokenModel(), 'user_id', $this->getAuthIdentifierName())
< ->where(function (Builder $query): void {
< $query->whereHas('client', function (Builder $query): void {
< $query->where(function (Builder $query): void {
< $provider = $this->getProviderName();
<
< $query->when($provider === config('auth.guards.api.provider'), function (Builder $query): void {
< $query->orWhereNull('provider');
< })->orWhere('provider', $provider);
< });
< });
< });
< }
---
> protected $accessToken;
65c17
< * Get the access token currently associated with the user.
---
> * Get the current access token being used by the user.
67,75c19
< public function token(): ?ScopeAuthorizable
< {
< return $this->currentAccessToken();
< }
<
< /**
< * Get the access token currently associated with the user.
< */
< public function currentAccessToken(): ?ScopeAuthorizable
---
> public function token(): ?TransientToken
85,123c29
< return $this->accessToken && $this->accessToken->can($scope);
< }
<
< /**
< * Determine if the current API token is missing a given scope.
< */
< public function tokenCant(string $scope): bool
< {
< return ! $this->tokenCan($scope);
< }
<
< /**
< * Create a new personal access token for the user.
< *
< * @param string[] $scopes
< */
< public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult
< {
< return app(PersonalAccessTokenFactory::class)->make(
< $this->getAuthIdentifier(), $name, $scopes, $this->getProviderName()
< );
< }
<
< /**
< * Get the user provider name.
< *
< * @throws \LogicException
< */
< public function getProviderName(): string
< {
< $providers = collect(config('auth.guards'))->where('driver', 'passport')->pluck('provider')->all();
<
< foreach (config('auth.providers') as $provider => $config) {
< if (in_array($provider, $providers) && $config['driver'] === 'eloquent' && is_a($this, $config['model'])) {
< return $provider;
< }
< }
<
< throw new LogicException('Unable to determine authentication provider for this model from configuration.');
---
> return $this->accessToken ? $this->accessToken->can($scope) : false;
129c35
< public function withAccessToken(?ScopeAuthorizable $accessToken): static
---
> public function withAccessToken(TransientToken $accessToken): static
root@docker_lamp_1:/home/jiminny# cat vendor/laravel/passport/src/Contracts/OAuthenticatable.php
<?php
namespace Laravel\Passport\Contracts;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Laravel\Passport\PersonalAccessTokenResult;
interface OAuthenticatable extends Authenticatable
{
/**
* Get all the user's registered OAuth applications.
*
* @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, \Illuminate\Foundation\Auth\User>
*/
public function oauthApps(): MorphMany;
/**
* Get all the access tokens for the user.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, \Illuminate\Foundation\Auth\User>
*/
public function tokens(): HasMany;
/**
* Determine if the current API token has a given scope.
*/
public function tokenCan(string $scope): bool;
/**
* Determine if the current API token is missing a given scope.
*/
public function tokenCant(string $scope): bool;
/**
* Create a new personal access token for the user.
*
* @param string[] $scopes
*/
public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult;
/**
* Get the access token currently associated with the user.
*/
public function currentAccessToken(): ?ScopeAuthorizable;
/**
* Set the current access token for the user.
*/
public function withAccessToken(?ScopeAuthorizable $accessToken): static;
/**
* Get the user provider name.
*/
public function getProviderName(): string;
}
root@docker_lamp_1:/home/jiminny# grep -n "use HasApiTokens" app/Models/User.php app/Models/Partner.php app/Traits/HasApiTokens.php
app/Models/User.php:243: use HasApiTokens;
app/Models/Partner.php:78: use HasApiTokens;
root@docker_lamp_1:/home/jiminny# # Does User use Jiminny's or Passport's?
grep -rn "HasApiTokens" app/Models/User.php
43:use Laravel\Passport\HasApiTokens;
243: use HasApiTokens;
root@docker_lamp_1:/home/jiminny#
DOCKER
Close Tab
DEV (docker)
Close Tab
APP (-zsh)
Close Tab
-zsh
Close Tab
screenpipe"
Close Tab
⌥⌘1
DEV (docker)...
|
iTerm2
|
DEV (docker)
|
NULL
|
53852
|
|
53853
|
iTerm2•ShellEditViewSessionScriptsProfilesWindowHe iTerm2•ShellEditViewSessionScriptsProfilesWindowHelpDOCKER381DEV (docker)$82DEV (docker)APP (-zsh)|*3-zsh@return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, \Illuminate\Foundation\Auth\User>*/public function tokens(: HasMany;/***/* Determine if the current API token has a given scope.public function tokenCan(string $scope): bool;/***/* Determine if the current API token is missing a given scope.public function tokenCant(string $scope): bool;/*** Create a new personal access token for the user.** @paramstring[] Sscopes*/public function createToken(string Sname, array $scopes = []): PersonalAccessTokenResult;/*** Get the access token currently associated with the user.*/public function currentAccessToken®: ?ScopeAuthorizable;/***/* Set the current access token for the user.public function withAccessToken(?ScopeAuthorizable SaccessToken): static;/*** Get the user provider name.*/public function getProviderName(: string;rootedocker_1amp_1:/home/jiminny# grep -n "use HasApiTokens" app/Models/User.php app/Models/Partner.php app/Traits/HasApiTokens.phpapp/Models/User.php:243:app/ModeLs/Part.er. Php: 78: Usese HaSApiTokens;root@docker_lamp_1:/home/jiminny# # Does User use Jiminny's or Passport's?grep -rn "HasApiTokens" app/Models/User.php43:use Laravel\Passport\HasApiTokens;243:use HasApiTokens;root@docker_lamp_1:/home/jiminny#• ₴4100% 0 8Mon 20 Apr 11:30:58T81screenpipe"*,- *5DEV...
|
iTerm2
|
NULL
|
NULL
|
53853
|
|
53854
|
FV faVsco.js?9 masterProledey© Opportunity.php© Pa FV faVsco.js?9 masterProledey© Opportunity.php© Participant.php© Partner.php© Permission.phpC Phonenumber.ongc) Playoacklneme.ono© Playbook.phpC) Playbookcategorv.php© Playlist.phpC) RateLimit.php© Region.phpC) Role.php@ RoleChangeEvent.ohpc) ScoveGrouo.ono© Session.php(C) SlackBot.oho(C) SocialAccount.oho(C) Stade oho© Task.phpC Team.php© TeamAiContext.php© TeamDomain.php© TeamFeature.php© TeamSettings.php© TextRelay.php© Track.php© TranscriptionModel.php© TranscriptionModelLocale.php© TranscriptionProvider.phpc User.php© UserSettings.php© Vocabulary.phpc) VocabularyPronunciation.php© VoiceAccess.php(c)VolceconsentPrefix.onoNotitications• → Observers> O Policiesv Providers@ ActivitvServiceProvider.ohn@ AniServiceProvider.nhn@ AnnServiceProvider.nhnC) AuthServiceProvider.nhn@ RroadcastServiceProvider.ohn© CalendarServiceProvider.php© CreateParticipantsServiceProvideC) CrmServiceProvider nhnl© EncryptionServiceProvider.php(c CvontCorvicoDrovidor nhnl© HubspotJournalServiceProvider.p© HubspotWebhookServiceProvideA limC) AooServiceProvider.ongC) AutomatedReport.phonamespace Jiminny Models;liminnu Models VIsenamethod stringl] getRoles() laratrust's annotation* @property int $id* @property mixed Suuidx ocopent scring snamex olooent surind semalt* doroperty string null ssecondary emaz* doroperty string null spassword•doroperty string null sohoto pachiGoropertu bool Suses two factor authl•doropertu strinolnuur sauthu 10Gpropertu strinalnulz scountru code• doropertu int.nulz Sregion 1di• doropertu strinalnulz ssecondaru phone• Aoropertu strinalnull Scaller id• coronentu int nuu sion title 1di• Aoronentu strinalnull Stwo facton reset code• Goronertu int Steam id• Gorobertu intlnull Sarounidi* Goronertu strinalnull Stimezone* Oproperty string $language* Annonentu ctrinalnull Cconfononco numhon* @property stringlnull $conference_pin* @property string|null $conference_slug* Apropenty string Sconference join preference* Annonentu bool Sconfonenco ¿oin nomindon* doropertu scring sconterence recoraannounce* Apropentu int $conference record preference* doroperty int sconference banawidch* opropertu int sconference start weocamMOn ZU AOr 11:30.service.pnp© RouteServiceProvider.phpC) FieldRepository.ongC) Reportcontroller.pnp© Partner.php© User.php X©syncuserrllotcompanyListener.gA67 X1 X7outright wrong! Also, we don't support using the $team argument.Security patch review and testing guidancecreatel okenolPersonalAccessokenkesultmissingcurrentAccessToken?ScopeAuthorizablemissingw1chaccesslokeno?ScopeAuthorizable(nullable)wrong— Iransiencloken non-nullable)getProviderNameOsuringmissmneThe immediate risk is withAccessToken — Passport internals call this and now pass ?Sconeruthorizable bui vour sionaure onv accenisanon-nulllabe Transtentiloken.juniswill throw a fatal type error at runtime whenever Passport tries to set or clear the access token.Why it hasn't blown up vet — PHP resolves trait method precedence at class definition timeand Laravel \Passport HasApiTokens isalso use dby the models (via the trait), so Passport'sown trait methods may be filling the gaps. Check which trait wins:grep -n "use HasApiTokens" app/Models/User.php app/Models/Partner.php app/Traits/HasAp# Does User use Jiminnv's or Passport's?grep -rn "HasApiTokens" app/Models/User.phpIf User only uses Jiminny Traits HasApiTokens,then oauthApps, tokens.createloken), getProviderName(), tokenCant() ,and currentAccessloken() areallmissing at runtime — the interface contract is broken. Ifit use s Passport's directly too, there'sarralr cont icrThe fix - your custom trait should not exist as a standalone override. Either:1. Delete Jiminny Traits HasApiTokens anduse Laravel Passport HasApiTokenscirectvin bot models.of2. If vou need the custom token() return type hint. extend via the model directly ratherthan a competing traitGiven the PR is already merged, check if any auth flows are actually failing right now by hittingPOST loauth/token with a real client credentials or password grant request in vour local envbefore this reaches staging production.0Replv…CannotAh...
|
iTerm2
|
NULL
|
NULL
|
53854
|
|
53855
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelp100% C47 8 Mon 20 Apr 11:30:59DOCKER381DEV (docker)$82DEV (docker)APP (-zsh)|83-zsh@return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, \Illuminate\Foundation\Auth\User>*/public function tokens(: HasMany;/***/* Determine if the current API token has a given scope.public function tokenCan(string $scope): bool;/***/* Determine if the current API token is missing a given scope.public function tokenCant(string $scope): bool;/*** Create a new personal access token for the user.* @paramstring[] Sscopes*/public function createToken(string Sname, array $scopes = []): PersonalAccessTokenResult;/*** Get the access token currently associated with the user.*/public function currentAccessToken(: ?ScopeAuthorizable;/***/* Set the current access token for the user.public function withAccessToken(?ScopeAuthorizable SaccessToken): static;/*** Get the user provider name.*/public function getProviderName(: string;rootedocker_1amp_1:/home/jiminny# grep -n "use HasApiTokens" app/Models/User.php app/Models/Partner.php app/Traits/HasApiTokens.phpapp/Models/User.php:243:app/Models/Part,Pr.P2p:78: use HasasApiTonens;root@docker_lamp_1:/home/jiminny# # Does User use Jiminny's or Passport's?grep -rn "HasApiTokens" app/Models/User.php43:use Laravel\Passport\HasApiTokens;243:use HasApiTokens;root@docker_lamp_1:/home/jiminny# l• ₴4screenpipe"T₴1|**- 85DEV...
|
iTerm2
|
NULL
|
NULL
|
53855
|
|
53856
|
VIeWWinaowrTavsco.sProjecty© Opportunity.php© Part VIeWWinaowrTavsco.sProjecty© Opportunity.php© Participant.php© Partner.php© Permission.phpC Phonenumber.ongPlayoacklneme.ono© Playbook.phpC) Playbookcategorv.php©Playlist.phpC) RateLimit.php© Region.phpC) Role.php©RoleChangeEvent.phpc) ScoveGrouo.ono© Session.php(C) SlackBot.oho© SocialAccount.php© Stage.php© Taskphp© Team.php© TeamAiContext.php© TeamDomain.php© TeamFeature.php© TeamSettings.php© TextRelay.php© Track.php© TranscriptionModel.php© TranscriptionModelLocale.php© TranscriptionProvider.phpc User.php© UserSettings.php© Vocabulary.phpc) VocabularyPronunciation.php© VoiceAccess.php(c)VolceconsentPrefix.onoNotitications• → Observers> Eo Policiesv Providers©ActivityServiceProvider.php@ AniServiceProvider.nhn© AppServiceProvider.phpC) AuthServiceProvider.nhn© BroadcastServiceProvider.php© CalendarServiceProvider.php© CreateParticipantsServiceProvide(C) CrmServiceProvider.nhn© EncryptionServiceProvider.php© EventServiceProvider.php© HubspotJournalServiceProvider.p© HubspotWebhookServiceProviderA limiAppServiceProvider.phpC) AutomatedReport.phonamespace Jiminny \Models;Jiminny \Models\Useramethod string[] getRoles() laratrust's annotation* @property int $id ]* @property mixed $uvidx ocopent scring snamex olooent surind semalt* doroperty string null ssecondaryemaz* doroperty string null spassword•doroperty string null sonoto pachAproperty bool $uses_two_factor_auth•doropertu strinolnuur sauthu 10@property string|null $country_code• doropertu int nulz Sregion 1di• doropertu strinalnulz ssecondaru phone@property string|null $caller_id* Goronentu int nuu sion titie 1di@property string|null $two_factor_reset_code• Goronertu int Steam id@property int|null $group_id* @property string|null $timezone* @property string $language* @property string|null $conference_number* @property string|null $conference_pin* @property string|null $conference_slug* @property string $conference_join_preference* Anropertu bool Sconference join reminder |* doroperty scring sconterence recora announce* @property int Sconference_record_preference* doroperty int sconference banawidch* opropertu int sconference start weocam100% LzMon ZUAOr 11.31.00service.pnp© Partner.phpouseronpx© ReportController.php©syncuserrllotcompanyListener.gA67 X1 X7outright wrong! Also, we don't support using the $team argument.Security patch review and testing guidancecreatel okenolPersonalAccessokenkesultmissingcurrentAccessToken()w1chaccesslokeno?ScopeAuthorizable?ScopeAuthorizable(nullable)missingwrong— Iransiencloken non-nullable)getProviderName()suringmissmneThe immediate risk is withAccessToken() - Passport internals call this and now pass?Sconeruthorizable bui vour sionaure onv accenisanon-nulllabe Transtentiloken.juniswill throw a fatal type error at runtime whenever Passport tries to set or clear the access token.Why it hasn't blown up yet — PHP resolves trait method precedence at class definition time,and Laravel\Passport\HasApiTokens is also use d by the models (via the trait), so Passport'sown trait methods may be filling the gaps. Check which trait wins:grep -n "use HasApiTokens" app/Models/User.php app/Models/Partner.php app/Traits/HasAp# Does User use Jiminny's or Passport's?grep -rn "HasApiTokens" app/Models/User.phpIf User only use s Jiminny\Traits\HasApiTokens, then oauthApps(), tokens(),createloken), getProviderName(), tokenCant) ,and currentAccesstoken areallmissing at runtime — the interface contract is broken. If it use s Passport's directly too, there'sarralr cont icr.The fix - your custom trait should not exist as a standalone override. Either:1. Delete Jiminny\Traits\HasApiTokens and use Laravel\Passport\HasApiTokensdirectly in both models, or2. If you need the custom token () return type hint, extend via the model directly ratherhen ssamnhtinntunt.root@docker_lamp_1:/home/jiminny# grep-n "use HasApiTokens" app/Models/User.phpapp/Models/Partner.php app/Traits/HasApiTokens.php20o Mode s/userono:4c: use HasAoillokens:app/Models/Partner.php:78: use HasApiTokens;root@docker_lamp_1:/home/iminny# # Does User use Jiminny's or Passport's?grep-rn "HasApiTokens" app/Models/User.php43:use Laravel|Passport\HasApiTokens;243: use HasApiTokens;root@docker_larfp_1:/home/jiminny#CannotAh...
|
iTerm2
|
NULL
|
NULL
|
53856
|
|
53857
|
iTerm2ShellEdit|ViewSessionScriptsProfilesWindowHe iTerm2ShellEdit|ViewSessionScriptsProfilesWindowHelp100% C47 8 Mon 20 Apr 11:31:10DOCKER₴81DEV (docker)$82DEV (docker)APP (-zsh)|83-zsh@return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, \Illuminate\Foundation\Auth\User>*/public function tokens(: HasMany;/***/* Determine if the current API token has a given scope.public function tokenCan(string $scope): bool;/***/* Determine if the current API token is missing a given scope.public function tokenCant(string $scope): bool;/*** Create a new personal access token for the user.** @paramstring[] Sscopes*/public function createToken(string Sname, array $scopes = []): PersonalAccessTokenResult;/*** Get the access token currently associated with the user.*/public function currentAccessToken(: ?ScopeAuthorizable;/***/* Set the current access token for the user.public function withAccessToken(?ScopeAuthorizable SaccessToken): static;/*** Get the user provider name.*/public function getProviderName(: string;rootedocker_1amp_1:/home/jiminny# grep -n "use HasApiTokens" app/Models/User.php app/Models/Partner.php app/Traits/HasApiTokens.phpapp/Models/User.php:243:app/Models/Part,Pr.P2p:78: use HasasApiTonens;root@docker_lamp_1:/home/jiminny# # Does User use Jiminny's or Passport's?grep -rn "HasApiTokens" app/Models/User.php43:use Laravel\Passport\HasApiTokens;243:use HasApiTokens;root@docker_lamp_1:/home/jiminny# l• *4screenpipe"• *5DEV...
|
iTerm2
|
NULL
|
NULL
|
53857
|
|
53858
|
VIeWWinaowrTavsco.sProject© Opportunity.php© Parti VIeWWinaowrTavsco.sProject© Opportunity.php© Participant.php© Partner.php© Permission.phpC Phonenumber.ongPlayoacklneme.ono© Playbook.phpC) Playbookcategorv.php©Playlist.phpC) RateLimit.php© Region.phpC) Role.php©RoleChangeEvent.php(c) Sconegrouo,ono© Session.php(C) SlackBot.oho© SocialAccount.php© Stage.php© Taskphp© Team.php© TeamAiContext.php© TeamDomain.php© TeamFeature.php© TeamSettings.php© TextRelay.php© Track.php© TranscriptionModel.php© TranscriptionModelLocale.php© TranscriptionProvider.phpc User.php© UserSettings.php© Vocabulary.phpc) VocabularyPronunciation.php© VoiceAccess.php(c)VolceconsentPrefix.onoNotitications• → Observers> Eo Policiesv Providers©ActivityServiceProvider.php@ AniServiceProvider.nhn© AppServiceProvider.phpC) AuthServiceProvider.nhn©BroadcastServiceProvider.php© CalendarServiceProvider.php© CreateParticipantsServiceProvideC) CrmServiceProvider nhnl© EncryptionServiceProvider.php© EventServiceProvider.php© HubspotJournalServiceProvider.p© HubspotWebhookServiceProviderA limiAppServiceProvider.phpC) AutomatedReport.phonamespace Jiminny \Models;Jiminny \Models\Useramethod string[] getRoles() laratrust's annotation* @property int $id ]* @property mixed $uvidx ocopent scring snamex olooent surind semalt* doroperty string null ssecondary emaz* doroperty string null spassword•doroperty string null sonoto pachAproperty bool $uses_two_factor_auth•doropertu strinolnuur sauthu 10@property string|null $country_code• doropertu int.nulz Sregion 1di• doropertu strinalnulz ssecondaru phone@property string|null $caller_id* Goronentu int nuu sion titie 1di@property string|null $two_factor_reset_code• Goronertu int Steam id@property int|null $group_id* @property string|null $timezone* @property string $language* @property string|null $conference_number* @property string|null $conference_pin* @property string|null $conference_slug* @property string $conference_join_preference* Anropertu bool Sconference join reminder |* doropertu scring sconterence recoraannounce* @property int Sconference_record_preference* doroperty int sconference banawidch* opropertu int sconference start weocam100% LzMon ZUAOr 11.31.10service.pnpkouteservicerrovider.ong© Partner.php© ReportController.php© User.phpx©syncuserrllotcompanyListener.gA67 X1 X7Security patch review and testing guidancewill throw a ratal type error at runtime whenever rassport tries to set or clear the access token.Why it hasn't blown up yet — PHP resolves trait method precedence at class definition time,ana Laravel \Passport\HasAp1lokens Isalso use a Dy the models (via the trait), so rassport'sown trait methods may be filling the gaps. Check which trait wins:bashgrep -n "use HasApiTokens" app/Models/User.php app/Models/Partner.php app/Traits/HasApoutright wrong! Also, we don't support using the $team argument.# Does User use Jiminny's or Passport's?grep -rn "HasApiTokens" app/Models/User.phpIf User only uses Jiminny\Traits\HasApiTokens,then oauthApps(), tokens(),createToken() , getProviderName(), tokenCant() , and currentAccessToken() areallmissing at runtime — the interface contract is broken. If1t use s lassport's directly too, there'sa trait conflict.The fix - your custom trait should not exist as a standalone override. Either:1. Delete Jiminny\Traits\HasApiTokens anduse Laravel\Passport\HasApiTokensdirectly in both models, or2. If you need the custom token ()) return type hint, extend via the model directly ratherthan a competing traitGiven the PR is alreadv merged. check if anv auth flows are actually failing right now bv hittingPOST /oauth/token with a real client credentials or password grant request in your local envbefore this reaches staging/production.root@docker_lamp_1:/home/jiminny# grep-n "use HasApiTokens" app/Models/User.phpapp/Models/Partner.php app/Traits/HasApiTokens.php20o Mode s/userono:4c: use HasAoillokens:app/Models/Partner.php:78: use HasApiTokens;root@docker_lamp_1:/home/fiminny# # Does User use Jiminny's or Passport's?grep-rn "HasApiTokens" app/Models/User.php43:use Laravel|Passport\HasApiTokens;243: use HasApiTokens;root@docker_lamp_1:/home/jiminny#Sonnet 4.6...
|
iTerm2
|
NULL
|
NULL
|
53858
|
|
53859
|
VIewWindowrTavsco.sProject© Opportunity.php© Parti VIewWindowrTavsco.sProject© Opportunity.php© Participant.php© Partner.php© Permission.phpC Phonenumber.ongc) Playoacklneme.ono© Playbook.phpC) Playbookcategorv.php© Playlist.phpC) RateLimit.php© Region.phpC) Role.php© RoleChangeEvent.phpc) ScoveGrouo.ono© Session.php(C) SlackBot.oho(C) SocialAccount.oho(C) Stade oho© Task.phpC Team.php© TeamAiContext.php© TeamDomain.php© TeamFeature.php© TeamSettings.php© TextRelay.php© Track.php© TranscriptionModel.php© TranscriptionModelLocale.php© TranscriptionProvider.phpc User.php© UserSettings.php© Vocabulary.phpc) VocabularyPronunciation.php© VoiceAccess.php(c)VolceconsentPrefix.onoNotitications• → Observers> O Policiesv Providers@ ActivitvServiceProvider.ohn@ AniServiceProvider.nhn@ AnnServiceProvider.nhnC) AuthServiceProvider.nhn@ RroadcastServiceProvider.ohn© CalendarServiceProvider.php@ CreateParticipantsServiceProvideC) CrmServiceProvider nhnl© EncryptionServiceProvider.php(c CvontCorvicoDrovidor nhnl© HubspotJournalServiceProvider.p© HubspotWebhookServiceProvideA limC) AooServiceProvider.ongC) AutomatedReport.phonamespace Jiminny Models;Liminnu Models VIsenamethod stringl] getRoles() laratrust's annotation* @property int $id* @property mixed Suuidx oohopent scring snamex olooent surind semalt* doroperty string null ssecondary emaz* doroperty string null spassword•doroperty string null sonoto pachGoropertu bool Suses two factor auth•doropertu strinolnuur sauthu 10Gpropertu strinalnulz scountru code• doropertu int.nulz Sregion 1di• doropertu strinalnulz ssecondaru phone• Aoropertu strinalnull Scaller id* coronentu int nuu sion tite io.• Aoronentu strinalnull Stwo factor reset code• Goronertu int Steam id• Gorobertu intlnull Sarounidi* Goronertu strinalnull Stimezone* Oproperty string $language* Annonentu ctrinalnull Cconfononco numhon* @property stringlnull $conference_pin* @property string|null $conference_slug* Apropenty string Sconference join preference* Annonentu bool Sconfonenco ¿oin nomindon* doropertu scring sconterence recoraannounce* Apropentu int $conference record preference* doroperty int sconference banawidch* opropertu int sconference start weocam100% C 8Mon ZUAOr 11:31-12Security patch review and testing guidanceservice.pnpkouteservicerrovider.ongC) FieldRepository.ong© ReportController.php© Partner.php© User.php x © SyncUserPilotCompanyListener.p© createsnaredevent.png- A67 X1 X1rotdockes serpht/aome/onis/fa fner n ° aр Tra: TaApiTokens.phpapp/odelf/Parnerp2p: sH4asApirokens:root@docker lamp 1:home/iiminnv# # Does User use Jiminnv's or Passport's?grep -rn "HasApiTokens" app/Models/User.php4s:use Larave Passoort hasaoilokens.243: use HasApiTokens;root@docker_lamp_1:/home/fiminny#outright wrong! Also, we don't support using the $team argument.Replv…CannotAhClaude is Al and can make mistakes. Please double-check responses....
|
iTerm2
|
NULL
|
NULL
|
53859
|
|
53860
|
VIewWinaowrTavsco.sProject© Opportunity.php© Parti VIewWinaowrTavsco.sProject© Opportunity.php© Participant.php© Partner.php© Permission.phpC Phonenumber.ongc) Playoacklneme.ono© Playbook.phpC) Playbookcategorv.php© Playlist.phpC) RateLimit.php© Region.phpC) Role.php© RoleChangeEvent.phpc) ScoveGrouo.ono© Session.php(C) SlackBot.oho(C) SocialAccount.oho(C) Stade oho© Task.phpC Team.php© TeamAiContext.php© TeamDomain.php© TeamFeature.php© TeamSettings.php© TextRelay.php© Track.php© TranscriptionModel.php© TranscriptionModelLocale.php© TranscriptionProvider.phpc User.php© UserSettings.php© Vocabulary.phpc) VocabularyPronunciation.php© VoiceAccess.php(c)VolceconsentPrefix.onoNotitications• → Observers> O Policiesv Providers@ ActivitvServiceProvider.ohn@ AniServiceProvider.nhn@ AnnServiceProvider.nhnC) AuthServiceProvider.nhn@ RroadcastServiceProvider.ohn© CalendarServiceProvider.php@ CreateParticipantsServiceProvideC) CrmServiceProvider nhnl© EncryptionServiceProvider.php(c CvontCorvicoDrovidor nhnl© HubspotJournalServiceProvider.p© HubspotWebhookServiceProvideA limC) AooServiceProvider.ongC) AutomatedReport.phonamespace Jiminny Models;liminnu Models VIsenamethod stringl] getRoles() laratrust's annotation* @property int $id* @property mixed Suuidx ocopent scring snamex olooent surind semalt* doroperty string null ssecondary emaz* doroperty string null spassword•doroperty string null sohoto pachiGoropertu bool Suses two factor auth•doropertu strinolnuur sauthu 10Gpropertu strinalnulz scountru code• doropertu int.nulz Sregion 1di• doropertu strinalnulz ssecondaru phone• Aoropertu strinalnull Scaller id* coronentu int nuu sion tite io.• Aoronentu strinalnull Stwo facton reset code• Goronertu int Steam id• Gorobertu intlnull Sarounidi* Goronertu strinalnull Stimezone* Oproperty string $language* Annonentu ctrinalnull Cconfononco numhon* @property stringlnull $conference_pin* @property string|null $conference_slug* Apropenty string Sconference join preference* Annonentu bool Sconfonenco ¿oin nomindon* doroperty scring sconterence recora announce* Apropentu int $conference record preference* doroperty int sconference banawidch* opropertu int sconference start weocam• ∞.100% LzMOn ZU AOr 11:31-2service.pnpC Field.phpC) FieldRepository.pnpC) ReportController.onp© RouteServiceProvider.php© Partner.php© User.php XOsyncuserrllotcompanyListener.grinstalledevent.phpCreateAcuivityLoggedevent.ongC Createsnaredevent.phgA67 X1 X7Security patch review and testing guidanceIf User onlv useS Jiminny Traits HasApiTokens,then oauthApps() , tokens() ,createloken), getProviderName, tokenCant,and currentAccessToken areallmissing at runtime — the interface contract is broken. If it use s Passport's directly too, there'sa trait conflict.The fix - your custom trait should not exist as a standalone override. Either:1. Delete Jiminny Traits\HasApiTokens anduse Laravel \Passport\HasAp1Tokensdirectly in both models, or2. If you need the custom token() return type hint, extend via the model directly ratherthan a competing traitGiven the PR is already merged, check if anv auth flows are actually failing right now by hittingPOST /oauth/token with a real client credentials or password grant request in your local envbefore this reaches staging production.outright wrong! Also, we don't support using the $team argument.Both models use Passport'sown HasApiTokens (Laravel\ Passport\HasApiTokens).notyour custom Jiminny Traits \HasApiTokens. Your custom trait inapp/Traits/HasApiTokens.php is essentially dead code — nothingimports it.bash# Confirm nothing uses the custom traitlgrep -rn "Jiminny)|\Traits\|\HasApiTokens" app/# orgrep -rn "use JiminnyTraits\HasApiTokenReplv.CannotAhClaude ic Aand can make mictakes Plasce double-check recnoncaci...
|
iTerm2
|
NULL
|
NULL
|
53860
|
|
53861
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelp100% C47 8 Mon 20 Apr 11:31:38DOCKER381DEV (docker)$82DEV (docker)APP (-zsh)|83-zsh@return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, \Illuminate\Foundation\Auth\User>*/public function tokens(: HasMany;/***/* Determine if the current API token has a given scope.public function tokenCan(string $scope): bool;/***/* Determine if the current API token is missing a given scope.public function tokenCant(string $scope): bool;/*** Create a new personal access token for the user.* @paramstring[] Sscopes*/public function createToken(string Sname, array $scopes = []): PersonalAccessTokenResult;/*** Get the access token currently associated with the user.*/public function currentAccessToken(: ?ScopeAuthorizable;/***/* Set the current access token for the user.public function withAccessToken(?ScopeAuthorizable SaccessToken): static;/*** Get the user provider name.*/public function getProviderName(: string;rootedocker_1amp_1:/home/jiminny# grep -n "use HasApiTokens" app/Models/User.php app/Models/Partner.php app/Traits/HasApiTokens.phpapp/Models/User.php:243:app/Models/Part,Pr.P2p:78: use HasasApiTonens;root@docker_lamp_1:/home/jiminny# # Does User use Jiminny's or Passport's?grep -rn "HasApiTokens" app/Models/User.php43:use Laravel\Passport\HasApiTokens;243:use HasApiTokens;root@docker_lamp_1:/home/jiminny# l• *4screenpipe"• *5DEV...
|
iTerm2
|
NULL
|
NULL
|
53861
|
|
53862
|
VIeWWindowrTavsco.sProject© Opportunity.php© Parti VIeWWindowrTavsco.sProject© Opportunity.php© Participant.php© Partner.php© Permission.phpC Phonenumber.ongPlayoacklneme.ono© Playbook.phpC) Playbookcategorv.php©Playlist.phpC) RateLimit.php© Region.phpC) Role.php©RoleChangeEvent.phpc) ScoveGrouo.ono© Session.php(C) SlackBot.oho© SocialAccount.php© Stage.php© Taskphp© Team.php© TeamAiContext.php© TeamDomain.php© TeamFeature.php© TeamSettings.php© TextRelay.php© Track.php© TranscriptionModel.php© TranscriptionModelLocale.php© TranscriptionProvider.phpc User.php© UserSettings.php© Vocabulary.phpc) VocabularyPronunciation.php© VoiceAccess.php(c)VolceconsentPrefix.onoNotitications• → Observers> Eo Policiesv Providers©ActivityServiceProvider.php@ AniServiceProvider.nhn© AppServiceProvider.phpC) AuthServiceProvider.nhn©BroadcastServiceProvider.php© CalendarServiceProvider.php© CreateParticipantsServiceProvideC) CrmServiceProvider nhnl© EncryptionServiceProvider.php© EventServiceProvider.php© HubspotJournalServiceProvider.p© HubspotWebhookServiceProviderA limiAppServiceProvider.phpC) AutomatedReport.phonamespace Jiminny \Models;Jiminny \Models\Useramethod string[] getRoles() laratrust's annotation* @property int $id ]* @property mixed $uvidx ocopent scring snamex olooent surind semalt* doroperty string null ssecondary emaz* doroperty string null spassword•doroperty string null sohoto pachiAproperty bool $uses_two_factor_auth•doropertu strinolnuur sauthu 10@property string|null $country_code• doropertu int.nulz Sregion 1di• doropertu strinalnulz ssecondaru phone@property string|null $caller_id* coronentu int nuu sion tite io.@property string|null $two_factor_reset_code• Goronertu int Steam id@property int|null $group_id* @property string|null $timezone* @property string $language* @property string|null Sconference_number* @property string|null $conference_pin* @property string|null $conference_slug* @property string $conference_join_preference* Anropertu bool Sconference join reminder |* doropertu scring sconterence recora announce* @property int Sconference_record_preference* doroperty int sconference banawidch* opropertu int sconference start weocam100% LzMon 2U AOr 11:31:30Security patch review and testing guidanceservice.pnpkouteservicerrovider.ong© Partner.php© FieldRepository.php© ReportController.php© User.phpxOsyncuserrllotcompanyListener.gCreateAcuivityLoggedevent.ong© createsnaredevent.pngA67 X1 X7Both models use Passport's own HasApiTokens (Laravel\Passport\HasApiTokens), notyour custom Jiminny\Traits\HasApiTokens . Your custom trait inapp/Traits/HasApiTokens. php is essentially dead code — nothing imports it.outright wrong! Also, we don't support using the $team argument.# Confirm nothing uses the custom traitgrep -rn "Jiminny||\Traits||\HasApiTokens" app/ A# orgrep -rn "use Jiminny|||\Traits|||\HasApiTokens" app/If that comes back empty, you're fine. Passport's full trait is what's actually running on bothUser and Partner , which means:•A lll untertace methods are satishedi• withAccessToken(?ScopeAuthorizable) is the correct signaturetokens(), oauthApps(), createToken() , getProviderName() etc. are all presentThe custom trait in app/Traits/HasApiTokens.php is just orphaned code - probably aleftover from an older version of Passport before the library provided a proper trait. It'sharmless right now but should be deleted to avoid confusion.Bottom line on the securitv PR: vou're clear. Passport is wired un correctlv. the bump is safe.and the one failing test was the pre-existing flaky factory issue. You can proceed withconncence*Reply...Sonnet 4.6Claude ic Aland can make mictakes Plosce double-check recnoncaci...
|
iTerm2
|
NULL
|
NULL
|
53862
|
|
53863
|
root@docker_lamp_1:/home/jiminny# diff \
vendor/ root@docker_lamp_1:/home/jiminny# diff \
vendor/laravel/passport/src/HasApiTokens.php \
app/Traits/HasApiTokens.php
3c3
< namespace Laravel\Passport;
---
> namespace Jiminny\Traits;
5,9c5
< use Illuminate\Database\Eloquent\Builder;
< use Illuminate\Database\Eloquent\Relations\HasMany;
< use Illuminate\Database\Eloquent\Relations\MorphMany;
< use Laravel\Passport\Contracts\ScopeAuthorizable;
< use LogicException;
---
> use Laravel\Passport\TransientToken;
11,13d6
< /**
< * @phpstan-require-implements \Laravel\Passport\Contracts\OAuthenticatable
< */
18,44d10
< */
< protected ?ScopeAuthorizable $accessToken = null;
<
< /**
< * Get all of the user's registered OAuth clients.
< *
< * @deprecated Use oauthApps()
< *
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Client, $this>
< */
< public function clients(): HasMany
< {
< return $this->hasMany(Passport::clientModel(), 'user_id');
< }
<
< /**
< * Get all of the user's registered OAuth applications.
< *
< * @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, $this>
< */
< public function oauthApps(): MorphMany
< {
< return $this->morphMany(Passport::clientModel(), 'owner');
< }
<
< /**
< * Get all of the access tokens for the user.
46c12
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, $this>
---
> * @var Laravel\Passport\TransientToken
48,62c14
< public function tokens(): HasMany
< {
< return $this->hasMany(Passport::tokenModel(), 'user_id', $this->getAuthIdentifierName())
< ->where(function (Builder $query): void {
< $query->whereHas('client', function (Builder $query): void {
< $query->where(function (Builder $query): void {
< $provider = $this->getProviderName();
<
< $query->when($provider === config('auth.guards.api.provider'), function (Builder $query): void {
< $query->orWhereNull('provider');
< })->orWhere('provider', $provider);
< });
< });
< });
< }
---
> protected $accessToken;
65c17
< * Get the access token currently associated with the user.
---
> * Get the current access token being used by the user.
67,75c19
< public function token(): ?ScopeAuthorizable
< {
< return $this->currentAccessToken();
< }
<
< /**
< * Get the access token currently associated with the user.
< */
< public function currentAccessToken(): ?ScopeAuthorizable
---
> public function token(): ?TransientToken
85,123c29
< return $this->accessToken && $this->accessToken->can($scope);
< }
<
< /**
< * Determine if the current API token is missing a given scope.
< */
< public function tokenCant(string $scope): bool
< {
< return ! $this->tokenCan($scope);
< }
<
< /**
< * Create a new personal access token for the user.
< *
< * @param string[] $scopes
< */
< public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult
< {
< return app(PersonalAccessTokenFactory::class)->make(
< $this->getAuthIdentifier(), $name, $scopes, $this->getProviderName()
< );
< }
<
< /**
< * Get the user provider name.
< *
< * @throws \LogicException
< */
< public function getProviderName(): string
< {
< $providers = collect(config('auth.guards'))->where('driver', 'passport')->pluck('provider')->all();
<
< foreach (config('auth.providers') as $provider => $config) {
< if (in_array($provider, $providers) && $config['driver'] === 'eloquent' && is_a($this, $config['model'])) {
< return $provider;
< }
< }
<
< throw new LogicException('Unable to determine authentication provider for this model from configuration.');
---
> return $this->accessToken ? $this->accessToken->can($scope) : false;
129c35
< public function withAccessToken(?ScopeAuthorizable $accessToken): static
---
> public function withAccessToken(TransientToken $accessToken): static
root@docker_lamp_1:/home/jiminny# cat vendor/laravel/passport/src/Contracts/OAuthenticatable.php
<?php
namespace Laravel\Passport\Contracts;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Laravel\Passport\PersonalAccessTokenResult;
interface OAuthenticatable extends Authenticatable
{
/**
* Get all the user's registered OAuth applications.
*
* @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, \Illuminate\Foundation\Auth\User>
*/
public function oauthApps(): MorphMany;
/**
* Get all the access tokens for the user.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, \Illuminate\Foundation\Auth\User>
*/
public function tokens(): HasMany;
/**
* Determine if the current API token has a given scope.
*/
public function tokenCan(string $scope): bool;
/**
* Determine if the current API token is missing a given scope.
*/
public function tokenCant(string $scope): bool;
/**
* Create a new personal access token for the user.
*
* @param string[] $scopes
*/
public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult;
/**
* Get the access token currently associated with the user.
*/
public function currentAccessToken(): ?ScopeAuthorizable;
/**
* Set the current access token for the user.
*/
public function withAccessToken(?ScopeAuthorizable $accessToken): static;
/**
* Get the user provider name.
*/
public function getProviderName(): string;
}
root@docker_lamp_1:/home/jiminny# grep -n "use HasApiTokens" app/Models/User.php app/Models/Partner.php app/Traits/HasApiTokens.php
app/Models/User.php:243: use HasApiTokens;
app/Models/Partner.php:78: use HasApiTokens;
root@docker_lamp_1:/home/jiminny# # Does User use Jiminny's or Passport's?
grep -rn "HasApiTokens" app/Models/User.php
43:use Laravel\Passport\HasApiTokens;
243: use HasApiTokens;
root@docker_lamp_1:/home/jiminny#
DOCKER
Close Tab
DEV (docker)
Close Tab
APP (-zsh)
Close Tab
-zsh
Close Tab
screenpipe"
Close Tab
⌥⌘1
DEV (docker)...
|
iTerm2
|
DEV (docker)
|
NULL
|
53863
|
|
53864
|
root@docker_lamp_1:/home/jiminny# diff \
vendor/ root@docker_lamp_1:/home/jiminny# diff \
vendor/laravel/passport/src/HasApiTokens.php \
app/Traits/HasApiTokens.php
3c3
< namespace Laravel\Passport;
---
> namespace Jiminny\Traits;
5,9c5
< use Illuminate\Database\Eloquent\Builder;
< use Illuminate\Database\Eloquent\Relations\HasMany;
< use Illuminate\Database\Eloquent\Relations\MorphMany;
< use Laravel\Passport\Contracts\ScopeAuthorizable;
< use LogicException;
---
> use Laravel\Passport\TransientToken;
11,13d6
< /**
< * @phpstan-require-implements \Laravel\Passport\Contracts\OAuthenticatable
< */
18,44d10
< */
< protected ?ScopeAuthorizable $accessToken = null;
<
< /**
< * Get all of the user's registered OAuth clients.
< *
< * @deprecated Use oauthApps()
< *
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Client, $this>
< */
< public function clients(): HasMany
< {
< return $this->hasMany(Passport::clientModel(), 'user_id');
< }
<
< /**
< * Get all of the user's registered OAuth applications.
< *
< * @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, $this>
< */
< public function oauthApps(): MorphMany
< {
< return $this->morphMany(Passport::clientModel(), 'owner');
< }
<
< /**
< * Get all of the access tokens for the user.
46c12
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, $this>
---
> * @var Laravel\Passport\TransientToken
48,62c14
< public function tokens(): HasMany
< {
< return $this->hasMany(Passport::tokenModel(), 'user_id', $this->getAuthIdentifierName())
< ->where(function (Builder $query): void {
< $query->whereHas('client', function (Builder $query): void {
< $query->where(function (Builder $query): void {
< $provider = $this->getProviderName();
<
< $query->when($provider === config('auth.guards.api.provider'), function (Builder $query): void {
< $query->orWhereNull('provider');
< })->orWhere('provider', $provider);
< });
< });
< });
< }
---
> protected $accessToken;
65c17
< * Get the access token currently associated with the user.
---
> * Get the current access token being used by the user.
67,75c19
< public function token(): ?ScopeAuthorizable
< {
< return $this->currentAccessToken();
< }
<
< /**
< * Get the access token currently associated with the user.
< */
< public function currentAccessToken(): ?ScopeAuthorizable
---
> public function token(): ?TransientToken
85,123c29
< return $this->accessToken && $this->accessToken->can($scope);
< }
<
< /**
< * Determine if the current API token is missing a given scope.
< */
< public function tokenCant(string $scope): bool
< {
< return ! $this->tokenCan($scope);
< }
<
< /**
< * Create a new personal access token for the user.
< *
< * @param string[] $scopes
< */
< public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult
< {
< return app(PersonalAccessTokenFactory::class)->make(
< $this->getAuthIdentifier(), $name, $scopes, $this->getProviderName()
< );
< }
<
< /**
< * Get the user provider name.
< *
< * @throws \LogicException
< */
< public function getProviderName(): string
< {
< $providers = collect(config('auth.guards'))->where('driver', 'passport')->pluck('provider')->all();
<
< foreach (config('auth.providers') as $provider => $config) {
< if (in_array($provider, $providers) && $config['driver'] === 'eloquent' && is_a($this, $config['model'])) {
< return $provider;
< }
< }
<
< throw new LogicException('Unable to determine authentication provider for this model from configuration.');
---
> return $this->accessToken ? $this->accessToken->can($scope) : false;
129c35
< public function withAccessToken(?ScopeAuthorizable $accessToken): static
---
> public function withAccessToken(TransientToken $accessToken): static
root@docker_lamp_1:/home/jiminny# cat vendor/laravel/passport/src/Contracts/OAuthenticatable.php
<?php
namespace Laravel\Passport\Contracts;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Laravel\Passport\PersonalAccessTokenResult;
interface OAuthenticatable extends Authenticatable
{
/**
* Get all the user's registered OAuth applications.
*
* @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, \Illuminate\Foundation\Auth\User>
*/
public function oauthApps(): MorphMany;
/**
* Get all the access tokens for the user.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, \Illuminate\Foundation\Auth\User>
*/
public function tokens(): HasMany;
/**
* Determine if the current API token has a given scope.
*/
public function tokenCan(string $scope): bool;
/**
* Determine if the current API token is missing a given scope.
*/
public function tokenCant(string $scope): bool;
/**
* Create a new personal access token for the user.
*
* @param string[] $scopes
*/
public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult;
/**
* Get the access token currently associated with the user.
*/
public function currentAccessToken(): ?ScopeAuthorizable;
/**
* Set the current access token for the user.
*/
public function withAccessToken(?ScopeAuthorizable $accessToken): static;
/**
* Get the user provider name.
*/
public function getProviderName(): string;
}
root@docker_lamp_1:/home/jiminny# grep -n "use HasApiTokens" app/Models/User.php app/Models/Partner.php app/Traits/HasApiTokens.php
app/Models/User.php:243: use HasApiTokens;
app/Models/Partner.php:78: use HasApiTokens;
root@docker_lamp_1:/home/jiminny# # Does User use Jiminny's or Passport's?
grep -rn "HasApiTokens" app/Models/User.php
43:use Laravel\Passport\HasApiTokens;
243: use HasApiTokens;
root@docker_lamp_1:/home/jiminny#
DOCKER
Close Tab
DEV (docker)
Close Tab
APP (-zsh)
Close Tab
-zsh
Close Tab
screenpipe"
Close Tab
⌥⌘1
DEV (docker)...
|
iTerm2
|
DEV (docker)
|
NULL
|
53864
|
|
53865
|
root@docker_lamp_1:/home/jiminny# diff \
vendor/ root@docker_lamp_1:/home/jiminny# diff \
vendor/laravel/passport/src/HasApiTokens.php \
app/Traits/HasApiTokens.php
3c3
< namespace Laravel\Passport;
---
> namespace Jiminny\Traits;
5,9c5
< use Illuminate\Database\Eloquent\Builder;
< use Illuminate\Database\Eloquent\Relations\HasMany;
< use Illuminate\Database\Eloquent\Relations\MorphMany;
< use Laravel\Passport\Contracts\ScopeAuthorizable;
< use LogicException;
---
> use Laravel\Passport\TransientToken;
11,13d6
< /**
< * @phpstan-require-implements \Laravel\Passport\Contracts\OAuthenticatable
< */
18,44d10
< */
< protected ?ScopeAuthorizable $accessToken = null;
<
< /**
< * Get all of the user's registered OAuth clients.
< *
< * @deprecated Use oauthApps()
< *
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Client, $this>
< */
< public function clients(): HasMany
< {
< return $this->hasMany(Passport::clientModel(), 'user_id');
< }
<
< /**
< * Get all of the user's registered OAuth applications.
< *
< * @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, $this>
< */
< public function oauthApps(): MorphMany
< {
< return $this->morphMany(Passport::clientModel(), 'owner');
< }
<
< /**
< * Get all of the access tokens for the user.
46c12
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, $this>
---
> * @var Laravel\Passport\TransientToken
48,62c14
< public function tokens(): HasMany
< {
< return $this->hasMany(Passport::tokenModel(), 'user_id', $this->getAuthIdentifierName())
< ->where(function (Builder $query): void {
< $query->whereHas('client', function (Builder $query): void {
< $query->where(function (Builder $query): void {
< $provider = $this->getProviderName();
<
< $query->when($provider === config('auth.guards.api.provider'), function (Builder $query): void {
< $query->orWhereNull('provider');
< })->orWhere('provider', $provider);
< });
< });
< });
< }
---
> protected $accessToken;
65c17
< * Get the access token currently associated with the user.
---
> * Get the current access token being used by the user.
67,75c19
< public function token(): ?ScopeAuthorizable
< {
< return $this->currentAccessToken();
< }
<
< /**
< * Get the access token currently associated with the user.
< */
< public function currentAccessToken(): ?ScopeAuthorizable
---
> public function token(): ?TransientToken
85,123c29
< return $this->accessToken && $this->accessToken->can($scope);
< }
<
< /**
< * Determine if the current API token is missing a given scope.
< */
< public function tokenCant(string $scope): bool
< {
< return ! $this->tokenCan($scope);
< }
<
< /**
< * Create a new personal access token for the user.
< *
< * @param string[] $scopes
< */
< public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult
< {
< return app(PersonalAccessTokenFactory::class)->make(
< $this->getAuthIdentifier(), $name, $scopes, $this->getProviderName()
< );
< }
<
< /**
< * Get the user provider name.
< *
< * @throws \LogicException
< */
< public function getProviderName(): string
< {
< $providers = collect(config('auth.guards'))->where('driver', 'passport')->pluck('provider')->all();
<
< foreach (config('auth.providers') as $provider => $config) {
< if (in_array($provider, $providers) && $config['driver'] === 'eloquent' && is_a($this, $config['model'])) {
< return $provider;
< }
< }
<
< throw new LogicException('Unable to determine authentication provider for this model from configuration.');
---
> return $this->accessToken ? $this->accessToken->can($scope) : false;
129c35
< public function withAccessToken(?ScopeAuthorizable $accessToken): static
---
> public function withAccessToken(TransientToken $accessToken): static
root@docker_lamp_1:/home/jiminny# cat vendor/laravel/passport/src/Contracts/OAuthenticatable.php
<?php
namespace Laravel\Passport\Contracts;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Laravel\Passport\PersonalAccessTokenResult;
interface OAuthenticatable extends Authenticatable
{
/**
* Get all the user's registered OAuth applications.
*
* @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, \Illuminate\Foundation\Auth\User>
*/
public function oauthApps(): MorphMany;
/**
* Get all the access tokens for the user.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, \Illuminate\Foundation\Auth\User>
*/
public function tokens(): HasMany;
/**
* Determine if the current API token has a given scope.
*/
public function tokenCan(string $scope): bool;
/**
* Determine if the current API token is missing a given scope.
*/
public function tokenCant(string $scope): bool;
/**
* Create a new personal access token for the user.
*
* @param string[] $scopes
*/
public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult;
/**
* Get the access token currently associated with the user.
*/
public function currentAccessToken(): ?ScopeAuthorizable;
/**
* Set the current access token for the user.
*/
public function withAccessToken(?ScopeAuthorizable $accessToken): static;
/**
* Get the user provider name.
*/
public function getProviderName(): string;
}
root@docker_lamp_1:/home/jiminny# grep -n "use HasApiTokens" app/Models/User.php app/Models/Partner.php app/Traits/HasApiTokens.php
app/Models/User.php:243: use HasApiTokens;
app/Models/Partner.php:78: use HasApiTokens;
root@docker_lamp_1:/home/jiminny# # Does User use Jiminny's or Passport's?
grep -rn "HasApiTokens" app/Models/User.php
43:use Laravel\Passport\HasApiTokens;
243: use HasApiTokens;
root@docker_lamp_1:/home/jiminny# grep -rn "Jiminny\\\Traits\\\HasApiTokens" app/
DOCKER
Close Tab
DEV (docker)
Close Tab
APP (-zsh)
Close Tab
-zsh
Close Tab
screenpipe"
Close Tab
⌥⌘1
DEV (docker)...
|
iTerm2
|
DEV (docker)
|
NULL
|
53865
|
|
53866
|
FV faVsco.js v?9 masterProletey© Opportunity.php© FV faVsco.js v?9 masterProletey© Opportunity.php© Participant.php© Partner.php© Permission.phpC Phonenumber.ongPlayoacklneme.ono© Playbook.phpC) Playbookcategorv.php©Playlist.phpC) RateLimit.php© Region.phpC) Role.php©RoleChangeEvent.phpc) ScoveGrouo.ono© Session.php(C) SlackBot.oho© SocialAccount.php© Stage.php© Taskphp© Team.php© TeamAiContext.php© TeamDomain.php© TeamFeature.php© TeamSettings.php© TextRelay.php© Track.php© TranscriptionModel.php© TranscriptionModelLocale.php© TranscriptionProvider.phpc User.php© UserSettings.php© Vocabulary.phpc) VocabularyPronunciation.php© VoiceAccess.php(c)VolceconsentPrefix.onoNotitications• → Observers> Eo Policiesv Providers©ActivityServiceProvider.php@ AniServiceProvider.nhn© AppServiceProvider.phpC) AuthServiceProvider.nhn© BroadcastServiceProvider.php© CalendarServiceProvider.php© CreateParticipantsServiceProvideC) CrmServiceProvider nhnl© EncryptionServiceProvider.php© EventServiceProvider.php© HubspotJournalServiceProvider.p© HubspotWebhookServiceProviderA limiAppServiceProvider.phpC) AutomatedReport.phonamespace Jiminny \Models;Jiminny \Models\Useramethod string[] getRoles() laratrust's annotation* @property int $id ]* @property mixed $uvidx ocopent scring snamex olooent surind semalt* doroperty string null ssecondary emaz* doroperty string null spassword•doroperty string null sohoto pachiAproperty bool $uses_two_factor_auth•doropertu strinolnuur sauthu 10@property string|null $country_code• doropertu int.nulz Sregion 1di• doropertu strinalnulz ssecondaru phone@property string|null $caller_id• coronentu int nuu sion title 1di@property string|null $two_factor_reset_code• Goronertu int Steam id@property int|null $group_id* @property string|null $timezone* @property string $language* @property string|null Sconference_number* @property string|null $conference_pin* @property string|null $conference_slug* @property string $conference_join_preference* Apropertu bool Sconference join reminder |* doropertu scring sconterence recora announce* @property int Sconference_record_preference* doroperty int sconference banawidch* opropertu int sconference start weocam• ∞.MON ZU AOr 11:31:40Security patch review and testing guidanceservice.pnpkouteservicerrovider.ong© Partner.php© FieldRepository.php© ReportController.php© User.phpxOsyncuserrllotcompanyListener.gCreateAcuivityLoggedevent.ong© createsnaredevent.pngA67 X1 X7outright wrong! Also, we don't support using the $team argument.Both models use Passport's own HasApiTokens (Laravel\Passport\HasApiTokens), notyour custom Jiminny\Traits\HasApiTokens . Your custom trait inapp/Traits/HasApiTokens. php is essentially dead code — nothing imports it.# Confirm nothingReply+grep -rn "Jiminny)|\Traits||\HasApiTokens" app/grep -rn "use Jiminny|||\Traits|||\HasApiTokens" app/If that comes back empty, you're fine. Passport's full trait is what's actually running on bothUser and Partner , which means:•A lll untertace methods are satishedi• withAccessToken(?ScopeAuthorizable) is the correct signaturetokens() , oauthApps(), createToken() , getProviderName() etc. are all presentThe custom trait in app/Traits/HasApiTokens.php is just orphaned code - probably aleftover from an older version of Passport before the library provided a proper trait. It'sharmless right now but should be deleted to avoid confusion.Bottom line on the securitv PR: vou're clear. Passport is wired un correctlv. the bump is safe.and the one failing test was the pre-existing flaky factory issue. You can proceed withconncence*Reply...Sonnet 4.6Claude ic Aland can make mictakes Plosce double-check recnoncaci...
|
iTerm2
|
NULL
|
NULL
|
53866
|
|
53867
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelpDEV (docker)APP (-zsh)DOCKERDEV (docker)$82X3-zsh* @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, \Illuminate\Foundation Auth\User>*/public function tokens(: HasMany;/***/* Determine if the current API token has a given scope.public function tokenCan(string $scope): bool;/*** Determine if the current API token is missing a given scope.*/public function tokenCant(string $scope): bool;/*** Create a new personal access token for the user.** @param string[]Sscopes*/public function createToken(string Sname, array $scopes = O): PersonalAccessTokenResult;/*** Get the access token currently associated with the user.*/public function currentAccessToken(): ?ScopeAuthorizable;/***/* Set the current access token for the user.public function withAccessToken(?ScopeAuthorizable SaccessToken): static;/***/* Get the user provider name.public function getProviderName(): string;root@docker_lamp_1:/home/jiminny# grep-n "use HasApiTokens" app/Models/User.php app/Models/Partner.php app/Traits/HasApiTokens.phpapp/Models/User.php:243:use HasApiTokens;app/Models/Partner.php:78:use HasApiTokens;root@docker_lamp_1:/home/jiminny# # Does User use Jiminny's or Passport's?grep-rn "HasApiTokens" app/Models/User.php43:use Laravel\Passport\HasApiTokens;243:use HasApiTokens;root@docker_lamp_1:/home/jiminny# grep -rn "Jiminny)|\Traits||\HasApiTokens" app/root@docker_lamp_1:/home/jiminny#• ₴4100% (47 8 Mon 20 Apr 11:31:45T81screenpipe™• ₴5DEV...
|
iTerm2
|
NULL
|
NULL
|
53867
|
|
53869
|
FV faVsco.js~?9 masterProledey© Opportunity.php© P FV faVsco.js~?9 masterProledey© Opportunity.php© Participant.php© Partner.php© Permission.phpC Phonenumber.ongPlayoacklneme.ono© Playbook.phpC) Playbookcategorv.php©Playlist.phpC) RateLimit.php© Region.phpC) Role.php©RoleChangeEvent.phpc) ScoveGrouo.ono© Session.php(C) SlackBot.oho© SocialAccount.php© Stage.php© Taskphp© Team.php© TeamAiContext.php© TeamDomain.php© TeamFeature.php© TeamSettings.php© TextRelay.php© Track.php© TranscriptionModel.php© TranscriptionModelLocale.php© TranscriptionProvider.phpc User.php© UserSettings.php© Vocabulary.phpc) VocabularyPronunciation.php© VoiceAccess.php(c)VolceconsentPrefix.onoNotitications• → Observers> Eo Policiesv Providers©ActivityServiceProvider.php@ AniServiceProvider.nhn© AppServiceProvider.phpC) AuthServiceProvider.nhn©BroadcastServiceProvider.php© CalendarServiceProvider.php© CreateParticipantsServiceProvideC) CrmServiceProvider nhnl© EncryptionServiceProvider.php© EventServiceProvider.php© HubspotJournalServiceProvider.p© HubspotWebhookServiceProviderA limiAppServiceProvider.phpC) AutomatedReport.phonamespace Jiminny \Models;Jiminny \Models\Useramethod string[] getRoles() laratrust's annotation* @property int $id ]* @property mixed $uvidx oohopent scring snamex olooent surind semalt* doroperty string null ssecondary emaz* doroperty string null spassword•doroperty string null sonoto pachAproperty bool $uses_two_factor_auth•doropertu strinolnuur sauthu 10@property string|null $country_code• doropertu int.nulz Sregion 1di• doropertu strinalnulz ssecondaru phone@property string|null $caller_id• coronentu int nuu sion title 1di@property string|null $two_factor_reset_code• Goronertu int Steam id@property int|null $group_id* @property string|null $timezone* @property string $language* @property string|null Sconference_number* @property string|null $conference_pin* @property string|null $conference_slug* @property string $conference_join_preference* Anropertu bool Sconference join reminder |* doropertu scring sconterence recora announce* @property int Sconference_record_preference* doroperty int sconference banawidch* opropertu int sconference start weocamMON ZU AOr 11:31:40Security patch review and testing guidanceservice.pnpkouteservicerrovider.ong© Partner.php© FieldRepository.php© ReportController.php© User.phpx©syncuserrllotcompanyListener.gCreateAcuivityLoggedevent.ong© createsnaredevent.pngA67 X1 X7Both models use Passport's own HasApiTokens (Laravel\Passport\HasApiTokens), notyour custom Jiminny\Traits\HasApiTokens . Your custom trait inapp/Traits/HasApiTokens. php is essentially dead code — nothing imports it.outright wrong! Also, we don't support using the $team argument.# Conturm nothino uses the custom trautgrep -rn "Jiminny\TrsApiTokens" app/Reovhgrep -rn "use Jiminny|||\Traits|||\HasApiTokens" app/If that comes back empty, you're fine. Passport's full trait is what's actually running on bothUser and Partner, which means:•A lll untertace methods are satishedi• withAccessToken(?ScopeAuthorizable) is the correct signaturetokens(), oauthApps(), createToken() , getProviderName() etc. are all presentThe custom trait in app/Traits/HasApiTokens.php is just orphaned code - probably aleftover from an older version of Passport before the library provided a proper trait. It'sharmless right now but should be deleted to avoid confusion.Bottom line on the securitv PR: vou're clear. Passport is wired un correctlv. the bump is safe.and the one failing test was the pre-existing flaky factory issue. You can proceed withconncence*Reply...Sonnet 4.6Claude ic Aland can make mictakes Plosce double-check recnoncaci...
|
iTerm2
|
NULL
|
NULL
|
53869
|
|
53870
|
ClaudeFileEditViewWindowHelp100% 0 8DEV (docker)AP ClaudeFileEditViewWindowHelp100% 0 8DEV (docker)APP (-zsh)DOCKERDEV (docker)$82X3-zsh* @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, \Illuminate\Foundation Auth\User>*/public function tokens(: HasMany;/***/* Determine if the current API token has a given scope.public function tokenCan(string $scope): bool;/*** Determine if the current API token is missing a given scope.*/public function tokenCant(string $scope): bool;/*** Create a new personal access token for the user.** @param stringO]Sscopes*/public function createToken(string Sname, array $scopes = O): PersonalAccessTokenResult;/*** Get the access token currently associated with the user.*/public function currentAccessToken(): ?ScopeAuthorizable;/***/* Set the current access token for the user.public function withAccessToken(?ScopeAuthorizable SaccessToken): static;/***/* Get the user provider name.public function getProviderName(): string;root@docker_lamp_1:/home/jiminny# grep-n "use HasApiTokens" app/Models/User.php app/Models/Partner.php app/Traits/HasApiTokens.phpapp/Models/User.php:243:use HasApiTokens;app/Models/Partner.php:78:use HasApiTokens;root@docker_lamp_1:/home/jiminny# # Does User use Jiminny's or Passport's?grep-rn "HasApiTokens" app/Models/User.php43:use Laravel\Passport\HasApiTokens;243:use HasApiTokens;root@docker_lamp_1:/home/jiminny# grep -rn "Jiminny)|\Traits||\HasApiTokens" app/root@docker_lamp_1:/home/jiminny# ]• ₴4screenpipe"Mon 20 Apr 11:31:48181• *5DEV...
|
iTerm2
|
NULL
|
NULL
|
53870
|
|
53871
|
root@docker_lamp_1:/home/jiminny# diff \
vendor/ root@docker_lamp_1:/home/jiminny# diff \
vendor/laravel/passport/src/HasApiTokens.php \
app/Traits/HasApiTokens.php
3c3
< namespace Laravel\Passport;
---
> namespace Jiminny\Traits;
5,9c5
< use Illuminate\Database\Eloquent\Builder;
< use Illuminate\Database\Eloquent\Relations\HasMany;
< use Illuminate\Database\Eloquent\Relations\MorphMany;
< use Laravel\Passport\Contracts\ScopeAuthorizable;
< use LogicException;
---
> use Laravel\Passport\TransientToken;
11,13d6
< /**
< * @phpstan-require-implements \Laravel\Passport\Contracts\OAuthenticatable
< */
18,44d10
< */
< protected ?ScopeAuthorizable $accessToken = null;
<
< /**
< * Get all of the user's registered OAuth clients.
< *
< * @deprecated Use oauthApps()
< *
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Client, $this>
< */
< public function clients(): HasMany
< {
< return $this->hasMany(Passport::clientModel(), 'user_id');
< }
<
< /**
< * Get all of the user's registered OAuth applications.
< *
< * @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, $this>
< */
< public function oauthApps(): MorphMany
< {
< return $this->morphMany(Passport::clientModel(), 'owner');
< }
<
< /**
< * Get all of the access tokens for the user.
46c12
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, $this>
---
> * @var Laravel\Passport\TransientToken
48,62c14
< public function tokens(): HasMany
< {
< return $this->hasMany(Passport::tokenModel(), 'user_id', $this->getAuthIdentifierName())
< ->where(function (Builder $query): void {
< $query->whereHas('client', function (Builder $query): void {
< $query->where(function (Builder $query): void {
< $provider = $this->getProviderName();
<
< $query->when($provider === config('auth.guards.api.provider'), function (Builder $query): void {
< $query->orWhereNull('provider');
< })->orWhere('provider', $provider);
< });
< });
< });
< }
---
> protected $accessToken;
65c17
< * Get the access token currently associated with the user.
---
> * Get the current access token being used by the user.
67,75c19
< public function token(): ?ScopeAuthorizable
< {
< return $this->currentAccessToken();
< }
<
< /**
< * Get the access token currently associated with the user.
< */
< public function currentAccessToken(): ?ScopeAuthorizable
---
> public function token(): ?TransientToken
85,123c29
< return $this->accessToken && $this->accessToken->can($scope);
< }
<
< /**
< * Determine if the current API token is missing a given scope.
< */
< public function tokenCant(string $scope): bool
< {
< return ! $this->tokenCan($scope);
< }
<
< /**
< * Create a new personal access token for the user.
< *
< * @param string[] $scopes
< */
< public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult
< {
< return app(PersonalAccessTokenFactory::class)->make(
< $this->getAuthIdentifier(), $name, $scopes, $this->getProviderName()
< );
< }
<
< /**
< * Get the user provider name.
< *
< * @throws \LogicException
< */
< public function getProviderName(): string
< {
< $providers = collect(config('auth.guards'))->where('driver', 'passport')->pluck('provider')->all();
<
< foreach (config('auth.providers') as $provider => $config) {
< if (in_array($provider, $providers) && $config['driver'] === 'eloquent' && is_a($this, $config['model'])) {
< return $provider;
< }
< }
<
< throw new LogicException('Unable to determine authentication provider for this model from configuration.');
---
> return $this->accessToken ? $this->accessToken->can($scope) : false;
129c35
< public function withAccessToken(?ScopeAuthorizable $accessToken): static
---
> public function withAccessToken(TransientToken $accessToken): static
root@docker_lamp_1:/home/jiminny# cat vendor/laravel/passport/src/Contracts/OAuthenticatable.php
<?php
namespace Laravel\Passport\Contracts;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Laravel\Passport\PersonalAccessTokenResult;
interface OAuthenticatable extends Authenticatable
{
/**
* Get all the user's registered OAuth applications.
*
* @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, \Illuminate\Foundation\Auth\User>
*/
public function oauthApps(): MorphMany;
/**
* Get all the access tokens for the user.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, \Illuminate\Foundation\Auth\User>
*/
public function tokens(): HasMany;
/**
* Determine if the current API token has a given scope.
*/
public function tokenCan(string $scope): bool;
/**
* Determine if the current API token is missing a given scope.
*/
public function tokenCant(string $scope): bool;
/**
* Create a new personal access token for the user.
*
* @param string[] $scopes
*/
public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult;
/**
* Get the access token currently associated with the user.
*/
public function currentAccessToken(): ?ScopeAuthorizable;
/**
* Set the current access token for the user.
*/
public function withAccessToken(?ScopeAuthorizable $accessToken): static;
/**
* Get the user provider name.
*/
public function getProviderName(): string;
}
root@docker_lamp_1:/home/jiminny# grep -n "use HasApiTokens" app/Models/User.php app/Models/Partner.php app/Traits/HasApiTokens.php
app/Models/User.php:243: use HasApiTokens;
app/Models/Partner.php:78: use HasApiTokens;
root@docker_lamp_1:/home/jiminny# # Does User use Jiminny's or Passport's?
grep -rn "HasApiTokens" app/Models/User.php
43:use Laravel\Passport\HasApiTokens;
243: use HasApiTokens;
root@docker_lamp_1:/home/jiminny# grep -rn "Jiminny\\\Traits\\\HasApiTokens" app/
root@docker_lamp_1:/home/jiminny#
DOCKER
Close Tab
DEV (docker)
Close Tab
APP (-zsh)
Close Tab
-zsh
Close Tab
screenpipe"
Close Tab
⌥⌘1
DEV (docker)...
|
iTerm2
|
DEV (docker)
|
NULL
|
53871
|
|
53872
|
root@docker_lamp_1:/home/jiminny# diff \
vendor/ root@docker_lamp_1:/home/jiminny# diff \
vendor/laravel/passport/src/HasApiTokens.php \
app/Traits/HasApiTokens.php
3c3
< namespace Laravel\Passport;
---
> namespace Jiminny\Traits;
5,9c5
< use Illuminate\Database\Eloquent\Builder;
< use Illuminate\Database\Eloquent\Relations\HasMany;
< use Illuminate\Database\Eloquent\Relations\MorphMany;
< use Laravel\Passport\Contracts\ScopeAuthorizable;
< use LogicException;
---
> use Laravel\Passport\TransientToken;
11,13d6
< /**
< * @phpstan-require-implements \Laravel\Passport\Contracts\OAuthenticatable
< */
18,44d10
< */
< protected ?ScopeAuthorizable $accessToken = null;
<
< /**
< * Get all of the user's registered OAuth clients.
< *
< * @deprecated Use oauthApps()
< *
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Client, $this>
< */
< public function clients(): HasMany
< {
< return $this->hasMany(Passport::clientModel(), 'user_id');
< }
<
< /**
< * Get all of the user's registered OAuth applications.
< *
< * @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, $this>
< */
< public function oauthApps(): MorphMany
< {
< return $this->morphMany(Passport::clientModel(), 'owner');
< }
<
< /**
< * Get all of the access tokens for the user.
46c12
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, $this>
---
> * @var Laravel\Passport\TransientToken
48,62c14
< public function tokens(): HasMany
< {
< return $this->hasMany(Passport::tokenModel(), 'user_id', $this->getAuthIdentifierName())
< ->where(function (Builder $query): void {
< $query->whereHas('client', function (Builder $query): void {
< $query->where(function (Builder $query): void {
< $provider = $this->getProviderName();
<
< $query->when($provider === config('auth.guards.api.provider'), function (Builder $query): void {
< $query->orWhereNull('provider');
< })->orWhere('provider', $provider);
< });
< });
< });
< }
---
> protected $accessToken;
65c17
< * Get the access token currently associated with the user.
---
> * Get the current access token being used by the user.
67,75c19
< public function token(): ?ScopeAuthorizable
< {
< return $this->currentAccessToken();
< }
<
< /**
< * Get the access token currently associated with the user.
< */
< public function currentAccessToken(): ?ScopeAuthorizable
---
> public function token(): ?TransientToken
85,123c29
< return $this->accessToken && $this->accessToken->can($scope);
< }
<
< /**
< * Determine if the current API token is missing a given scope.
< */
< public function tokenCant(string $scope): bool
< {
< return ! $this->tokenCan($scope);
< }
<
< /**
< * Create a new personal access token for the user.
< *
< * @param string[] $scopes
< */
< public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult
< {
< return app(PersonalAccessTokenFactory::class)->make(
< $this->getAuthIdentifier(), $name, $scopes, $this->getProviderName()
< );
< }
<
< /**
< * Get the user provider name.
< *
< * @throws \LogicException
< */
< public function getProviderName(): string
< {
< $providers = collect(config('auth.guards'))->where('driver', 'passport')->pluck('provider')->all();
<
< foreach (config('auth.providers') as $provider => $config) {
< if (in_array($provider, $providers) && $config['driver'] === 'eloquent' && is_a($this, $config['model'])) {
< return $provider;
< }
< }
<
< throw new LogicException('Unable to determine authentication provider for this model from configuration.');
---
> return $this->accessToken ? $this->accessToken->can($scope) : false;
129c35
< public function withAccessToken(?ScopeAuthorizable $accessToken): static
---
> public function withAccessToken(TransientToken $accessToken): static
root@docker_lamp_1:/home/jiminny# cat vendor/laravel/passport/src/Contracts/OAuthenticatable.php
<?php
namespace Laravel\Passport\Contracts;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Laravel\Passport\PersonalAccessTokenResult;
interface OAuthenticatable extends Authenticatable
{
/**
* Get all the user's registered OAuth applications.
*
* @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, \Illuminate\Foundation\Auth\User>
*/
public function oauthApps(): MorphMany;
/**
* Get all the access tokens for the user.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, \Illuminate\Foundation\Auth\User>
*/
public function tokens(): HasMany;
/**
* Determine if the current API token has a given scope.
*/
public function tokenCan(string $scope): bool;
/**
* Determine if the current API token is missing a given scope.
*/
public function tokenCant(string $scope): bool;
/**
* Create a new personal access token for the user.
*
* @param string[] $scopes
*/
public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult;
/**
* Get the access token currently associated with the user.
*/
public function currentAccessToken(): ?ScopeAuthorizable;
/**
* Set the current access token for the user.
*/
public function withAccessToken(?ScopeAuthorizable $accessToken): static;
/**
* Get the user provider name.
*/
public function getProviderName(): string;
}
root@docker_lamp_1:/home/jiminny# grep -n "use HasApiTokens" app/Models/User.php app/Models/Partner.php app/Traits/HasApiTokens.php
app/Models/User.php:243: use HasApiTokens;
app/Models/Partner.php:78: use HasApiTokens;
root@docker_lamp_1:/home/jiminny# # Does User use Jiminny's or Passport's?
grep -rn "HasApiTokens" app/Models/User.php
43:use Laravel\Passport\HasApiTokens;
243: use HasApiTokens;
root@docker_lamp_1:/home/jiminny# grep -rn "Jiminny\\\Traits\\\HasApiTokens" app/
root@docker_lamp_1:/home/jiminny#
DOCKER
Close Tab
DEV (docker)
Close Tab
APP (-zsh)
Close Tab
-zsh
Close Tab
screenpipe"
Close Tab
⌥⌘1
DEV (docker)...
|
iTerm2
|
DEV (docker)
|
NULL
|
53872
|
|
53873
|
root@docker_lamp_1:/home/jiminny# diff \
vendor/ root@docker_lamp_1:/home/jiminny# diff \
vendor/laravel/passport/src/HasApiTokens.php \
app/Traits/HasApiTokens.php
3c3
< namespace Laravel\Passport;
---
> namespace Jiminny\Traits;
5,9c5
< use Illuminate\Database\Eloquent\Builder;
< use Illuminate\Database\Eloquent\Relations\HasMany;
< use Illuminate\Database\Eloquent\Relations\MorphMany;
< use Laravel\Passport\Contracts\ScopeAuthorizable;
< use LogicException;
---
> use Laravel\Passport\TransientToken;
11,13d6
< /**
< * @phpstan-require-implements \Laravel\Passport\Contracts\OAuthenticatable
< */
18,44d10
< */
< protected ?ScopeAuthorizable $accessToken = null;
<
< /**
< * Get all of the user's registered OAuth clients.
< *
< * @deprecated Use oauthApps()
< *
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Client, $this>
< */
< public function clients(): HasMany
< {
< return $this->hasMany(Passport::clientModel(), 'user_id');
< }
<
< /**
< * Get all of the user's registered OAuth applications.
< *
< * @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, $this>
< */
< public function oauthApps(): MorphMany
< {
< return $this->morphMany(Passport::clientModel(), 'owner');
< }
<
< /**
< * Get all of the access tokens for the user.
46c12
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, $this>
---
> * @var Laravel\Passport\TransientToken
48,62c14
< public function tokens(): HasMany
< {
< return $this->hasMany(Passport::tokenModel(), 'user_id', $this->getAuthIdentifierName())
< ->where(function (Builder $query): void {
< $query->whereHas('client', function (Builder $query): void {
< $query->where(function (Builder $query): void {
< $provider = $this->getProviderName();
<
< $query->when($provider === config('auth.guards.api.provider'), function (Builder $query): void {
< $query->orWhereNull('provider');
< })->orWhere('provider', $provider);
< });
< });
< });
< }
---
> protected $accessToken;
65c17
< * Get the access token currently associated with the user.
---
> * Get the current access token being used by the user.
67,75c19
< public function token(): ?ScopeAuthorizable
< {
< return $this->currentAccessToken();
< }
<
< /**
< * Get the access token currently associated with the user.
< */
< public function currentAccessToken(): ?ScopeAuthorizable
---
> public function token(): ?TransientToken
85,123c29
< return $this->accessToken && $this->accessToken->can($scope);
< }
<
< /**
< * Determine if the current API token is missing a given scope.
< */
< public function tokenCant(string $scope): bool
< {
< return ! $this->tokenCan($scope);
< }
<
< /**
< * Create a new personal access token for the user.
< *
< * @param string[] $scopes
< */
< public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult
< {
< return app(PersonalAccessTokenFactory::class)->make(
< $this->getAuthIdentifier(), $name, $scopes, $this->getProviderName()
< );
< }
<
< /**
< * Get the user provider name.
< *
< * @throws \LogicException
< */
< public function getProviderName(): string
< {
< $providers = collect(config('auth.guards'))->where('driver', 'passport')->pluck('provider')->all();
<
< foreach (config('auth.providers') as $provider => $config) {
< if (in_array($provider, $providers) && $config['driver'] === 'eloquent' && is_a($this, $config['model'])) {
< return $provider;
< }
< }
<
< throw new LogicException('Unable to determine authentication provider for this model from configuration.');
---
> return $this->accessToken ? $this->accessToken->can($scope) : false;
129c35
< public function withAccessToken(?ScopeAuthorizable $accessToken): static
---
> public function withAccessToken(TransientToken $accessToken): static
root@docker_lamp_1:/home/jiminny# cat vendor/laravel/passport/src/Contracts/OAuthenticatable.php
<?php
namespace Laravel\Passport\Contracts;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Laravel\Passport\PersonalAccessTokenResult;
interface OAuthenticatable extends Authenticatable
{
/**
* Get all the user's registered OAuth applications.
*
* @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, \Illuminate\Foundation\Auth\User>
*/
public function oauthApps(): MorphMany;
/**
* Get all the access tokens for the user.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, \Illuminate\Foundation\Auth\User>
*/
public function tokens(): HasMany;
/**
* Determine if the current API token has a given scope.
*/
public function tokenCan(string $scope): bool;
/**
* Determine if the current API token is missing a given scope.
*/
public function tokenCant(string $scope): bool;
/**
* Create a new personal access token for the user.
*
* @param string[] $scopes
*/
public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult;
/**
* Get the access token currently associated with the user.
*/
public function currentAccessToken(): ?ScopeAuthorizable;
/**
* Set the current access token for the user.
*/
public function withAccessToken(?ScopeAuthorizable $accessToken): static;
/**
* Get the user provider name.
*/
public function getProviderName(): string;
}
root@docker_lamp_1:/home/jiminny# grep -n "use HasApiTokens" app/Models/User.php app/Models/Partner.php app/Traits/HasApiTokens.php
app/Models/User.php:243: use HasApiTokens;
app/Models/Partner.php:78: use HasApiTokens;
root@docker_lamp_1:/home/jiminny# # Does User use Jiminny's or Passport's?
grep -rn "HasApiTokens" app/Models/User.php
43:use Laravel\Passport\HasApiTokens;
243: use HasApiTokens;
root@docker_lamp_1:/home/jiminny# grep -rn "Jiminny\\\Traits\\\HasApiTokens" app/
root@docker_lamp_1:/home/jiminny# grep -rn "use Jiminny\\\\Traits\\\\HasApiTokens" app/
DOCKER
Close Tab
DEV (docker)
Close Tab
APP (-zsh)
Close Tab
-zsh
Close Tab
screenpipe"
Close Tab
⌥⌘1
DEV (docker)...
|
iTerm2
|
DEV (docker)
|
NULL
|
53873
|
|
53874
|
root@docker_lamp_1:/home/jiminny# diff \
vendor/ root@docker_lamp_1:/home/jiminny# diff \
vendor/laravel/passport/src/HasApiTokens.php \
app/Traits/HasApiTokens.php
3c3
< namespace Laravel\Passport;
---
> namespace Jiminny\Traits;
5,9c5
< use Illuminate\Database\Eloquent\Builder;
< use Illuminate\Database\Eloquent\Relations\HasMany;
< use Illuminate\Database\Eloquent\Relations\MorphMany;
< use Laravel\Passport\Contracts\ScopeAuthorizable;
< use LogicException;
---
> use Laravel\Passport\TransientToken;
11,13d6
< /**
< * @phpstan-require-implements \Laravel\Passport\Contracts\OAuthenticatable
< */
18,44d10
< */
< protected ?ScopeAuthorizable $accessToken = null;
<
< /**
< * Get all of the user's registered OAuth clients.
< *
< * @deprecated Use oauthApps()
< *
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Client, $this>
< */
< public function clients(): HasMany
< {
< return $this->hasMany(Passport::clientModel(), 'user_id');
< }
<
< /**
< * Get all of the user's registered OAuth applications.
< *
< * @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, $this>
< */
< public function oauthApps(): MorphMany
< {
< return $this->morphMany(Passport::clientModel(), 'owner');
< }
<
< /**
< * Get all of the access tokens for the user.
46c12
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, $this>
---
> * @var Laravel\Passport\TransientToken
48,62c14
< public function tokens(): HasMany
< {
< return $this->hasMany(Passport::tokenModel(), 'user_id', $this->getAuthIdentifierName())
< ->where(function (Builder $query): void {
< $query->whereHas('client', function (Builder $query): void {
< $query->where(function (Builder $query): void {
< $provider = $this->getProviderName();
<
< $query->when($provider === config('auth.guards.api.provider'), function (Builder $query): void {
< $query->orWhereNull('provider');
< })->orWhere('provider', $provider);
< });
< });
< });
< }
---
> protected $accessToken;
65c17
< * Get the access token currently associated with the user.
---
> * Get the current access token being used by the user.
67,75c19
< public function token(): ?ScopeAuthorizable
< {
< return $this->currentAccessToken();
< }
<
< /**
< * Get the access token currently associated with the user.
< */
< public function currentAccessToken(): ?ScopeAuthorizable
---
> public function token(): ?TransientToken
85,123c29
< return $this->accessToken && $this->accessToken->can($scope);
< }
<
< /**
< * Determine if the current API token is missing a given scope.
< */
< public function tokenCant(string $scope): bool
< {
< return ! $this->tokenCan($scope);
< }
<
< /**
< * Create a new personal access token for the user.
< *
< * @param string[] $scopes
< */
< public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult
< {
< return app(PersonalAccessTokenFactory::class)->make(
< $this->getAuthIdentifier(), $name, $scopes, $this->getProviderName()
< );
< }
<
< /**
< * Get the user provider name.
< *
< * @throws \LogicException
< */
< public function getProviderName(): string
< {
< $providers = collect(config('auth.guards'))->where('driver', 'passport')->pluck('provider')->all();
<
< foreach (config('auth.providers') as $provider => $config) {
< if (in_array($provider, $providers) && $config['driver'] === 'eloquent' && is_a($this, $config['model'])) {
< return $provider;
< }
< }
<
< throw new LogicException('Unable to determine authentication provider for this model from configuration.');
---
> return $this->accessToken ? $this->accessToken->can($scope) : false;
129c35
< public function withAccessToken(?ScopeAuthorizable $accessToken): static
---
> public function withAccessToken(TransientToken $accessToken): static
root@docker_lamp_1:/home/jiminny# cat vendor/laravel/passport/src/Contracts/OAuthenticatable.php
<?php
namespace Laravel\Passport\Contracts;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Laravel\Passport\PersonalAccessTokenResult;
interface OAuthenticatable extends Authenticatable
{
/**
* Get all the user's registered OAuth applications.
*
* @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, \Illuminate\Foundation\Auth\User>
*/
public function oauthApps(): MorphMany;
/**
* Get all the access tokens for the user.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, \Illuminate\Foundation\Auth\User>
*/
public function tokens(): HasMany;
/**
* Determine if the current API token has a given scope.
*/
public function tokenCan(string $scope): bool;
/**
* Determine if the current API token is missing a given scope.
*/
public function tokenCant(string $scope): bool;
/**
* Create a new personal access token for the user.
*
* @param string[] $scopes
*/
public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult;
/**
* Get the access token currently associated with the user.
*/
public function currentAccessToken(): ?ScopeAuthorizable;
/**
* Set the current access token for the user.
*/
public function withAccessToken(?ScopeAuthorizable $accessToken): static;
/**
* Get the user provider name.
*/
public function getProviderName(): string;
}
root@docker_lamp_1:/home/jiminny# grep -n "use HasApiTokens" app/Models/User.php app/Models/Partner.php app/Traits/HasApiTokens.php
app/Models/User.php:243: use HasApiTokens;
app/Models/Partner.php:78: use HasApiTokens;
root@docker_lamp_1:/home/jiminny# # Does User use Jiminny's or Passport's?
grep -rn "HasApiTokens" app/Models/User.php
43:use Laravel\Passport\HasApiTokens;
243: use HasApiTokens;
root@docker_lamp_1:/home/jiminny# grep -rn "Jiminny\\\Traits\\\HasApiTokens" app/
root@docker_lamp_1:/home/jiminny# grep -rn "use Jiminny\\\\Traits\\\\HasApiTokens" app/
root@docker_lamp_1:/home/jiminny#
DOCKER
Close Tab
DEV (docker)
Close Tab
APP (-zsh)
Close Tab
-zsh
Close Tab
screenpipe"
Close Tab
⌥⌘1
DEV (docker)...
|
iTerm2
|
DEV (docker)
|
NULL
|
53874
|
|
53875
|
root@docker_lamp_1:/home/jiminny# diff \
vendor/ root@docker_lamp_1:/home/jiminny# diff \
vendor/laravel/passport/src/HasApiTokens.php \
app/Traits/HasApiTokens.php
3c3
< namespace Laravel\Passport;
---
> namespace Jiminny\Traits;
5,9c5
< use Illuminate\Database\Eloquent\Builder;
< use Illuminate\Database\Eloquent\Relations\HasMany;
< use Illuminate\Database\Eloquent\Relations\MorphMany;
< use Laravel\Passport\Contracts\ScopeAuthorizable;
< use LogicException;
---
> use Laravel\Passport\TransientToken;
11,13d6
< /**
< * @phpstan-require-implements \Laravel\Passport\Contracts\OAuthenticatable
< */
18,44d10
< */
< protected ?ScopeAuthorizable $accessToken = null;
<
< /**
< * Get all of the user's registered OAuth clients.
< *
< * @deprecated Use oauthApps()
< *
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Client, $this>
< */
< public function clients(): HasMany
< {
< return $this->hasMany(Passport::clientModel(), 'user_id');
< }
<
< /**
< * Get all of the user's registered OAuth applications.
< *
< * @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, $this>
< */
< public function oauthApps(): MorphMany
< {
< return $this->morphMany(Passport::clientModel(), 'owner');
< }
<
< /**
< * Get all of the access tokens for the user.
46c12
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, $this>
---
> * @var Laravel\Passport\TransientToken
48,62c14
< public function tokens(): HasMany
< {
< return $this->hasMany(Passport::tokenModel(), 'user_id', $this->getAuthIdentifierName())
< ->where(function (Builder $query): void {
< $query->whereHas('client', function (Builder $query): void {
< $query->where(function (Builder $query): void {
< $provider = $this->getProviderName();
<
< $query->when($provider === config('auth.guards.api.provider'), function (Builder $query): void {
< $query->orWhereNull('provider');
< })->orWhere('provider', $provider);
< });
< });
< });
< }
---
> protected $accessToken;
65c17
< * Get the access token currently associated with the user.
---
> * Get the current access token being used by the user.
67,75c19
< public function token(): ?ScopeAuthorizable
< {
< return $this->currentAccessToken();
< }
<
< /**
< * Get the access token currently associated with the user.
< */
< public function currentAccessToken(): ?ScopeAuthorizable
---
> public function token(): ?TransientToken
85,123c29
< return $this->accessToken && $this->accessToken->can($scope);
< }
<
< /**
< * Determine if the current API token is missing a given scope.
< */
< public function tokenCant(string $scope): bool
< {
< return ! $this->tokenCan($scope);
< }
<
< /**
< * Create a new personal access token for the user.
< *
< * @param string[] $scopes
< */
< public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult
< {
< return app(PersonalAccessTokenFactory::class)->make(
< $this->getAuthIdentifier(), $name, $scopes, $this->getProviderName()
< );
< }
<
< /**
< * Get the user provider name.
< *
< * @throws \LogicException
< */
< public function getProviderName(): string
< {
< $providers = collect(config('auth.guards'))->where('driver', 'passport')->pluck('provider')->all();
<
< foreach (config('auth.providers') as $provider => $config) {
< if (in_array($provider, $providers) && $config['driver'] === 'eloquent' && is_a($this, $config['model'])) {
< return $provider;
< }
< }
<
< throw new LogicException('Unable to determine authentication provider for this model from configuration.');
---
> return $this->accessToken ? $this->accessToken->can($scope) : false;
129c35
< public function withAccessToken(?ScopeAuthorizable $accessToken): static
---
> public function withAccessToken(TransientToken $accessToken): static
root@docker_lamp_1:/home/jiminny# cat vendor/laravel/passport/src/Contracts/OAuthenticatable.php
<?php
namespace Laravel\Passport\Contracts;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Laravel\Passport\PersonalAccessTokenResult;
interface OAuthenticatable extends Authenticatable
{
/**
* Get all the user's registered OAuth applications.
*
* @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, \Illuminate\Foundation\Auth\User>
*/
public function oauthApps(): MorphMany;
/**
* Get all the access tokens for the user.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, \Illuminate\Foundation\Auth\User>
*/
public function tokens(): HasMany;
/**
* Determine if the current API token has a given scope.
*/
public function tokenCan(string $scope): bool;
/**
* Determine if the current API token is missing a given scope.
*/
public function tokenCant(string $scope): bool;
/**
* Create a new personal access token for the user.
*
* @param string[] $scopes
*/
public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult;
/**
* Get the access token currently associated with the user.
*/
public function currentAccessToken(): ?ScopeAuthorizable;
/**
* Set the current access token for the user.
*/
public function withAccessToken(?ScopeAuthorizable $accessToken): static;
/**
* Get the user provider name.
*/
public function getProviderName(): string;
}
root@docker_lamp_1:/home/jiminny# grep -n "use HasApiTokens" app/Models/User.php app/Models/Partner.php app/Traits/HasApiTokens.php
app/Models/User.php:243: use HasApiTokens;
app/Models/Partner.php:78: use HasApiTokens;
root@docker_lamp_1:/home/jiminny# # Does User use Jiminny's or Passport's?
grep -rn "HasApiTokens" app/Models/User.php
43:use Laravel\Passport\HasApiTokens;
243: use HasApiTokens;
root@docker_lamp_1:/home/jiminny# grep -rn "Jiminny\\\Traits\\\HasApiTokens" app/
root@docker_lamp_1:/home/jiminny# grep -rn "use Jiminny\\\\Traits\\\\HasApiTokens" app/
root@docker_lamp_1:/home/jiminny#
DOCKER
Close Tab
DEV (docker)
Close Tab
APP (-zsh)
Close Tab
-zsh
Close Tab
screenpipe"
Close Tab
⌥⌘1
DEV (docker)...
|
iTerm2
|
DEV (docker)
|
NULL
|
53875
|
|
53876
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelp100% 0 8DOCKER381public function tokens(): HasMany;DEV (docker)$82DEV (docker)APP (-zsh)*3-zsh• *4screenpipe™Mon 20 Apr 11:31:58T81*- *5/***/* Determine if the current API token has a given scope.public function tokenCan(string $scope): bool;/***/* Determine if the current API token is missing a given scope.public function tokenCant(stringSscope): bool;/*** Createa new personal accesstoken for the user.* @param*/string(]Sscopespublic function createToken(string Sname, array $scopes = []): PersonalAccessTokenResult;/***/* Get the access token currently associated with the user.public function currentAccessToken(): ?ScopeAuthorizable;/***/* Set the current access token for the user.public function withAccessToken(?ScopeAuthorizable SaccessToken): static;/*** Get the user provider name.*/public function getProviderName(): string;root@docker_lamp_1:/home/jiminny#grep-n "use HasApiTokens" app/Models/User.php app/Models/Partner.php app/Traits/HasApiTokens.phpapp/Models/User.php:243:use HasApiTokens;app/Models/Partner.php:78:use HasApiTokens;root@docker_lamp_1:/home/jiminny# # Does User use Jiminny's or Passport's?greprn"HasApiTokens"app/Models/User.php43:use Laravel\Passport\HasApiTokens;243:use HasApiTokens;root@docker_lamp_1:/home/jiminny# grep -rn "Jiminny\|\Traits|(\HasApiTokens" app/root@docker_lamp_1:/home/jiminny# grep -rn "use Jiminny\||\Traits| ||\HasApiTokens" app/root@docker_lamp_1:/home/jiminny#DEV...
|
iTerm2
|
NULL
|
NULL
|
53876
|
|
53877
|
FV faVsco.js~?9 masterProledey© Opportunity.php© P FV faVsco.js~?9 masterProledey© Opportunity.php© Participant.php© Partner.php© Permission.phpC Phonenumber.ongPlayoacklneme.ono© Playbook.phpC) Playbookcategorv.php©Playlist.phpC) RateLimit.php© Region.phpC) Role.php©RoleChangeEvent.phpc) ScoveGrouo.ono© Session.php(C) SlackBot.oho© SocialAccount.php© Stage.php© Taskphp© Team.php© TeamAiContext.php© TeamDomain.php© TeamFeature.php© TeamSettings.php© TextRelay.php© Track.php© TranscriptionModel.php© TranscriptionModelLocale.php© TranscriptionProvider.phpc User.php© UserSettings.php© Vocabulary.phpc) VocabularyPronunciation.php© VoiceAccess.php(c)VolceconsentPrefix.onoNotitications• → Observers> Eo Policiesv Providers©ActivityServiceProvider.php@ AniServiceProvider.nhn© AppServiceProvider.phpC) AuthServiceProvider.nhn©BroadcastServiceProvider.php© CalendarServiceProvider.php© CreateParticipantsServiceProvideC) CrmServiceProvider nhnl© EncryptionServiceProvider.php© EventServiceProvider.php© HubspotJournalServiceProvider.p© HubspotWebhookServiceProviderA limiAppServiceProvider.phpC) AutomatedReport.phonamespace Jiminny \Models;Jiminny \Models\Useramethod string[] getRoles() laratrust's annotation* @property int $id ]* @property mixed $uvidx oohopent scring snamex olooent surind semalt* doroperty string null ssecondary emaz* doroperty string null spassword•doroperty string null sonoto pachAproperty bool $uses_two_factor_auth•doropertu strinolnuur sauthu 10@property string|null $country_code• doropertu int.nulz Sregion 1di• doropertu strinalnulz ssecondaru phone@property string|null $caller_id• coronentu int nuu sion title 1di@property string|null $two_factor_reset_code• Goronertu int Steam id@property int|null $group_id* @property string|null $timezone* @property string $language* @property string|null Sconference_number* @property string|null $conference_pin* @property string|null $conference_slug* @property string $conference_join_preference* Anropertu bool Sconference join reminder |* doropertu scring sconterence recora announce* @property int Sconference_record_preference* doroperty int sconference banawidch* opropertu int sconference start weocam• ∞.MOn ZU AOr 11:31:00Security patch review and testing guidanceservice.pnpkouteservicerrovider.ong© Partner.php© FieldRepository.php© ReportController.php© User.phpxOsyncuserrllotcompanyListener.gCreateAcuivityLoggedevent.ong© createsnaredevent.pngA67 X1 X7Both models use Passport's own HasApiTokens (Laravel\Passport\HasApiTokens), notyour custom Jiminny\Traits\HasApiTokens . Your custom trait inapp/Traits/HasApiTokens. php is essentially dead code — nothing imports it.outright wrong! Also, we don't support using the $team argument.# Conturm nothino uses the custom trautgrep -rn "JiminnyTrsApiTokens" app/Reovngrep -rn "use Jiminny|||\Traits|||\HasApiTokens" app/If that comes back empty, you're fine. Passport's full trait is what's actually running on bothUser and Partner, which means:•A lll untertace methods are satishedi• withAccessToken(?ScopeAuthorizable) is the correct signaturetokens() , oauthApps(), createToken() , getProviderName() etc. are all presentThe custom trait in app/Traits/HasApiTokens.php is just orphaned code - probably aleftover from an older version of Passport before the library provided a proper trait. It'sharmless right now but should be deleted to avoid confusion.Bottom line on the securitv PR: vou're clear. Passport is wired un correctlv. the bump is safe.and the one failing test was the pre-existing flaky factory issue. You can proceed withconncence*Reply...Sonnet 4.6Claude ic Aland can make mictakes Plosce double-check recnoncaci...
|
iTerm2
|
NULL
|
NULL
|
53877
|
|
53878
|
iTerm2ShellEdit|ViewSessionScriptsProfilesWindowHe iTerm2ShellEdit|ViewSessionScriptsProfilesWindowHelp‹$0DOCKER₴81public function tokens(): HasMany;DEV (docker)$82DEV (docker)APP (-zsh)*3-zsh• *4100% C47 8 Mon 20 Apr 11:31:59T₴1|screenpipe"• *5/***/* Determine if the current API token has a given scope.public function tokenCan(string $scope): bool;/***/* Determine if the current API token is missing a given scope.public function tokenCant(stringSscope): bool;/*** Createa new personal accesstoken for the user.* @param*/string(]Sscopespublic function createToken(string Sname, array $scopes = []): PersonalAccessTokenResult;/***/* Get the access token currently associated with the user.public function currentAccessToken(): ?ScopeAuthorizable;/***/* Set the current access token for the user.public function withAccessToken(?ScopeAuthorizable SaccessToken): static;/***/* Get the user provider name.public function getProviderName(): string;root@docker_lamp_1:/home/jiminny#grep-n "use HasApiTokens" app/Models/User.php app/Models/Partner.php app/Traits/HasApiTokens.phpapp/Models/User.php:243:use HasApiTokens;app/Models/Partner.php:78:use HasApiTokens;root@docker_lamp_1:/home/jiminny# # Does User use Jiminny's or Passport's?greprn"HasApiTokens"app/Models/User.php43:use Laravel\Passport\HasApiTokens;243:use HasApiTokens;root@docker_lamp_1:/home/jiminny# grep -rn "Jiminny\|\Traits|(\HasApiTokens" app/root@docker_lamp_1:/home/jiminny# grep -rn "use Jiminny\||\Traits| ||\HasApiTokens" app/root@docker_lamp_1:/home/jiminny#DEV...
|
iTerm2
|
NULL
|
NULL
|
53878
|
|
53879
|
VIeWWindowrTavsco.sProject© Opportunity.php© Parti VIeWWindowrTavsco.sProject© Opportunity.php© Participant.php© Partner.php© Permission.phpC Phonenumber.ongPlayoacklneme.ono© Playbook.phpC) Playbookcategorv.php©Playlist.phpC) RateLimit.php© Region.phpC) Role.php©RoleChangeEvent.phpc) ScoveGrouo.ono© Session.php(C) SlackBot.oho© SocialAccount.php© Stage.php© Taskphp© Team.php© TeamAiContext.php© TeamDomain.php© TeamFeature.php© TeamSettings.php© TextRelay.php© Track.php© TranscriptionModel.php© TranscriptionModelLocale.php© TranscriptionProvider.phpc User.php© UserSettings.php© Vocabulary.phpc) VocabularyPronunciation.php© VoiceAccess.php(c)VolceconsentPrefix.onoNotitications• → Observers> Eo Policiesv Providers©ActivityServiceProvider.php@ AniServiceProvider.nhn© AppServiceProvider.phpC) AuthServiceProvider.nhn© BroadcastServiceProvider.php© CalendarServiceProvider.php© CreateParticipantsServiceProvide(C) CrmServiceProvider.nhn© EncryptionServiceProvider.php© EventServiceProvider.php© HubspotJournalServiceProvider.p© HubspotWebhookServiceProviderA limiAppServiceProvider.phpC) AutomatedReport.phonamespace Jiminny \Models;Jiminny \Models\Useramethod string[] getRoles() laratrust's annotation* @property int $id ]* @property mixed $uvidx ocopent scring snamex olooent surind semalt* doroperty string null ssecondaryemaz* doroperty string null spasswora•doroperty string null sonoto pachAproperty bool $uses_two_factor_auth•doropertu strinolnuur sauthu 10@property string|null $country_code• doropertu int.nulz Sregion 1di• doropertu strinalnulz ssecondaru phone@property string|null $caller_id* Goronentu int nuu sion titie 1di@property string|null $two_factor_reset_code• Goronertu int Steam id@property int/null $group_id* @property string|null $timezone* @property string $language* @property string|null $conference_number* @property string|null $conference_pin* @property string|null $conference_slug* @property string $conference_join_preference* doroperty scring sconterence recora announce* @property int Sconference_record_preference* doroperty int sconference banawidch* opropertu int sconference start weocam• ∞.100% C4& Mon 20 Apr 11:32:01Security patch review and testing guidanceService.php© RouteServiceProvider.php© Field.php(c) Partner.php© FieldRepository.php© ReportController.php© User.phpx© SyncUserPilotCompanyListener.fCreateAcuivityLoggedevent.ong© CreateSharedEvent.phpA67 X1 X7root@docker_lamp_1:/home/jiminny# grep-rn"Jiminny "Traits|" HasApilokens" app/root@docker_lamp_1:/home/jiminny# grep-rn "useJiminny (|l| Traitsl|||HasApiTokens" app/root@docker_lamp_1:/home/jiminny#outright wrong! Also, we don't support using the $team argument.$1iTermPSReply...CannotAhClaude is Al and can make mistakes. Please double-check responses....
|
iTerm2
|
NULL
|
NULL
|
53879
|
|
53899
|
root@docker_lamp_1:/home/jiminny# diff \
vendor/ root@docker_lamp_1:/home/jiminny# diff \
vendor/laravel/passport/src/HasApiTokens.php \
app/Traits/HasApiTokens.php
3c3
< namespace Laravel\Passport;
---
> namespace Jiminny\Traits;
5,9c5
< use Illuminate\Database\Eloquent\Builder;
< use Illuminate\Database\Eloquent\Relations\HasMany;
< use Illuminate\Database\Eloquent\Relations\MorphMany;
< use Laravel\Passport\Contracts\ScopeAuthorizable;
< use LogicException;
---
> use Laravel\Passport\TransientToken;
11,13d6
< /**
< * @phpstan-require-implements \Laravel\Passport\Contracts\OAuthenticatable
< */
18,44d10
< */
< protected ?ScopeAuthorizable $accessToken = null;
<
< /**
< * Get all of the user's registered OAuth clients.
< *
< * @deprecated Use oauthApps()
< *
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Client, $this>
< */
< public function clients(): HasMany
< {
< return $this->hasMany(Passport::clientModel(), 'user_id');
< }
<
< /**
< * Get all of the user's registered OAuth applications.
< *
< * @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, $this>
< */
< public function oauthApps(): MorphMany
< {
< return $this->morphMany(Passport::clientModel(), 'owner');
< }
<
< /**
< * Get all of the access tokens for the user.
46c12
< * @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, $this>
---
> * @var Laravel\Passport\TransientToken
48,62c14
< public function tokens(): HasMany
< {
< return $this->hasMany(Passport::tokenModel(), 'user_id', $this->getAuthIdentifierName())
< ->where(function (Builder $query): void {
< $query->whereHas('client', function (Builder $query): void {
< $query->where(function (Builder $query): void {
< $provider = $this->getProviderName();
<
< $query->when($provider === config('auth.guards.api.provider'), function (Builder $query): void {
< $query->orWhereNull('provider');
< })->orWhere('provider', $provider);
< });
< });
< });
< }
---
> protected $accessToken;
65c17
< * Get the access token currently associated with the user.
---
> * Get the current access token being used by the user.
67,75c19
< public function token(): ?ScopeAuthorizable
< {
< return $this->currentAccessToken();
< }
<
< /**
< * Get the access token currently associated with the user.
< */
< public function currentAccessToken(): ?ScopeAuthorizable
---
> public function token(): ?TransientToken
85,123c29
< return $this->accessToken && $this->accessToken->can($scope);
< }
<
< /**
< * Determine if the current API token is missing a given scope.
< */
< public function tokenCant(string $scope): bool
< {
< return ! $this->tokenCan($scope);
< }
<
< /**
< * Create a new personal access token for the user.
< *
< * @param string[] $scopes
< */
< public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult
< {
< return app(PersonalAccessTokenFactory::class)->make(
< $this->getAuthIdentifier(), $name, $scopes, $this->getProviderName()
< );
< }
<
< /**
< * Get the user provider name.
< *
< * @throws \LogicException
< */
< public function getProviderName(): string
< {
< $providers = collect(config('auth.guards'))->where('driver', 'passport')->pluck('provider')->all();
<
< foreach (config('auth.providers') as $provider => $config) {
< if (in_array($provider, $providers) && $config['driver'] === 'eloquent' && is_a($this, $config['model'])) {
< return $provider;
< }
< }
<
< throw new LogicException('Unable to determine authentication provider for this model from configuration.');
---
> return $this->accessToken ? $this->accessToken->can($scope) : false;
129c35
< public function withAccessToken(?ScopeAuthorizable $accessToken): static
---
> public function withAccessToken(TransientToken $accessToken): static
root@docker_lamp_1:/home/jiminny# cat vendor/laravel/passport/src/Contracts/OAuthenticatable.php
<?php
namespace Laravel\Passport\Contracts;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Laravel\Passport\PersonalAccessTokenResult;
interface OAuthenticatable extends Authenticatable
{
/**
* Get all the user's registered OAuth applications.
*
* @return \Illuminate\Database\Eloquent\Relations\MorphMany<\Laravel\Passport\Client, \Illuminate\Foundation\Auth\User>
*/
public function oauthApps(): MorphMany;
/**
* Get all the access tokens for the user.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany<\Laravel\Passport\Token, \Illuminate\Foundation\Auth\User>
*/
public function tokens(): HasMany;
/**
* Determine if the current API token has a given scope.
*/
public function tokenCan(string $scope): bool;
/**
* Determine if the current API token is missing a given scope.
*/
public function tokenCant(string $scope): bool;
/**
* Create a new personal access token for the user.
*
* @param string[] $scopes
*/
public function createToken(string $name, array $scopes = []): PersonalAccessTokenResult;
/**
* Get the access token currently associated with the user.
*/
public function currentAccessToken(): ?ScopeAuthorizable;
/**
* Set the current access token for the user.
*/
public function withAccessToken(?ScopeAuthorizable $accessToken): static;
/**
* Get the user provider name.
*/
public function getProviderName(): string;
}
root@docker_lamp_1:/home/jiminny# grep -n "use HasApiTokens" app/Models/User.php app/Models/Partner.php app/Traits/HasApiTokens.php
app/Models/User.php:243: use HasApiTokens;
app/Models/Partner.php:78: use HasApiTokens;
root@docker_lamp_1:/home/jiminny# # Does User use Jiminny's or Passport's?
grep -rn "HasApiTokens" app/Models/User.php
43:use Laravel\Passport\HasApiTokens;
243: use HasApiTokens;
root@docker_lamp_1:/home/jiminny# grep -rn "Jiminny\\\Traits\\\HasApiTokens" app/
root@docker_lamp_1:/home/jiminny# grep -rn "use Jiminny\\\\Traits\\\\HasApiTokens" app/
root@docker_lamp_1:/home/jiminny#
DOCKER
Close Tab
DEV (docker)
Close Tab
APP (-zsh)
Close Tab
-zsh
Close Tab
screenpipe"
Close Tab
⌥⌘1
DEV (docker)...
|
iTerm2
|
DEV (docker)
|
NULL
|
53899
|