Fastapi generated api do not get authentication parameters from Cookie
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 領域
- api, authentication, backend
調査の方向性
まず、生成された API 認証のエントリポイントと issue に示されている middleware を特定し、bearer token がどのように読み取られるかを調べます。その経路を、提供された仕様の securitySchemes cookieAuth および bearerAuth と比較します。cookie の認証情報が処理され、関連する仕様パラメータが尊重されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
The generated function supports the bearer token but not cookie.
@app.middleware("http")
async def add_process_time_header(request: Request, call_next):
# retrieve the bearer token from the header
# and save it for use in the AuthClient
authorization = request.headers.get('Authorization')
if authorization:
set_authentication_token(authorization)
return await call_next(request)
The cookie authentication is handy when the application is secured by a gatekeeper, as it comes for free on every request.
It's also ignoring the parameter coming from the spec, like in
securitySchemes:
bearerAuth:
scheme: bearer
bearerFormat: JWT
type: http
x-bearerInfoFunc: cloudharness.auth.decode_token
cookieAuth:
type: apiKey
name: kc-access
in: cookie
x-apikeyInfoFunc: cloudharness.auth.decode_token
This is not necessarily required as we don't have different decode token handlers, but can be confusins as the Connexion apis require those instead
- 主要言語
- Python
- スター
- 19
- フォーク
- 5
- 平均マージ
- 11日 20時間
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
MetaCell/cloud-harness のほかの issue
-
new feature
難易度 5/5 1週間以上 初心者へのやさしさ 28/100
MetaCell/cloud-harness#810 · コメント 1 件 ·
-
When using a custom image for on_exit_notify of a workflow queue and payload should not be mandatoryオープンgood first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
MetaCell/cloud-harness#801 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
MetaCell/cloud-harness#781 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 32/100
MetaCell/cloud-harness#709 ·
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
MetaCell/cloud-harness#706 · コメント 1 件 ·
MetaCell/cloud-harness の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
cathrynlavery/diagram-design#441 ·
メンテナーはふだん 2 日以内に返信
-
[Cleanup] Include the public header in work_split.cpp対応中かも @blozano-tt が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
tenstorrent/tt-metal#60850 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
backend::sglang bug language::python observability
難易度 2/5 半日 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
OpenShot/openshot-qt#6202 ·
メンテナーはふだん 1 日以内に返信