Skip to content
This repository has been archived by the owner on Dec 9, 2018. It is now read-only.

Template repositories don't support authentication #1765

Open
brampouwelse opened this issue Sep 7, 2017 · 3 comments
Open

Template repositories don't support authentication #1765

brampouwelse opened this issue Sep 7, 2017 · 3 comments
Assignees
Milestone

Comments

@brampouwelse
Copy link

Template repositories (configured in Eclipse preferences) dont work if they require autentication.

@brampouwelse
Copy link
Author

I had a look at the code to see if I can fix this one myself... And I did get it to work but discovered some other things.

Loading templates doesn't work at all when using a repository that requires authentication

  • For template repositories (Eclipse preferences) templates are not listed at all in the dialog
  • For workspace repositories (OSGiRepository) templates are listed but can't be loaded

That it doesn't work for OSGiRepositories has to do with the OSGiRepository not supporting the way the RepoPluginsBundleLocator queries it. Eventually the RepoPluginsBundleLocator reverts to a direct download (which fails if the repository requires authentication);

@bjhargrave
Copy link
Member

bjhargrave commented Sep 26, 2017

OSGiRepository use the http code which supports credentials. See http://bnd.bndtools.org/instructions/connection-settings.html for how to set them up.

@brampouwelse
Copy link
Author

I'm aware of how to use connection settings (which also work for a FixedIndexedRepo btw.) but it just doesn't work.

The template repos that are configured in the Eclipse preferences are loaded using a FixedIndexedRepo that's not part of the workspace ( https://github.com/bndtools/bndtools/blob/master/bndtools.core/src/org/bndtools/core/templating/repobased/ReposTemplateLoader.java#L184 )

That repo just doesn't get the connection settings ..

I've tried to come up with a fix ( #1766 )
but then ran into another issue.

https://github.com/bndtools/bndtools/blob/master/bndtools.core/src/org/bndtools/core/templating/repobased/RepoPluginsBundleLocator.java#L28

The RepoPluginsBundleLocator tries to load the bundle from the repo without version, that doesn't work for the OSGiRepository so it always falls back to a direct download without beeing aware of the connection settings. This makes that templates are listed in the selection dialog but after that it can't download the bundle containing the template.

The only way I managed to load templates from an authenticated repo at this moment is by adding a FixedIndexedRepo to the workspace (and configuring the connection settings).

@bjhargrave bjhargrave added this to the Someday milestone Dec 8, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants