Skip to content

An sbt plugin for fetching repository credentials from the system keychain

License

Notifications You must be signed in to change notification settings

plausiblelabs/sbt-keychain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sbt-keychain

sbt-keychain provides support for fetching repository credentials from the system keychain, rather than including them in plaintext in a local credentials file.

The plugin currently provides basic support for credential lookup via git credential helpers, including git-credential-osxkeychain for Mac OS X, and git-credential-winstore on Windows.

In the future, we'll investigate adding direct support for querying the system keychain APIs, including:

Contributions of keychain storage backends are most welcome.

Installation and Configuration

Add the following to your ~/.sbt/0.13/plugins/gpg.sbt file (you may need to create the directory):

// Required until we can submit the plugin to Maven Central
resolvers += "Plausible OSS" at "https://opensource.plausible.coop/nexus/content/repositories/public"

addSbtPlugin("coop.plausible" %% "sbt-keychain" % "1.0.1")

Configure the set of accounts to be fetched from the keychain in ~/.sbt/0.13/global.sbt:

import coop.plausible.sbt.keychain.{KeychainAccount, KeychainPlugin}

KeychainPlugin.keychainSettings

keychainAccounts ++= Seq(
    KeychainAccount("Sonatype Nexus Repository Manager", "https://maven.example.org", Some("my-username"))
)

credentials <++= KeychainPlugin.keychainCredentials

Credentials for the listed accounts will be automatically fetched from the keychain by KeychainPlugin.keychainCredentials. If username is left unspecified (eg, None), the keychain plugin will try to derive the account name from the keychain.

About

An sbt plugin for fetching repository credentials from the system keychain

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages