The preview token answer does not say how long the token lasts, so an admin on another origin cannot reuse one
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 55/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- csharp, openapi
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- C#
- スター
- 567
- フォーク
- 107
- 平均マージ
- 1時間 19分
- マージ済み PR(30日)
- 353
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
fluentcms/FluentCMS のほかの issue
-
area:localization plugin type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
area:storage type:bug
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
-
area:testing type:bug
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
area:storage plugin type:bug
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
area:admin type:bug
難易度 4/5 3〜5日 初心者へのやさしさ 47/100
メンテナーはふだん 1 日以内に返信
fluentcms/FluentCMS の issue をすべて見る
似ている issue
-
fix(ocr): compile the Tesseract-free pipeline with Tokio runtime対応中かも @Goldziher が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
priority:P2
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
lompotc silently drops Java/C# class members past 128 instead of erroring, as its header claimsオープンbug sev-5 vm
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
-
area:jobads-cv bug FE mvp P3
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
klasolsson81/jobbliggaren#2271 ·
メンテナーはふだん 1 日以内に返信