Skip to content

Commit

Permalink
Split AuthZ e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
creydr committed Aug 26, 2024
1 parent 36e0721 commit 936ef17
Showing 1 changed file with 17 additions and 1 deletion.
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

0 comments on commit 936ef17

Please sign in to comment.