-
Notifications
You must be signed in to change notification settings - Fork 505
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(api): add tests for key recovery not enabled scenario
feat(api): add support for recoverable keys in key creation docs(security): update documentation for recovering keys and key creation
- Loading branch information
Showing
5 changed files
with
69 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ To learn more about how it works under the hood, you can head over to our [engin | |
|
||
## Opting in | ||
|
||
By default we only store key hashes, not encrypted keys. | ||
By default we only store key hashes, not encrypted keys. | ||
|
||
If you want us to store keys in a way that we can recover them, you need to opt in: | ||
|
||
|
@@ -52,6 +52,22 @@ Send us the email from the email address associated with your workspace and incl | |
</Note> | ||
|
||
|
||
## Creating keys | ||
|
||
When creating a key, you can set the `recoverable` field to `true`. This will store the key in a way that we can recover it later. | ||
|
||
|
||
```shell | ||
curl --request POST \ | ||
--url https://api.unkey.dev/v1/keys.createKey \ | ||
--header 'Authorization: Bearer {ROOT_KEY}' \ | ||
--header 'Content-Type: application/json' \ | ||
-d '{ | ||
"apiId": "{API_ID}", | ||
"recoverable": true | ||
}' | ||
``` | ||
|
||
|
||
|
||
## Recovering plaintext keys | ||
|
@@ -78,8 +94,7 @@ curl --request GET \ | |
|
||
|
||
<Info> | ||
If you have any questions about recovery, please reach out to us at [[email protected]](mailto:[email protected]). | ||
If you have any questions about recovery, please reach out to us at [[email protected]](mailto:[email protected]). | ||
|
||
For security concerns, please disclose them responsibly by emailing [[email protected]](mailto:[email protected]) instead. | ||
</Info> | ||
|