Uploaded image for project: 'WildFly WIP'
  1. WildFly WIP
  2. WFWIP-696

MicroProfile OpenAPI and multiple deployments: conflicting root level ".security" definitions appear in the final OpenAPI components element, but not at root level

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • MP OpenAPI
    • None
    • Hide

      1. Build the WildFly snapshot based on the feature branch:

      • git clone git@github.com:pferraro/wildfly.git
      • cd wildfly
      • git checkout openapi
      • mvn clean install -DskipTests

      2. Run the tests

      • git clone git@github.com:fabiobrz/eap-microprofile-test-suite.git
      • cd eap-microprofile-test-suite
      • git checkout issue-344.mp-openapi-multi-war
      • mvn clean verify -pl microprofile-open-api -am -Djboss.dist=<WILDFLY_SNAPSHOT_BUILD_DIRECTORY> -Dtest=MultipleWarsAffectingGlobalPropertiesAndReferencesTest#testConflictingSecurityRequirements
      Show
      1. Build the WildFly snapshot based on the feature branch: git clone git@github.com:pferraro/wildfly.git cd wildfly git checkout openapi mvn clean install -DskipTests 2. Run the tests git clone git@github.com:fabiobrz/eap-microprofile-test-suite.git cd eap-microprofile-test-suite git checkout issue-344.mp-openapi-multi-war mvn clean verify -pl microprofile-open-api -am -Djboss.dist=<WILDFLY_SNAPSHOT_BUILD_DIRECTORY> -Dtest=MultipleWarsAffectingGlobalPropertiesAndReferencesTest#testConflictingSecurityRequirements
    • User Experience

      • Have a localServicesRouterDeployment.war, defining a root level security element, e.g.:
        security:
          # a global security requirement declaration, must match a .components.securityScheme
          api_key:
          - admins
        ...
        components:
          ...
          securitySchemes:
            api_key:
              type: apiKey
              name: api_key
              in: header
        ...
        
      • Then, have a anotherLocalServicesRouterDeployment.war, defining a root level security element, with the same name, but different attributes, e.g.:
        security:
          # a global security requirement declaration, must match a .components.securityScheme
          api_key:
          - root
        ...
        components:
          securitySchemes:
            api_key:
              type: apiKey
              name: apiKey
              in: cookie
        ...
        

      When deploying both the applications, the resulting OpenAPI document components element holds the result of what has been defined, and at the operation level (and conflicting names are resolved):

      ---
      components:
        schemas:
          ...
        securitySchemes:
          anotherLocalServicesRouterDeploymentapi_key:
            in: cookie
            name: apiKey
            type: apiKey
          localServicesRouterDeploymentapi_key:
            in: header
            name: api_key
            type: apiKey
      ...
      

      but the root level security element is not present.

              pferraro@redhat.com Paul Ferraro
              fburzigo@redhat.com Fabio Burzigotti
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: