Skip to content

Commit

Permalink
fix: add additional active user password
Browse files Browse the repository at this point in the history
  • Loading branch information
bbortt committed Jul 4, 2024
1 parent 978eb67 commit f95d08c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ _Never_ include your `VAULT_TOKEN` directly in the configuration file or commit

### Initializing Vault for Secret Management

The propeller init-vault command is the first step in setting up your database secret rotation process.
The `propeller init-vault` command is the first step in setting up your database secret rotation process.
It creates the necessary structure within your Vault instance to securely store and manage your PostgreSQL credentials.

**Command Usage:**
Expand All @@ -82,13 +82,16 @@ After running the command, the specified Vault path will contain a JSON secret w
```json
{
"postgresql_active_user": "TBD",
"postgresql_active_user_password": "TBD",
"postgresql_user_1": "TBD",
"postgresql_user_1_password": "TBD",
"postgresql_user_2": "TBD",
"postgresql_user_2_password": "TBD"
}
```

**Note that any previously present secrets in this path will be lost in the process!**

The "TBD" placeholders indicate that these values _must_ be filled once with the initial values before continuing the rotation process.

#### Example Result
Expand Down
4 changes: 2 additions & 2 deletions img/initial-vault-structure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/vault.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const VAULT_TOKEN: &'static str = "VAULT_TOKEN";
#[derive(Debug, Deserialize, Serialize)]
struct VaultStructure {
postgresql_active_user: String,
postgresql_active_user_password: String,
postgresql_user_1: String,
postgresql_user_1_password: String,
postgresql_user_2: String,
Expand All @@ -37,8 +38,11 @@ impl Vault {
}

pub(crate) fn init_secret_path(&mut self) {
// TODO: Theoretically it would be possible to check if anything exists in this path already - exit if so.

let vault_structure = VaultStructure {
postgresql_active_user: "TBD".to_string(),
postgresql_active_user_password: "TBD".to_string(),
postgresql_user_1: "TBD".to_string(),
postgresql_user_1_password: "TBD".to_string(),
postgresql_user_2: "TBD".to_string(),
Expand Down

0 comments on commit f95d08c

Please sign in to comment.