-
Notifications
You must be signed in to change notification settings - Fork 61
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 headers (to deploy to gitlab packaging) #111
Comments
Just stumbled over this gradle-related question and the documentation. Maybe the problem's even deeper... |
Wow, that approach to authentication is really quite unfortunate. Since Pomegranate has no access to the underlying HTTP abstractions, it's not so simple as adding support for HTTP headers, etc. I'm not going to work on this, but I think your best bet will be to follow the pattern set by https://github.com/s3-wagon-private/s3-wagon-private, probably subclassing whatever the usual HTTPS wagon is. That will allow you to access the username/passphrase info set in the usual way via Leiningen, set the custom Gitlab headers as necessary, and otherwise let everything else work as it usually does. FWIW, this approach will also mean that you can proceed independently; no changes here or in Leiningen should be necessary. |
Hi Chas,
thanks for taking the time to look into this. Actually, I'm really annoyed
by that authentication mechanism, and it might well be one (of a number of)
reason(s) to not use Gitlab Maven repos. However, while looking into this,
I found out that other tools are also using this, and also that other tools
share the problem (Clojure deps, Scala's SBT, among others). Also, aether
is a mess to deal with.
So, thanks for your thoughts. For me, you might close this issue, the
effort necessary is not worth it, especially if you also think it's not
easy to address from within pomegranate. Your hint on s3-wagon-private
would be the way to go for me then should I come back to this.
Cheers,
Chris
…On Tue, Apr 2, 2019 at 7:44 PM Chas Emerick ***@***.***> wrote:
Wow, that approach to authentication is really quite unfortunate. Since
Pomegranate has no access to the underlying HTTP abstractions, it's not so
simple as adding support for HTTP headers, etc.
I'm not going to work on this, but I think your best bet will be to follow
the pattern set by https://github.com/s3-wagon-private/s3-wagon-private,
probably subclassing whatever the usual HTTPS wagon is. That will allow you
to access the username/passphrase info set in the usual way via Leiningen
(and thus obviates the need for any changes there), set the custom Gitlab
headers as necessary, and otherwise let everything else work as it usually
does.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#111 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABAP48kc51AMLde1W4pPbNPTvZu3wVstks5vc5cOgaJpZM4cAJSk>
.
|
Just for completeness, I had a similar need to access GitLab maven repositories from leiningen. I followed the solution outlined above to create a small HttpWagon wrapper and works fine for accessing our GitLab private repos from lein. If anyone needs this, it is available at: https://github.com/nicheware/lein-gitlab-wagon |
Hi,
I want to deploy things into a Gitlab hosted maven repository (see https://docs.gitlab.com/ee/user/project/packages/maven_repository.html#authenticating-to-the-gitlab-maven-repository).
For authentication, one needs to pass credentials as an http header, which is usually done via settings.xml in maven.
I'm not sure how to do this in leiningen / pomegranate. Maybe there's a way to add the config to the session (as it is basically passed down as
aether.connector.http.headers
configuration property), maybe there's a better way.I'm willing to provide a PR for this, but I would first like your advice on how to tackle this in the best way (i.e., least offensive, easiest, ... you name it, way).
Or, maybe I'm just not getting it and pomegranate already supports it and I just missed it.
Any pointers are welcome. Thanks a lot.
Chris
The text was updated successfully, but these errors were encountered: