[PR #2502] [MERGED] feat: rename ServiceJWTSecret to ServiceSecret with deprecation #8315

Closed
opened 2026-04-20 18:08:50 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-vikunja/vikunja/pull/2502
Author: @kolaente
Created: 3/30/2026
Status: Merged
Merged: 3/30/2026
Merged by: @kolaente

Base: mainHead: claude/add-service-secret-config-zOi44


📝 Commits (6)

  • 5b9ea1e feat: add service.secret config, deprecate service.jwtsecret
  • e0ec4e4 fix: remove ServiceJWTSecret default, fix deprecation check
  • 050830b fix: update service.secret description to be generic, not JWT-specific
  • 57e695d fix: simplify deprecation check and add #nosec to ServiceJWTSecret
  • a42e030 fix: only migrate jwtsecret when service.secret is not explicitly set
  • 3f839de fix: warn when both service.secret and service.jwtsecret are set

📊 Changes

7 files changed (+27 additions, -10 deletions)

View changed files

📝 config-raw.json (+6 -1)
📝 pkg/config/config.go (+14 -2)
📝 pkg/doctor/config.go (+1 -1)
📝 pkg/e2etests/integrations.go (+1 -1)
📝 pkg/modules/auth/auth.go (+2 -2)
📝 pkg/routes/api_tokens.go (+1 -1)
📝 pkg/webtests/integrations.go (+2 -2)

📄 Description

Summary

This PR renames the ServiceJWTSecret configuration key to ServiceSecret to better reflect its purpose as a general service secret used for JWT token signing. The old key is deprecated but still supported for backward compatibility.

Key Changes

  • Introduced new ServiceSecret config key (service.secret) as the primary configuration option
  • Marked ServiceJWTSecret (service.JWTSecret) as deprecated with a migration path
  • Added deprecation logic in InitConfig() that automatically migrates values from the old key to the new key if the old key is explicitly set
  • Updated all code references to use ServiceSecret.GetString() instead of ServiceJWTSecret.GetString():
    • JWT token signing in auth module
    • JWT token parsing in test utilities and middleware
    • Configuration validation in doctor module
  • Updated configuration schema documentation to reflect the new primary key and deprecation status

Implementation Details

  • The migration logic checks if ServiceJWTSecret differs from ServiceSecret and copies the value while logging a deprecation warning
  • Both keys are initialized with the same default random value to ensure backward compatibility
  • All internal code now uses the new ServiceSecret key, while the old key remains functional for existing configurations

https://claude.ai/code/session_01WxMqCGturowwjgGfRMUW7J


🔄 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/go-vikunja/vikunja/pull/2502 **Author:** [@kolaente](https://github.com/kolaente) **Created:** 3/30/2026 **Status:** ✅ Merged **Merged:** 3/30/2026 **Merged by:** [@kolaente](https://github.com/kolaente) **Base:** `main` ← **Head:** `claude/add-service-secret-config-zOi44` --- ### 📝 Commits (6) - [`5b9ea1e`](https://github.com/go-vikunja/vikunja/commit/5b9ea1e1d97f1bfd9f474733ba19185fd6e9cfe5) feat: add service.secret config, deprecate service.jwtsecret - [`e0ec4e4`](https://github.com/go-vikunja/vikunja/commit/e0ec4e4242bdd483fcb6ac88fec0b763388a230e) fix: remove ServiceJWTSecret default, fix deprecation check - [`050830b`](https://github.com/go-vikunja/vikunja/commit/050830b423ae8df81c818bee27d0aa8862a228e9) fix: update service.secret description to be generic, not JWT-specific - [`57e695d`](https://github.com/go-vikunja/vikunja/commit/57e695d384fccd831ffb0c106abeddb4591d0e0b) fix: simplify deprecation check and add #nosec to ServiceJWTSecret - [`a42e030`](https://github.com/go-vikunja/vikunja/commit/a42e030cdfdccc2ca91dfd7ea29aff8ba0e9e0e3) fix: only migrate jwtsecret when service.secret is not explicitly set - [`3f839de`](https://github.com/go-vikunja/vikunja/commit/3f839dec613197b5fe6416c25b1b3c7e9542120b) fix: warn when both service.secret and service.jwtsecret are set ### 📊 Changes **7 files changed** (+27 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `config-raw.json` (+6 -1) 📝 `pkg/config/config.go` (+14 -2) 📝 `pkg/doctor/config.go` (+1 -1) 📝 `pkg/e2etests/integrations.go` (+1 -1) 📝 `pkg/modules/auth/auth.go` (+2 -2) 📝 `pkg/routes/api_tokens.go` (+1 -1) 📝 `pkg/webtests/integrations.go` (+2 -2) </details> ### 📄 Description ## Summary This PR renames the `ServiceJWTSecret` configuration key to `ServiceSecret` to better reflect its purpose as a general service secret used for JWT token signing. The old key is deprecated but still supported for backward compatibility. ## Key Changes - Introduced new `ServiceSecret` config key (`service.secret`) as the primary configuration option - Marked `ServiceJWTSecret` (`service.JWTSecret`) as deprecated with a migration path - Added deprecation logic in `InitConfig()` that automatically migrates values from the old key to the new key if the old key is explicitly set - Updated all code references to use `ServiceSecret.GetString()` instead of `ServiceJWTSecret.GetString()`: - JWT token signing in auth module - JWT token parsing in test utilities and middleware - Configuration validation in doctor module - Updated configuration schema documentation to reflect the new primary key and deprecation status ## Implementation Details - The migration logic checks if `ServiceJWTSecret` differs from `ServiceSecret` and copies the value while logging a deprecation warning - Both keys are initialized with the same default random value to ensure backward compatibility - All internal code now uses the new `ServiceSecret` key, while the old key remains functional for existing configurations https://claude.ai/code/session_01WxMqCGturowwjgGfRMUW7J --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-20 18:08:50 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#8315