mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-06 09:13:19 +03:00
[PR #709] [MERGED] feat: add "key-rotate" command #648
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/pocket-id/pocket-id/pull/709
Author: @ItalyPaleAle
Created: 7/3/2025
Status: ✅ Merged
Merged: 7/3/2025
Merged by: @stonith404
Base:
main← Head:key-rotate-cmd📝 Commits (1)
269af13feat: add "key-rotate" command📊 Changes
9 files changed (+463 additions, -85 deletions)
View changed files
📝
backend/cmd/main.go(+1 -29)📝
backend/go.mod(+3 -0)📝
backend/go.sum(+8 -0)➕
backend/internal/cmds/key_rotate.go(+107 -0)➕
backend/internal/cmds/key_rotate_test.go(+214 -0)📝
backend/internal/cmds/one_time_access_token.go(+56 -56)➕
backend/internal/cmds/root.go(+31 -0)➕
backend/internal/cmds/version.go(+19 -0)➕
backend/internal/utils/cmd_util.go(+24 -0)📄 Description
Follow-up from #682 (see: https://github.com/pocket-id/pocket-id/pull/682#issuecomment-3025838190 )
Adds a new CLI command "pocket-id key-rotate" which replaces the token signing key with a new one. The command allows passing the key algorithm, allowing the use of RSA keys of different sizes (RS384, RS512 - in addition to the default RS256), ECDSA keys (ES256, ES384, ES512), and EdDSA (with curve Ed25519)
This also adds spf13/cobra to handle the various sub-commands. Cobra makes it easier to parse CLI flags, and also automatically generates help pages with the
--helpflag.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.