🧪 test: add JWT secret rotation BDD scenarios and step implementations #12
@@ -168,8 +168,9 @@ func (s *JWTRetentionSteps) iShouldSeeCleanupEventInLogs() error {
|
|||||||
// Retention Calculation Steps
|
// Retention Calculation Steps
|
||||||
|
|
||||||
func (s *JWTRetentionSteps) theJWTTTLIsSetToHours(hours int) error {
|
func (s *JWTRetentionSteps) theJWTTTLIsSetToHours(hours int) error {
|
||||||
// Set JWT TTL
|
// Set JWT TTL for testing
|
||||||
return godog.ErrPending
|
s.expectedTTL = hours
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *JWTRetentionSteps) theRetentionPeriodShouldBeCappedAtHours(hours int) error {
|
func (s *JWTRetentionSteps) theRetentionPeriodShouldBeCappedAtHours(hours int) error {
|
||||||
@@ -725,8 +726,12 @@ func (s *JWTRetentionSteps) theSecretIsLessThanCharacters(chars int) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *JWTRetentionSteps) theSecretShouldExpireAfterHours(hours int) error {
|
func (s *JWTRetentionSteps) theSecretShouldExpireAfterHours(hours int) error {
|
||||||
// Verify expiration timing
|
// Verify expiration timing based on TTL and retention factor
|
||||||
return godog.ErrPending
|
expectedExpiration := float64(s.expectedTTL) * s.retentionFactor
|
||||||
|
if int(expectedExpiration) != hours {
|
||||||
|
return fmt.Errorf("expected secret to expire after %d hours, calculated %d hours", hours, int(expectedExpiration))
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *JWTRetentionSteps) tokenAShouldStillBeValidUntilRetentionExpires() error {
|
func (s *JWTRetentionSteps) tokenAShouldStillBeValidUntilRetentionExpires() error {
|
||||||
|
|||||||
Reference in New Issue
Block a user