CoolCMS API

ApiClientIdentity
in package

FinalYes

Verified external Api client for one request: who it is, which roles may be applied through it and its limits (`null` means the default from `api.clientKey.limits`).

Created only for a valid key of an enabled, non-revoked application; it carries neither the digest nor the readable key. Limits belong to the application, not the key; keyId serves only for recording the last use of the key.

Table of Contents

Properties

$allowedRoleCodes  : array<string|int, mixed>
$id  : int
$ipLimitPerMinute  : int|null
$keyId  : int
$keyLastUsedAt  : int|null
$lastUsedAt  : int|null
$limitPerMinute  : int|null
$limitPerSecond  : int|null
$name  : string
$userLimitPerMinute  : int|null

Methods

__construct()  : mixed
withLastUsedAt()  : self
Returns a copy with a new last-used time of both the application and the key.

Properties

$allowedRoleCodes read-only

public array<string|int, mixed> $allowedRoleCodes

Methods

__construct()

public __construct(int $id, string $name, array<int, string> $allowedRoleCodes[, int|null $limitPerSecond = null ][, int|null $limitPerMinute = null ][, int|null $userLimitPerMinute = null ][, int|null $ipLimitPerMinute = null ][, int|null $lastUsedAt = null ][, int $keyId = 0 ][, int|null $keyLastUsedAt = null ]) : mixed
Parameters
$id : int
$name : string
$allowedRoleCodes : array<int, string>

role codes (cms_system_user_roles.code) allowed to the client

$limitPerSecond : int|null = null
$limitPerMinute : int|null = null
$userLimitPerMinute : int|null = null
$ipLimitPerMinute : int|null = null
$lastUsedAt : int|null = null

unix time of the last recorded use of the application (last_used_at is written at most once a minute)

$keyId : int = 0

id of the key (cms_system_api_client_keys) the request came with; 0 = unknown (tests)

$keyLastUsedAt : int|null = null

unix time of the last recorded use of this key

withLastUsedAt()

Returns a copy with a new last-used time of both the application and the key.

public withLastUsedAt(int $lastUsedAt) : self
Parameters
$lastUsedAt : int
Return values
self
On this page

Search results