From e5c0fedb4d85888ce0e0d36f314a632c54b64384 Mon Sep 17 00:00:00 2001 From: Martijn Kamphuis Date: Tue, 21 Jan 2025 11:29:05 +0100 Subject: [PATCH 1/2] Add deprecation notice for issuers --- docker-compose.yaml | 2 +- generate-index.py | 29 +++++++++++------------------ templates/issuer.html | 7 +++++++ 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 944a863..dddad80 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -6,7 +6,7 @@ services: context: . dockerfile: Dockerfile ports: - - "80:80" + - "8080:80" environment: - NODE_OPTIONS=--openssl-legacy-provider restart: unless-stopped diff --git a/generate-index.py b/generate-index.py index ed6d5a3..df652c9 100755 --- a/generate-index.py +++ b/generate-index.py @@ -94,12 +94,14 @@ def readCredential(path): def readIssuer(path): xml = minidom.parse(path + '/description.xml') + deprecated = xml.getElementsByTagName('DeprecatedSince') issuer = { 'id': getText(xml.getElementsByTagName('ID')[0]), 'schememgr': getText(xml.getElementsByTagName('SchemeManager')[0]), 'shortName': translated(xml.getElementsByTagName('ShortName')[0]), 'name': translated(xml.getElementsByTagName('Name')[0]), 'contactEmail': getText(xml.getElementsByTagName('ContactEMail')[0]), + 'deprecated': getTime(deprecated[0]) if len(deprecated) > 0 else None, 'logo': path + '/logo.png', 'credentials': {}, } @@ -116,7 +118,6 @@ def get_issuer_name(issuer_tuple): def readSchemeManager(path): schememgr = {} - xml = minidom.parse(path + '/description.xml') schememgr = { 'id': getText(xml.getElementsByTagName('Id')[0]), @@ -169,8 +170,6 @@ def generateHTML(index, out, lang): LANG=lang, identifier='glossary') - - organized_data = [] for schememgr in index: scheme_data = { @@ -218,8 +217,6 @@ def generateHTML(index, out, lang): LANG=lang, identifier=credential['identifier']) - - render(out + '/credential-navigator.html', 'credential-navigator.html', index=index, organized_data=organized_data, @@ -231,17 +228,13 @@ def generateHTML(index, out, lang): if os.path.exists(config_file): with open(config_file) as f: schememanagers = json.load(f) - try: - index = [] - for info in schememanagers: - index.append(readSchemeManager(info['PATH'])) - - with open('index.json', 'w') as json_file: - json.dump(index, json_file) - print("JSON file generated: index.json") - - generateHTML(index, 'en', 'en') - generateHTML(index, 'nl', 'nl') + index = [] + for info in schememanagers: + index.append(readSchemeManager(info['PATH'])) + + with open('index.json', 'w') as json_file: + json.dump(index, json_file) + print("JSON file generated: index.json") - except Exception as e: - print(f"An error occurred: {e}") \ No newline at end of file + generateHTML(index, 'en', 'en') + generateHTML(index, 'nl', 'nl') diff --git a/templates/issuer.html b/templates/issuer.html index 6752103..ee05c45 100644 --- a/templates/issuer.html +++ b/templates/issuer.html @@ -6,6 +6,13 @@

{{ issuer.name[LANG] }}

Issuer

+ + {% if issuer.deprecated %} +
This issuer is deprecated since {{ issuer.deprecated }}.
+ Users cannot obtain credentials from this issuer anymore, although they might still possess credentials issued before this date. + When using credentials from this issuer, please provide users with a non-deprecated alternative.
+ {% endif %} + {% if schememgr.test %}
This is a testing issuer. Its IRMA private key is public, so anyone can issue credentials with this issuer. Use it for testing and demo purposes only.
{% endif %} From 94e0bed1a328334968532852f687315b6b9b448b Mon Sep 17 00:00:00 2001 From: Martijn Kamphuis Date: Tue, 21 Jan 2025 11:35:11 +0100 Subject: [PATCH 2/2] Nginx alpine image --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3141a39..e01608b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,7 +26,7 @@ RUN pip install --no-cache-dir Jinja2 requests && \ python3 -u generate-index.py # --- Stage 3: Final nginx stage -FROM nginx:stable +FROM nginx:stable-alpine COPY nginx.conf /etc/nginx/conf.d/default.conf