batch-v07b: bell without peering (#836), no handover to disabled accounts (#862), sign-in throttling (#841) #863

Merged
Cordy merged 8 commits from batch-v07b into main 2026-10-08 18:06:14 +00:00
Owner

Closes #836
Closes #862
Closes #841

  • #836: the bell and avatars work without peering. Each source is gated on its own: received/sent appear only when peering is constructed and enabled, and ocm-share only when OCM is enabled. Mutes for inactive kinds are kept.
  • #862: transfer, Space owner reassignment and admin create-with-owner refuse a disabled target. The refusal is 409 with code: target-disabled, audited as owner-transfer-refused / space-assign-owner-refused. The picker greys out disabled accounts and is a keyboard combobox.
  • #841: sign-in throttling.
    • Keyed on a normalised account key (NFKC). Sources with a successful sign-in in the last 30 days are familiar and persisted.
    • Unfamiliar sources get a progressive delay, then 429 with Retry-After at 20 attempts in 15 minutes.
    • Spray detection: more than 10 accounts from one address in 15 minutes.
    • auth.trustedProxies controls which proxies' X-Forwarded-For is trusted.
    • One identity per request (a valid cookie means Basic is never verified).
    • An LDAP outage answers 503 and doesn't count as failed attempts.
    • New bell items and audit verbs.
    • Docs: deployment, account, users-access, admin-policy.

Reviewed over four rounds; the final re-review verdict was "Ready to merge". go test ./... passes on the Mac (Go 1.26).

Closes #836 Closes #862 Closes #841 - **#836:** the bell and avatars work without peering. Each source is gated on its own: received/sent appear only when peering is constructed and enabled, and `ocm-share` only when OCM is enabled. Mutes for inactive kinds are kept. - **#862:** transfer, Space owner reassignment and admin create-with-owner refuse a disabled target. The refusal is 409 with `code: target-disabled`, audited as `owner-transfer-refused` / `space-assign-owner-refused`. The picker greys out disabled accounts and is a keyboard combobox. - **#841:** sign-in throttling. - Keyed on a normalised account key (NFKC). Sources with a successful sign-in in the last 30 days are familiar and persisted. - Unfamiliar sources get a progressive delay, then 429 with Retry-After at 20 attempts in 15 minutes. - Spray detection: more than 10 accounts from one address in 15 minutes. - `auth.trustedProxies` controls which proxies' X-Forwarded-For is trusted. - One identity per request (a valid cookie means Basic is never verified). - An LDAP outage answers 503 and doesn't count as failed attempts. - New bell items and audit verbs. - Docs: deployment, account, users-access, admin-policy. Reviewed over four rounds; the final re-review verdict was "Ready to merge". `go test ./...` passes on the Mac (Go 1.26).
Build the notification bell (seen store, NotifyAPI) and AvatarsAPI on every
instance via buildNotify; peering only attaches Transfers and its runtime
switch (attachPeeringNotify). derive gates received/sent on peering being
constructed and on, ocm-share on OCMEnabled; items of a switched-off feature
are hidden, not deleted. GET /notifications/prefs adds the active kinds, the
UI hides other switches, PUT keeps stored mutes for inactive kinds. Generic
empty-state text in EN/DE/FR/IT. Handbook and CHANGELOG v0.6.323.
Progressive delay per canonical account name, never a lockout. Familiar
addresses (a sign-in in the last 30 days) keep their own budget; others
share 5 free, 1s doubling to 30s, 429 + Retry-After after 20 in 15 min.
One address failing on >10 accounts in 15 min is slowed. One counter for
/auth/password and every Basic path. Waits are state-enforced (429 inside
the window) and the failing answer's own wait is capped, cancellable and
bounded process-wide. auth.trustedProxies (CAIRN_TRUSTED_PROXIES): XFF only
from those. Audit auth-throttled / auth-spray-detected (admin tier). Bell:
owner failures-since-last-sign-in and slowed notices, admin limit and
spray items. Sign-in page shows the real Retry-After.
- A session cookie with a Basic header for another name records nothing:
  success counts only when the Basic credential itself was verified
  (User.ViaBasic, cleared on session issue).
- Attempts in flight count against the free budget (per distinct
  credential; parallel identical credentials are one attempt).
- LDAP outages return ErrDirectoryUnavailable, Multi passes it through,
  /auth/password answers 503; familiar devices, the notice and spray
  detection never count it (the unfamiliar pool still does).
- Spray refusal skips accounts familiar at the address; one WARN when
  X-Forwarded-For comes from a peer outside trustedProxies.
- Familiar addresses persist in signin-familiar.json (statePaths, bound
  on s3), debounced, flushed at shutdown.
- IPv6 familiar and spray state keyed on the /64.
- Change-password current-password check goes through the throttle (429).
- Admin limit items only for existing accounts; at most 3 spray items;
  key truncation on a rune boundary; begin/release paired with defer;
  IPv4-mapped trustedProxies CIDRs unmapped, too-wide ones refused.
- Docs and CHANGELOG corrected.
- throttle key normalises login names (trim, collapse whitespace, drop Cc/Cf, NFC, lowercase); LDAP refuses spaced/invisible-char names before searching
- LDAP alias success no longer resets or familiarises the typed name's bucket
- user bind: only connection failure/busy/unavailable is an outage; other result codes are rejections
- auth-throttled audited when the limit is reached by outage-counted attempts
- change-password dialog: localized 429 with Retry-After (api/luPost carry status + retryAfter)
- DE Sie-form for #836 empty state and #841 bell strings; 204 asserted for avatar delete
- docs: account, deployment, users-access; CHANGELOG
auth: NFKC keys, trimmed LDAP names, alias familiarity (#841)
All checks were successful
ci / test-and-build (pull_request) Successful in 2m3s
54abb5e2bc
Cordy merged commit 495c9671c6 into main 2026-10-08 18:06:14 +00:00
Cordy deleted branch batch-v07b 2026-10-08 18:06:20 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#863
No description provided.