[PR #709] [MERGED] feat: add "key-rotate" command #648

Closed
opened 2025-10-07 00:20:00 +03:00 by OVERLORD · 0 comments
Owner

📋 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: mainHead: key-rotate-cmd


📝 Commits (1)

  • 269af13 feat: 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 --help flag.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/pocket-id/pocket-id/pull/709 **Author:** [@ItalyPaleAle](https://github.com/ItalyPaleAle) **Created:** 7/3/2025 **Status:** ✅ Merged **Merged:** 7/3/2025 **Merged by:** [@stonith404](https://github.com/stonith404) **Base:** `main` ← **Head:** `key-rotate-cmd` --- ### 📝 Commits (1) - [`269af13`](https://github.com/pocket-id/pocket-id/commit/269af135ce5fc5ba1d35b9e179473436ae48273e) feat: add "key-rotate" command ### 📊 Changes **9 files changed** (+463 additions, -85 deletions) <details> <summary>View changed files</summary> 📝 `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) </details> ### 📄 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](https://github.com/spf13/cobra) to handle the various sub-commands. Cobra makes it easier to parse CLI flags, and also automatically generates help pages with the `--help` flag. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2025-10-07 00:20:00 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pocket-id#648