Skip to content

pgpSigningKey can't be found using credentials method #170

@margussipria

Description

@margussipria

steps

sbt-pgp version: 2.0.0
sbt version: 1.3.3

problem

Using credentials how it is show README.md will not work.

When documentation part was copied from jodersky/sbt-gpg, also changes should have been done to that.

In this plugin gpg has been changed to pgp

pgpSigningKey := Credentials.forHost(credentials.value, "pgp").map(_.userName),

But changing this does not help, as this plugin is running that line before credential is added? I can see my key when running:

sbt:macros> show credentials
[info] * DirectCredentials("GnuPG Key ID", "pgp", "2BE67AC00D699E04E840B7FE29967E804D85663F", ****)

But can't see key when I run

sbt:macros> show pgpSigningKey
[info] None

I can use usePgpKeyHex method to add key, or add manually following line

pgpSigningKey := Credentials.forHost(credentials.value, "pgp").map(_.userName)

But that would be same if I would add key directly as

pgpSigningKey := Some("2BE67AC00D699E04E840B7FE29967E804D85663F")

expectation

  1. Documentation to be correct
  2. Signing key to be be loaded from credentials (plugin default value is resolved too early?)

notes

  1. I have tested moving credentials from project scope to global, didn't help with discovery.
  2. It would be nice to be able prefix host gpg for example with organization key. I have 2 keys that I use for signing different projects, those projects that could have multiple maintainers signing, it would be nice to have for work code one public configuration and every member has own private credentials file. For now I can have this option and also fix bug by having this line in public configuration
pgpSigningKey := Credentials.forHost(credentials.value, s"${organization.value}-gpg").map(_.userName)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions