CycloneDX / CycloneDX/cyclonedx-python-lib

Wrong input should result into an exception

オープン
#766 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
breaking change
主要言語
Python
スター
116
フォーク
67
平均マージ
8日 2時間
マージ済み PR(30日)
2

説明

The code in spdx.py function `is_compound_expression` may run into an exception for several cases, and this results into a `return False`.

This is semantically overloaded.
In case of `False` we cannot distinguish between
- the value cannot be interpreted at all (invalid characters)
- it is a compound expression, but consists of partially unknown, but maybe valid simple (e.g. LicenseRef-*) expression(s)

So it may not be clear what is feasible of how to proceed in case of False.

In case of invalid characters the exception should not be caught, but (re)raised so that an appropriate exception handling can be applied.

The `validate` parameter should be made available in the `is_compound_expression` function to allow either both license item validation along with the compound check or compound check only.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

spdx.py の is_compound_expression から始め、無効な文字と一部が不明なライセンス式に対する例外処理を追跡します。validate パラメーターが他の場所でどのように扱われているかを確認し、無効な入力では適切な例外が伝播するようにしつつ、ライセンス項目の検証あり・なしのどちらでも複合式をチェックできるようにします。呼び出し側が、無効な入力と、不明な項目を含む有効な複合式を区別できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
backend
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。