Skip to content

Conversation

@ibihim
Copy link
Collaborator

@ibihim ibihim commented May 21, 2025

What

Add more authorization tests to test the authorization chain, if different authorization methods are set.

Why

Those tests are missing and make it hard to guarantee the same behavior in the sig-auth-acceptance branch.

Copy link
Collaborator

@stlaz stlaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed first two commits

Comment on lines +8 to +9
resources:
- tokenreviews
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: the inconsistency in how string slices are constructed in the yaml is weird

},
{
name: "non-resource/get/metrics/forbidden",
name: "static/forbidden",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be staticAuthz non-resource/get/metrics/forbidden

}{
{
name: "resource/namespace/metrics/query rewrite/granted",
name: "static/granted",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs better name. What exactly is granted?

check kubetest.Action
}{
{
name: "templated-query-rewrite-static/granted",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the original names were more descriptive, see how to incorporate them here

@@ -0,0 +1,14 @@
apiVersion: rbac.authorization.k8s.io/v1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert all of the file moves, like test/e2e/static-auth/serviceAccount.yaml → test/e2e/authz-static/serviceAccount.yaml
This is really hard to review otherwise and the benefit of the move is minimal

Comment on lines 41 to 42
// "Basics": testBasics(client),
// "H2CUpstream": testH2CUpstream(client),
Copy link
Collaborator

@stlaz stlaz May 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem right

),
},
{
name: "static/forbidden -> rbac/granted",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need good test names given the test framework makes the tests super cryptic on their own. I am having a hard time understanding what this might mean.

@stlaz
Copy link
Collaborator

stlaz commented May 29, 2025

Any move or modification of an e2e test is currently incredibly painful to do and also to review.

I created #380 to address these kinds of issues. I would like for it to merge before any other bigger changes to the e2e test suite, including this PR.

@ibihim
Copy link
Collaborator Author

ibihim commented Sep 30, 2025

I can't wait to merge it into this PR 😭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants