class Blacklist implements BlacklistContract

Methods

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

Create a new blacklist instance.

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)

Create a date from a Unix timestamp.

Details

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

Create a new blacklist instance.

Parameters

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

at line 31
bool add(array $payload)

Add the token (jti claim) to the blacklist.

Parameters

array $payload

Return Value

bool

at line 79
bool addForever(array $payload)

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

Parameters

array $payload

Return Value

bool

at line 87
protected bool addForeverWithGracePeriod(array $payload)

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

Parameters

array $payload

Return Value

bool

at line 107
bool has(array $payload)

Determine whether the token has been blacklisted.

Parameters

array $payload

Return Value

bool

at line 126
bool remove(array $payload)

Remove the token (jti claim) from the blacklist.

Parameters

array $payload

Return Value

bool

at line 134
bool clear()

Remove all tokens from the blacklist.

Return Value

bool

at line 143
protected int getGraceTimestamp()

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

Return Value

int

at line 156
Blacklist setGracePeriod(int $gracePeriod)

Set the grace period.

On the shared blacklist, runtime mutation affects every subsequent request and races across coroutines.

Parameters

int $gracePeriod

Return Value

Blacklist

at line 167
int getGracePeriod()

Get the grace period.

Return Value

int

at line 175
string getKey(array $payload)

Get the unique key held within the blacklist.

Parameters

array $payload

Return Value

string

at line 198
Blacklist setKey(string $key)

Set the unique key held within the blacklist.

On the shared blacklist, runtime mutation affects every subsequent request and races across coroutines.

Parameters

string $key

Return Value

Blacklist

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

Set the refresh time limit.

On the shared blacklist, runtime mutation affects every subsequent request and races across coroutines.

Parameters

int|null $ttl

Return Value

Blacklist

at line 225
int|null getRefreshTTL()

Get the refresh time limit.

Return Value

int|null

at line 233
protected CarbonInterface timestamp(int $timestamp)

Create a date from a Unix timestamp.

Parameters

int $timestamp

Return Value

CarbonInterface