Skip to content

Commit

Permalink
Add issuer deprecation notice (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamphuisem authored Jan 21, 2025
1 parent f77a6d8 commit 691c54c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
context: .
dockerfile: Dockerfile
ports:
- "80:80"
- "8080:80"
environment:
- NODE_OPTIONS=--openssl-legacy-provider
restart: unless-stopped
29 changes: 11 additions & 18 deletions generate-index.py
Original file line number Diff line number Diff line change
Expand Up @@ -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': {},
}
Expand All @@ -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]),
Expand Down Expand Up @@ -169,8 +170,6 @@ def generateHTML(index, out, lang):
LANG=lang,
identifier='glossary')



organized_data = []
for schememgr in index:
scheme_data = {
Expand Down Expand Up @@ -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,
Expand All @@ -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}")
generateHTML(index, 'en', 'en')
generateHTML(index, 'nl', 'nl')
7 changes: 7 additions & 0 deletions templates/issuer.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
<img class="float-right" width="100" src="{{ assets }}/{{ issuer.logo }}"/>
<h2>{{ issuer.name[LANG] }}</h2>
<p class="subtitle">Issuer</p>

{% if issuer.deprecated %}
<div class="alert alert-warning warning-test"><strong>This issuer is deprecated since {{ issuer.deprecated }}</strong>.<br/>
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.</div>
{% endif %}

{% if schememgr.test %}
<div class="alert alert-warning warning-test"><strong>This is a testing issuer.</strong> Its IRMA private key is public, so anyone can issue credentials with this issuer. Use it for testing and demo purposes only.</div>
{% endif %}
Expand Down

0 comments on commit 691c54c

Please sign in to comment.