Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-5680

Add createResource(URLConnection conn) to DataModelHelperImpl to support URLs that require Authentication

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: bundlerepository-2.0.10
    • Fix Version/s: bundlerepository-2.0.12
    • Labels:
      None
    • Environment:
      macOS 10.12.6, Felix 5.6.4
    • Flags:
      Important

      Description

      Referring to classes:

      • org.apache.felix.bundlerepository.impl.DataModelHelperImpl.java
      • org.apache.felix.bundlerepository.impl.FileUtil.java

      Current scenario: The method DataModelHelperImpl.createResource(URL bundleUrl) has an inner method loadEntry(String name) that calls FileUtil.openURL(bundleUrl) on the line 479. FileUtil.openURL(URL bundleURL) is a helper function for FileUtil.openURL(URLConnection conn).

      Problem: It restricts the use of URL connections that require authorization. As a result, a 401 error occurs for bundleURLs that require HttpHeaders.AUTHORIZATION. Note: It is not the same as setting Proxy-Authorization because Authorization is a different HTTPHeader.

      Possible Solution: Overload the DataModelHelperImpl.createResource() such that it takes as input a URLConnection object which then calls the FileUtil.openURL(conn). An URLConnection object has method setRequestProperty(key, value) which could then make it possible for DataModelHelperImpl.createResource() to handle diverse scenarios.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                dangiankit Ankit Dangi
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: