From 4f9efb3eeae66c85b55ce63849d8aa0d5ec5891b Mon Sep 17 00:00:00 2001 From: Alex Snaps Date: Wed, 4 Sep 2024 09:51:21 -0400 Subject: [PATCH] wip: done with deniesWith Signed-off-by: Alex Snaps --- controllers/auth_config_controller.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/controllers/auth_config_controller.go b/controllers/auth_config_controller.go index 0f16465e..36a914c6 100644 --- a/controllers/auth_config_controller.go +++ b/controllers/auth_config_controller.go @@ -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, @@ -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