diff options
| author | J08nY | 2024-02-03 19:36:05 +0100 |
|---|---|---|
| committer | J08nY | 2024-02-03 19:36:05 +0100 |
| commit | 5e852ac4e42afaf7fb7a6f7b9493d276723fd7e7 (patch) | |
| tree | e24589fed6ea9e6937cb22d403caff413808eaf5 | |
| parent | 7d56381b408dd6ab1ed7d7ebaa84d192419eb140 (diff) | |
| download | sec-certs-5e852ac4e42afaf7fb7a6f7b9493d276723fd7e7.tar.gz sec-certs-5e852ac4e42afaf7fb7a6f7b9493d276723fd7e7.tar.zst sec-certs-5e852ac4e42afaf7fb7a6f7b9493d276723fd7e7.zip | |
Improve Italian rules.
| -rw-r--r-- | src/sec_certs/rules.yaml | 8 | ||||
| -rw-r--r-- | src/sec_certs/sample/cc_certificate_id.py | 9 | ||||
| -rw-r--r-- | tests/cc/test_cc_misc.py | 4 |
3 files changed, 7 insertions, 14 deletions
diff --git a/src/sec_certs/rules.yaml b/src/sec_certs/rules.yaml index b2b4a979..c0acd3d4 100644 --- a/src/sec_certs/rules.yaml +++ b/src/sec_certs/rules.yaml @@ -77,8 +77,12 @@ cc_cert_id: # ISCB-5-RPT-C075-CR-v2 # ISCB-5-RPT-C046-CR-V1a IT: - - "OCSI/CERT/.+?" # Italy - - "OCSI/CERT/.+?/20[0-9]+(?:\\w|/RC)" # Italy (OCSI/CERT/ATS/01/2018/RC) + - "OCSI/CERT/(?:(?P<lab>[A-Z]{3})/)?(?P<counter>[0-9]{2,3})/(?P<year>[0-9]{4})/RC" + # Examples: + # OCSI/CERT/SYS/04/2018/RC + # OCSI/CERT/CCL/10/2022/RC + # OCSI/CERT/TEC/09/2017/RC + # OCSI/CERT/ATS/06/2020/RC TR: - "[0-9\\.]+?/TSE-CCCS-[0-9]+" # Turkish CCCS (21.0.0sc/TSE-CCCS-75) - "(?:[0-9]{1,2}\\.){2}[0-9]{1,2}/[0-9]{1,4}-[0-9]{3}" # 21.0.01/13-028 diff --git a/src/sec_certs/sample/cc_certificate_id.py b/src/sec_certs/sample/cc_certificate_id.py index 7e0b7f4a..88e1f4a7 100644 --- a/src/sec_certs/sample/cc_certificate_id.py +++ b/src/sec_certs/sample/cc_certificate_id.py @@ -116,13 +116,6 @@ class CertificateId: break return new_cert_id - def _canonical_it(self): - new_cert_id = self.clean - if not new_cert_id.endswith("/RC"): - new_cert_id = new_cert_id + "/RC" - - return new_cert_id - def _canonical_in(self): return self.clean.replace(" ", "") @@ -217,7 +210,6 @@ class CertificateId: "US": self._canonical_us, "MY": self._canonical_my, "ES": self._canonical_es, - "IT": self._canonical_it, "IN": self._canonical_in, "SE": self._canonical_se, "UK": self._canonical_uk, @@ -227,6 +219,7 @@ class CertificateId: "NL": self._canonical_nl, "AU": self._canonical_au, # SG is canonical by default + # IT is canonucal by default } if self.scheme in schemes: diff --git a/tests/cc/test_cc_misc.py b/tests/cc/test_cc_misc.py index e1d516b3..2c93c546 100644 --- a/tests/cc/test_cc_misc.py +++ b/tests/cc/test_cc_misc.py @@ -30,10 +30,6 @@ def test_canonicalize_es(): assert canonicalize("2011-14-INF-1095-v1", "ES") == "2011-14-INF-1095" -def test_canonicalize_it(): - assert canonicalize("OCSI/CERT/SYS/10/2016", "IT") == "OCSI/CERT/SYS/10/2016/RC" - - def test_canonicalize_in(): assert canonicalize("IC3S/KOL01/ADVA/EAL2/0520/0021 /CR", "IN") == "IC3S/KOL01/ADVA/EAL2/0520/0021/CR" |
