oatpp-authkit/include/oatpp-authkit
Uwe Schuster 52449e4159 #15: RedactedFieldRepository — null credentials on historical rows
Adds a decorator that sits below TemporalRepository and redacts
configured fields whenever it sees a save with valid_until != SENTINEL
(i.e., a historical row being closed by the temporal close-then-update
flow). The live row keeps its values intact.

Per Option B from the issue thread: by default the user-repo factory
redacts both passwordHash and tlsCertDn. Empty redaction list passes
everything through unchanged, so non-user temporal stacks compose the
decorator without surprise behaviour.

Files:
- repo/RedactedFieldRepository.hpp — new decorator. Schema contribution
  is empty (purely a save-time transform). Field-name matching uses
  oatpp's reflective property dispatcher and matches against the C++
  identifier name (first DTO_FIELD argument).
- repo/ConcreteUserRepository.hpp — makeUserRepository now wraps the
  concrete repo in RedactedFieldRepository<UserDto>{"passwordHash",
  "tlsCertDn"} before passing to TemporalRepository. Optional second
  argument lets consumers override the redaction list.
- test/test_redacted_field_repository.cpp — five tests cover live-row
  pass-through, historical-row redaction (both fields), partial
  redaction list, empty list, and null-valid_until treated as live.
- README.md — adds RedactedFieldRepository to the header inventory.

14 of 14 tests pass. Bumped 0.12.0 → 0.13.0.

Closes #15

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 20:52:02 +02:00
..
auth #6: route ad-hoc JSON through ObjectMapper (Option A — DI everywhere, all-in-one) 2026-04-25 21:56:05 +02:00
db #14 PR 4: relocate users with temporal shape (Option B) 2026-05-06 12:57:59 +02:00
dto #14 PR 4: relocate users with temporal shape (Option B) 2026-05-06 12:57:59 +02:00
handler #6: route ad-hoc JSON through ObjectMapper (Option A — DI everywhere, all-in-one) 2026-04-25 21:56:05 +02:00
interceptor #3: SecurityHeadersInterceptor — strict baseline + CspOverride ctor (Option B) 2026-04-25 21:54:58 +02:00
mail v0.3.2: Add mail::SmtpTransport — lifted from fewo-webapp 2026-04-23 15:06:35 +02:00
repo #15: RedactedFieldRepository — null credentials on historical rows 2026-05-06 20:52:02 +02:00
startup v0.1.0: initial clean-lift from fewo-webapp 2026-04-21 21:42:53 +02:00
systemd Add systemd::notify helper (zero-dep sd_notify protocol) 2026-04-22 23:01:40 +02:00
util v0.2.1: wrap clean-lift headers in namespace oatpp_authkit 2026-04-21 21:53:21 +02:00
ws Hub.hpp: friend Listener so it can call sharedMapper() 2026-04-29 16:04:45 +02:00