diff options
| author | adamjanovsky | 2025-02-13 13:28:31 +0100 |
|---|---|---|
| committer | GitHub | 2025-02-13 13:28:31 +0100 |
| commit | 443d38c9cf6d6e76c6667484a185839dd821fd11 (patch) | |
| tree | 508ac726d9408dc4917c1ced920f53447e9b64ac | |
| parent | bdbd974847b713d14ccd90b617bae4e41447c09e (diff) | |
| parent | ba6da69bffd99a49a830de988af300108f3f8d80 (diff) | |
| download | sec-certs-0.3.1.tar.gz sec-certs-0.3.1.tar.zst sec-certs-0.3.1.zip | |
Merge pull request #473 from crocs-muni/pre-release-fixes0.3.1
Pre-release fixes
| -rw-r--r-- | notebooks/examples/protection_profiles.ipynb | 4 | ||||
| -rw-r--r-- | src/sec_certs/dataset/auxiliary_dataset_handling.py | 2 | ||||
| -rw-r--r-- | src/sec_certs/dataset/cc.py | 2 | ||||
| -rw-r--r-- | src/sec_certs/dataset/dataset.py | 2 | ||||
| -rw-r--r-- | src/sec_certs/dataset/protection_profile.py | 4 | ||||
| -rw-r--r-- | tests/cc/conftest.py | 2 | ||||
| -rw-r--r-- | tests/cc/test_cc_analysis.py | 4 | ||||
| -rw-r--r-- | tests/cc/test_cc_protection_profiles.py | 4 | ||||
| -rw-r--r-- | tests/data/protection_profiles/dataset.json (renamed from tests/data/protection_profiles/pp.json) | 0 |
9 files changed, 12 insertions, 12 deletions
diff --git a/notebooks/examples/protection_profiles.ipynb b/notebooks/examples/protection_profiles.ipynb index f1de21a8..a6d51118 100644 --- a/notebooks/examples/protection_profiles.ipynb +++ b/notebooks/examples/protection_profiles.ipynb @@ -8,9 +8,9 @@ "\n", "This notebook illustrated basic functionality of the `ProtectionProfileDataset` class that holds protection profiles bound to Common Criteria certified products. The object that holds a single profile is called `ProtectionProfile`. \n", "\n", - "Note that there exists a front end to this functionality at [sec-certs.org/cc](https://sec-certs.org/cc/). Before reinventing the wheel, it's good idea to check our web. Maybe you don't even need to run the code, but just use our web instead. \n", + "Note that there exists a front end to this functionality at [sec-certs.org/pp](https://sec-certs.org/pp/). Before reinventing the wheel, it's good idea to check our web. Maybe you don't even need to run the code, but just use our web instead. \n", "\n", - "For full API documentation of the `CCDataset` class go to the [dataset](../../api/dataset) docs." + "For full API documentation of the `ProtectionProfileDataset` class go to the [dataset](../../api/dataset) docs." ] }, { diff --git a/src/sec_certs/dataset/auxiliary_dataset_handling.py b/src/sec_certs/dataset/auxiliary_dataset_handling.py index 11608a2e..69d5e837 100644 --- a/src/sec_certs/dataset/auxiliary_dataset_handling.py +++ b/src/sec_certs/dataset/auxiliary_dataset_handling.py @@ -258,7 +258,7 @@ class ProtectionProfileDatasetHandler(AuxiliaryDatasetHandler): @property def dset_path(self) -> Path: - return self.root_dir / "pp.json" + return self.root_dir / "dataset.json" def load_dataset(self) -> None: from sec_certs.dataset.protection_profile import ProtectionProfileDataset diff --git a/src/sec_certs/dataset/cc.py b/src/sec_certs/dataset/cc.py index 05e29a27..fb90c142 100644 --- a/src/sec_certs/dataset/cc.py +++ b/src/sec_certs/dataset/cc.py @@ -63,7 +63,7 @@ class CCDataset(Dataset[CCCertificate], ComplexSerializableType): │ │ ├── pps │ │ │ ├── pdf │ │ │ └── txt - │ │ └── pp.json + │ │ └── dataset.json │ └── maintenances │ ├── certs │ │ ├── reports diff --git a/src/sec_certs/dataset/dataset.py b/src/sec_certs/dataset/dataset.py index 7a9c92ed..be070580 100644 --- a/src/sec_certs/dataset/dataset.py +++ b/src/sec_certs/dataset/dataset.py @@ -169,7 +169,7 @@ class Dataset(Generic[CertSubType], ComplexSerializableType, ABC): if not snapshot_url: snapshot_url = cls.SNAPSHOT_URL if not progress_bar_desc: - progress_bar_desc = f"Downloading: {type(cls).__name__}" + progress_bar_desc = f"Downloading: {cls.__name__}" if (artifacts or auxiliary_datasets) and path is None: raise ValueError("Path needs to be defined if artifacts or auxiliary datasets are to be downloaded.") diff --git a/src/sec_certs/dataset/protection_profile.py b/src/sec_certs/dataset/protection_profile.py index 2295191a..9b22ca75 100644 --- a/src/sec_certs/dataset/protection_profile.py +++ b/src/sec_certs/dataset/protection_profile.py @@ -31,7 +31,7 @@ class ProtectionProfileDataset(Dataset[ProtectionProfile], ComplexSerializableTy ├── pps │ ├── pdf │ └── txt - └── pp.json + └── dataset.json """ FULL_ARCHIVE_URL: ClassVar[AnyHttpUrl] = config.pp_latest_full_archive @@ -57,7 +57,7 @@ class ProtectionProfileDataset(Dataset[ProtectionProfile], ComplexSerializableTy @property def json_path(self) -> Path: - return self.root_dir / "pp.json" + return self.root_dir / "dataset.json" @property def reports_dir(self) -> Path: diff --git a/tests/cc/conftest.py b/tests/cc/conftest.py index 91f8caab..8651b92e 100644 --- a/tests/cc/conftest.py +++ b/tests/cc/conftest.py @@ -39,7 +39,7 @@ def toy_dataset() -> CCDataset: @pytest.fixture def toy_pp_dataset() -> ProtectionProfileDataset: - with resources.path(tests.data.protection_profiles, "pp.json") as path: + with resources.path(tests.data.protection_profiles, "dataset.json") as path: return ProtectionProfileDataset.from_json(path) diff --git a/tests/cc/test_cc_analysis.py b/tests/cc/test_cc_analysis.py index 6591ca18..a6b1b5e1 100644 --- a/tests/cc/test_cc_analysis.py +++ b/tests/cc/test_cc_analysis.py @@ -37,11 +37,11 @@ def processed_cc_dset( ) -> CCDataset: tmp_dir = tmp_path_factory.mktemp("cc_dset") shutil.copytree(analysis_data_dir, tmp_dir, dirs_exist_ok=True) - shutil.copy(pp_data_dir / "pp.json", tmp_dir / "pp.json") + shutil.copy(pp_data_dir / "dataset.json", tmp_dir / "dataset.json") cc_dset = CCDataset.from_json(tmp_dir / "vulnerable_dataset.json") cc_dset.aux_handlers[ProtectionProfileDatasetHandler].root_dir.mkdir(parents=True, exist_ok=True) - shutil.copy(tmp_dir / "pp.json", cc_dset.aux_handlers[ProtectionProfileDatasetHandler].dset_path) + shutil.copy(tmp_dir / "dataset.json", cc_dset.aux_handlers[ProtectionProfileDatasetHandler].dset_path) cc_dset.aux_handlers[ProtectionProfileDatasetHandler].process_dataset() cc_dset.aux_handlers[CPEMatchDictHandler].dset = {} diff --git a/tests/cc/test_cc_protection_profiles.py b/tests/cc/test_cc_protection_profiles.py index b8d2e821..29cee8b7 100644 --- a/tests/cc/test_cc_protection_profiles.py +++ b/tests/cc/test_cc_protection_profiles.py @@ -13,7 +13,7 @@ def test_dataset_from_json(toy_pp_dataset: ProtectionProfileDataset, pp_data_dir with (tmp_path / "dset.json").open("r") as handle: data = json.load(handle) - with (pp_data_dir / "pp.json").open("r") as handle: + with (pp_data_dir / "dataset.json").open("r") as handle: template_data = json.load(handle) del data["timestamp"] @@ -22,7 +22,7 @@ def test_dataset_from_json(toy_pp_dataset: ProtectionProfileDataset, pp_data_dir def test_dataset_to_json(toy_pp_dataset: ProtectionProfileDataset, pp_data_dir: Path, tmp_path: Path): - assert toy_pp_dataset == ProtectionProfileDataset.from_json(pp_data_dir / "pp.json") + assert toy_pp_dataset == ProtectionProfileDataset.from_json(pp_data_dir / "dataset.json") compressed_path = tmp_path / "dset.json.gz" toy_pp_dataset.to_json(compressed_path, compress=True) decompressed_dataset = ProtectionProfileDataset.from_json(compressed_path, is_compressed=True) diff --git a/tests/data/protection_profiles/pp.json b/tests/data/protection_profiles/dataset.json index 7b96cf8c..7b96cf8c 100644 --- a/tests/data/protection_profiles/pp.json +++ b/tests/data/protection_profiles/dataset.json |
