aserto-dev / aserto-spring

Aserto authorization filter for Spring Security.
Apache License 2.0
3 stars 1 forks source link

Illegal Rego package names with hyphens from HttpPathPolicyMap #7

Closed reardonm closed 5 months ago

reardonm commented 5 months ago

When an HTTP request path is mapped to a policy module name by the HttpPathPolicyMapper, if hyphen characters are present in the request path, the resulting Rego policy package name uses the hyphen, and is an illegal Rego package name. For example, with a request path of /api/v1/fire-hydrants/{id}, the resulting policy module name is root.GET.api.vi.fire-hydrants.__id. The hyphen should instead be replaced with an underscore: root.GET.api.vi.fire_hydrants.__id.

Aserto Spring Version: 0.2.0 Spring Boot: 3.3.0 Java Version: 22.0.1

ogazitt commented 5 months ago

Thanks @reardonm! We are reviewing this now.

gertd commented 5 months ago

Fixed in aserto-spring v0.2.2

https://central.sonatype.com/artifact/com.aserto/aserto-spring https://github.com/aserto-dev/aserto-spring