Skip to content

Add missing env var placeholders to dev backend-listen chart - #7029

Merged
beastoin merged 2 commits into
mainfrom
mon/dev-backend-listen-add-missing-secret-refs
Apr 26, 2026
Merged

beastoin merged 2 commits into
mainfrom
mon/dev-backend-listen-add-missing-secret-refs

Conversation

@beastoin

@beastoin beastoin commented Apr 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Add 5 env vars present in prod but missing from dev backend-listen
  • Variables: GROQ_API_KEY, OPENROUTER_API_KEY, RAPID_API_HOST, RAPID_API_KEY, CONVERSATION_SUMMARIZED_APP_IDS
  • Add secret key mappings to ExternalSecret values (backend-secrets chart) for GCP SM → K8s sync
  • Use secretKeyRef pattern in backend-listen chart (consistent with existing secret refs)

GCP Secret Manager status (based-hardware-dev)

Secret Status
GROQ_API_KEY Created with PLACEHOLDER_GROQ_API_KEY value
OPENROUTER_API_KEY Already existed (real value, 73 chars)
RAPID_API_HOST Already existed (real value, 28 chars)
RAPID_API_KEY Already existed (real value, 50 chars)
CONVERSATION_SUMMARIZED_APP_IDS Created with PLACEHOLDER_CONVERSATION_SUMMARIZED_APP_IDS value

Context

Beta users are routed to dev backends (PR #7014). Env var audit found these 5 vars exist in prod backend-listen but are absent in dev GKE deployment.

Test plan

  • Deploy backend-secrets chart first (syncs new keys to K8s secret)
  • Deploy backend-listen chart (pods pick up new env vars)
  • Verify pods start without CrashLoopBackOff
  • Replace 2 placeholder values (GROQ_API_KEY, CONVERSATION_SUMMARIZED_APP_IDS) with real values when available

🤖 Generated with Claude Code

Add 5 env vars present in prod but missing from dev backend-listen:
GROQ_API_KEY, OPENROUTER_API_KEY, RAPID_API_HOST, RAPID_API_KEY,
CONVERSATION_SUMMARIZED_APP_IDS. Set as PLACEHOLDER_ values to be
replaced with real secrets later.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@greptile-apps

greptile-apps Bot commented Apr 26, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds five env vars (GROQ_API_KEY, OPENROUTER_API_KEY, RAPID_API_HOST, RAPID_API_KEY, CONVERSATION_SUMMARIZED_APP_IDS) to the dev backend-listen Helm values that exist in prod but were missing from dev. However, all five are added using plain value: fields instead of valueFrom: secretKeyRef:, which is inconsistent with every other secret in this file and with how the same vars are declared in the prod chart.

  • The test plan is self-contradicting: it says to populate dev-omi-backend-secrets, but the chart never references that secret for these vars — updating it will have no effect, and pods will silently use the literal placeholder strings at runtime.

Confidence Score: 3/5

Not safe to merge as-is — the five new vars use the wrong injection mechanism, breaking the test plan and risking silent runtime failures or credential exposure.

Single P1 finding with a security dimension: wrong secret injection pattern means the K8s secret is never wired in, pods silently use placeholder strings at runtime, and there is a structural risk of committing real API keys to the chart YAML.

backend/charts/backend-listen/dev_omi_backend_listen_values.yaml — all five new env var entries need to be converted from plain value: to valueFrom: secretKeyRef: name: dev-omi-backend-secrets.

Security Review

  • Secret leakage risk (dev_omi_backend_listen_values.yaml): Using plain value: for API keys (GROQ_API_KEY, OPENROUTER_API_KEY, RAPID_API_KEY) creates a structural incentive to replace placeholder strings with real credentials directly in the YAML file, which would then be committed to git. The correct pattern — valueFrom: secretKeyRef: — keeps credentials exclusively in the K8s secret store and is already used for all other secrets in this chart.

Important Files Changed

Filename Overview
backend/charts/backend-listen/dev_omi_backend_listen_values.yaml Adds 5 env vars present in prod but uses plain value: "PLACEHOLDER_..." instead of valueFrom: secretKeyRef:, breaking the stated test plan and inconsistent with every other secret in this file and the prod chart

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Helm Chart Deploy] --> B{Env var source}
    B -->|Other secrets - correct| C["valueFrom: secretKeyRef:\n→ dev-omi-backend-secrets"]
    B -->|5 new vars - this PR| D["value: PLACEHOLDER_...\n(plain string)"]
    C --> E[Pod reads real secret\nfrom K8s secret store]
    D --> F[Pod starts with literal\nPLACEHOLDER string]
    F --> G[Silent runtime failure\non API calls]
    D --> H[Risk: real key committed\nto YAML in git]
    E --> I[✅ Correct behavior]
Loading

Reviews (1): Last reviewed commit: "Add missing env var placeholders to dev ..." | Re-trigger Greptile

Comment on lines +320 to +329
name: dev-omi-backend-secrets
key: METRICS_SECRET
- name: GROQ_API_KEY
value: "PLACEHOLDER_GROQ_API_KEY"
- name: OPENROUTER_API_KEY
value: "PLACEHOLDER_OPENROUTER_API_KEY"
- name: RAPID_API_HOST
value: "PLACEHOLDER_RAPID_API_HOST"
- name: RAPID_API_KEY
value: "PLACEHOLDER_RAPID_API_KEY"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 security Plain value: breaks the stated test plan and risks secret leakage

All five vars use plain value: instead of valueFrom: secretKeyRef:. This breaks the stated test plan — "replace placeholder values with real secrets in dev-omi-backend-secrets" — because the chart never references that K8s secret for these vars; populating it has no effect. Pods will start with the literal placeholder strings, silently failing at runtime on every downstream API call. It also creates a structural incentive to embed real keys directly in this YAML file, risking credential exposure in git.

Every other secret in this file and all five of these vars in the prod chart use valueFrom: secretKeyRef: name: dev-omi-backend-secrets. Use that same pattern here so that (a) the K8s secret is actually wired in, (b) missing keys cause a clear pod startup failure rather than silent runtime errors, and (c) no credentials ever appear in the chart YAML.

- Add 5 missing keys to ExternalSecret values (backend-secrets chart)
  so they sync from GCP Secret Manager to K8s secret
- Update backend-listen chart to use secretKeyRef instead of plain values
- Created GROQ_API_KEY and CONVERSATION_SUMMARIZED_APP_IDS in GCP SM
  with PLACEHOLDER_ values; OPENROUTER_API_KEY, RAPID_API_HOST,
  RAPID_API_KEY already existed with real values

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@beastoin
beastoin merged commit ebed328 into main Apr 26, 2026
2 checks passed
@beastoin
beastoin deleted the mon/dev-backend-listen-add-missing-secret-refs branch April 26, 2026 09:46
Glucksberg pushed a commit to Glucksberg/omi-local that referenced this pull request Apr 28, 2026
…rdware#7029)

## Summary
- Add 5 env vars present in prod but missing from dev backend-listen
- Variables: `GROQ_API_KEY`, `OPENROUTER_API_KEY`, `RAPID_API_HOST`,
`RAPID_API_KEY`, `CONVERSATION_SUMMARIZED_APP_IDS`
- Add secret key mappings to ExternalSecret values (backend-secrets
chart) for GCP SM → K8s sync
- Use `secretKeyRef` pattern in backend-listen chart (consistent with
existing secret refs)

## GCP Secret Manager status (based-hardware-dev)
| Secret | Status |
|--------|--------|
| GROQ_API_KEY | Created with `PLACEHOLDER_GROQ_API_KEY` value |
| OPENROUTER_API_KEY | Already existed (real value, 73 chars) |
| RAPID_API_HOST | Already existed (real value, 28 chars) |
| RAPID_API_KEY | Already existed (real value, 50 chars) |
| CONVERSATION_SUMMARIZED_APP_IDS | Created with
`PLACEHOLDER_CONVERSATION_SUMMARIZED_APP_IDS` value |

## Context
Beta users are routed to dev backends (PR BasedHardware#7014). Env var audit found
these 5 vars exist in prod backend-listen but are absent in dev GKE
deployment.

## Test plan
- [ ] Deploy backend-secrets chart first (syncs new keys to K8s secret)
- [ ] Deploy backend-listen chart (pods pick up new env vars)
- [ ] Verify pods start without CrashLoopBackOff
- [ ] Replace 2 placeholder values (GROQ_API_KEY,
CONVERSATION_SUMMARIZED_APP_IDS) with real values when available

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.

1 participant