[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [p2-dev] Authority component in a p2 repository URI

AFAIK, there is no good solution.


In Tycho, we are hacking credentials into the registry on access of a repository. We use a special IProvisioningAgent instance for this with own I*RepositoryManager instances to do this transparently.


For details, start at the class RemoteAgent in the Tycho sources.






From: p2-dev-bounces@xxxxxxxxxxx [mailto:p2-dev-bounces@xxxxxxxxxxx] On Behalf Of Peter Nehrer
Sent: Freitag, 1. Februar 2013 16:48
To: p2-dev@xxxxxxxxxxx
Subject: Re: [p2-dev] Authority component in a p2 repository URI


Hi Ian,

I had a similar requirement and what I ended up doing was modifying DirectorApplication to supply credentials via UIServices. E.g.,

    private class AvoidTrustPromptService extends UIServices {

        public AuthenticationInfo getUsernamePassword(String location) {
            return authenticationMap.get(location);

I populate the authenticationMap through custom command-line arguments or a properties file; e.g.:

                authenticationMap.put(location, new UIServices.AuthenticationInfo(username, password, false));

Where location is your repository URL's hostname.

I couldn't find any other reasonable way for doing this in DirectorApplication. Frankly I was surprised that this wasn't a more common use-case for it -- I would think that authenticated repositories would be more commonly used in automation scenarios.


On 1/31/13 2:02 PM, Ian Bull wrote:

I'm trying to access a p2 repository using the following syntax:



And it's failing a parse exception:

java.lang.NumberFormatException: For input string: "password@localhost"

From the stack, it appears that ECF is trying to use 'irbull' as the host and password@localhost as the port. In HttpClientFileSystemBrowse, the URI is converted to a String, and the string is parsed into components (host, port, etc..). Does anybody know if this is supported? If not, is there a URI syntax that we use for specifying usernames and passwords in p2?



R. Ian Bull | EclipseSource Victoria | +1 250 477 7484
http://eclipsesource.com | http://twitter.com/eclipsesource

p2-dev mailing list