spring-cloud / spring-cloud-common-security-config

A common security infrastructure used by Spring Cloud Data Flow and the projects in its ecosystem
19 stars 32 forks source link

feat: config to disable pathParts parsing #95

Closed klopfdreh closed 2 years ago

klopfdreh commented 2 years ago

Solves https://github.com/spring-cloud/spring-cloud-common-security-config/issues/94

With this PR you can disable the parsing of the pathParts by applying this configuration:

    spring:
      cloud:
        dataflow:  
          security:
            authorization:
                user_login:
                  map-oauth-scopes: true
                  parse-oauth-scope-path-parts: false
                  role-mappings:
                    ROLE_CREATE: '/F///FUNC/2000803037///X'
klopfdreh commented 2 years ago

If the name of the property is ok for you I need to rename it to „parseOauthPathParts“ with lower A. I am going to do this, tomorrow. The name also reflects back the scope like „mapOauthScopes“, now.

Edit: maybe „parseOauthScopePathParts“ would be even better. I would not mention that this is happening during the mapping, because this is obvious because the property is applied to the class ProviderRoleMapping so you can assume that the parsing is done during the role mapping.

onobc commented 2 years ago

Edit: maybe „parseOauthScopePathParts“ would be even better

I think that will work well.

onobc commented 2 years ago

Thanks again for another excellent contribution @klopfdreh .

I rebased and merged the proposal here https://github.com/spring-cloud/spring-cloud-common-security-config/commit/7b0929e11b2d68ce3689728139cbf4c618efd954