Skip to content

Add optional PAP change listener configurable via JNDI - #75

Open
mikfaretta wants to merge 1 commit into
authzforce:developfrom
mikfaretta:feature/pap-change-listener
Open

mikfaretta wants to merge 1 commit into
authzforce:developfrom
mikfaretta:feature/pap-change-listener

Conversation

@mikfaretta

Copy link
Copy Markdown

Refs #74 .

Adds an optional server-level PAP change listener, following the
maintainers' feedback on hook locations and listener configuration.

Changes

  • Introduce PapChangeListener and PapChangeEvent.
  • Notify listeners after successful policy/version additions and
    deletions, PDP configuration changes (including root-policy changes),
    attribute-provider configuration changes, and domain deletion.
  • Add hooks in DomainResourceImpl, PolicyResourceImpl and
    PolicyVersionResourceImpl, passing the listener through
    DomainsResourceImpl.
  • Support external listener implementations packaged as separate JARs,
    configured through the JNDI property
    org.ow2.authzforce.rest.service.PapChangeListener.class.
  • Add configuration documentation and unit/integration tests.

The listener is optional and disabled by default. No new library
dependencies or changes to PDP evaluation or policy persistence
are introduced.

Callback semantics and scope

Callbacks run synchronously after successful PAP operations.
Listener RuntimeExceptions are logged without changing the successful
outcome of the PAP operation.

Notifications are best effort: they are not atomic with policy
persistence and do not provide durable delivery or ordering guarantees.
Direct filesystem changes are not covered.

Broker integration, persistent event queues, asynchronous publishing
and consumer reconciliation remain outside this PR.

Validation

Validation was performed before cherry-picking onto the latest develop:

  • All 8 new notification tests passed, including HTTP integration
    coverage and listener configuration tests.
  • Packaging, Javadoc, PMD/CPD and SpotBugs checks passed.
  • Full suite with this change: 312 tests, 3 failures, 15 skipped.
  • Baseline at 1b5a007: 304 tests, the same 3 failures, 15 skipped.

The three failures occurred in the addDomain tests of:

  • AdminDomainTest
  • DomainPdpResourceWithCustomXacmlJsonSchemaTest
  • DomainResourceTestWithAutoSyncAndVersionRolling

These failures were reproduced on the unmodified baseline in the
Windows environment. Logs showed HTTP 404 responses and invalid
Windows file URI handling during JSON schema initialization.

Validation used offline Maven dependencies. The online dependency
vulnerability check was skipped.

The cherry-pick conflict in dist/src/webapp-context.xml was resolved
by retaining develop's removal of the duplicate
xacmlJsonSchemaRelativePath property and preserving the new listener
configuration. The test suite has not been rerun after this resolution.

Notify listeners after successful policy/version changes, PDP and
attribute-provider configuration updates, and domain deletion.

Support external listener implementations without new dependencies
or changes to PDP evaluation and policy persistence.

Add configuration documentation and unit/integration tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant