🧪 test: implement JWT secret rotation BDD tests
All checks were successful
CI/CD Pipeline / Build Docker Cache (push) Successful in 11s
CI/CD Pipeline / CI Pipeline (push) Successful in 4m32s

- Fix admin handler to handle flexible boolean parsing

- Modify GenerateJWT to use latest secret for signing

- Update JWT secret manager for proper expiration handling

- Fix BDD test steps to use actual tokens instead of hardcoded ones

- Add comprehensive debug logging for JWT operations

Resolves JWT secret rotation feature implementation

Generated by Mistral Vibe.

Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
2026-04-09 16:14:31 +02:00
parent 695cd407f2
commit 07f8bd65b7
9 changed files with 742 additions and 35 deletions

View File

@@ -39,6 +39,9 @@ type AuthService interface {
GenerateJWT(ctx context.Context, user *User) (string, error)
ValidateJWT(ctx context.Context, token string) (*User, error)
AdminAuthenticate(ctx context.Context, masterPassword string) (*User, error)
AddJWTSecret(secret string, isPrimary bool, expiresIn time.Duration)
RotateJWTSecret(newSecret string)
GetJWTSecretByIndex(index int) (string, bool)
}
// UserManager defines interface for user management operations