Skip to content

feat(secrets): add unified Bitwarden secret runner - #157

Merged
subhashkhileri merged 8 commits into
redhat-developer:mainfrom
zdrapela:feat/bitwarden-local-secrets
Sep 10, 2026
Merged

feat(secrets): add unified Bitwarden secret runner#157
subhashkhileri merged 8 commits into
redhat-developer:mainfrom
zdrapela:feat/bitwarden-local-secrets

Conversation

@zdrapela

@zdrapela zdrapela commented Sep 4, 2026

Copy link
Copy Markdown
Member

What

  • Add a provider-neutral secrets export with profile parsing, collection mapping, Bitwarden access, environment materialization, and child-process execution.
  • Add the rhdh-e2e-secrets exec CLI for running commands with selected secrets.
  • Require an already unlocked Bitwarden session and use the locally installed bw executable.
  • Validate readable collections and explicitly deny the AWS credentials collection.
  • Preserve the existing VAULT_* environment naming contract through profile transforms.
  • Support attachment-backed Bitwarden items by accepting exactly one valid attachment, deriving a sanitized item-basename filename, and retrieving content in memory with bw get attachment ... --raw.
  • Validate attachment metadata before retrieval: attachment-backed items accept only null or empty-string notes, and command failures do not expose payload contents.
  • Add unit/integration coverage and documentation for local secret execution.
  • Release the package as 2.3.0.

Why the locally installed bw CLI

The runner invokes the locally installed Bitwarden bw executable instead of adding the NPM @bitwarden/cli package. The NPM CLI requires a specific Node.js version, which would conflict with Node.js versions selected by the E2E toolchain and CI and would add unnecessary runtime coupling to every consumer. Using the external CLI keeps the package dependency graph stable while allowing the same secret-management flow to be used by both rhdh-plugin-export-overlays and rhdh.

The runner does not log in, unlock, lock, or persist the Bitwarden session. It only uses the existing BW_SESSION value and the installed CLI.

Consumer

The corresponding overlay integration is in rhdh-plugin-export-overlays#3565.

This package is intended to be the shared secret-management tool for E2E execution across both rhdh-plugin-export-overlays and rhdh repositories.

Validation

  • Full build and test: 165 passed, 0 failed.
  • Targeted Prettier, ESLint, and git diff checks passed.
  • Local Bitwarden process isolation and secret materialization checks passed.

Dependency

The overlay consumer must wait for the 2.3.0 package release before registry-based installs can resolve it.

@zdrapela
zdrapela force-pushed the feat/bitwarden-local-secrets branch from b842b71 to d86a871 Compare September 9, 2026 15:04
@zdrapela
zdrapela marked this pull request as ready for review September 9, 2026 15:05
Keep provider credentials out of spawned test processes without mutating Playwright's process environment during global setup.

Assisted-by: OpenCode
Signed-off-by: Zbyněk Drápela <zbynek.drapela@gmail.com>
Allow local .env values to override inherited secrets while preserving CI environment precedence.

Assisted-by: OpenCode
Signed-off-by: Zbyněk Drápela <zbynek.drapela@gmail.com>
process.env.KEYCLOAK_METADATA_URL = `${keycloak.keycloakUrl}/realms/${realm}`;
process.env.KEYCLOAK_BASE_URL = keycloak.keycloakUrl;

console.table({

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this info was helpful to know what key-cloak credentials are when testing locally. either to login to rhdh or keycloak itself for debugging

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I can put that back

Assisted-by: OpenCode
Comment thread src/playwright/global-setup.ts Outdated
@subhashkhileri
subhashkhileri merged commit 17840df into redhat-developer:main Sep 10, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants