Skip to content

Add multi team secret support to VaultBackend#65493

Merged
shahar1 merged 1 commit intoapache:mainfrom
stephen-bracken:hashicorp-team-secrets-backend
Apr 22, 2026
Merged

Add multi team secret support to VaultBackend#65493
shahar1 merged 1 commit intoapache:mainfrom
stephen-bracken:hashicorp-team-secrets-backend

Conversation

@stephen-bracken
Copy link
Copy Markdown
Contributor

Add support for team scoped secrets to the VaultBackend secrets backend

related: #65372

If multi_team is enabled, the VaultBackend will now prefix each variable or connection id with the team name,
i.e. {base_path}/{team_name}/{key}.
If no key is found under the team specific secrets then a global path will be searched instead. This global path
will default to using the base path, but can also be prefixed e.g. {base_path}/global/{key} or {base_path}/shared/{key} etc.

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)
  • No

@boring-cyborg boring-cyborg Bot added area:providers area:secrets provider:hashicorp Hashicorp provider related issues labels Apr 19, 2026
@stephen-bracken stephen-bracken force-pushed the hashicorp-team-secrets-backend branch 7 times, most recently from 13e0f1a to 4c3c7e0 Compare April 19, 2026 19:11
@stephen-bracken stephen-bracken marked this pull request as ready for review April 19, 2026 19:58
baraka-akeyless added a commit to baraka-akeyless/airflow that referenced this pull request Apr 20, 2026
When core.multi_team is enabled, the secrets backend now looks up
secrets under {base_path}/{team_name}/{key} first, falling back to
a global path. Supports use_team_secrets_path and global_secrets_path
configuration options, matching the VaultBackend pattern from apache#65493.

Made-with: Cursor
@shahar1 shahar1 requested a review from Copilot April 21, 2026 06:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds multi-team (team-scoped) secret lookup behavior to the HashiCorp VaultBackend, allowing connection/variable resolution to prefer {base_path}/{team_name}/{key} and fall back to a global path when configured.

Changes:

  • Add team/global lookup logic to VaultBackend (including new use_team_secrets_path and global_secrets_path kwargs).
  • Update get_connection() and get_variable() to use team-aware secret resolution when multi-team mode is enabled.
  • Add unit tests covering team-scoped and global-fallback secret retrieval.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
providers/hashicorp/src/airflow/providers/hashicorp/secrets/vault.py Implements multi-team path resolution and global fallback behavior in VaultBackend.
providers/hashicorp/tests/unit/hashicorp/secrets/test_vault.py Adds tests validating team-scoped lookup, disabling team separation, and global fallback behavior.

Comment thread providers/hashicorp/src/airflow/providers/hashicorp/secrets/vault.py Outdated
Comment thread providers/hashicorp/src/airflow/providers/hashicorp/secrets/vault.py Outdated
Comment thread providers/hashicorp/src/airflow/providers/hashicorp/secrets/vault.py Outdated
Comment thread providers/hashicorp/src/airflow/providers/hashicorp/secrets/vault.py Outdated
Comment thread providers/hashicorp/tests/unit/hashicorp/secrets/test_vault.py Outdated
@stephen-bracken stephen-bracken force-pushed the hashicorp-team-secrets-backend branch from 4c3c7e0 to 061808c Compare April 21, 2026 12:06
Comment thread providers/hashicorp/src/airflow/providers/hashicorp/secrets/vault.py Outdated
@stephen-bracken stephen-bracken force-pushed the hashicorp-team-secrets-backend branch from 061808c to a78ad65 Compare April 21, 2026 16:15
Comment thread providers/hashicorp/tests/unit/hashicorp/secrets/test_vault.py Outdated
Comment thread providers/hashicorp/tests/unit/hashicorp/secrets/test_vault.py Outdated
Comment thread providers/hashicorp/tests/unit/hashicorp/secrets/test_vault.py Outdated
@stephen-bracken stephen-bracken force-pushed the hashicorp-team-secrets-backend branch from a78ad65 to e4cb164 Compare April 21, 2026 17:29
@stephen-bracken stephen-bracken force-pushed the hashicorp-team-secrets-backend branch from e4cb164 to 32be5da Compare April 21, 2026 17:58
eladkal pushed a commit to baraka-akeyless/airflow that referenced this pull request Apr 21, 2026
When core.multi_team is enabled, the secrets backend now looks up
secrets under {base_path}/{team_name}/{key} first, falling back to
a global path. Supports use_team_secrets_path and global_secrets_path
configuration options, matching the VaultBackend pattern from apache#65493.

Made-with: Cursor
@eladkal
Copy link
Copy Markdown
Contributor

eladkal commented Apr 21, 2026

Tests are failing
FAILED providers/hashicorp/tests/unit/hashicorp/secrets/test_vault.py::TestVaultSecrets::test_get_variable_value_multi_team[global_var_no_team] - AssertionError: assert equals failed

@stephen-bracken stephen-bracken force-pushed the hashicorp-team-secrets-backend branch 2 times, most recently from cc6ba4a to 17c0ecd Compare April 21, 2026 21:43
@stephen-bracken stephen-bracken force-pushed the hashicorp-team-secrets-backend branch from 17c0ecd to 61e6931 Compare April 21, 2026 22:33
@shahar1 shahar1 merged commit 51bd898 into apache:main Apr 22, 2026
89 checks passed
@boring-cyborg
Copy link
Copy Markdown

boring-cyborg Bot commented Apr 22, 2026

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

eladkal pushed a commit to baraka-akeyless/airflow that referenced this pull request Apr 22, 2026
When core.multi_team is enabled, the secrets backend now looks up
secrets under {base_path}/{team_name}/{key} first, falling back to
a global path. Supports use_team_secrets_path and global_secrets_path
configuration options, matching the VaultBackend pattern from apache#65493.

Made-with: Cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants