Re:Show HN: RBAC for your REST API in 2 minutes
by itsronenh on Tuesday March 01, 2022 @10:55AM
(#30515656)
Do package names have to match API routes? Can I create a policy that is shared by multiple endpoints?
[ Parent
| on HN ]
Re:Show HN: RBAC for your REST API in 2 minutes
by gertd on Tuesday March 01, 2022 @10:57AM
(#30515673)
Technically names do not have to match, but it certainly makes it easier if you have a pattern to rely on when injecting authorization into a middleware layer.
Re:Show HN: RBAC for your REST API in 2 minutes
by ogazitt on Tuesday March 01, 2022 @11:00AM
(#30515731)
By convention, we generate a package for every API definition in the OpenAPI spec. But the calling application can decide which package to use when authorizing an operation, so you can use a single policy for multiple endpoints.