Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support HTTPS proxies and authentication #129

Open
fullben opened this issue May 12, 2023 · 2 comments
Open

Support HTTPS proxies and authentication #129

fullben opened this issue May 12, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@fullben
Copy link

fullben commented May 12, 2023

Does this plugin support authentication with the remote it is trying to acquire dependencies from?

@nedtwigg nedtwigg added the enhancement New feature or request label May 16, 2023
@nedtwigg
Copy link
Collaborator

It does not currently, but that could be added. HTTP clients are created in two places:

  1. for downloading p2 metadata

    if (cachingPolicy.cacheAllowed()) {
    metadataResponseCache = new Cache(new File(p2metadata, "connection"), maxSize);
    metadataClient = new OkHttpClient.Builder().cache(metadataResponseCache).build();
    } else {
    metadataResponseCache = null;
    metadataClient = new OkHttpClient.Builder().build();
    }

  2. for downloading the actual jars

    final OkHttpClient client = new OkHttpClient.Builder().build();
    final P2ClientCache cachingPolicy;

Happy to merge a PR which adds auth support. Ideally we would copy whatever environment variables Eclipse p2 and Tycho are currently using for this, not sure how they handle it.

@nedtwigg nedtwigg changed the title p2deps authentication support Support HTTPS proxies and authentication May 25, 2023
@lkoe
Copy link

lkoe commented Sep 5, 2023

Landed via spotless-gradle-plugin and having an interest in this functionality.

Proxy doesn't seem to be an issue as standard java proxy properties (e.g. http.proxyHost...) are honored but we are required to mirror the eclipse p2 repository from a central artifactory server requiring authentication.
Effectively this currently prevents us from using newer spotless versions :-|

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants