Skip to content

Commit facfef4

Browse files
mo-automoabu
andcommitted
docs: scope basic lock guarantee to versioned writers
Co-authored-by: Mohammad Abudayyeh <47318409+moabu@users.noreply.github.com> Signed-off-by: moauto <54212639+mo-auto@users.noreply.github.com>
1 parent 66bcd99 commit facfef4

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

  • docs/script-catalog/person_authentication/other/basic.lock.account

‎docs/script-catalog/person_authentication/other/basic.lock.account/README.md‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@ While an account is locked, `invalid_login_count_attribute` holds `locked:<epoch
2121
count, where `jansVersion` is the user version the lock wrote. The script only unlocks inactive accounts whose marker
2222
and version are unchanged since the lock, so accounts disabled or edited by an administrator stay locked.
2323

24-
The script's user writes are compare-and-set on `jansVersion`: a counter, lock or unlock write that races another
25-
write re-reads the user and decides again, so the script never overwrites a concurrent change. Janssen's own user
26-
writers (auth server, Config API, SCIM, Casa, Jans Link) all advance `jansVersion`. Custom entity classes or direct
27-
database updates on `jansPerson` must advance it too, or unlock cannot see their changes.
28-
29-
Other writers still update users with a plain `merge`, which diffs the user they read against the stored entry. An
30-
update read before a lock and saved after it (for example an in-flight Config API PATCH) can therefore write the
31-
status it read and reactivate the account early. The script itself never overwrites such an update.
24+
On backends with versioned updates, the script's user writes are compare-and-set on `jansVersion`: a counter, lock
25+
or unlock write that races a write which advances `jansVersion` re-reads the user and decides again instead of
26+
overwriting it. Janssen's own user writers (auth server, Config API, SCIM, Casa, Jans Link) all advance `jansVersion`.
27+
Custom entity classes or direct database updates on `jansPerson` must advance it too, or the script and unlock cannot
28+
see their changes.
29+
30+
Other writers update users with `merge`, which checks only the version it reads itself, not the one their own earlier
31+
read saw. An update read before a lock and saved after it (for example an in-flight Config API PATCH) can therefore
32+
write the status it read and reactivate the account early.
3233

3334
Counter and lock writes fall back to a plain update on backends without versioned updates; unlock does not, so such
3435
accounts must be reactivated by an administrator.

0 commit comments

Comments
 (0)