Skip to content

Commit

Permalink
chore(docs): Add section for retrievable vs irretrievable keys
Browse files Browse the repository at this point in the history
  • Loading branch information
LauraBeatris committed Apr 9, 2024
1 parent 467c6b4 commit dc060f3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docs/pages/design/node/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,10 @@ The `Auth` object should contain an identifier for the non-user principal making
#### Security considerations
The hashed key should be returned in the response for better security. When attempting to verify the API Key, then the `key` argument provided should be hashed and compared to the stored hashed key. If they match, then the API Key is valid.
API-key implementations is divided into two groups: **Retrievable** and **Irretrievable**. Each have their security tradeoffs.
**Retrievable:**
The keys are stored via a one-way encryption process so they can never be retrieved, or stolen from the database in a worse case scenario. Stripe and Amazon AWS use this approach.
[Unkey](https://unkey.dev/docs/security/overview) applies a similar concept, where the hashed keys get stored. When attempting to verify the API Key, then the `key` argument gets hashed and compared to the stored hashed key. If they match, then the API Key is valid.

0 comments on commit dc060f3

Please sign in to comment.