DbApiKeyRepository
class DbApiKeyRepository implements ApiKeyRepositoryInterface (View source)
Class DbApiKeyRepository
Database implementation of the API key repository
Constants
| private HASH_PREFIX |
|
Methods
DbApiKeyRepository constructor
No description
No description
One-way hash applied to API keys before persistence. SHA-256 is sufficient
because keys are 256+ bits of entropy from random_bytes(32); brute force
across the keyspace is infeasible without a salt. The sha256$ prefix
makes hashed entries syntactically distinct from any legacy plaintext key
so the plaintext-fallback path can refuse pass-the-hash candidates without
also rejecting unusual legacy key formats.
No description
No description
No description
No description
No description
No description
No description
Details
__construct(PDO $db, ConfigurationManager $config, LoggerInterface|null $logger = null)
DbApiKeyRepository constructor
array
getAll(int|null $userId = null)
No description
ApiKey|null
findById(int $id)
No description
ApiKey|null
findBySecretKey(string $secretKey)
No description
static string
hashSecretKey(string $secretKey)
One-way hash applied to API keys before persistence. SHA-256 is sufficient
because keys are 256+ bits of entropy from random_bytes(32); brute force
across the keyspace is infeasible without a salt. The sha256$ prefix
makes hashed entries syntactically distinct from any legacy plaintext key
so the plaintext-fallback path can refuse pass-the-hash candidates without
also rejecting unusual legacy key formats.
bool
delete(int $id)
No description
bool
updateLastUsed(int $id)
No description
bool
disable(int $id)
No description
bool
enable(int $id)
No description
int
countByUser(int $userId)
No description
array
getZoneIds(int $apiKeyId)
No description
void
saveZoneIds(int $apiKeyId, array $zoneIds)
No description