Skip to content

Commit

Permalink
wip: done with deniesWith
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Snaps <[email protected]>
  • Loading branch information
alexsnaps committed Sep 4, 2024
1 parent 4e0b30a commit 4f9efb3
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions controllers/auth_config_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -571,9 +571,9 @@ func (r *AuthConfigReconciler) translateAuthConfig(ctx context.Context, authConf

interfacedCallbackConfigs := make([]auth.AuthConfigEvaluator, 0)

for name, callback := range authConfig.Spec.Callbacks {
for callbackName, callback := range authConfig.Spec.Callbacks {
translatedCallback := &evaluators.CallbackConfig{
Name: name,
Name: callbackName,
Priority: callback.Priority,
Conditions: buildJSONExpression(authConfig, callback.Conditions, jsonexp.All),
Metrics: callback.Metrics,
Expand Down Expand Up @@ -606,9 +606,11 @@ func (r *AuthConfigReconciler) translateAuthConfig(ctx context.Context, authConf
}

// denyWith
if denyWith := authConfig.Spec.DenyWith; denyWith != nil {
translatedAuthConfig.Unauthenticated = buildAuthorinoDenyWithValues(denyWith.Unauthenticated)
translatedAuthConfig.Unauthorized = buildAuthorinoDenyWithValues(denyWith.Unauthorized)
if denyWith := authConfig.Spec.Response.Unauthenticated; denyWith != nil {
translatedAuthConfig.Unauthenticated = buildAuthorinoDenyWithValues(denyWith)
}
if denyWith := authConfig.Spec.Response.Unauthorized; denyWith != nil {
translatedAuthConfig.Unauthorized = buildAuthorinoDenyWithValues(denyWith)
}

return translatedAuthConfig, nil
Expand Down

0 comments on commit 4f9efb3

Please sign in to comment.