This repository has been archived by the owner on Sep 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #180 from admin-ch/release/4.8.0
- Loading branch information
Showing
17 changed files
with
133 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,7 @@ | |
"BBIBP-CorV_T", | ||
"CoronaVac_T", | ||
"Covaxin_T", | ||
"EU/1/21/1624", | ||
"VLA2001", | ||
"Convidecia" | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,8 @@ | |
"BBIBP-CorV_T", | ||
"CoronaVac_T", | ||
"Covaxin_T", | ||
"VLA2001" | ||
"VLA2001", | ||
"EU/1/21/1624" | ||
] | ||
] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,8 @@ | |
"BBIBP-CorV_T", | ||
"CoronaVac_T", | ||
"Covaxin_T", | ||
"VLA2001" | ||
"VLA2001", | ||
"EU/1/21/1624" | ||
] | ||
] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -205,7 +205,8 @@ | |
"BBIBP-CorV_T", | ||
"CoronaVac_T", | ||
"Covaxin_T", | ||
"VLA2001" | ||
"VLA2001", | ||
"EU/1/21/1624" | ||
] | ||
] | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ | |
"BBIBP-CorV_T", | ||
"CoronaVac_T", | ||
"Covaxin_T", | ||
"EU/1/21/1624", | ||
"VLA2001", | ||
"Convidecia" | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,8 @@ | |
"BBIBP-CorV_T", | ||
"CoronaVac_T", | ||
"Covaxin_T", | ||
"VLA2001" | ||
"VLA2001", | ||
"EU/1/21/1624" | ||
] | ||
] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,8 @@ | |
"BBIBP-CorV_T", | ||
"CoronaVac_T", | ||
"Covaxin_T", | ||
"VLA2001" | ||
"VLA2001", | ||
"EU/1/21/1624" | ||
] | ||
] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...d-verifier/ch-covidcertificate-backend-verifier-ws/src/main/resources/dump_revocations.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import requests | ||
import json | ||
import io | ||
import time | ||
|
||
isFinished = False | ||
since = "0" | ||
certs = [] | ||
validDuration = 0 | ||
|
||
while isFinished == False: | ||
try: | ||
response = requests.get( | ||
url="https://www.cc.bit.admin.ch/trust/v2/revocationList", | ||
params= {"since": since} if since != "0" else {} , | ||
headers={ | ||
"Accept": "application/json", | ||
"Authorization": "Bearer 0795dc8b-d8d0-4313-abf2-510b12d50939", | ||
}, | ||
) | ||
jsonResponse = response.json() | ||
certs.extend(jsonResponse["revokedCerts"]) | ||
validDuration = jsonResponse["validDuration"] | ||
since = response.headers["X-Next-Since"] | ||
isFinished = response.headers["Up-To-Date"] == "true" | ||
except requests.exceptions.RequestException: | ||
print('HTTP Request failed') | ||
|
||
with open('revocations.csv', 'w') as file: | ||
file.write('\n'.join(certs)) | ||
|
||
|
||
data = { | ||
"validDuration": validDuration, | ||
"lastDownload": round(time.time() * 1000), | ||
"nextSince": since | ||
} | ||
|
||
with open('revocation_metadata.json', 'w') as f: | ||
json.dump(data, f) |
1 change: 1 addition & 0 deletions
1
...ifier/ch-covidcertificate-backend-verifier-ws/src/main/resources/revocation_metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"validDuration": 172800000, "lastDownload": 1665473995987, "nextSince": "11843609"} |
Binary file added
BIN
+20.6 MB
...nd-verifier/ch-covidcertificate-backend-verifier-ws/src/main/resources/revocations.sqlite
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
set -xeu | ||
cd "$(dirname "$0")" || exit | ||
python3 ch-covidcertificate-backend-verifier/ch-covidcertificate-backend-verifier-ws/src/main/resources/dump_revocations.py | ||
sqlite3 revocations.sqlite "CREATE TABLE revocations ( uvci text NOT NULL );" ".mode csv" ".import revocations.csv revocations" | ||
sqlite3 revocations.sqlite "CREATE TABLE \"metadata\" (\"validDuration\" integer NOT NULL DEFAULT '0',\"lastDownload\" integer NOT NULL DEFAULT '0',\"nextSince\" text);" | ||
sqlite3 revocations.sqlite "INSERT INTO \"metadata\" (validDuration, lastDownload, nextSince) VALUES ($(cat revocation_metadata.json | jq .validDuration), $(cat revocation_metadata.json | jq .lastDownload), $(cat revocation_metadata.json | jq .nextSince));" | ||
rm revocations.csv | ||
mv revocations.sqlite ch-covidcertificate-backend-verifier/ch-covidcertificate-backend-verifier-ws/src/main/resources/ | ||
mv revocation_metadata.json ch-covidcertificate-backend-verifier/ch-covidcertificate-backend-verifier-ws/src/main/resources/ | ||
|
||
./ch-covidcertificate-backend-verifier/ch-covidcertificate-backend-verifier-valuesets/src/main/resources/test_rules.sh |