-
Notifications
You must be signed in to change notification settings - Fork 627
feat: v2 reroll key endpoint #3785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 12 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
d7d55f6
feat: initial reroll struct
Flo4604 fcd22f2
Merge branch 'main' into feat/keys.rerollKey
Flo4604 63ab590
add basic test
Flo4604 87bf85b
test and fix ratelimit and add reroll event
Flo4604 2057d77
cleanup file
Flo4604 e7a1757
docs changes
Flo4604 76b0fe7
docs changes
Flo4604 c1a046f
docs changes
Flo4604 df16163
change auditlog
Flo4604 bd7c4bf
Update go/pkg/db/custom_types.go
Flo4604 0ca0354
rabbit fixes
Flo4604 bb4580e
Merge branch 'feat/keys.rerollKey' of github.com:unkeyed/unkey into f…
Flo4604 48e7798
rabbit fixes
Flo4604 949196e
run in parallel
Flo4604 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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
40 changes: 40 additions & 0 deletions
40
go/apps/api/openapi/spec/paths/v2/keys/rerollKey/V2KeysRerollKeyRequestBody.yaml
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| type: object | ||
| required: | ||
| - keyId | ||
| - expiration | ||
| properties: | ||
| keyId: | ||
| type: string | ||
| minLength: 3 | ||
| maxLength: 255 | ||
| pattern: "^[a-zA-Z0-9_]+$" | ||
| description: | | ||
| The database identifier of the key to reroll. | ||
|
|
||
| This is the unique ID returned when creating or listing keys, NOT the actual API key token. | ||
| You can find this ID in: | ||
| - The response from `keys.createKey` | ||
| - Key verification responses | ||
| - The Unkey dashboard | ||
| - API key listing endpoints | ||
| example: key_2cGKbMxRyIzhCxo1Idjz8q | ||
| expiration: | ||
| type: integer | ||
| format: int64 | ||
| minimum: 0 | ||
| maximum: 4102444800000 | ||
| description: | | ||
| Duration in milliseconds until the ORIGINAL key is revoked, starting from now. | ||
|
|
||
| This parameter controls the overlap period for key rotation: | ||
| - Set to `0` to revoke the original key immediately | ||
| - Positive values keep the original key active for the specified duration | ||
| - Allows graceful migration by giving users time to update their credentials | ||
|
|
||
| Common overlap periods: | ||
| - Immediate revocation: 0 | ||
| - 1 hour grace period: 3600000 | ||
| - 24 hours grace period: 86400000 | ||
| - 7 days grace period: 604800000 | ||
| - 30 days grace period: 2592000000 | ||
| example: 86400000 |
19 changes: 19 additions & 0 deletions
19
go/apps/api/openapi/spec/paths/v2/keys/rerollKey/V2KeysRerollKeyResponseBody.yaml
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| type: object | ||
| required: | ||
| - meta | ||
| - data | ||
| properties: | ||
| meta: | ||
| "$ref": "../../../../common/Meta.yaml" | ||
| data: | ||
| "$ref": "./V2KeysRerollKeyResponseData.yaml" | ||
| examples: | ||
| rerollKey: | ||
| summary: Key rerolled successfully | ||
| description: Successfully rerolled a key | ||
| value: | ||
| meta: | ||
| requestId: req_abc123def456 | ||
| data: | ||
| keyId: key_2cGKbMxRyIzhCxo1Idjz8q | ||
| key: prod_2cGKbMxRjIzhCxo1IdjH3arELti7Sdyc8w6XYbvtcyuBowPT |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.