Skip to content

Commit

Permalink
fix: function name
Browse files Browse the repository at this point in the history
  • Loading branch information
FemiNoviaLina committed Jul 8, 2024
1 parent 5c2b954 commit f976bf4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/proxy/attribute/attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type Attribute struct {
Value string `yaml:"value" mapstructure:"value"`
}

func ComposeAttribute(attribute string, attrs map[string]interface{}) string {
func Compose(attribute string, attrs map[string]interface{}) string {
if strings.Contains(attribute, "${") {
template := fasttemplate.New(attribute, "${", "}")
return template.ExecuteString(attrs)
Expand Down
2 changes: 1 addition & 1 deletion internal/proxy/hook/authz/authz.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ func getAttributesValues(attributes interface{}) ([]string, error) {
func composeResourcesName(resourceList []string, permissionAttributes map[string]interface{}) []string {
var resourcesName []string
for _, res := range resourceList {
resourcesName = append(resourcesName, proxyattr.ComposeAttribute(res, permissionAttributes))
resourcesName = append(resourcesName, proxyattr.Compose(res, permissionAttributes))
}
return resourcesName
}
2 changes: 1 addition & 1 deletion internal/proxy/middleware/authz/authz.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ func (c *Authz) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
func (c Authz) preparePermissionResource(ctx context.Context, perm Permission, attrs map[string]interface{}) (resource.Resource, error) {
resourceName, ok := attrs[perm.Attribute].(string)
if !ok {
resourceName = attribute.ComposeAttribute(perm.Attribute, attrs)
resourceName = attribute.Compose(perm.Attribute, attrs)
}

res := resource.Resource{
Expand Down

0 comments on commit f976bf4

Please sign in to comment.