Home session expiry maps 401 by exact error-string match (Low)
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 56/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- rust
- Bereich
- backend-api-design, observability, security
Rechercherichtung
Start with home_projection_token_error in elastos/crates/elastos-server/src/api/gateway_home_runtime.rs, then read grant_bound_token_expiry in gateway_home_token.rs and RoomSessionAuthorization::validate in room_service.rs. Replace the exact message comparison with typed error handling, and log the underlying grant-store error before it is collapsed. Done when inactive or revoked grants map to 401 regardless of message wording and the underlying error is logged.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Severity: Low (fails closed; correctness and observability only)
Found in the security review of #536.
Current behavior
home_projection_token_error (elastos/crates/elastos-server/src/api/gateway_home_runtime.rs) decides 401 by exact string equality:
if err.to_string() == "home launch token auth session is not active" { 401 } else { 500 }
A future rewording of load_active_session_grant, an added .context(...), or any anyhow display change falls through to gateway_internal_error → 500. Access is still denied, but the client loses its "re-authenticate" signal and logs fill with misleading 500s.
Fix
- Use a typed error (an enum such as
HomeTokenError::SessionInactive, orerr.downcast_ref) instead of string equality. - Log the underlying error before the
map_err(|_| …)collapses ingrant_bound_token_expiry(gateway_home_token.rs) andRoomSessionAuthorization::validate(room_service.rs), so a lapsed grant is distinguishable from I/O or state corruption.
Done means
- A lapsed or revoked grant maps to 401 regardless of how the grant loader's message is worded.
- The underlying grant-store error is logged before it is collapsed to an auth failure.
- Vorherrschende Sprache
- Rust
- Sterne
- 6
- Forks
- 2
- Ø Merge
- 1 T. 3 Std.
- Gemergte PRs (30 T.)
- 42
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus elastos/elastos-runtime
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
elastos/elastos-runtime#563 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
elastos/elastos-runtime#508 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
elastos/elastos-runtime#436 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
elastos/elastos-runtime#427 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
elastos/elastos-runtime#405 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in elastos/elastos-runtime
Ähnliche Issues
-
Panic on live viewport resize when unstyled elements exist in display: none subtreeEvtl. vergeben @GoCoder7 hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
DioxusLabs/blitz#1488 ·
Maintainer antworten meist innerhalb von 1 Tag
-
🏷️ good first issue enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
Maintainer antworten meist innerhalb von 1 Tag
-
S-Needs triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
vectordotdev/vrl#2042 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
Maintainer antworten meist innerhalb von 1 Tag