Skip to content

Commit 3d3b563

Browse files
authored
Merge pull request #1805 from Arshardh/gateway-pol-fix
Fix issue where wildcard policy not engaging for provider
2 parents 80fb2d6 + a0d55a4 commit 3d3b563

3 files changed

Lines changed: 284 additions & 171 deletions

File tree

gateway/gateway-controller/pkg/utils/llm_provider_transformer_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4857,7 +4857,7 @@ func TestTransform_PathMatchingEdgeCases_AllowAll_PolicyMoreGeneral(t *testing.T
48574857

48584858
func TestTransform_PathMatchingEdgeCases_AllowAll_NestedWildcardPolicies(t *testing.T) {
48594859
// AllowAll: Multiple nested wildcard policies with no exceptions
4860-
// All policies should attach to catch-all operations
4860+
// Broader wildcard policies should also apply to nested wildcard operations
48614861
transformer, _ := setupTestTransformer(t)
48624862

48634863
policies := []api.LLMPolicy{
@@ -4916,8 +4916,9 @@ func TestTransform_PathMatchingEdgeCases_AllowAll_NestedWildcardPolicies(t *test
49164916
nestedOp := findOperation(spec.Operations, "api/v1/*", "GET")
49174917
require.NotNil(t, nestedOp, "api/v1/* GET should exist")
49184918
require.NotNil(t, nestedOp.Policies)
4919-
assert.Len(t, *nestedOp.Policies, 1)
4920-
assert.Equal(t, "NestedPolicy", (*nestedOp.Policies)[0].Name)
4919+
assert.Len(t, *nestedOp.Policies, 2)
4920+
assert.Equal(t, "TopLevelPolicy", (*nestedOp.Policies)[0].Name)
4921+
assert.Equal(t, "NestedPolicy", (*nestedOp.Policies)[1].Name)
49214922

49224923
// Find api/* operation
49234924
topOp := findOperation(spec.Operations, "api/*", "GET")

0 commit comments

Comments
 (0)