The preview token answer does not say how long the token lasts, so an admin on another origin cannot reuse one
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
- 55/100
- Issue-Typ
- Feature
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- csharp, openapi
- Bereich
- api, backend-api-design
Rechercherichtung
Start with the preview-token endpoint and response model, then read PreviewTokenOptions and the OpenAPI document and client definitions. Check how the endpoint computes expiresAt and how configured or requested lifetimes are applied. Done when the response includes the issued lifetime in seconds and the OpenAPI document and both clients include the member.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Problem
The answer of a preview token mint gives expiresAt, a moment on the server's clock, and the server checks it with no skew. The admin runs in the browser, whose clock may differ by minutes, so it cannot tell from expiresAt alone how long the token it holds still lasts. It reads the response's Date header to measure the server's clock (#3437), but:
- an admin on another origin never sees
Date: CORS does not safelist it, and the Management API's policy exposes onlyETag,Location,Retry-Afterand the rate limit headers (src/FluentCMS.Core/Api/Common/CorsPolicies.cs, lines 17 and 36); - a reverse proxy may write its own
Date(nginx does by default); - the lifetime is the operator's (
PreviewTokenOptions.DefaultLifetime, from 1 minute up toMaximumLifetime), so the admin cannot assume ten minutes.
Without either, the admin mints a new token on every save and every Reload, and a token cannot be revoked.
Proposal
Add to the answer of POST .../preview-token the token's lifetime in whole seconds as issued (for instance expiresIn), beside expiresAt. The admin then takes the deadline as its own clock at the request plus that lifetime, whatever the skew and whatever proxy is in front. It adds to an answer and changes no model. The OpenAPI document and the clients take the member.
Acceptance
- The mint answer carries the token's lifetime in seconds, equal to
expiresAtminus the moment of issue - A configured
DefaultLifetimeand a requested lifetime are both reflected - The OpenAPI document and the two clients have the member
For workstation B (#3356). Asked for by #3437 (#3403): until it is merged, an admin that sees no Date header mints on every save and every Reload, as before #3437.
- Vorherrschende Sprache
- C#
- Sterne
- 567
- Forks
- 107
- Ø Merge
- 1 Std. 19 Min.
- Gemergte PRs (30 T.)
- 353
Entwicklungsumgebung
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
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 fluentcms/FluentCMS
-
area:localization plugin type:bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
area:storage type:bug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
Maintainer antworten meist innerhalb von 1 Tag
-
area:testing type:bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
area:storage plugin type:bug
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
Maintainer antworten meist innerhalb von 1 Tag
-
area:admin type:bug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 47/100
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in fluentcms/FluentCMS
Ähnliche Issues
-
worldInstancedOccluderNode reads its appendix count as one byte, but it is a VLQEvtl. vergeben @spuddeh hat das heute übernommen. Offen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
fix(ocr): compile the Tesseract-free pipeline with Tokio runtimeEvtl. vergeben @Goldziher hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
priority:P2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
-
lompotc silently drops Java/C# class members past 128 instead of erroring, as its header claimsOffenbug sev-5 vm
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100