Skip to content

Commit 5f96eaa

Browse files
committed
Manually merge PR174: Write-protect ID fields in sign up forms when user is already authenticated
git-svn-id: svn+ssh://svn.code.sf.net/p/migrid/code/trunk@6191 b75ad72c-e7d7-11dd-a971-7dbc132099af
1 parent 2e7b474 commit 5f96eaa

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
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

0 commit comments

Comments
 (0)