Skip to content

Commit 37b537f

Browse files
committed
merge reauth-confirm_id branch to allow triggering of password verification on update/create
2 parents 72d453a + de46b0b commit 37b537f

File tree

18 files changed

+1573
-46
lines changed

18 files changed

+1573
-46
lines changed

CHANGES.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ Fixed:
2626

2727
Features:
2828

29+
- add support for authorized changes. User can be prompted to enter
30+
their password to authorize a change. If the user's password is
31+
properly entered, the change is committed. (John Rouillard)
32+
2933
2025-07-13 2.5.0
3034

3135
Fixed:

doc/admin_guide.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1729,6 +1729,8 @@ IMAPS_OAUTH:
17291729
single: roundup-admin; man page reference
17301730
pair: roundup-admin; designator
17311731

1732+
.. _`roundup-admin templates`:
1733+
17321734
Using roundup-admin
17331735
===================
17341736

doc/customizing.txt

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1815,6 +1815,60 @@ Some simple javascript might help in the last step. If you have high volume
18151815
you could search for all currently-Pending users and do a bulk edit of all
18161816
their roles at once (again probably with some simple javascript help).
18171817

1818+
.. _sensitive_changes:
1819+
1820+
Confirming Users Making Sensitive Account Changes
1821+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1822+
1823+
Some changes to account data: user passwords or email addresses are
1824+
particularly sensitive. The `OWASP Authentication`_ recommendations
1825+
include asking for a re-authentication or confirmation step when making
1826+
these changes. This can be easily implemented using an auditor.
1827+
1828+
Create a file in your detectors directory with the following
1829+
contents::
1830+
1831+
from roundup.cgi.exceptions import Reauth
1832+
1833+
def confirmid(db, cl, nodeid, newvalues):
1834+
1835+
if hasattr(db, 'reauth_done'):
1836+
# the user has confirmed their identity
1837+
return
1838+
1839+
# if the password or email are changing, require id confirmation
1840+
if 'password' in newvalues:
1841+
raise Reauth('Add an optional message to the user')
1842+
1843+
if 'address' in newvalues:
1844+
raise Reauth('Add an optional message to the user')
1845+
1846+
def init(db):
1847+
db.user.audit('set', confirmid, priority=110)
1848+
1849+
If a change is made to any user's password or address fields, the user
1850+
making the change will be shown a page where they have to enter an
1851+
identity verifier (by default the invoking user's account password).
1852+
If the verifier is successfully verified it will set the
1853+
``reauth_done`` attribute on the db object and reprocess the change.
1854+
1855+
The default auditor priority is 100. This auditor is set to run
1856+
**after** most other auditors. This allows the user to correct any
1857+
failing information on the form before being asked to confirm their
1858+
identity. Once they confirm their identity the change is expected to
1859+
be committed without issue. See :ref:`Confirming the User` for
1860+
details on customizing the verification operation.
1861+
1862+
Also you could use an existing auditor and add::
1863+
1864+
if 'someproperty' in newvalues and not hasattr(db, 'reauth_done'):
1865+
raise Reauth('Need verification before changing someproperty')
1866+
1867+
at the end of the auditor (after all checks are done) to force user
1868+
verification. Just make sure you import Reauth at the top of the file.
1869+
1870+
.. _`OWASP Authentication`:
1871+
https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html#require-re-authentication-for-sensitive-features
18181872

18191873
Changes to the Web User Interface
18201874
---------------------------------
@@ -2436,6 +2490,10 @@ The `reference document`_ also has examples:
24362490
<reference.html#extending-the-configuration-file>`_.
24372491
* `Adding a new Permission <reference.html#adding-a-new-permission>`_
24382492

2493+
as does the design document:
2494+
2495+
* `detector examples <design.html#detector-example>`_
2496+
24392497
Examples on the Wiki
24402498
====================
24412499

doc/glossary.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ Roundup Glossary
9999
tracker with a particular look and feel, :term:`schema`,
100100
permissions model, and :term:`detectors`. Roundup ships with
101101
five templates and people on the net `have produced other
102-
templates`_
102+
templates`_. You can find the installed location of the
103+
standard Roundup templates using the :ref:`roundup-admin
104+
templates <roundup-admin templates>` command.
103105

104106

105107
tracker

doc/pydoc.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,32 @@ Client class
99
============
1010

1111
.. autoclass:: roundup.cgi.client::Client
12+
:members:
13+
14+
CGI Action class
15+
================
16+
17+
Action class and selected derived classes.
18+
19+
Action
20+
------
21+
.. autoclass:: roundup.cgi.actions::Action
22+
:members:
23+
24+
LoginAction
25+
------------
1226

27+
.. autoclass:: roundup.cgi.actions::LoginAction
28+
:members:
29+
30+
.. _`ReauthAction_pydoc`:
31+
32+
ReauthAction
33+
------------
34+
35+
.. autoclass:: roundup.cgi.actions::ReauthAction
36+
:members:
37+
1338
Templating Utils class
1439
======================
1540

0 commit comments

Comments
 (0)