Cluster sign-out leaves an instance signed in once its instanceFqdn disappears

Aperta Adatta ai principianti
#2,021 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
77/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript

Direzione di ricerca

Inizia da src/lib/types/isInstance.ts e segui come src/features/auth/store/authStore.ts ricava le chiavi di autenticazione e come src/features/clusters/components/ClusterCard.tsx disconnette le istanze. Riproduci la sequenza descritta con un’istanza che perde il suo instanceFqdn; il lavoro è completato quando la disconnessione del cluster cancella il suo indicatore di accesso, l’utente e il flag Fabric Connect. Nell’issue non viene indicato alcun file di test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

Cluster Sign Out cannot clear an instance's sign-in once that instance comes back from central manager without an instanceFqdn. Its sign-in marker, user and Fabric Connect flag survive until the user signs out of the app.

Cause

authStore.setUserForEntity (src/features/auth/store/authStore.ts, ~line 359) returns early when calculateIdFromEntity or calculateKeyFromEntity yields nothing. Both decide "is this an instance?" with isInstance (src/lib/types/isInstance.ts), which is !!instance.instanceFqdn. So an instance object without an FQDN is neither an instance nor a cluster to the store, and the cluster sign-out loop (src/features/clusters/components/ClusterCard.tsx, ~line 116) skips it.

The path: sign in to an instance while it has an FQDN, then a later GET /Cluster/<id> lists it without one (the shape behind #2020), then sign out of the cluster.

Impact

Same user only, and app sign-out still clears everything. Not observed in production; found by code trace during review of the #2020 fix, which closed the other route to this state (Fabric Connect to an instance that never had an address).

Suggested fix

Key an instance's auth by instance.id rather than by whether it has an FQDN: make isInstance discriminate on something an address-less instance still has (for example the ins- id prefix getInstanceClient already uses), or have cluster sign-out call signOutLocally(instance.id) directly.

Review-Deferral: 293e0b262f5c7343 severity=minor category=security

🤖 Generated by Claude Code (Claude Opus 5.5); posted via @dawsontoth.

Lingua principale
TypeScript
Stelle
5
Fork
4
Merge medio
1g 20h
PR unite (30g)
140

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di HarperFast/studio

Tutte le issue di HarperFast/studio

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.