diff --git a/internal/proxy/attribute/attribute.go b/internal/proxy/attribute/attribute.go index a2ef1b0f3..f84f2733e 100644 --- a/internal/proxy/attribute/attribute.go +++ b/internal/proxy/attribute/attribute.go @@ -32,8 +32,8 @@ type Attribute struct { } func ComposeAttribute(attribute string, attrs map[string]interface{}) string { - if strings.Contains(attribute, "{") { - template := fasttemplate.New(attribute, "{", "}") + if strings.Contains(attribute, "${") { + template := fasttemplate.New(attribute, "${", "}") return template.ExecuteString(attrs) } return attribute diff --git a/test/e2e_test/testbench/testdata/configs/rules/rule.yaml b/test/e2e_test/testbench/testdata/configs/rules/rule.yaml index 9766ff78c..a00c66a11 100644 --- a/test/e2e_test/testbench/testdata/configs/rules/rule.yaml +++ b/test/e2e_test/testbench/testdata/configs/rules/rule.yaml @@ -1,7 +1,7 @@ rules: - backends: - name: entropy - target: "http://localhost:58420" + target: "http://localhost:56945" frontends: - name: ping path: "/api/ping" @@ -181,7 +181,7 @@ rules: action: authz_action attributes: resource: - value: '{project}-{name}' + value: ${project}-${name} type: composite project: key: project @@ -216,4 +216,4 @@ rules: permissions: - name: owner namespace: entropy/firehose - attribute: '{project}-{name}' \ No newline at end of file + attribute: ${project}-${name} \ No newline at end of file diff --git a/test/e2e_test/testbench/testdata/configs/rules/rule.yamltpl b/test/e2e_test/testbench/testdata/configs/rules/rule.yamltpl index 8d5431260..c463f5d65 100644 --- a/test/e2e_test/testbench/testdata/configs/rules/rule.yamltpl +++ b/test/e2e_test/testbench/testdata/configs/rules/rule.yamltpl @@ -181,7 +181,7 @@ rules: action: authz_action attributes: resource: - value: '{project}-{name}' + value: ${project}-${name} type: composite project: key: project @@ -216,4 +216,4 @@ rules: permissions: - name: owner namespace: entropy/firehose - attribute: '{project}-{name}' \ No newline at end of file + attribute: ${project}-${name} \ No newline at end of file