From c4a28985b2bdca9acb17baee883df2bf7057c90c Mon Sep 17 00:00:00 2001 From: Alex Snaps Date: Wed, 30 Oct 2024 09:32:55 -0400 Subject: [PATCH] Test counters Signed-off-by: Alex Snaps --- install/manifests.yaml | 146 ----------------------------------------- install/rbac/role.yaml | 146 ----------------------------------------- tests/e2e-test.sh | 11 ++++ 3 files changed, 11 insertions(+), 292 deletions(-) diff --git a/install/manifests.yaml b/install/manifests.yaml index f3aa8e3c..a0ed239b 100644 --- a/install/manifests.yaml +++ b/install/manifests.yaml @@ -5274,80 +5274,6 @@ kind: ClusterRole metadata: name: authorino-manager-role rules: -- apiGroups: - - "" - resources: - - configmaps - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - "" - resources: - - configmaps/status - verbs: - - delete - - get - - patch - - update -- apiGroups: - - "" - resources: - - events - verbs: - - create - - patch -- apiGroups: - - "" - resources: - - secrets - verbs: - - get - - list - - watch -- apiGroups: - - "" - resources: - - serviceaccounts - verbs: - - create - - get - - list - - update - - watch -- apiGroups: - - "" - resources: - - services - verbs: - - create - - get - - list - - update - - watch -- apiGroups: - - apps - resources: - - deployments - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - authentication.k8s.io - resources: - - tokenreviews - verbs: - - create - apiGroups: - authorino.kuadrant.io resources: @@ -5368,12 +5294,6 @@ rules: - get - patch - update -- apiGroups: - - authorization.k8s.io - resources: - - subjectaccessreviews - verbs: - - create - apiGroups: - coordination.k8s.io resources: @@ -5391,69 +5311,3 @@ rules: - get - list - watch -- apiGroups: - - operator.authorino.kuadrant.io - resources: - - authorinos - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - operator.authorino.kuadrant.io - resources: - - authorinos/finalizers - verbs: - - update -- apiGroups: - - operator.authorino.kuadrant.io - resources: - - authorinos/status - verbs: - - get - - patch - - update -- apiGroups: - - rbac.authorization.k8s.io - resources: - - clusterrolebindings - verbs: - - create - - get - - list - - update - - watch -- apiGroups: - - rbac.authorization.k8s.io - resources: - - clusterroles - verbs: - - create - - get - - list - - update - - watch -- apiGroups: - - rbac.authorization.k8s.io - resources: - - rolebindings - verbs: - - create - - get - - list - - update - - watch -- apiGroups: - - rbac.authorization.k8s.io - resources: - - roles - verbs: - - create - - get - - list - - update - - watch diff --git a/install/rbac/role.yaml b/install/rbac/role.yaml index 2328df39..69520e9e 100644 --- a/install/rbac/role.yaml +++ b/install/rbac/role.yaml @@ -4,80 +4,6 @@ kind: ClusterRole metadata: name: manager-role rules: -- apiGroups: - - "" - resources: - - configmaps - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - "" - resources: - - configmaps/status - verbs: - - delete - - get - - patch - - update -- apiGroups: - - "" - resources: - - events - verbs: - - create - - patch -- apiGroups: - - "" - resources: - - secrets - verbs: - - get - - list - - watch -- apiGroups: - - "" - resources: - - serviceaccounts - verbs: - - create - - get - - list - - update - - watch -- apiGroups: - - "" - resources: - - services - verbs: - - create - - get - - list - - update - - watch -- apiGroups: - - apps - resources: - - deployments - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - authentication.k8s.io - resources: - - tokenreviews - verbs: - - create - apiGroups: - authorino.kuadrant.io resources: @@ -98,12 +24,6 @@ rules: - get - patch - update -- apiGroups: - - authorization.k8s.io - resources: - - subjectaccessreviews - verbs: - - create - apiGroups: - coordination.k8s.io resources: @@ -121,69 +41,3 @@ rules: - get - list - watch -- apiGroups: - - operator.authorino.kuadrant.io - resources: - - authorinos - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - operator.authorino.kuadrant.io - resources: - - authorinos/finalizers - verbs: - - update -- apiGroups: - - operator.authorino.kuadrant.io - resources: - - authorinos/status - verbs: - - get - - patch - - update -- apiGroups: - - rbac.authorization.k8s.io - resources: - - clusterrolebindings - verbs: - - create - - get - - list - - update - - watch -- apiGroups: - - rbac.authorization.k8s.io - resources: - - clusterroles - verbs: - - create - - get - - list - - update - - watch -- apiGroups: - - rbac.authorization.k8s.io - resources: - - rolebindings - verbs: - - create - - get - - list - - update - - watch -- apiGroups: - - rbac.authorization.k8s.io - resources: - - roles - verbs: - - create - - get - - list - - update - - watch diff --git a/tests/e2e-test.sh b/tests/e2e-test.sh index fefb7f70..fb071730 100755 --- a/tests/e2e-test.sh +++ b/tests/e2e-test.sh @@ -204,6 +204,7 @@ send_k8s_sa_requests $IP_IN "app-1-sa" " GET /admin => 200 GET /greetings/1 => 403" +# Test #5 done send_k8s_sa_requests $IP_IN "app-2-sa" " GET / => 200 POST / => 200 @@ -211,6 +212,7 @@ send_k8s_sa_requests $IP_IN "app-2-sa" " GET /admin => 403 GET /greetings/1 => 403" +# Test #10 done send_api_key_requests $IP_IN "ndyBzreUzF4zqDQsqSPMHkRhriEOtcRx" " GET / => 200 POST / => 200 @@ -218,6 +220,7 @@ send_api_key_requests $IP_IN "ndyBzreUzF4zqDQsqSPMHkRhriEOtcRx" " GET /admin => 200 GET /greetings/1 => 403" +# Test #15 done send_api_key_requests $IP_IN "pR2zLorYFIYOE4LLiQAWMPIRei1YgRBy" " GET / => 200 POST / => 200 @@ -225,14 +228,17 @@ send_api_key_requests $IP_IN "pR2zLorYFIYOE4LLiQAWMPIRei1YgRBy" " GET /admin => 403 GET /greetings/1 => 403" +# Test #20 done kubectl -n $namespace delete secret/alice-api-key 2>/dev/null >/dev/null && sleep 1 send_api_key_requests $IP_IN "pR2zLorYFIYOE4LLiQAWMPIRei1YgRBy" " POST / => 401" +# Test #21 done send_api_key_requests $IP_IN "ndyBzreUzF4zqDQsqSPMHkRhriEOtcRx" " POST / => 200" +# Test #22 done send_oidc_requests $IP_IN "john" "p" " GET / => 200 POST / => 200 @@ -240,6 +246,7 @@ send_oidc_requests $IP_IN "john" "p" " GET /admin => 403 GET /greetings/1 => 200" +# Test #27 done send_oidc_requests $IP_IN "jane" "p" " GET / => 200 POST / => 200 @@ -247,6 +254,7 @@ send_oidc_requests $IP_IN "jane" "p" " GET /admin => 200 GET /greetings/1 => 403" +# Test #32 done send_oauth_opaque_requests $IP_IN "peter" "p" " GET / => 200 POST / => 200 @@ -254,6 +262,7 @@ send_oauth_opaque_requests $IP_IN "peter" "p" " GET /admin => 403 GET /greetings/1 => 403" +# Test #37 done send_anonymous_requests $IP_IN " GET / => 200 POST / => 401 @@ -261,9 +270,11 @@ send_anonymous_requests $IP_IN " GET /admin => 401 GET /greetings/1 => 401" +# Test #42 done send_anonymous_requests $IP_OUT " GET / => 403" +# Test #43 done send_requests "https" "authorino-authorino-oidc" "8083" $IP_IN "" " GET /authorino/e2e-test/wristband/.well-known/openid-configuration => 200 GET /authorino/e2e-test/wristband/.well-known/openid-connect/certs => 200