Google Cloud deployment returns a 500 error when the client secret file is not valid JSON
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
調査の方向性
まず web/pgadmin/misc/cloud/google/__init__.py の verify_credentials() を読み、そこで発生したエラーがどのように HTTP レスポンスになるかを追ってください。issue に記載された、無効な JSON、無効な UTF-8、不正な client secret、ファイルが存在しない場合を確認してください。各ケースで明確な通常の Bad Request が返され、ファイルが存在しない場合には既存の “Client secret path not found” エラーが使われれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
In the Google Cloud deployment wizard, selecting a client secret file that is not valid JSON makes the "Click here to authenticate yourself to Google" step fail with an internal server error (HTTP 500), instead of saying that the file is invalid.
verify_credentials() in web/pgadmin/misc/cloud/google/__init__.py calls json.load() on the file without handling errors. A file that isn't JSON, isn't UTF-8, or doesn't have the structure of a Google OAuth client secret raises an exception that is not caught. A request without client_secret_file fails the same way, because unquote(None) raises TypeError.
To Reproduce
- Start Deploy Cloud PostgreSQL and choose Google Cloud.
- Select any file that is not a Google client secret JSON file (e.g. a
.sqlor text file) as the client secret file. - Click the button to authenticate with Google.
- The request returns a 500 error.
Expected behavior
A clear error such as "The client secret file is not a valid Google OAuth client secret JSON file.", returned as a normal bad-request response.
Error message
HTTP 500 Internal Server Error. The server log shows an uncaught json.decoder.JSONDecodeError (or UnicodeDecodeError for a non-UTF-8 file).
Desktop (please complete the following information):
- OS: any
- pgAdmin version: 9.18 (also current master)
- Mode: Desktop and Server
- Package type: any
Additional context
Catching ValueError (which covers JSONDecodeError and UnicodeDecodeError), and checking that the expected keys are present, before creating the Google object would fix it. A missing client_secret_file should return the existing "Client secret path not found" error.
- 主要言語
- Python
- スター
- 3.9k
- フォーク
- 914
- 平均マージ
- 1日 15時間
- マージ済み PR(30日)
- 39
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pgadmin-org/pgadmin4 のほかの issue
-
Import/Export Data fails for a file name containing a backslash, and creates a stray file named EオープンBug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
pgadmin-org/pgadmin4#10672 ·
メンテナーはふだん 1 日以内に返信
-
Helm chart: allow setting ingressClassName on the Ingress対応中かも @commarla が 4 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
pgadmin-org/pgadmin4#10658 ·
メンテナーはふだん 1 日以内に返信
-
Feature
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
pgadmin-org/pgadmin4#10426 · コメント 3 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Feature
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
pgadmin-org/pgadmin4#10272 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
-
Housekeeping
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
pgadmin-org/pgadmin4#10157 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
pgadmin-org/pgadmin4 の issue をすべて見る
似ている issue
-
ci enhancement testing
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
area/config comp/tools P2 platform/telegram type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
NousResearch/hermes-agent#145412 ·
メンテナーはふだん 1 日以内に返信
-
[oblt-aw][autodoc] Update docs for security org scaffolding and Docs AI menu permission changes対応中かも @github-actions が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
curriculum documentation quality
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
githubnext/gh-aw-workshop#5039 ·
メンテナーはふだん 1 日以内に返信
-
Community project: hosted MOSS-Image studio with a visual JSON layout builder (no ComfyUI needed)オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 65/100
OpenMOSS/MOSS-Image#27 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信