Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Commit

Permalink
New test certs, updated dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
merlinschumacher committed Nov 8, 2021
1 parent 532f21a commit 7c81e7e
Show file tree
Hide file tree
Showing 10 changed files with 2,344 additions and 5,639 deletions.
2 changes: 1 addition & 1 deletion cert_loaders/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ def _build_certlist(self):
# A DSC(Document Signing Certificate) issued by a CSCA
# (Certificate Signing Certificate Authority) quoted from:
# https://github.com/eu-digital-green-certificates/dgc-testdata/blob/main/AT/2DCode/raw/1.json
dsc = "-----BEGIN CERTIFICATE-----\nMIIBvTCCAWOgAwIBAgIKAXk8i88OleLsuTAKBggqhkjOPQQDAjA2MRYwFAYDVQQDDA1BVCBER0MgQ1NDQSAxMQswCQYDVQQGEwJBVDEPMA0GA1UECgwGQk1TR1BLMB4XDTIxMDUwNTEyNDEwNloXDTIzMDUwNTEyNDEwNlowPTERMA8GA1UEAwwIQVQgRFNDIDExCzAJBgNVBAYTAkFUMQ8wDQYDVQQKDAZCTVNHUEsxCjAIBgNVBAUTATEwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAASt1Vz1rRuW1HqObUE9MDe7RzIk1gq4XW5GTyHuHTj5cFEn2Rge37+hINfCZZcozpwQKdyaporPUP1TE7UWl0F3o1IwUDAOBgNVHQ8BAf8EBAMCB4AwHQYDVR0OBBYEFO49y1ISb6cvXshLcp8UUp9VoGLQMB8GA1UdIwQYMBaAFP7JKEOflGEvef2iMdtopsetwGGeMAoGCCqGSM49BAMCA0gAMEUCIQDG2opotWG8tJXN84ZZqT6wUBz9KF8D+z9NukYvnUEQ3QIgdBLFSTSiDt0UJaDF6St2bkUQuVHW6fQbONd731/M4nc=\n-----END CERTIFICATE-----"
dsc = "-----BEGIN CERTIFICATE-----\nMIIGXjCCBBagAwIBAgIQXg7NBunD5eaLpO3Fg9REnzA9BgkqhkiG9w0BA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cert_dsc(dsc))
2 changes: 1 addition & 1 deletion occv.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

app = FastAPI(title="Open Covid Certificate Validator",
description=api_description,
version="0.0.1",
version="0.0.2",
)

if DEV_MODE:
Expand Down
49 changes: 25 additions & 24 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
aiofiles==0.7.0
asn1crypto==1.4.0
anyio==3.3.4
asgiref==3.4.1
asn1crypto==1.4.0
attrs==21.2.0
base45==0.4.2
caio==0.9.3
cbor2==5.4.1
certifi==2021.5.30
charset-normalizer==2.0.4
click==8.0.1
coverage==5.5
cryptography==3.4.7
cwt==1.3.2
fastapi==0.68.0
base45==0.4.3
cbor2==5.4.2
certifi==2021.10.8
certvalidator==0.11.1
cffi==1.15.0
charset-normalizer==2.0.7
click==8.0.3
coverage==6.1.1
cryptography==35.0.0
cwt==1.4.2
fastapi==0.70.0
h11==0.12.0
idna==3.2
idna==3.3
iniconfig==1.1.1
packaging==21.0
pluggy==0.13.1
py==1.10.0
pycparser==2.20
oscrypto==1.2.1
packaging==21.2
pluggy==1.0.0
py==1.11.0
pycparser==2.21
pydantic==1.8.2
pyparsing==2.4.7
pytest==6.2.4
python-multipart==0.0.5
pytest==6.2.5
requests==2.26.0
six==1.16.0
starlette==0.14.2
sniffio==1.2.0
starlette==0.16.0
toml==0.10.2
typing-extensions==3.10.0.0
urllib3==1.26.6
uvicorn==0.14.0
typing-extensions==3.10.0.2
urllib3==1.26.7
uvicorn==0.15.0
67 changes: 34 additions & 33 deletions test_occy.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,41 @@

client = TestClient(app)

test_dcc = "HC1:NCFOXN%TS3DH3ZSUZK+.V0ETD%65NL-AH-R6IOOK.IR9B+9G4G50PHZF0AT4V22F/8X*G3M9JUPY0BX/KR96R/S09T./0LWTKD33236J3TA3M*4VV2 73-E3GG396B-43O058YIB73A*G3W19UEBY5:PI0EGSP4*2DN43U*0CEBQ/GXQFY73CIBC:G 7376BXBJBAJ UNFMJCRN0H3PQN*E33H3OA70M3FMJIJN523.K5QZ4A+2XEN QT QTHC31M3+E32R44$28A9H0D3ZCL4JMYAZ+S-A5$XKX6T2YC 35H/ITX8GL2-LH/CJTK96L6SR9MU9RFGJA6Q3QR$P2OIC0JVLA8J3ET3:H3A+2+33U SAAUOT3TPTO4UBZIC0JKQTL*QDKBO.AI9BVYTOCFOPS4IJCOT0$89NT2V457U8+9W2KQ-7LF9-DF07U$B97JJ1D7WKP/HLIJL8JF8JFHJP7NVDEBU1J*Z222E.GJ457661CFFTWM-8P2IUE7K*SSW613:9/:TT5IYQBTBU16R4I1A/9VRPJ-TS.7ZEM7MSVOCD4RG2L-TQJROXL2J:52J7F0Q10SMAP3CG3KHF0DWIH"
test_dcc = "HC1:6BF+70790T9WJWG.FKY*4GO0.O1CV2 O5 N2FBBRW1*70HS8WY04AC*WIFN0AHCD8KD97TK0F90KECTHGWJC0FDC:5AIA%G7X+AQB9746HS80:54IBQF60R6$A80X6S1BTYACG6M+9XG8KIAWNA91AY%67092L4WJCT3EHS8XJC$+DXJCCWENF6OF63W5NW6WF6%JC QE/IAYJC5LEW34U3ET7DXC9 QE-ED8%E.JCBECB1A-:8$96646AL60A60S6Q$D.UDRYA 96NF6L/5QW6307KQEPD09WEQDD+Q6TW6FA7C466KCN9E%961A6DL6FA7D46JPCT3E5JDLA7$Q6E464W5TG6..DX%DZJC6/DTZ9 QE5$CB$DA/D JC1/D3Z8WED1ECW.CCWE.Y92OAGY8MY9L+9MPCG/D5 C5IA5N9$PC5$CUZCY$5Y$527B+A4KZNQG5TKOWWD9FL%I8U$F7O2IBM85CWOC%LEZU4R/BXHDAHN 11$CA5MRI:AONFN7091K9FKIGIY%VWSSSU9%01FO2*FTPQ3C3F"

test_response = json.loads("""{
"valid": true,
"dccdata": {
"1": "AT",
"4": 1635876000,
"6": 1620324000,
"-260": {
"1": {
"v": [
{
"dn": 1,
"ma": "ORG-100030215",
"vp": "1119349007",
"dt": "2021-02-18",
"co": "AT",
"ci": "URN:UVCI:01:AT:10807843F94AEE0EE5093FBC254BD813#B",
"mp": "EU/1/20/1528",
"is": "Ministry of Health, Austria",
"sd": 2,
"tg": "840539006"
}
],
"nam": {
"fnt": "MUSTERFRAU<GOESSINGER",
"fn": "Musterfrau-Gößinger",
"gnt": "GABRIELE",
"gn": "Gabriele"
},
"ver": "1.0.0",
"dob": "1998-02-26"
}
}
}
"dccdata":{
"-260":{
"1":{
"dob":"1964-08-12",
"nam":{
"fn":"Mustermann",
"fnt":"MUSTERMANN",
"gn":"Erika",
"gnt":"ERIKA"
},
"v":[
{
"ci":"URN:UVCI:01DE/IZ12345A/5CWLU12RNOB9RXSEOP6FG8#W",
"co":"DE",
"dn":2,
"dt":"2021-05-29",
"is":"Robert Koch-Institut",
"ma":"ORG-100031184",
"mp":"EU/1/20/1507",
"sd":2,
"tg":"840539006",
"vp":"1119349007"
}
],
"ver":"1.0.0"
}
},
"1":"DE",
"4":1643356073,
"6":1622316073
},
"valid":true
}""")


Expand Down
11 changes: 5 additions & 6 deletions test_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ def test_dcc_validator_success(self):
dcc_validator = DCCValidator("XX")

# An EUDCC (EU Digital COVID Certificate) quoted from:
# https://github.com/eu-digital-green-certificates/dgc-testdata/blob/main/AT/2DCode/raw/1.json
test_dcc = "HC1:NCFOXN%TS3DH3ZSUZK+.V0ETD%65NL-AH-R6IOOK.IR9B+9G4G50PHZF0AT4V22F/8X*G3M9JUPY0BX/KR96R/S09T./0LWTKD33236J3TA3M*4VV2 73-E3GG396B-43O058YIB73A*G3W19UEBY5:PI0EGSP4*2DN43U*0CEBQ/GXQFY73CIBC:G 7376BXBJBAJ UNFMJCRN0H3PQN*E33H3OA70M3FMJIJN523.K5QZ4A+2XEN QT QTHC31M3+E32R44$28A9H0D3ZCL4JMYAZ+S-A5$XKX6T2YC 35H/ITX8GL2-LH/CJTK96L6SR9MU9RFGJA6Q3QR$P2OIC0JVLA8J3ET3:H3A+2+33U SAAUOT3TPTO4UBZIC0JKQTL*QDKBO.AI9BVYTOCFOPS4IJCOT0$89NT2V457U8+9W2KQ-7LF9-DF07U$B97JJ1D7WKP/HLIJL8JF8JFHJP7NVDEBU1J*Z222E.GJ457661CFFTWM-8P2IUE7K*SSW613:9/:TT5IYQBTBU16R4I1A/9VRPJ-TS.7ZEM7MSVOCD4RG2L-TQJROXL2J:52J7F0Q10SMAP3CG3KHF0DWIH"
test_dcc_content = "{4: 1635876000, 6: 1620324000, 1: 'AT', -260: {1: {'v': [{'dn': 1, 'ma': 'ORG-100030215', 'vp': '1119349007', 'dt': '2021-02-18', 'co': 'AT', 'ci': 'URN:UVCI:01:AT:10807843F94AEE0EE5093FBC254BD813#B', 'mp': 'EU/1/20/1528', 'is': 'Ministry of Health, Austria', 'sd': 2, 'tg': '840539006'}], 'nam': {'fnt': 'MUSTERFRAU<GOESSINGER', 'fn': 'Musterfrau-Gößinger', 'gnt': 'GABRIELE', 'gn': 'Gabriele'}, 'ver': '1.0.0', 'dob': '1998-02-26'}}}"
# https://github.com/eu-digital-green-certificates/dgc-testdata/blob/main/DE/2DCode/raw/1.json
test_dcc = "HC1:6BF+70790T9WJWG.FKY*4GO0.O1CV2 O5 N2FBBRW1*70HS8WY04AC*WIFN0AHCD8KD97TK0F90KECTHGWJC0FDC:5AIA%G7X+AQB9746HS80:54IBQF60R6$A80X6S1BTYACG6M+9XG8KIAWNA91AY%67092L4WJCT3EHS8XJC$+DXJCCWENF6OF63W5NW6WF6%JC QE/IAYJC5LEW34U3ET7DXC9 QE-ED8%E.JCBECB1A-:8$96646AL60A60S6Q$D.UDRYA 96NF6L/5QW6307KQEPD09WEQDD+Q6TW6FA7C466KCN9E%961A6DL6FA7D46JPCT3E5JDLA7$Q6E464W5TG6..DX%DZJC6/DTZ9 QE5$CB$DA/D JC1/D3Z8WED1ECW.CCWE.Y92OAGY8MY9L+9MPCG/D5 C5IA5N9$PC5$CUZCY$5Y$527B+A4KZNQG5TKOWWD9FL%I8U$F7O2IBM85CWOC%LEZU4R/BXHDAHN 11$CA5MRI:AONFN7091K9FKIGIY%VWSSSU9%01FO2*FTPQ3C3F"
test_dcc_content = "{1: 'DE', 6: 1622316073, 4: 1643356073, -260: {1: {'v': [{'ci': 'URN:UVCI:01DE/IZ12345A/5CWLU12RNOB9RXSEOP6FG8#W', 'co': 'DE', 'dn': 2, 'dt': '2021-05-29', 'is': 'Robert Koch-Institut', 'ma': 'ORG-100031184', 'mp': 'EU/1/20/1507', 'sd': 2, 'tg': '840539006', 'vp': '1119349007'}], 'dob': '1964-08-12', 'nam': {'fn': 'Mustermann', 'gn': 'Erika', 'fnt': 'MUSTERMANN', 'gnt': 'ERIKA'}, 'ver': '1.0.0'}}}"
valid, content = dcc_validator.validate(test_dcc)
self.assertIsInstance(content, dict)
self.assertTrue(valid)
Expand All @@ -27,7 +27,7 @@ def test_dcc_validator_invalid(self):
"""
dcc_validator = DCCValidator("XX")

# An EUDCC (EU Digital COVID Certificate) quoted from:
# An EUDCC (EU Digital COVID Certificate) quoted from, that is not valid for the test cert:
# https://github.com/eu-digital-green-certificates/dgc-testdata/blob/main/AT/2DCode/raw/1.json
test_dcc = "HC1:NCFOXN%TS3DH3ZSUZK+.V0ETD%65NL-AH-R6IOOK.IR9B+9G4G50PHZF0AT4V22F/8X*G3M9JUPY0BX/KR96R/S09T./0LWTKD33236J3TA3M*4VV2 73-E3GG396B-43O058YIB73A*G3W19UEBY5:PI0EGSP4*2DN43U*0CEBQ/GXQFY73CIBC:G 7376BXBJBAJ UNFMJCRN0H3PQN*E33H3OA70M3FMJIJN523.K5QZ4A+2XEN QT QTHC31M3+E32R44$28A9H0D3ZCL4JMYAZ+S-A5$XKX6T2YC 35H/ITX8GL2-LH/CJTK96L6SR9MU9RFGJA6Q3QR$P2OIC0JVLA8J3ET3:H3A+2+33U SAAUOT3TPTO4UBZIC0JKQTL*QDKBO.AI9BVYTOCFOPS4IJCOT0$89NT2V457U8+9W2KQ-7LF9-DF07U$B97JJ1D7WKP/HLIJL8JF8JFHJP7NVDEBU1J*Z222E.GJ457661CFFTWM-8P2IUE7K*SSW613:9/:TT5IYQBTBU16R4I1A/9VRPJ-TS.7ZEM7MSVOCD4RG2L-TQJROXL2J:52J7F0Q10SMAP3CGfKHF0DWIH"
valid, content = dcc_validator.validate(test_dcc)
Expand All @@ -40,8 +40,7 @@ def test_dcc_validator_failure(self):
"""
dcc_validator = DCCValidator("XX")

# An EUDCC (EU Digital COVID Certificate) quoted from:
# https://github.com/eu-digital-green-certificates/dgc-testdata/blob/main/AT/2DCode/raw/1.json
# An useless string that starts with the correct prefix but is not a valid dcc.
test_dcc = "HC1:FFFFFFFFFFFFFFFFFFFFFFF"
valid, content = dcc_validator.validate(test_dcc)
self.assertIsNone(content)
Expand Down
2 changes: 1 addition & 1 deletion web/dist/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/dist/bundle.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 7c81e7e

Please sign in to comment.