Repository navigation
Open
Labels
NAESB ESPI StandardRequired to comply with the NAESB ESPI standardRequired to comply with the NAESB ESPI standardenhancementNew feature or requestNew feature or request
Description
Summary
Implement the ESPI Bulk API on the Data Custodian: GET /espi/1_1/resource/Batch/Bulk/{bulkId}. Per REQ.21 it accepts only the Third Party's client access token (client_credentials, ThirdParty_Admin_Access) and returns, as one Atom feed, the data of every customer Authorization that the Third Party holds under that bulk id.
Current state
- No
Batch/Bulkendpoint exists (CLAUDE.md "REST API Structure" lists it as not implemented).SecurityConfigurationonly routes/espi/1_1/resource/Batch/**into the generic usage-data rule (FB_4 + commodity, or DC admin), which is the wrong token for Bulk. - Building blocks already present:
AuthorizationRepository.findAllIdsByBulkId(thirdParty, bulkId)(matches onscope LIKE :bulkId) andAuthorizationService.findAllIdsByBulkId;NotificationServiceImplalready treats/Batch/Bulk/resource URIs as the Third Party's client access token URIs;- the AS's
EspiTokenCustomizermaps a Third Party admin to the.../Batch/Bulk/**resource URI (JWT-era code).
- The client access token response does not yet carry the Bulk
resourceURIor theauthorizationURI(ESPI token-response URIs: FB_51 gating, re-provisioning on refresh, missing URIs for client_credentials tokens #202).
Scope
- Endpoint:
GET /espi/1_1/resource/Batch/Bulk/{bulkId}→ an Atom feed (the fix(#247): export DC collection endpoints as Atom feeds instead of a bare List #250exportFeedassembly) of the resources of every Authorization of the calling Third Party whose scope carriesBulkId={bulkId}. - Access rule (single source of truth):
- accept only
ThirdParty_Admin_Access(Third Party client access token), plusDataCustodian_Admin_Accessfor operators; - reject customer function-block tokens and the registration access token (403);
- ownership: only Authorizations whose
applicationInformation.clientIdequals the token'sclient_id(same rule asAdminCaller, fix(#247): export DC collection endpoints as Atom feeds instead of a bare List #250); an unknown or foreign bulk id → 404. - Move
/Batch/Bulk/**out of the generic usage-data matcher inSecurityConfiguration.
- accept only
- Data and limits: decide the feed's content per REQ.21 (UsagePoint subtree per Authorization) and add paging or size limits, since bulk responses can be large; consider streaming.
- Notification: a Third Party is told about bulk data through its notification URI (BatchList containing the Bulk URI). Confirm that the existing
NotificationServiceImplpath produces those URIs. - Tests:
- Third Party client token → 200 with only its own Authorizations' data;
- another Third Party's bulk id → 404;
- customer token → 403; registration access token → 403;
- DC admin → 200;
- the empty bulk case returns an empty feed.
Dependencies
#202 (client access token resourceURI / authorizationURI), #251 (Third Party client credentials limited to ThirdParty_Admin_Access / FB=36_40), #187 (resource scoping / E1 engine), #253 (sample data for manual testing), #255 (roadmap: Phase 2)
🤖 Generated with Claude Code
Metadata
Metadata
Assignees
Labels
NAESB ESPI StandardRequired to comply with the NAESB ESPI standardRequired to comply with the NAESB ESPI standardenhancementNew feature or requestNew feature or request
Activity