Hush.Provider.OsKeychain (hush_os_keychain v0.1.0)

Copy Markdown View Source

Provider to read secrets from the operating system keychain.

The key is the service of a generic password item:

config :app, MyApp.Repo,
  password: {:hush, Hush.Provider.OsKeychain, "myapp.db_password"}

# optional, required when several items share a service
config :hush, Hush.Provider.OsKeychain, account: "ygor"

A missing item, or a machine without a usable store, returns {:error, :not_found} so Hush applies default or optional. Any other failure returns an error message.