Skip to content
This repository has been archived by the owner on Feb 28, 2021. It is now read-only.

Pass pgp credentials via other mechanisms #102

Merged
merged 2 commits into from
Apr 27, 2017
Merged

Conversation

jvican
Copy link
Member

@jvican jvican commented Apr 16, 2017

Previously, pgp passphrases could not be provided from system properties
and environment variables. This commit enables this use case and makes
pgp credentials behave in the same way as sonatype credentials do.

@jvican
Copy link
Member Author

jvican commented Apr 16, 2017

CI fails because of sbt/sbt#3108.

@jvican
Copy link
Member Author

jvican commented Apr 26, 2017

I've just pushed to see what's going on. After the resolution error went away, I got a weird error: incompatible class version. It seems there are some stale class files that are not correctly cleaned. Let's see if there's more luck now.

Previously, pgp passphrases could not be provided from system properties
and environment variables. This commit enables this use case and makes
pgp credentials behave in the same way as sonatype credentials do.
@jvican
Copy link
Member Author

jvican commented Apr 26, 2017

I think I've just figured out what happened. Someone push forced to master 2.12, and CI never ran. If it had, it would have failed because Travis uses Oracle JDK7 by default.

@jvican
Copy link
Member Author

jvican commented Apr 26, 2017

Yes, CI is passing as expected.

@jvican
Copy link
Member Author

jvican commented Apr 26, 2017

Can you quickly review this @eed3si9n ?

Copy link
Member

@2m 2m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@dwijnand dwijnand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I particularly like the more compact encoding (rather than nesting).

Only thing I'd do differently is:

  1. look in the cache before sys props, like requestSonatypeCredentials
  2. prompt the user or throw sys.error also in requestPgpCredentials, like requestSonatypeCredentials, rather than do half in requestPgpCredentials and half outside.

@jvican
Copy link
Member Author

jvican commented Apr 27, 2017

Hey Dale, thanks for the feedback. The reason why I didn't use user prompt in this PR is because I'm not interested in making it behave the same as the sonatype credentials. I'm just interested in a programmatic way to pass them to the plugin. This is also the reason why we don't cache them (there is no need to if users cannot type the credentials in).

I someone is interested in that feature, I suggest to do it in another PR. Honestly, I'm not convinced that prompting for the gpg password is a good idea at all (I would personally prefer a safer mechanism that involves the connection with gpg-agent).

@dwijnand
Copy link
Member

One of us is confused, because as I see it there is no need to implement user prompt because it's there already.

https://github.com/sbt/sbt-bintray/pull/102/files#diff-0c323dc89cc4b703a5896b0640646c9eR107

@jvican
Copy link
Member Author

jvican commented Apr 27, 2017

I didn't mean "implement it" but rather use it for pgp credentials.

@jvican
Copy link
Member Author

jvican commented Apr 27, 2017

Merging since @dwijnand and I agreed privately that we can solve the concerns described in this ticket in the future if the need arises.

@jvican jvican merged commit b0d9e37 into sbt:master Apr 27, 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

Successfully merging this pull request may close these issues.

4 participants