diff --git a/app/cred.py b/app/cred.py index c55ab617..ee14f8b6 100644 --- a/app/cred.py +++ b/app/cred.py @@ -64,7 +64,7 @@ def validate_cred(self, userid, new_cred): if isequal: return 1, "Credentials already available." - if new_cred["type"] == "EUNode": + if new_cred["type"] in ["EUNode", "EUNodeCont"]: if new_cred["node"] == cred["node"]: return 2, ("This site has already a Credential with the same EU Node site." + " This may cause problems authenticating with the site." + diff --git a/app/static/images/EUNodeContRow.png b/app/static/images/EUNodeContRow.png new file mode 100644 index 00000000..fdf91d58 Binary files /dev/null and b/app/static/images/EUNodeContRow.png differ diff --git a/app/templates/modal_creds.html b/app/templates/modal_creds.html index 11ccc5fd..67e0bf86 100644 --- a/app/templates/modal_creds.html +++ b/app/templates/modal_creds.html @@ -314,6 +314,19 @@ +{% elif cred_type == "EUNodeCont" %} +
+
+ +
+
+ +
+
{% else %} diff --git a/app/utils.py b/app/utils.py index cb696fc7..8df90db0 100644 --- a/app/utils.py +++ b/app/utils.py @@ -210,7 +210,11 @@ def getUserAuthData(access_token, cred, userid, cred_id=None, full=False, add_ex for cred in creds: if cred['enabled'] and (cred_id is None or cred_id == cred['id'] or cred['id'] in extra_auth_ids): res += "\\nid = %s" % cred['id'] - if cred['type'] == "EUNode": + if cred['type'] == "EUNodeCont": + # Add the EUNode provider as Kubernetes + res += "; type = Kubernetes; token = '%s';" % cred['token'] + res += " host = https://api.%s.paas.open-science-cloud.ec.europa.eu:6443" % cred['node'] + elif cred['type'] == "EUNode": # Add the EUNode provider as OpenStack res += "; type = OpenStack; auth_version = 3.x_appcred;" res += " host = https://api.%s.iaas.open-science-cloud.ec.europa.eu:5000" % cred['node']