Uploaded image for project: 'Red Hat OpenShift Dev Spaces (formerly CodeReady Workspaces) '
  1. Red Hat OpenShift Dev Spaces (formerly CodeReady Workspaces)
  2. CRW-4106

[RN] Support URLs with basic authentication when resolving a devfile

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major Major
    • 3.5.0.GA
    • 3.5.0.GA, 3.6.0.GA
    • docs
    • False
    • None
    • False
    • Hide
      = Support for devfile URLs with basic authentication

      With this update, basic authentication support for devfile URLs is available. This feature is available for GitHub, GitLab, Bitbucket, Microsoft Azure, and other providers that support Personal Access Token.

      For example, you can now load a devfile from a URL such as:

      https://devspaces.you.cluster#https://&lt;personal-access-token&gt;@&lt;git provider host>/<path>?remotes=<git-repo-url>
      Show
      = Support for devfile URLs with basic authentication With this update, basic authentication support for devfile URLs is available. This feature is available for GitHub, GitLab, Bitbucket, Microsoft Azure, and other providers that support Personal Access Token. For example, you can now load a devfile from a URL such as: https://devspaces.you.cluster#https://&lt;personal-access-token&gt;@&lt;git provider host>/<path>?remotes=<git-repo-url>
    • Feature
    • Done

      Synced from eclipse/che issue

      https://github.com/eclipse/che/issues/21998

      Is your enhancement related to a problem? Please describe

      There are git services for which Che cannot resolve the Devfile.

      A workaround is to use the raw URL to the devfile. For example for azure devops the following public URL worked:

      https://dev.azure.com/marioloriedo/a5c3e8ae-6db1-4a4f-8b81-0a8ef12f154b/_apis/git/repositories/317bf9fc-90a2-42d2-884a-2766575892e8/items?path=/.devfile.yaml&versionDescriptor%5BversionOptions%5D=0&versionDescriptor%5BversionType%5D=0&versionDescriptor%5Bversion%5D=main&resolveLfs=true&%24format=octetStream&api-version=5.0&download=true
      

      <img width="1493" alt="image" src="https://user-images.githubusercontent.com/606959/218344617-f8c65e4f-c964-4c42-840f-90d4d46ab93b.png">
      For private repositories a developer could still use the same workaround but in this case he should include the personal access token in the URL. For example:

      https://mrebmvdxzlhhmratfm5iqzf5ox4iagdc2zhgcwrhbref7cihte6q@dev.azure.com/marioloriedo/marioloriedo/_apis/sourceProviders/TfsGit/filecontents?repository=private-repo&commitOrBranch=main&path=/.devfile.yaml&api-version=7.0
      

      But the che-server fails to resolve the devfile in this case:

      <img width="1346" alt="image" src="https://user-images.githubusercontent.com/606959/218345211-b54dc902-a384-468b-9c6c-baabe82accf5.png">
      The same URL works fine with cURL:

      <img width="871" alt="image" src="https://user-images.githubusercontent.com/606959/218345934-207bb4c7-3e6c-49e2-a629-27e2923225b1.png">

      Describe the solution you'd like

      The che-server should be able to resolve the file.

      Additional context

      I have also tested with a github.com private repository and the message is different:

      <img width="1014" alt="image" src="https://user-images.githubusercontent.com/606959/218346053-4768151a-8794-487c-9930-9f6cc34f3962.png">
      The URL used was:

      https://$GH_PAT@raw.githubusercontent.com/<user or organization>/<repo name>/<branch>/.devfile.yaml
      

      Che-server should resolve the file In this case too but it doesn't work.

            rhn-ecs-pkovar Petr Kovar (Inactive)
            jiralint.codeready Bot Codeready
            Jana Vrbkova Jana Vrbkova
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: