HYPERFLEET-1147 - feat: enable caller identity header in API helm values#60
HYPERFLEET-1147 - feat: enable caller identity header in API helm values#60kuudori wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdds Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 11✅ Passed checks (11 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
Configure identity_header in base API values so the API resolves caller identity from the X-HyperFleet-Identity HTTP header for audit attribution. Overridable via API_IDENTITY_HEADER env var.
4c52514 to
0ea5f21
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@helmfile/configs/base/adapters/adapter1/adapter-task-config.yaml`:
- Around line 184-185: The adapter task config is hardcoding the identity header
name instead of using the same configurable source as the API. Update the header
entry in the adapter task configuration to be driven by the rendered value
derived from API_IDENTITY_HEADER, matching the identity header setting used by
base-api.yaml.gotmpl and consumed by hyperfleet-api at runtime. Keep the
identity value as-is, but make the header name overridable through the same
config path so status calls continue sending the header the API expects when the
env var is changed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Central YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: fadd9cc0-a428-4bea-ae3f-f0baf153d1a5
📒 Files selected for processing (9)
helmfile/configs/base/adapters/adapter1/adapter-task-config.yamlhelmfile/configs/base/adapters/adapter2/adapter-task-config.yamlhelmfile/configs/base/adapters/adapter3/adapter-task-config.yamlhelmfile/configs/e2e/adapters/cl-deployment/adapter-task-config.yamlhelmfile/configs/e2e/adapters/cl-job/adapter-task-config.yamlhelmfile/configs/e2e/adapters/cl-maestro/adapter-task-config.yamlhelmfile/configs/e2e/adapters/cl-namespace/adapter-task-config.yamlhelmfile/configs/e2e/adapters/np-configmap/adapter-task-config.yamlhelmfile/values/base-api.yaml.gotmpl
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
openshift-hyperfleet/architecture(manual)openshift-hyperfleet/hyperfleet-api(manual)openshift-hyperfleet/hyperfleet-sentinel(manual)openshift-hyperfleet/hyperfleet-adapter(manual)openshift-hyperfleet/hyperfleet-broker(manual)
✅ Files skipped from review due to trivial changes (2)
- helmfile/configs/e2e/adapters/cl-deployment/adapter-task-config.yaml
- helmfile/values/base-api.yaml.gotmpl
| - name: "X-HyperFleet-Identity" | ||
| value: "adapter@adapter.local" |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Do not hardcode the identity header name.
base-api.yaml.gotmpl makes config.server.identity_header configurable via API_IDENTITY_HEADER, and hyperfleet-api consumes that setting at runtime. Hardcoding X-HyperFleet-Identity here means any override will stop adapter status calls from sending the header the API actually reads, breaking audit attribution for these updates (CWE-345). Drive this header name from the same rendered value source as the API config.
As per path instructions, "All env vars are defined with ?= in the env files, so values can be overridden on the CLI (use this to verify API_IDENTITY_HEADER overrides behavior)."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@helmfile/configs/base/adapters/adapter1/adapter-task-config.yaml` around
lines 184 - 185, The adapter task config is hardcoding the identity header name
instead of using the same configurable source as the API. Update the header
entry in the adapter task configuration to be driven by the rendered value
derived from API_IDENTITY_HEADER, matching the identity header setting used by
base-api.yaml.gotmpl and consumed by hyperfleet-api at runtime. Keep the
identity value as-is, but make the header name overridable through the same
config path so status calls continue sending the header the API expects when the
env var is changed.
Sources: Path instructions, Linked repositories
Configure identity_header in base API values so the API resolves caller identity from the X-HyperFleet-Identity HTTP header for audit attribution. Overridable via API_IDENTITY_HEADER env var.
Summary
Test Plan
make test-allpassesmake lintpassesmake test-helm(if applicable)