The preview token answer does not say how long the token lasts, so an admin on another origin cannot reuse one
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- csharp, openapi
- Área
- api, backend-api-design
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- C#
- Estrellas
- 567
- Forks
- 107
- Merge medio
- 1 h 19 min
- PR fusionados (30 d)
- 353
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de fluentcms/FluentCMS
-
area:localization plugin type:bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
area:storage type:bug
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 1 día
-
area:testing type:bug
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
area:storage plugin type:bug
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
area:admin type:bug
Dificultad 4/5 3-5 días Aptitud para principiantes 47/100
Los mantenedores suelen responder en 1 día
Todos los issues de fluentcms/FluentCMS
Issues similares
-
fix(ocr): compile the Tesseract-free pipeline with Tokio runtimePosiblemente ocupada @Goldziher la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
priority:P2
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
lompotc silently drops Java/C# class members past 128 instead of erroring, as its header claimsAbiertobug sev-5 vm
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
-
area:jobads-cv bug FE mvp P3
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
klasolsson81/jobbliggaren#2271 ·
Los mantenedores suelen responder en 1 día