OAuthAccounts
class OAuthAccounts
Constants
| DEFAULT_CACHE_TTL |
|
| DEFAULT_CACHE_PREFIX |
|
| protected DEFAULT_ACCOUNT_MODEL |
|
Properties
| static protected OAuthAccount> | $accountModel | ||
| static protected bool | $initialized | ||
| static protected string|null | $partitionColumn | ||
| static protected null|Closure(): null|int|string | $partitionResolver | ||
| protected Repository|null | $cache | ||
| protected int | $cacheTtl | ||
| protected Repository|null | $renewalCache | ||
| protected string | $renewalStore |
Methods
Create the account service.
Select the account model.
Get the configured account model.
Resolve the current partition, rejecting missing configured context.
Validate an existing account's partition or fill it for a new account.
Check that an account reference still belongs to the active context.
Read committed credentials, using the shared cache when enabled.
Get current credentials, sharing one bounded renewal with waiting callers.
Claim, perform and persist one provider attempt while holding the renewal lock.
Use the authoritative replacement after losing a conditional write.
Calculate a bounded provider retry delay in milliseconds.
Read a structured OAuth error without inspecting exception messages.
Determine whether shared credential caching is enabled.
Resolve and validate the credential cache only when it is used.
Resolve and validate the renewal lock store only when it is used.
Flush all static state.
Details
at line 71
__construct(Repository $config, Factory $cacheFactory, ModelCacheCoordinator $cacheCoordinator, ModelCacheStoreValidator $cacheValidator, TokenAcquisition $acquisition, ExceptionHandler $exceptions)
Create the account service.
at line 88
static void
useAccountModel(string $model)
Select the account model.
The model persists for the worker lifetime and affects every account operation.
at line 107
static string
accountModel()
Get the configured account model.
at line 119
static void
resolvePartitionUsing(string $column, Closure $resolver)
Configure the account partition resolver.
The column and callback persist for the worker lifetime and affect every account operation.
at line 137
string|null
partition()
Resolve the current partition, rejecting missing configured context.
at line 157
void
prepareAccount(OAuthAccount $account)
Validate an existing account's partition or fill it for a new account.
at line 187
OAuthAccountIdentity
identity(OAuthAccount $account)
Capture an account's persisted storage identity.
at line 222
void
ensurePartition(OAuthAccountIdentity $identity)
Check that an account reference still belongs to the active context.
at line 232
OAuthAccount
find(OAuthAccountIdentity $identity)
Read committed credentials, using the shared cache when enabled.
at line 255
void
invalidate(OAuthAccountIdentity $identity)
Invalidate the account after its transaction commits.
at line 275
OAuthAuthenticator
token(OAuthAccountIdentity $identity, Closure $refreshUsing)
Get current credentials, sharing one bounded renewal with waiting callers.
at line 321
protected OAuthAuthenticator|null
usableToken(OAuthAccount $account)
Return a usable token, or null when renewal must run first.
at line 347
protected OAuthAuthenticator
renew(OAuthAccountIdentity $identity, Closure $refreshUsing, int $attempt, int|null $retryDelay)
Claim, perform and persist one provider attempt while holding the renewal lock.
at line 462
protected OAuthAuthenticator
replacementToken(OAuthAccountIdentity $identity)
Use the authoritative replacement after losing a conditional write.
at line 475
protected int|null
retryDelay(Throwable $exception, string|null $error, int $attempt)
Calculate a bounded provider retry delay in milliseconds.
at line 507
protected string|null
oauthError(Throwable $exception)
Read a structured OAuth error without inspecting exception messages.
at line 530
protected ResponseInterface|null
failureResponse(Throwable $exception)
Get the response retained by the supported OAuth clients.
at line 542
protected bool
cacheEnabled()
Determine whether shared credential caching is enabled.
at line 550
protected Repository
cache()
Resolve and validate the credential cache only when it is used.
at line 572
protected Repository
renewalCache()
Resolve and validate the renewal lock store only when it is used.
at line 591
protected string
cacheKey(OAuthAccountIdentity $identity)
Build the shared credential key.
at line 599
static void
flushState()
Flush all static state.