nebari-dev / nebari-dev/llm-serving-pack

Extract OIDC JWT provider name as a constant in auth.go

Open Beginner friendly
#49 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: developer experience 👩🏻‍💻 good first issue needs: follow-up 📥 priority: medium ⚡ type: maintenance 🛠
Dominant language
Go
Stars
3
Forks
3
Avg merge
16h 31m
Merged PRs (30d)
11

Description

Follow-up from #47.

operator/internal/controller/reconcilers/auth.go uses the string "oidc" as the JWT provider name in two places:

  • buildInternalSecurityPolicy: provider["name"] = "oidc" (line ~155).
  • buildGroupAuthorization: principal.jwt.provider = "oidc" (line ~234).

Envoy Gateway matches the authorization rule to the provider by this name. If a future change renames the provider in one spot without updating the other, the gateway will silently default-deny every request on the internal endpoint. Nothing in our unit tests or in EG's admission validation catches the mismatch.

Suggested fix
const internalJWTProviderName = "oidc"

at the top of auth.go, reference it from both call sites. Optionally add a table case asserting jwt.providers[0].name == principal.jwt.provider so the invariant is guarded by the test suite.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in operator/internal/controller/reconcilers/auth.go, reading buildInternalSecurityPolicy and buildGroupAuthorization. Replace both provider-name literals with the shared constant, then run the relevant auth reconciler unit tests and verify that the JWT provider name matches the group authorization principal; add the invariant case if the test structure supports it.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
authentication
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
82/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.