Skip to content

Support URLs with basic authentication when resolving a devfile #21998

@l0rd

Description

@l0rd

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

image

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://${PAT}@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:

image

The same URL works fine with cURL:

image

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:

image

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.

Metadata

Metadata

Assignees

Labels

area/che-serverarea/git/oauth-servicesOAuth support to authenticate developers with their GitHub, GitLab, Bitbucket etc...accountskind/enhancementA feature request - must adhere to the feature request template.new&noteworthyFor new and/or noteworthy issues that deserve a blog post, new docs, or emphasis in release notesseverity/P1Has a major impact to usage or development of the system.sprint/currentstatus/release-notes-review-neededIssues that needs to be reviewed by the doc team for the Release Notes wording

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions