Add EnvVarHeaderContentGuard - #8015
Open
decko wants to merge 7 commits into
Open
Conversation
Validate a Base64-encoded request header against a content-app environment variable so shared secrets can rotate without updating guard records. Names must be listed in ENVVAR_HEADER_CONTENT_GUARD_ALLOWED_VARS. fixes pulp#8007 Assisted-by: Cursor Grok 4.6 Co-authored-by: Cursor <cursoragent@cursor.com>
Assisted-by: Cursor Grok 4.6 Co-authored-by: Cursor <cursoragent@cursor.com>
Reject names not in ENVVAR_HEADER_CONTENT_GUARD_ALLOWED_VARS before decoding the request header. Assisted-by: Cursor Grok 4.6 Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the env and allowlist in template_config.yml; do not hand-edit the plugin-template output. Assisted-by: Cursor Grok 4.6 Co-authored-by: Cursor <cursoragent@cursor.com>
Assisted-by: Cursor Grok 4.6 Co-authored-by: Cursor <cursoragent@cursor.com>
CLI support needs a separate pulp-cli PR; the REST API is available now. Assisted-by: Cursor Grok 4.6 Co-authored-by: Cursor <cursoragent@cursor.com>
Assisted-by: Cursor Grok 4.6 Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
EnvVarHeaderContentGuardso a Base64-encoded request header can be checked against a content-app environment variable (fixes #8007). Rotation is a deploy/env change, not a DB update ofHeaderContentGuard.header_value.env_varmust be listed inENVVAR_HEADER_CONTENT_GUARD_ALLOWED_VARS(default[]). The secret is never stored or returned by the API.ENVVAR_HEADER_GUARD_TEST_SECRETfrom the Pulp container env (injected viatemplate_config.yml/ CIpulp_env).Test plan
pytest -k envvar_headerunit tests (secret + allowlist set in the pulp container)pytest -k envvar_headerfunctional tests (create guard, 403 without/wrong header, 404 with matching Base64 header, 400 for disallowedenv_var, access policy present)/pulp/api/v3/contentguards/core/envvar_header/and that GET does not expose a secret valueRelated: PULP-2257, pulp-service prototype pulp/pulp-service#1420
Assisted-by: Cursor Grok 4.6
Made with Cursor