From 3b78ac598a00cdd5c3e079381fa3e1d6466e54e8 Mon Sep 17 00:00:00 2001 From: Yasin Date: Thu, 5 Jun 2014 15:42:38 +0200 Subject: [PATCH] F4f: jfed identity dl button added --- portal/accountview.py | 23 ++ portal/templates/account-view.html | 21 +- .../templates/onelab/onelab_account-view.html | 322 ++++++++++++++++++ 3 files changed, 364 insertions(+), 2 deletions(-) create mode 100644 portal/templates/onelab/onelab_account-view.html diff --git a/portal/accountview.py b/portal/accountview.py index 67c765d9..20c2b05c 100644 --- a/portal/accountview.py +++ b/portal/accountview.py @@ -455,6 +455,29 @@ def account_process(request): else: messages.error(request, 'Account error: You need an account in myslice platform to perform this action') return HttpResponseRedirect("/portal/account/") + + # download identity for jfed + elif 'dl_identity' in request.POST: + for account_detail in account_details: + for platform_detail in platform_details: + if platform_detail['platform_id'] == account_detail['platform_id']: + if 'myslice' in platform_detail['platform']: + account_config = json.loads(account_detail['config']) + if 'user_private_key' in account_config: + private_key = account_config['user_private_key'] + user_hrn = account_config.get('user_hrn','N/A') + registry = 'http://sfa-fed4fire.pl.sophia.inria.fr:12345/' + jfed_identity = user_hrn + '\n' + registry + '\n' + private_key + response = HttpResponse(jfed_identity, content_type='text/plain') + response['Content-Disposition'] = 'attachment; filename="jfed_identity.txt"' + return response + else: + messages.error(request, 'Download error: Private key is not stored in the server') + return HttpResponseRedirect("/portal/account/") + + else: + messages.error(request, 'Account error: You need an account in myslice platform to perform this action') + return HttpResponseRedirect("/portal/account/") #clear all creds elif 'clear_cred' in request.POST: diff --git a/portal/templates/account-view.html b/portal/templates/account-view.html index 353a83c2..8c4c9af9 100644 --- a/portal/templates/account-view.html +++ b/portal/templates/account-view.html @@ -30,7 +30,7 @@ @@ -144,7 +144,24 @@ {%endif%} - + + {%if 'N/A' not in user_private_key%} + + + {%else%} + + + {%endif%} + +
-
Platform: Myslice
+
Platforms: Myslice
Identity + + Identity + +

Tradeoff: Ease-of-use vs Security.
Ease-of-use: Automatic account delegation. Don't delete private key.
diff --git a/portal/templates/onelab/onelab_account-view.html b/portal/templates/onelab/onelab_account-view.html new file mode 100644 index 00000000..a0806070 --- /dev/null +++ b/portal/templates/onelab/onelab_account-view.html @@ -0,0 +1,322 @@ +{% extends "layout_wide.html" %} +{% block content %} + + +{% if messages %} +

    + {% for message in messages %} + {{ message }} + {% endfor %} +
+{% endif %} + +
+
+ +
+ +
+ {% csrf_token %} + + + + + + + + + + + + + + + + + + + + + {%if 'Enabled' in user_status %} + + + + + + + + + + {%if 'N/A' not in user_private_key%} + + + {%else%} + + + {%endif%} + + + + + {%endif%} +
+
Platforms: Myslice
+
Email + {{ person.email }} + +
Password + + ******** + + + + + + + + + + + + +
Enter password:
Confirm password: + + +
+
+
Full Name + {{ fullname }} + + +
+ + + +
+ +
Authority + {{ authority }} + +
Generate Keys + +
Public Key + ******** + + +
+
+ + +
+
+ + +
Private Key ******** + + + Private Key ******** + + +
+

Tradeoff: Ease-of-use vs Security.
+ Ease-of-use: Automatic account delegation. Don't delete private key.
+ Security: Manual account delegation. Download & Delete private key. +

+
+ +
+
+ +
+
+ +

Principal Account Account used for delegating credentials

+ + + + + + + + + + {% for row in principal_acc %} + + + + + + + + + {%endfor%} +
PlatformAccount TypeAccount DelegationUser hrnUser Status
{{ row.platform_name }} {{ row.account_type }} {{ row.delegation_type }} {{ row.usr_hrn }} {{ row.user_status }}
+ +
+ + + {%if 'Enabled' in user_status %} +
+

Credentials Delegated to Principal Account

+ + + + + + + {% for row in my_users %} + + + + + {%endfor%} +
Delegated User Credential
Expiration DateDownload
{{ row.cred_exp }} + +
+

+ + + + + + + + {% for row in my_slices %} + + + + + + {%endfor%} +
Delegated Slice Credentials
Slice NameExpiration DateDownload
{{ row.slice_name }} {{ row.cred_exp }} + +
+

+ + + + + + + + {% for row in my_auths %} + + + + + + {%endfor%} +
Delegated Authority Credentials
Authority NameExpiration DateDownload
{{ row.auth_name }} {{ row.cred_exp }} + +
+

+ {%if '' not in my_users%} +

+ {%else%} +

+ {%endif%} +
+
+ +
+
+ +

Testbed Access Reference Accounts in the following testbeds

+ + + + + + + + {% for row in ref_acc %} + + + + + + + {%endfor%} +
PlatformAccount TypeReference toRemove Account
{{ row.platform_name }} {{ row.account_type }} {{ row.account_reference }} + +
+ + +

Add reference account to the following testbeds

+ + + + + + {% for platform in platform_list %} + + + + + {%endfor%} +
PlatformsAdd Account
{{ platform.platform_no_access }} + +
+
+{%endif%} +
+ +
+ + + +{% endblock %} -- 2.43.0