Skip to content

Commit

Permalink
Add a Prerequisite helper to check if the OIDC authentication feature…
Browse files Browse the repository at this point in the history
… flag is enabled (#7609)
  • Loading branch information
creydr authored Jan 23, 2024
1 parent 341a8df commit 6962251
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/rekt/features/featureflags/featureflags.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,20 @@ func TransportEncryptionStrict() feature.ShouldRun {
}
}

func AuthenticationOIDCEnabled() feature.ShouldRun {
return func(ctx context.Context, t feature.T) (feature.PrerequisiteResult, error) {
flags, err := getFeatureFlags(ctx, "config-features")
if err != nil {
return feature.PrerequisiteResult{}, err
}

return feature.PrerequisiteResult{
ShouldRun: flags.IsOIDCAuthentication(),
Reason: flags.String(),
}, nil
}
}

func IstioDisabled() feature.ShouldRun {
return func(ctx context.Context, t feature.T) (feature.PrerequisiteResult, error) {
flags, err := getFeatureFlags(ctx, "config-features")
Expand Down

0 comments on commit 6962251

Please sign in to comment.