Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split AuthZ e2e tests #8181

Merged
merged 1 commit into from
Aug 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Split AuthZ e2e tests
  • Loading branch information
creydr committed Aug 26, 2024
commit 936ef172aa2e1cd17188c8f6434214e972a82ec9
18 changes: 17 additions & 1 deletion test/rekt/features/authz/addressable_authz_conformance.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,29 @@ import (
"knative.dev/reconciler-test/pkg/k8s"
)

// AddressableAuthZConformance returns a feature set to test all Authorization features for an addressable.
func AddressableAuthZConformance(gvr schema.GroupVersionResource, kind, name string) *feature.FeatureSet {
fs := feature.FeatureSet{
Name: fmt.Sprintf("%s handles authorization features correctly", kind),
Features: []*feature.Feature{
addressableRespectsEventPolicyFilters(gvr, kind, name),
},
}

fs.Features = append(fs.Features, AddressableAuthZConformanceRequestHandling(gvr, kind, name).Features...)

return &fs
}

// AddressableAuthZConformanceRequestHandling returns a FeatureSet to test the basic authorization features.
// This basic feature set contains to allow authorized and reject unauthorized requests. In addition it also
// tests, that the addressable becomes unready in case of a NotReady assigned EventPolicy.
func AddressableAuthZConformanceRequestHandling(gvr schema.GroupVersionResource, kind, name string) *feature.FeatureSet {
fs := feature.FeatureSet{
Name: fmt.Sprintf("%s handles authorization in requests correctly", kind),
Features: []*feature.Feature{
addressableAllowsAuthorizedRequest(gvr, kind, name),
addressableRejectsUnauthorizedRequest(gvr, kind, name),
addressableRespectsEventPolicyFilters(gvr, kind, name),
addressableBecomesUnreadyOnUnreadyEventPolicy(gvr, kind, name),
},
}
Expand Down
Loading