Failed REST uploads expose internal error details
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
issueで説明されているアップロードハンドラーと既存のUploadAPITestCaseフィクスチャから始めます。StorageError、OSError、ImproperlyConfiguredがHTTP 400レスポンスに変換される仕組みを追い、その後アップロードAPIのテストを実行します。失敗時に例外の詳細を公開せず固定メッセージを返し、根本のエラーがログで引き続き確認できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Plugin Version
v0.0.1
NetBox Version
v4.7.4
Python Version
3.12
Steps to Reproduce
- Create a Script Project with source type Upload.
- In a local API test, patch the configured
netbox_scriptsstorage backend'ssave()method to raise:PermissionError( 13, 'Permission denied', '/srv/netbox/private/deploy.py', ) - As a user with permission to change the Project and add Script Files, POST a Python source file as multipart form data to
/api/plugins/netbox-scripts/projects/<id>/upload/.
This was reproduced using the existing UploadAPITestCase fixture and a mocked backend failure.
Expected Behavior
The upload returns HTTP 400 with a fixed message, such as “The upload could not be stored.” The underlying exception and traceback are logged for troubleshooting.
Configuration failures should also return a fixed message without including internal exception details.
Observed Behavior
The response is HTTP 400, but its detail includes the storage exception's message, including the internal path:
[Errno 13] Permission denied: '/srv/netbox/private/deploy.py'
A failure from the backend's save() method also includes the generated storage key.
The upload handler formats caught StorageError and OSError exceptions into the response. Its adjacent ImproperlyConfigured handler returns the exception text directly, which can include internal details from a failed NetBox Branching routing check.
- 主要言語
- Python
- スター
- 8
- フォーク
- 0
- 平均マージ
- 11時間 35分
- マージ済み PR(30日)
- 20
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
netbox-community/netbox-scripts のほかの issue
-
app: scripts severity: medium status: backlog type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
netbox-community/netbox-scripts#83 ·
メンテナーはふだん 1 日以内に返信
-
app: scripts status: backlog type: documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
netbox-community/netbox-scripts#80 ·
メンテナーはふだん 1 日以内に返信
-
app: scripts severity: medium status: backlog type: bug
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
netbox-community/netbox-scripts#79 ·
メンテナーはふだん 1 日以内に返信
-
app: scripts severity: low status: backlog type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
netbox-community/netbox-scripts#76 ·
メンテナーはふだん 1 日以内に返信
-
app: scripts severity: low status: backlog type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
netbox-community/netbox-scripts#74 ·
メンテナーはふだん 1 日以内に返信
netbox-community/netbox-scripts の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 2 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
developmentseed/titiler-cmr#278 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 2 日以内に返信