OnepasswordClient

class phalanx.storage.onepassword.OnepasswordClient(url, vault_title)

Bases: object

Retrieve secrets stored in 1Password via 1Password Connect.

This client is specific to a particular Phalanx environment. It is created using the metadata of a Phalanx environment by OnepasswordStorage.

The 1Password Connect authentication token is taken from the OP_CONNECT_TOKEN environment variable, which must be set.

Parameters:
  • url (str) – URL of the 1Password Connect server.

  • vault_title (str) – Title of vault within that 1Password Connect server from which to retrieve secrets.

Methods Summary

get_secrets(query)

Get static secrets for an environment from 1Password.

Methods Documentation

get_secrets(query)

Get static secrets for an environment from 1Password.

Parameters:

query (dict[str, list[str]]) – Query for secrets in the form of a dictionary of applications to lists of secret keys for that application that should be retrieved.

Returns:

Retrieved static secrets as a dictionary of applications to secret keys to StaticSecret objects.

Return type:

dict of dict

Raises:

MissingOnepasswordSecretsError – Raised if any of the items or fields expected to be in 1Password are not present.