class Blacklist implements BlacklistContract

Methods

__construct(StorageContract $storage, int $gracePeriod = 0, int|null $refreshTTL = 20160, int $leeway = 0, string $key = 'jti')

No description

bool
add(array $payload)

Add the token (jti claim) to the blacklist.

bool
addForever(array $payload)

Add the token (jti claim) to the blacklist indefinitely.

bool
addForeverWithGracePeriod(array $payload)

Add the token to the blacklist indefinitely after its grace period.

bool
has(array $payload)

Determine whether the token has been blacklisted.

bool
remove(array $payload)

Remove the token (jti claim) from the blacklist.

bool
clear()

Remove all tokens from the blacklist.

int
getGraceTimestamp()

Get the timestamp when the blacklist comes into effect This defaults to immediate (0 seconds).

setGracePeriod(int $gracePeriod)

Set the grace period.

int
getGracePeriod()

Get the grace period.

string
getKey(array $payload)

Get the unique key held within the blacklist.

setKey(string $key)

Set the unique key held within the blacklist.

setRefreshTTL(int|null $ttl)

Set the refresh time limit.

int|null
getRefreshTTL()

Get the refresh time limit.

CarbonInterface
timestamp(int $timestamp)

No description

Details

at line 15
__construct(StorageContract $storage, int $gracePeriod = 0, int|null $refreshTTL = 20160, int $leeway = 0, string $key = 'jti')

No description

Parameters

StorageContract $storage
int $gracePeriod
int|null $refreshTTL
int $leeway
string $key

at line 27
bool add(array $payload)

Add the token (jti claim) to the blacklist.

Parameters

array $payload

Return Value

bool

at line 75
bool addForever(array $payload)

Add the token (jti claim) to the blacklist indefinitely.

Parameters

array $payload

Return Value

bool

at line 83
protected bool addForeverWithGracePeriod(array $payload)

Add the token to the blacklist indefinitely after its grace period.

Parameters

array $payload

Return Value

bool

at line 103
bool has(array $payload)

Determine whether the token has been blacklisted.

Parameters

array $payload

Return Value

bool

at line 122
bool remove(array $payload)

Remove the token (jti claim) from the blacklist.

Parameters

array $payload

Return Value

bool

at line 130
bool clear()

Remove all tokens from the blacklist.

Return Value

bool

at line 139
protected int getGraceTimestamp()

Get the timestamp when the blacklist comes into effect This defaults to immediate (0 seconds).

Return Value

int

at line 152
Blacklist setGracePeriod(int $gracePeriod)

Set the grace period.

Boot-only. Blacklist is a worker-lifetime singleton; runtime mutation affects every subsequent request and races across coroutines.

Parameters

int $gracePeriod

Return Value

Blacklist

at line 162
int getGracePeriod()

Get the grace period.

Return Value

int

at line 170
string getKey(array $payload)

Get the unique key held within the blacklist.

Parameters

array $payload

Return Value

string

at line 193
Blacklist setKey(string $key)

Set the unique key held within the blacklist.

Boot-only. Blacklist is a worker-lifetime singleton; runtime mutation affects every subsequent request and races across coroutines.

Parameters

string $key

Return Value

Blacklist

at line 208
Blacklist setRefreshTTL(int|null $ttl)

Set the refresh time limit.

Boot-only. Blacklist is a worker-lifetime singleton; runtime mutation affects every subsequent request and races across coroutines.

Parameters

int|null $ttl

Return Value

Blacklist

at line 218
int|null getRefreshTTL()

Get the refresh time limit.

Return Value

int|null

at line 223
protected CarbonInterface timestamp(int $timestamp)

No description

Parameters

int $timestamp

Return Value

CarbonInterface