comparison doc/upgrading.txt @ 8412:0663a7bcef6c reauth-confirm_id

feat: finish reauth docs, enhance code. Decided to keep name Reauth for now. admin_guide.txt: add reference mark to roundup admin help. Used for template command reference in upgrading.txt. customizing.txt: added worked example of adding a reauth auditor for address and password. Also links to OWASP recommendations. Added link to example code in design.doc on detectors. glossary.txt: reference using roundup-admin template command in def for tracker templates. pydoc.txt: Added methods for Client class. Added class and methods for (cgi) Action, LoginAction and ReauthAction. reference.txt Edited and restructured detector section. Added section on registering a detector and priority use/execution order. (reference to design doc was used before). Added/enhanced description of exception an auditor can raise (includes Reauth). Added section on Reauth implementation and use (Confirming the User). Also has paragraph on future ideas. upgrading.txt Stripped down the original section. Moved a lot to reference.txt. Referenced customizing example, mention installation of _generic.reauth.html and reference reference.txt. cgi/actions.py: fixed bad ReST that was breaking pydoc.txt processing changed doc on limitations of Reauth code. added docstring for Reauth::verifyPassword cgi/client.py: fix ReST for a method breaking pydoc.py processing cgi/templating.py: fix docstring on embed_form_fields templates/*/html/_generic.reauth.html disable spelling for password field add timing info to the javascript function that processes file data. reformat javascript IIFE templates/jinja2/html/_generic.reauth.html create a valid jinja2 template. Looks like my original jinja template got overwritten and committed. feature parity with the other reauth templates. test/test_liveserver.py add test case for Reauth workflow. Makefile add doc.
author John Rouillard <rouilj@ieee.org>
date Wed, 13 Aug 2025 23:52:49 -0400
parents ef1ea918b07a
children 94eed885e958
comparison
equal deleted inserted replaced
8411:ef1ea918b07a 8412:0663a7bcef6c
115 115
116 When changing sensitive information (e.g. passwords) it is 116 When changing sensitive information (e.g. passwords) it is
117 useful to ask for a validated authorization. This makes sure 117 useful to ask for a validated authorization. This makes sure
118 that the user is present by typing their password. 118 that the user is present by typing their password.
119 119
120 In an auditor adding:: 120 You can add this to your auditors using the example
121 121 :ref:`sensitive_changes`.
122 from roundup.cgi.exceptions import Reauth 122
123 123 To use this, you must copy ``_generic.reauth.html`` into your
124 if 'password' in newvalues and not getattr(db, 'reauth_done', False): 124 tracker's html subdirectory. See the classic template directory for a
125 raise Reauth('Add an optional message to the user') 125 copy. If you are using jinja2, see the jinja2 template directory.
126 126 Then you can raise a Reauth exception and have the proper page
127 will present the user with a authorization page and optional message 127 displayed.
128 when the password is changed. The page is generated from the
129 ``_generic.reauth.html`` template by default.
130
131 Once the user enters their password and submits the page, the
132 password will be verified using:
133
134 roundup.cgi.actions:LoginAction::verifyPassword()
135
136 If the password is correct the original change is done.
137
138 To prevent the auditor from trigering another Reauth, the
139 attribute ``reauth_done`` is added to the db object. As a result,
140 the getattr call will return True and not raise Reauth.
141
142 You get one reauth for a submitted change. Note you cannot Reauth
143 multiple properties separately. If you need to auth multiple
144 properties separately, you need to reject the change and force the
145 user to submit each sensitive property separately. For example::
146
147 if 'password' in newvalues and 'realname' in newvalues:
148 raise Reject('Changing the username and the realname '
149 'at the same time is not allowed. Please '
150 'submit two changes.')
151
152 if 'password' in newvalues and not getattr(db, 'reauth_done', False):
153 raise Reauth()
154
155 if 'realname' in newvalues and not getattr(db, 'reauth_done', False):
156 raise Reauth()
157
158 See also: client.py:Client:reauth(self, exception) which can be changed
159 using interfaces.py in your tracker.
160
161 You should copy ``_generic.reauth.html`` into your tracker's html
162 subdirectory. See the classic template directory for a copy. If you
163 are using jinja2, see the jinja2 template directory. Then you can
164 raise a Reauth exception and have the proper page displayed.
165 128
166 Also javascript *MUST* be turned on if this is used with a file 129 Also javascript *MUST* be turned on if this is used with a file
167 input. If JavaScript is not turned on, attached files are lost during 130 input. If JavaScript is not turned on, attached files are lost during
168 the reauth step. Information from other types of inputs (password, 131 the reauth step. Information from other types of inputs (password,
169 date, text etc.) do not need JavaScript to work. 132 date, text etc.) do not need JavaScript to work.
133
134 See :ref:`Confirming the User` in the reference manual for details.
170 135
171 .. index:: Upgrading; 2.4.0 to 2.5.0 136 .. index:: Upgrading; 2.4.0 to 2.5.0
172 137
173 Migrating from 2.4.0 to 2.5.0 138 Migrating from 2.4.0 to 2.5.0
174 ============================= 139 =============================

Roundup Issue Tracker: http://roundup-tracker.org/