ApiKeyRepositoryInterface
interface ApiKeyRepositoryInterface (View source)
Persistence for API keys: lookup by key value or owner, creation, expiry and usage tracking.
Methods
Get all API keys
Find an API key by its secret key value
Delete an API key
Update the last used timestamp of an API key
Disable an API key
Enable an API key
Count number of API keys for a user
Get the zone IDs an API key is restricted to
Replace the set of zone IDs an API key is restricted to
Details
array
getAll(int|null $userId = null)
Get all API keys
ApiKey|null
findById(int $id)
Find an API key by ID
ApiKey|null
findBySecretKey(string $secretKey)
Find an API key by its secret key value
bool
delete(int $id)
Delete an API key
bool
updateLastUsed(int $id)
Update the last used timestamp of an API key
bool
disable(int $id)
Disable an API key
bool
enable(int $id)
Enable an API key
int
countByUser(int $userId)
Count number of API keys for a user
array
getZoneIds(int $apiKeyId)
Get the zone IDs an API key is restricted to
void
saveZoneIds(int $apiKeyId, array $zoneIds)
Replace the set of zone IDs an API key is restricted to