phpDocumentor

RequestControl Uses GxAdapterTrait

Class RequestControl

Table of Contents

$allowedIpsUrl  : string
$curl  : CurlClient
$gxAdapter  : mixed
$tokenDataCacheKey  : string
$tokenLifeSpan  : int
__construct()  : mixed
RequestControl constructor.
createRequestToken()  : string
Creates a new request token and returns it.
setGxAdapter()  : mixed
verifyRequestIp()  : bool
Checks a given ip and tries to verify it.
verifyRequestToken()  : bool
Checks a given token and tries to verify it.
deleteOldRequestTokens()  : void
Deletes old request tokens.
getRequestTokens()  : array<string|int, mixed>
Returns all active and existing request tokens.
gxAdapter()  : GxAdapter

Properties

$allowedIpsUrl

private string $allowedIpsUrl = 'https://core-api.gambiohub.com/trust/allowed_admin_feed_ips.json'

$tokenDataCacheKey

private string $tokenDataCacheKey = 'admin-feed-request-tokens'

Methods

createRequestToken()

Creates a new request token and returns it.

public createRequestToken() : string
Return values
string

verifyRequestIp()

Checks a given ip and tries to verify it.

public verifyRequestIp(string $ip) : bool
Parameters
$ip : string
Return values
bool

Returns true, if the given ip is valid, otherwise false will be returned.

verifyRequestToken()

Checks a given token and tries to verify it.

public verifyRequestToken(string $token) : bool
Parameters
$token : string
Return values
bool

Returns true, if the given token is valid, otherwise false will be returned.

deleteOldRequestTokens()

Deletes old request tokens.

private deleteOldRequestTokens() : void
Return values
void

getRequestTokens()

Returns all active and existing request tokens.

private getRequestTokens() : array<string|int, mixed>
Return values
array<string|int, mixed>

Search results