开发者

How can I configure endpoints for RBAC in Spring Boot via Cloud Config Server?

开发者 https://www.devze.com 2022-12-07 19:40 出处:网络
I want to add the ability to microservices to allow configuring endpoints and permissions for RBAC via Cloud Config Server. So if there is a service called mordor, then if I add following properties i

I want to add the ability to microservices to allow configuring endpoints and permissions for RBAC via Cloud Config Server. So if there is a service called mordor, then if I add following properties in its application.yml at Cloud Config Server's repo

rbac:
  - endpoint: /v1/test1
    method: GET
    scopes: ["rest-write:all", "read-write:product"]
  - endpoint: /v1/test2
    method: POST
    scopes: ["read-write:product"]

the endpoints mentioned above should be configured for RBAC. As of now, I am passing the scopes and permissions via Auth0 JWT and using it for authentication. But with this, I will be able to add RBAC also based on the permissions I configure in Auth0's dashboard.

What is the best way to proceed with this?

I am able to get the rbac endpoints from Cloud Config Server but the problem is how 开发者_JS百科to add them to Spring Security. I already have a class OAuth2SecurityConfiguerer where httpSecurity is configured but I haven't been able to add endpoints to Spring Security because it might require iterating over the endpoints obtained from Cloud Config Server

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号