🧪 test: implement secret retention based on TTL factor scenario
This commit is contained in:
@@ -168,8 +168,9 @@ func (s *JWTRetentionSteps) iShouldSeeCleanupEventInLogs() error {
|
||||
// Retention Calculation Steps
|
||||
|
||||
func (s *JWTRetentionSteps) theJWTTTLIsSetToHours(hours int) error {
|
||||
// Set JWT TTL
|
||||
return godog.ErrPending
|
||||
// Set JWT TTL for testing
|
||||
s.expectedTTL = hours
|
||||
return nil
|
||||
}
|
||||
|
||||
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 {
|
||||
// Verify expiration timing
|
||||
return godog.ErrPending
|
||||
// Verify expiration timing based on TTL and retention factor
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user