AI provider and MCP create adoption: use a secret nonce instead of the object UID

Geschlossen
#426 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
45/100
Issue-Typ
Refactoring
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
go, kubernetes
Bereich
backend, security

Rechercherichtung

Start by reading #423 and #253 to understand lost-create recovery and current adoption via coder-k8s:<object UID>. Locate the CoderAIProvider and CoderMCPServer create paths and the cleanup ConfigMap in the operator namespace. Implement nonce generation before create, store it only in cleanup record, restrict adoption to matching nonce; done when UID adoption is replaced and tests pass.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Follow-up from #423 (#422 item 1), maintainer decision "Option A" on that PR.

Gap. After a lost create answer, the CoderAIProvider and CoderMCPServer create paths adopt a Coder resource whose display name is the operator's temporary display name coder-k8s:<object UID>. The operator records that resource's ID, applies the spec to it, and later deletes it by that ID. The object UID is visible to anyone who can read the Kubernetes object. A Coder user who creates a resource with that exact display name inside the window can therefore get it adopted, overwritten, and later deleted. The window normally ends at the next successful read, about 5 s after the lost answer. It stays open while the object stalls with NameConflict or SlugConflict.

Why it was kept in #423. Adoption is the only recovery for a lost create answer (#253) and for a late commit after the marker was cleared. Removing it would make every lost create answer stall with a false conflict on the object's own resource.

Proposal (Option C). Replace the UID in the temporary display name with a random secret nonce. Generate it before the create, store it only in the cleanup record (ConfigMap in the operator namespace, which users cannot read), and adopt only a resource whose display name carries that nonce. Migration: records without a nonce keep today's behavior until their object is next created.

Refs #422, #423, #253


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

Vorherrschende Sprache
Go
Sterne
5
Forks
3
Ø Merge
2 Std. 49 Min.
Gemergte PRs (30 T.)
206

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus coder/coder-k8s

Alle Issues in coder/coder-k8s

Ähnliche Issues

Weitere Issues zu Go

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.