SecretMana.Backend behaviour (secret_mana v0.1.1)

View Source

The backend behaviour for the SecretMana library.

Summary

Types

config()

@type config() :: %SecretMana.Config{
  backend: term(),
  backend_config: term(),
  environment: term(),
  otp_app: term()
}

file_path()

@type file_path() :: String.t()

key_path()

@type key_path() :: [String.t()]

Callbacks

config(config)

@callback config(config()) :: term()

decrypt(config, t)

@callback decrypt(config(), String.t()) :: :ok

download_url(config)

(optional)
@callback download_url(config()) :: String.t()

edit(config)

@callback edit(config()) :: :ok

encrypt(config, file_path, check_file_type)

@callback encrypt(config(), file_path(), check_file_type :: boolean()) :: :ok

gen_key(config)

@callback gen_key(config()) :: :ok

generate_private_key_file(config, binary)

@callback generate_private_key_file(config(), binary()) :: :ok

install(config)

@callback install(config()) :: :ok

read!(config, key_path)

@callback read!(config(), key_path()) :: String.t()