The GitHub Actions job "Build" on jackrabbit-oak.git/issue/OAK-12331-impl has 
failed.
Run started by GitHub user dulvac (triggered by dulvac).

Head commit for run:
c9559876726dece07c47429b464d0d87cdd349bc / Andrei Dulvac <[email protected]>
OAK-12331: use value types for audit domain and event type

Review feedback from #3059. Replaces the raw String domain and type on the
audit SPI with AuditDomain and AuditType, so the values can be constrained
where they are built rather than trusted everywhere they are read.

Both are validated in their static factory: non-blank, no colon, no
whitespace, and nothing JcrNameParser rejects as a node name. A listener
that persists events into the repository can therefore build a path from a
domain without escaping it, which is what prompted the change. The colon is
excluded separately because JcrNameParser accepts it as a namespace prefix,
and a prefix means nothing for a flat identifier. Embedded whitespace is
excluded for the same reason.

They are separate types rather than one, so passing a type where a domain
belongs no longer compiles. Neither is an enum: consumer bundles define
their own domains, so the set is open.

The exported constants change type with them, SecurityAuditDomain.NAME
becoming SecurityAuditDomain.DOMAIN and the two UserAuditTypes membership
constants becoming AuditType. Payload keys stay String, since they are map
keys and not identifiers.

Also from the same review:

  - AuditEvent.isCommitAttested(event) replaces the advice that listeners
    check for the three reserved payload keys themselves. The key names are
    an implementation detail and a hand-rolled check breaks silently if
    they move.
  - Those keys are now oak.commit.* rather than commit.*, matching the
    oak. prefix the domain constants already use. The decorator reads them
    from the SPI so the strip path and the attestation check cannot drift
    apart.
  - AuditConfigurationImpl is now AuditPipeline. It implements a
    one-method interface, but its job is owning the toggle, buffer,
    registry and observer registration.
  - Dropped the empty @ObjectClassDefinition. It configured nothing, and
    adding one later is additive.
  - The activation log line said "activated" next to a bare toggle
    boolean, which read as a contradiction. It now says whether events
    will be captured, and the class javadoc separates wired from
    toggled-on from isActive().
  - Product-specific sample domains removed from javadoc, the TOCTOU
    comment in initialize() cut to the reason for the ordering, and a note
    added that the toggle starts disabled because Feature backs it with a
    fresh AtomicBoolean.

Co-authored-by: Jörg Hoh <[email protected]>

Report URL: https://github.com/apache/jackrabbit-oak/actions/runs/30907031732

With regards,
GitHub Actions via GitBox

Reply via email to