Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-2623

urlHandler protocol "profile:" returns wrong data

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • jboss-fuse-6.1
    • Fabric8 v1
    • None
    • % %
    • Hide
      • Take JBoss Fuse 6.1.0
        fabric:create --wait-for-provisioning
        
        profile-create --parents default profile-one 
        container-create-child root TestContainerOne
        container-add-profile TestContainerOne profile-one
        profile-edit --features camel-blueprint profile-one
        profile-edit --features camel profile-one
        
        
        profile-create --parents default profile-two 
        container-create-child root TestContainerTwo
        container-add-profile TestContainerTwo profile-two
        profile-edit --features camel-blueprint profile-two
        profile-edit --features camel profile-two
        

      Now create properties file "users.properties" inside these profiles.
      Content of "users.properties" present inside the "profile-one" looks like following:

      http://localhost:8181/hawtio/index.html#/wiki/branch/1.0/view/fabric/profiles/profile/one.profile/users.properties

      # Add properties here
      one=oneValueProfileOne
      two=twoValueProfileOne
      test.profile=one
      test.A=AA
      test.B=BB
      test.C=CC
      

      http://localhost:8181/hawtio/index.html#/wiki/branch/1.0/view/fabric/profiles/profile/two.profile/users.properties

      # Add properties here
      one=oneValueProfileTwo
      two=twoValueProfileTwo
      test.profile=two
      test.D=DD
      test.E=EE
      test.F=FF
      

      Deploy the bundles to these profiles.

      profile-edit --bundles mvn:my.example/restlet-one/1.0-SNAPSHOT profile-one
      profile-edit --bundles mvn:my.example/restlet-two/1.0-SNAPSHOT profile-two
      

      Output
      "jboss-fuse-6.1.0.redhat-379/instances/TestContainerOne/data/log/karaf.log" file output:

      | my.example.RestletOne              27 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | URL to use profile:users.properties
      | my.example.RestletOne              29 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | [RestletOne] io.fabric8.profile.urlhandler external form: profile:users.properties
      | my.example.RestletOne              34 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | [RestletOne] Got two:twoValueProfileOne
      | my.example.RestletOne              34 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | [RestletOne] Got test.profile:one
      | my.example.RestletOne              34 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | [RestletOne] Got one:oneValueProfileOne
      | my.example.RestletOne              34 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | [RestletOne] Got test.C:CC
      | my.example.RestletOne              34 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | [RestletOne] Got test.B:BB
      | my.example.RestletOne              34 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | [RestletOne] Got test.A:AA
      

      "jboss-fuse-6.1.0.redhat-379/instances/TestContainerTwo/data/log/karaf.log" file output:

      | my.example.RestletTwo              28 | 118 - my.example.restlet-two - 1.0.0.SNAPSHOT | URL to use profile:users.properties
      | my.example.RestletTwo              30 | 118 - my.example.restlet-two - 1.0.0.SNAPSHOT | ***[RestletTwo] io.fabric8.profile.urlhandler external form: profile:users.properties
      | my.example.RestletTwo              36 | 118 - my.example.restlet-two - 1.0.0.SNAPSHOT | ***[RestletTwo] Got test.F:FF
      | my.example.RestletTwo              36 | 118 - my.example.restlet-two - 1.0.0.SNAPSHOT | ***[RestletTwo] Got test.E:EE
      | my.example.RestletTwo              36 | 118 - my.example.restlet-two - 1.0.0.SNAPSHOT | ***[RestletTwo] Got two:twoValueProfileTwo
      | my.example.RestletTwo              36 | 118 - my.example.restlet-two - 1.0.0.SNAPSHOT | ***[RestletTwo] Got test.profile:two
      | my.example.RestletTwo              36 | 118 - my.example.restlet-two - 1.0.0.SNAPSHOT | ***[RestletTwo] Got test.D:DD
      | my.example.RestletTwo              36 | 118 - my.example.restlet-two - 1.0.0.SNAPSHOT | ***[RestletTwo] Got one:oneValueProfileTwo
      

      #######################
      Following is the Issue
      #######################
      So far everything is fine. But now when we assign the "profile-two" as well to the same container "TestContainerOne" (which already has profile-one assigned to it) then the bundles see the merged "users.properties" from individual profiles.

      container-add-profile TestContainerOne profile-two 
      container-stop TestContainerOne
      container-start TestContainerOne 
      

      Output

      "jboss-fuse-6.1.0.redhat-379/instances/TestContainerOne/data/log/karaf.log" file output:

      | my.example.RestletOne              29 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | [RestletOne] io.fabric8.profile.urlhandler external form: profile:users.properties
      | my.example.RestletOne              34 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | [RestletOne] Got test.D:DD
      | my.example.RestletOne              34 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | [RestletOne] Got test.C:CC
      | my.example.RestletOne              34 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | [RestletOne] Got test.B:BB
      | my.example.RestletOne              34 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | [RestletOne] Got test.A:AA
      | my.example.RestletOne              34 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | [RestletOne] Got one:oneValueProfileTwo
      | my.example.RestletOne              34 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | [RestletOne] Got test.profile:two
      | my.example.RestletOne              34 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | [RestletOne] Got test.F:FF
      | my.example.RestletOne              34 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | [RestletOne] Got test.E:EE
      | my.example.RestletOne              34 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | [RestletOne] Got two:twoValueProfileTwo
      
      | my.example.RestletTwo              28 | 119 - my.example.restlet-two - 1.0.0.SNAPSHOT | URL to use profile:users.properties
      | my.example.RestletTwo              30 | 119 - my.example.restlet-two - 1.0.0.SNAPSHOT | ***[RestletTwo] io.fabric8.profile.urlhandler external form: profile:users.properties
      | my.example.RestletTwo              36 | 119 - my.example.restlet-two - 1.0.0.SNAPSHOT | ***[RestletTwo] Got test.D:DD
      | my.example.RestletTwo              36 | 119 - my.example.restlet-two - 1.0.0.SNAPSHOT | ***[RestletTwo] Got test.C:CC
      | my.example.RestletTwo              36 | 119 - my.example.restlet-two - 1.0.0.SNAPSHOT | ***[RestletTwo] Got test.B:BB
      | my.example.RestletTwo              36 | 119 - my.example.restlet-two - 1.0.0.SNAPSHOT | ***[RestletTwo] Got test.A:AA
      | my.example.RestletTwo              36 | 119 - my.example.restlet-two - 1.0.0.SNAPSHOT | ***[RestletTwo] Got one:oneValueProfileTwo
      | my.example.RestletTwo              36 | 119 - my.example.restlet-two - 1.0.0.SNAPSHOT | ***[RestletTwo] Got test.profile:two
      | my.example.RestletTwo              36 | 119 - my.example.restlet-two - 1.0.0.SNAPSHOT | ***[RestletTwo] Got test.F:FF
      | my.example.RestletTwo              36 | 119 - my.example.restlet-two - 1.0.0.SNAPSHOT | ***[RestletTwo] Got test.E:EE
      | my.example.RestletTwo              36 | 119 - my.example.restlet-two - 1.0.0.SNAPSHOT | ***[RestletTwo] Got two:twoValueProfileTwo
      

      Oservations:
      Notice that the "restlet-one" bundle is able to see the additional the properties defined in the "users.proiperties" of profile-two (like E=EE,D=DD)

      Show
      Take JBoss Fuse 6.1.0 fabric:create --wait- for -provisioning profile-create --parents default profile-one container-create-child root TestContainerOne container-add-profile TestContainerOne profile-one profile-edit --features camel-blueprint profile-one profile-edit --features camel profile-one profile-create --parents default profile-two container-create-child root TestContainerTwo container-add-profile TestContainerTwo profile-two profile-edit --features camel-blueprint profile-two profile-edit --features camel profile-two Now create properties file "users.properties" inside these profiles. Content of "users.properties" present inside the "profile-one" looks like following: http://localhost:8181/hawtio/index.html#/wiki/branch/1.0/view/fabric/profiles/profile/one.profile/users.properties # Add properties here one=oneValueProfileOne two=twoValueProfileOne test.profile=one test.A=AA test.B=BB test.C=CC http://localhost:8181/hawtio/index.html#/wiki/branch/1.0/view/fabric/profiles/profile/two.profile/users.properties # Add properties here one=oneValueProfileTwo two=twoValueProfileTwo test.profile=two test.D=DD test.E=EE test.F=FF Deploy the bundles to these profiles. profile-edit --bundles mvn:my.example/restlet-one/1.0-SNAPSHOT profile-one profile-edit --bundles mvn:my.example/restlet-two/1.0-SNAPSHOT profile-two Output "jboss-fuse-6.1.0.redhat-379/instances/TestContainerOne/data/log/karaf.log" file output: | my.example.RestletOne 27 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | URL to use profile:users.properties | my.example.RestletOne 29 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | [RestletOne] io.fabric8.profile.urlhandler external form: profile:users.properties | my.example.RestletOne 34 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | [RestletOne] Got two:twoValueProfileOne | my.example.RestletOne 34 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | [RestletOne] Got test.profile:one | my.example.RestletOne 34 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | [RestletOne] Got one:oneValueProfileOne | my.example.RestletOne 34 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | [RestletOne] Got test.C:CC | my.example.RestletOne 34 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | [RestletOne] Got test.B:BB | my.example.RestletOne 34 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | [RestletOne] Got test.A:AA "jboss-fuse-6.1.0.redhat-379/instances/TestContainerTwo/data/log/karaf.log" file output: | my.example.RestletTwo 28 | 118 - my.example.restlet-two - 1.0.0.SNAPSHOT | URL to use profile:users.properties | my.example.RestletTwo 30 | 118 - my.example.restlet-two - 1.0.0.SNAPSHOT | ***[RestletTwo] io.fabric8.profile.urlhandler external form: profile:users.properties | my.example.RestletTwo 36 | 118 - my.example.restlet-two - 1.0.0.SNAPSHOT | ***[RestletTwo] Got test.F:FF | my.example.RestletTwo 36 | 118 - my.example.restlet-two - 1.0.0.SNAPSHOT | ***[RestletTwo] Got test.E:EE | my.example.RestletTwo 36 | 118 - my.example.restlet-two - 1.0.0.SNAPSHOT | ***[RestletTwo] Got two:twoValueProfileTwo | my.example.RestletTwo 36 | 118 - my.example.restlet-two - 1.0.0.SNAPSHOT | ***[RestletTwo] Got test.profile:two | my.example.RestletTwo 36 | 118 - my.example.restlet-two - 1.0.0.SNAPSHOT | ***[RestletTwo] Got test.D:DD | my.example.RestletTwo 36 | 118 - my.example.restlet-two - 1.0.0.SNAPSHOT | ***[RestletTwo] Got one:oneValueProfileTwo ####################### Following is the Issue ####################### So far everything is fine. But now when we assign the "profile-two" as well to the same container "TestContainerOne" (which already has profile-one assigned to it) then the bundles see the merged "users.properties" from individual profiles. container-add-profile TestContainerOne profile-two container-stop TestContainerOne container-start TestContainerOne Output "jboss-fuse-6.1.0.redhat-379/instances/TestContainerOne/data/log/karaf.log" file output: | my.example.RestletOne 29 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | [RestletOne] io.fabric8.profile.urlhandler external form: profile:users.properties | my.example.RestletOne 34 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | [RestletOne] Got test.D:DD | my.example.RestletOne 34 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | [RestletOne] Got test.C:CC | my.example.RestletOne 34 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | [RestletOne] Got test.B:BB | my.example.RestletOne 34 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | [RestletOne] Got test.A:AA | my.example.RestletOne 34 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | [RestletOne] Got one:oneValueProfileTwo | my.example.RestletOne 34 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | [RestletOne] Got test.profile:two | my.example.RestletOne 34 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | [RestletOne] Got test.F:FF | my.example.RestletOne 34 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | [RestletOne] Got test.E:EE | my.example.RestletOne 34 | 118 - my.example.restlet-one - 1.0.0.SNAPSHOT | [RestletOne] Got two:twoValueProfileTwo | my.example.RestletTwo 28 | 119 - my.example.restlet-two - 1.0.0.SNAPSHOT | URL to use profile:users.properties | my.example.RestletTwo 30 | 119 - my.example.restlet-two - 1.0.0.SNAPSHOT | ***[RestletTwo] io.fabric8.profile.urlhandler external form: profile:users.properties | my.example.RestletTwo 36 | 119 - my.example.restlet-two - 1.0.0.SNAPSHOT | ***[RestletTwo] Got test.D:DD | my.example.RestletTwo 36 | 119 - my.example.restlet-two - 1.0.0.SNAPSHOT | ***[RestletTwo] Got test.C:CC | my.example.RestletTwo 36 | 119 - my.example.restlet-two - 1.0.0.SNAPSHOT | ***[RestletTwo] Got test.B:BB | my.example.RestletTwo 36 | 119 - my.example.restlet-two - 1.0.0.SNAPSHOT | ***[RestletTwo] Got test.A:AA | my.example.RestletTwo 36 | 119 - my.example.restlet-two - 1.0.0.SNAPSHOT | ***[RestletTwo] Got one:oneValueProfileTwo | my.example.RestletTwo 36 | 119 - my.example.restlet-two - 1.0.0.SNAPSHOT | ***[RestletTwo] Got test.profile:two | my.example.RestletTwo 36 | 119 - my.example.restlet-two - 1.0.0.SNAPSHOT | ***[RestletTwo] Got test.F:FF | my.example.RestletTwo 36 | 119 - my.example.restlet-two - 1.0.0.SNAPSHOT | ***[RestletTwo] Got test.E:EE | my.example.RestletTwo 36 | 119 - my.example.restlet-two - 1.0.0.SNAPSHOT | ***[RestletTwo] Got two:twoValueProfileTwo Oservations: Notice that the "restlet-one" bundle is able to see the additional the properties defined in the "users.proiperties" of profile-two (like E=EE,D=DD)

      • Create two profiles with default profile as parent (I'll call them profile-one and profile-two). Create a data.properties file in each. Put one = one to in first data.properties file and two = two in the second one.

      Now create a pair of bundles (bundle-one, and bundle-two) that log the contents of URL "profile:data.properties" and add them to their respective profiles (bundle-one -> profile-one, bundle-two -> profile-two). Assign the profiles to a container.

      Expected result:
      bundle-one logs key: one, value = one (=contents of data.properties in profile-one)
      bundle-two logs key: two, value = two (=contents of data.properties in profile-two)

      What I got: both bundles log every entry of every data.properties file in every assigned profile. There seems to be a problem in overlay profile handling.

      This causes our per-service user credentials (kept in users.properties in various profiles) to spill over profile boundaries. Any credential can access any service!

      Workaround is to name every resource file uniquely

              pantinor@redhat.com Paolo Antinori
              jaysensharma Jay SenSharma (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: