FileCredentialStorage implements PendingAuthorizationStorageInterface
FinalYes
Persists credentials unencrypted in a JSON file with the mode 0600, in a directory with the mode 0700.
Tags
Table of Contents
Interfaces
- PendingAuthorizationStorageInterface
- Storage must be scoped to the user session that initiated authorization.
Properties
- $path : string
Methods
- __construct() : mixed
- consumePendingAuthorization() : PendingAuthorization|null
- Atomically retrieve and remove a pending authorization, including expired entries.
- forget() : void
- Drop everything held for one authorization server, or the whole store when null.
- getClientRegistration() : ClientRegistration|null
- getToken() : AccessToken|null
- saveClientRegistration() : void
- savePendingAuthorization() : void
- saveToken() : void
- synchronize() : T
- Run an operation while no other process sharing this storage runs one.
-
read()
: array{registrations: array
>, tokens: array >>, pending: array >} - underLock() : T
- update() : void
- Applies a change under an exclusive lock, so another process can't overwrite it.
- write() : void
Properties
$path read-only
private
string
$path
Methods
__construct()
public
__construct(string $path) : mixed
Parameters
- $path : string
consumePendingAuthorization()
Atomically retrieve and remove a pending authorization, including expired entries.
public
consumePendingAuthorization(string $state) : PendingAuthorization|null
Parameters
- $state : string
Return values
PendingAuthorization|nullforget()
Drop everything held for one authorization server, or the whole store when null.
public
forget([string|null $issuer = null ]) : void
Parameters
- $issuer : string|null = null
getClientRegistration()
public
getClientRegistration(string $issuer) : ClientRegistration|null
Parameters
- $issuer : string
-
the authorization server's issuer identifier
Return values
ClientRegistration|nullgetToken()
public
getToken(string $issuer, string $resource) : AccessToken|null
Parameters
- $issuer : string
-
the authorization server's issuer identifier
- $resource : string
-
the canonical URI of the protected resource the token may be sent to, followed by
#, the grant and, for a configured client, its client ID
Return values
AccessToken|nullsaveClientRegistration()
public
saveClientRegistration(string $issuer, ClientRegistration $registration) : void
Parameters
- $issuer : string
- $registration : ClientRegistration
savePendingAuthorization()
public
savePendingAuthorization(PendingAuthorization $authorization) : void
Parameters
- $authorization : PendingAuthorization
saveToken()
public
saveToken(string $issuer, string $resource, AccessToken $token) : void
Parameters
- $issuer : string
- $resource : string
- $token : AccessToken
synchronize()
Run an operation while no other process sharing this storage runs one.
public
synchronize(callable $operation) : T
Parameters
- $operation : callable
Return values
Tread()
private
read() : array{registrations: array>, tokens: array>>, pending: array>}
Return values
array{registrations: arrayunderLock()
private
underLock(string $suffix, callable(): T $operation) : T
Parameters
- $suffix : string
- $operation : callable(): T
Return values
Tupdate()
Applies a change under an exclusive lock, so another process can't overwrite it.
private
update(callable(array{registrations: array>, tokens: array>>, pending: array>}): array{registrations: array>, tokens: array>>, pending: array>} $change) : void
Parameters
-
$change
: callable(array{registrations: array
>, tokens: array >>, pending: array >}): array{registrations: array >, tokens: array >>, pending: array >}
write()
private
write(array{registrations: array>, tokens: array>>, pending: array>} $data) : void
Parameters
-
$data
: array{registrations: array
>, tokens: array >>, pending: array >}