feat(#177): admin compose & send ESPI BatchList notification (DC sender + TP receiver)#178
Merged
Merged
Conversation
…er + TP receiver) Data Custodian (sender): - NotificationService.notifyBatchList(uri, resourceUris): synchronous send — marshal BatchListDto via BatchListXmlCodec, POST application/atom+xml; validates the URI and >=1 resource (blanks dropped); surfaces failures to the caller. - BatchNotificationController (/custodian/notifications GET + /send POST): admin enters the Third Party notify URL (suggested from registered ApplicationInformation endpoints) and the BatchList resource URLs (ApplicationInformation, Authorization feed, Authorization entry, Subscription); flash success/failure. ROLE_CUSTODIAN. Dashboard card + nav item. Third Party (receiver), corrected to the ESPI flow: - For each <resource> URL the TP, as an OAuth client, performs an authenticated GET on the URL to obtain the data, then hands it to import (per-resource failures logged, don't abort the batch). Per-resource token selection = #146; unmarshal/persist of the payload = #89. - Inbound POST /espi/1_1/Notification is permitAll: the DC delivers without an OAuth token (transport-secured by TLS); the token is used only on the outbound fetch. - Removed the legacy sftp:// branch + Runtime.exec (ESPI no longer permits SFTP; injection risk). Unparseable payload -> 400. Verified live (with the #146/#179 TP bring-up applied): DC admin notify page -> DC POSTs BatchList -> TP receives, persists the BatchList, attempts an authenticated GET per resource (DC returns 401 until a token is wired) -> "Successfully processed notification with 4 resources". Tests: common 4/0, datacustodian 160/0, thirdparty 47/0. (TP boot bring-up split into #146/#179.) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
466d260 to
9add3a2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Admin page on the Data Custodian to compose and send an ESPI BatchList notification to a Third Party, plus the Third Party receiver that processes it. Closes #177. Built on the #158 notification contract.
Data Custodian (sender)
NotificationService.notifyBatchList(uri, resourceUris)— synchronous send (marshalBatchListDtoviaBatchListXmlCodec, POSTapplication/atom+xml); validates URI + ≥1 resource; surfaces failures.BatchNotificationControllerGET/POST /custodian/notifications— TP notify URL (suggested from registered ApplicationInformation endpoints) + the four resource URLs (ApplicationInformation, Authorization feed, Authorization entry, Subscription); flash result;ROLE_CUSTODIAN; dashboard card + nav item.Third Party (receiver) — ESPI flow
<resource>URL the TP (an OAuth client) performs an authenticated GET to obtain the data, then imports it (per-resource failures logged, don't abort). Per-resource token = TP bring-up: missing JAXB Atom marshaller, narrow component scan, and broader OAuth2-client wiring gaps #146; unmarshal/persist of the payload = Implement comprehensive JAXB unmarshalling support for XML import #89.POST /espi/1_1/NotificationispermitAll(DC delivers without an OAuth token — TLS at transport; token used only on the outbound fetch).sftp://branch +Runtime.exec(no longer permitted by ESPI; injection risk). Unparseable payload → 400.Verification
notifyBatchListPOSTs all URLs as one BatchList + validation guards), datacustodian 160/0, thirdparty 47/0.🤖 Generated with Claude Code