Iskra API Reference
    Preparing search index...

    Function hashedKeys

    • Keys stored by their SHA-256 (hashApiKey(key)), as a database table holds them: lookup gets the hash of the key the request sent.

      hashedKeys((hash) => db.queryOne('SELECT id, scopes FROM api_keys WHERE key_hash = :hash', { hash }))
      

      Parameters

      • lookup: (
            hash: string,
        ) =>
            | ApiKeyRecord
            | Promise<ApiKeyRecord | null | undefined>
            | null
            | undefined

      Returns KeyStore