Skip to content

Commit 346b4ba

Browse files
committed
Merge remote-tracking branch 'origin/master' into edge
2 parents ff721d8 + 8bbd13c commit 346b4ba

File tree

4 files changed

+28
-19
lines changed

4 files changed

+28
-19
lines changed

mig/shared/functionality/extcert.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# --- BEGIN_HEADER ---
55
#
66
# extcert - External certificate account sign up backend
7-
# Copyright (C) 2003-2023 The MiG Project lead by Brian Vinter
7+
# Copyright (C) 2003-2025 The MiG Project by the Science HPC Center at UCPH
88
#
99
# This file is part of MiG.
1010
#
@@ -25,7 +25,7 @@
2525
# -- END_HEADER ---
2626
#
2727

28-
"""Request account sign up with external certificate back end"""
28+
"""Request account access through externally signed X509 certificate auth"""
2929

3030
from __future__ import absolute_import
3131

@@ -159,11 +159,9 @@ def main(client_id, user_arguments_dict):
159159
fill_helpers['readonly_%s' % field] = ''
160160
ro_fields = [i for i in accepted['ro_fields'] if i in
161161
list(cert_field_map) + given_peers]
162-
# Only write-protect ID fields in auto-mode
163-
if keyword_auto in accepted['ro_fields']:
162+
# Write-protect ID fields in auto-mode or if already logged in
163+
if keyword_auto in accepted['ro_fields'] or client_id:
164164
ro_fields += [i for i in list(cert_field_map) if not i in ro_fields]
165-
# NOTE: lock all ID fields to current certificate here
166-
ro_fields += [i for i in id_fields if not i in ro_fields]
167165
for field in ro_fields:
168166
fill_helpers['readonly_%s' % field] = 'readonly'
169167
fill_helpers.update(user_fields)

mig/shared/functionality/reqcert.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
#
44
# --- BEGIN_HEADER ---
55
#
6-
# reqcert - Certificate account request backend
7-
# Copyright (C) 2003-2023 The MiG Project lead by Brian Vinter
6+
# reqcert - Local certificate request and account sign up backend
7+
# Copyright (C) 2003-2025 The MiG Project by the Science HPC Center at UCPH
88
#
99
# This file is part of MiG.
1010
#
@@ -25,7 +25,7 @@
2525
# -- END_HEADER ---
2626
#
2727

28-
"""Request certificate account back end"""
28+
"""Request account access through locally signed X509 certificate auth"""
2929

3030
from __future__ import absolute_import
3131

@@ -196,8 +196,8 @@ def main(client_id, user_arguments_dict):
196196
fill_helpers['readonly_%s' % field] = ''
197197
ro_fields = [i for i in accepted['ro_fields'] if i in
198198
list(cert_field_map) + given_peers]
199-
# Only write-protect ID fields in auto-mode
200-
if keyword_auto in accepted['ro_fields']:
199+
# Write-protect ID fields in auto-mode or if already logged in
200+
if keyword_auto in accepted['ro_fields'] or client_id:
201201
ro_fields += [i for i in list(cert_field_map) if not i in ro_fields]
202202
if reset_token:
203203
user_fields['reset_token'] = reset_token

mig/shared/functionality/reqoid.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# --- BEGIN_HEADER ---
55
#
66
# reqoid - OpenID account request backend
7-
# Copyright (C) 2003-2023 The MiG Project lead by Brian Vinter
7+
# Copyright (C) 2003-2025 The MiG Project by the Science HPC Center at UCPH
88
#
99
# This file is part of MiG.
1010
#
@@ -25,7 +25,7 @@
2525
# -- END_HEADER ---
2626
#
2727

28-
"""Request OpenID account back end"""
28+
"""Request account access through built-in OpenID 2.0 service auth"""
2929

3030
from __future__ import absolute_import
3131

@@ -198,8 +198,8 @@ def main(client_id, user_arguments_dict):
198198
fill_helpers['readonly_%s' % field] = ''
199199
ro_fields = [i for i in accepted['ro_fields'] if i in
200200
list(cert_field_map) + given_peers]
201-
# Only write-protect ID fields in auto-mode
202-
if keyword_auto in accepted['ro_fields']:
201+
# Write-protect ID fields in auto-mode or if already logged in
202+
if keyword_auto in accepted['ro_fields'] or client_id:
203203
ro_fields += [i for i in list(cert_field_map) if not i in ro_fields]
204204
if reset_token:
205205
user_fields['reset_token'] = reset_token

mig/shared/functionality/vgridman.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# --- BEGIN_HEADER ---
55
#
66
# vgridman - backend to manage vgrids
7-
# Copyright (C) 2003-2024 The MiG Project lead by Brian Vinter
7+
# Copyright (C) 2003-2025 The MiG Project lead by the Science HPC Center at UCPH
88
#
99
# This file is part of MiG.
1010
#
@@ -64,6 +64,7 @@ def main(client_id, user_arguments_dict):
6464
defaults = signature()[1]
6565
title_entry = find_entry(output_objects, 'title')
6666
label = "%s" % configuration.site_vgrid_label
67+
support_email = "%s" % configuration.support_email
6768
title_entry['text'] = "%s Management" % label
6869
(validate_status, accepted) = validate_input_and_cert(
6970
user_arguments_dict,
@@ -106,6 +107,7 @@ def main(client_id, user_arguments_dict):
106107
form_method = 'post'
107108
csrf_limit = get_csrf_limit(configuration)
108109
fill_helpers = {'vgrid_label': label,
110+
'support_email': support_email,
109111
'form_method': form_method,
110112
'csrf_field': csrf_field,
111113
'csrf_limit': csrf_limit}
@@ -488,11 +490,11 @@ def main(client_id, user_arguments_dict):
488490
if operation in show_operations:
489491
user_map = get_full_user_map(configuration)
490492
user_dict = user_map.get(client_id, None)
493+
output_objects.append({'object_type': 'sectionheader', 'text':
494+
'Additional %ss' % label})
495+
491496
# Optional limitation of create vgrid permission
492497
if user_dict and vgrid_create_allowed(configuration, user_dict):
493-
output_objects.append({'object_type': 'sectionheader', 'text':
494-
'Additional %ss' % label})
495-
496498
output_objects.append(
497499
{'object_type': 'text', 'text':
498500
'''Please enter a name for the new %(vgrid_label)s to add,
@@ -515,6 +517,15 @@ def main(client_id, user_arguments_dict):
515517
<input type="submit" value="Create %(vgrid_label)s" />
516518
</form>
517519
''' % fill_helpers})
520+
else:
521+
output_objects.append(
522+
{'object_type': 'warning', 'text':
523+
"""You don't have permission to create %(vgrid_label)ss on
524+
this site.""" % fill_helpers})
525+
output_objects.append(
526+
{'object_type': 'text', 'text':
527+
"""Please contact support at %(support_email)s if you think
528+
that you qualify for it.""" % fill_helpers})
518529

519530
output_objects.append({'object_type': 'sectionheader', 'text':
520531
'Request Access to %ss' % label})

0 commit comments

Comments
 (0)