Skip to content

Commit 062505a

Browse files
authored
do not include public sites in mock cipher generation unless env variable is active (#362)
1 parent 00e2a56 commit 062505a

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ VAULT_HOST_URL="https://localhost"
2727
# Used to match a remote server configuration.
2828
REMOTE_VAULT_CONFIG_MATCH="https://localhost:8443/api/config"
2929

30+
# (Optional) Indicate whether mock ciphers used in live site tests should be included in vault seeding
31+
# INCLUDE_PUBLIC_PAGE_CIPHERS="true"
32+
3033
# (Optional) Specify the root directory filename for the Bitwarden vault JSON import
3134
# you'd like to use (e.g. "vault.json")
3235
# Mock data generation tool: https://www.passwordvaultgenerator.com/

scripts/vault-seeder.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,13 @@ class VaultSeeder {
6868
vaultItems.forEach((item) => (existingVaultItems[item.name] = item));
6969
}
7070

71-
const allCiphers = [...localPageCiphers, ...publicPageCiphers];
71+
const includePublicPageCiphers =
72+
process.env.INCLUDE_PUBLIC_PAGE_CIPHERS === "true";
73+
74+
const allCiphers = [
75+
...localPageCiphers,
76+
...(includePublicPageCiphers ? publicPageCiphers : []),
77+
];
7278

7379
for (let index = 0; index < allCiphers.length; index++) {
7480
const pageCipher = allCiphers[index];

0 commit comments

Comments
 (0)