Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

feat: add `cyclonedx.model.dependency.Dependency.provides`

オープン
#691 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@uzairchhapra がすでに取り組んでいます。

2024年11月5日 から。

  • #735 @uzairchhapra による — オープン
  • #1036 @saquibsaifee による — オープン

評価

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

調査の方向性

cyclonedx.model.dependency.Dependency とエントリーポイント Bom.from_json(data=data) から開始し、依存関係フィールドがどのようにデシリアライズされるかを調べます。CycloneDX 1.6 の例に示されている provides フィールドのサポートを追加し、続いて再現スクリプトを実行して、Bom.from_json が報告された ValueError を発生させなくなったことを確認します。

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

説明

enhancement help wanted schema 1.6

Library Version: 7.6.1

Description:

Steps to Reproduce:

  1. Use the example JSON provided in the CycloneDX bom-examples repository.
  2. Run the following script:
import json
from cyclonedx.model.bom import Bom


# source: https://github.com/CycloneDX/bom-examples/blob/c0436d86cd60693f01d19fe1aacfd01e70e17036/CBOM/Example-With-Dependencies/bom.json

sample = '''{
  "bomFormat": "CycloneDX",
  "specVersion": "1.6",
  "serialNumber": "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79",
  "version": 1,
  "metadata": {
    "component": {
      "type": "application",
      "bom-ref": "acme-application",
      "name": "Acme Application",
      "version": "1.0"
    }
  },
  "components": [
    {
      "type": "cryptographic-asset",
      "bom-ref": "aes128gcm",
      "name": "AES",
      "cryptoProperties": {
        "assetType": "algorithm",
        "algorithmProperties": {
          "primitive": "ae",
          "parameterSetIdentifier": "128",
          "executionEnvironment": "software-plain-ram",
          "implementationPlatform": "x86_64",
          "certificationLevel": [ "none" ],
          "mode": "gcm",
          "cryptoFunctions": ["keygen", "encrypt", "decrypt", "tag"],
          "classicalSecurityLevel": 128,
          "nistQuantumSecurityLevel": 1
        },
        "oid": "2.16.840.1.101.3.4.1.6"
      }
    },
    {
      "type": "library",
      "bom-ref": "crypto-library",
      "name": "Crypto library",
      "version": "1.0.0"
    },
    {
      "type": "library",
      "bom-ref": "some-library",
      "name": "Some library",
      "version": "1.0.0"
    }
  ],
  "dependencies": [
    {
      "ref": "acme-application",
      "dependsOn": ["crypto-library"]
    },
    {
      "ref": "crypto-library",
      "provides": ["aes128gcm"],
      "dependsOn": ["some-library"]
    }
  ]
}'''


data = json.loads(sample)

Bom.from_json(data=data)

Observed Behavior:
The code fails with the following exception:

Traceback (most recent call last):
  ...
ValueError: Unexpected key provides/provides in data being serialized to cyclonedx.model.dependency.Dependency

Environment:

  • Python version: 3.10
  • Operating System: macOS
  • Library version: 7.6.1

Let me know if this works!

主要言語
Python
スター
117
フォーク
67
平均マージ
21時間 9分
マージ済み PR(30日)
3

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

CycloneDX/cyclonedx-python-lib のほかの issue

CycloneDX/cyclonedx-python-lib の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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