feat: Add ESPI 4.0 XSD compliance to Authorization with customerResourceURI #38
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
This PR adds ESPI 4.0 XSD compliance to the Authorization implementation by:
customerResourceURIfield for PII Subscription API accessmerge()andunlink()methods from AuthorizationEntityChanges
1. AuthorizationEntity.java (
openespi-common/.../domain/usage/)Added:
customerResourceURIfield (line 197-205) - Maps to existing database columncustomer_resource_uriRemoved:
merge()method - Only CRUD Gets supported initially, Spring Data JPA handles mergingunlink()method - Spring Data JPA cascade settings handle relationship cleanupUpdated:
toString()method to includecustomerResourceURI2. AuthorizationDto.java (
openespi-common/.../dto/usage/)BREAKING CHANGE - Complete rewrite for ESPI 4.0 XSD compliance:
New propOrder (matches ESPI 4.0 XSD lines 264-343):
Fields marked @XmlTransient (excluded from XML for security):
accessToken,refreshToken,authorizationCodestate,responseType,thirdPartyapplicationInformationId,retailCustomerIdAdded OpenAPI annotations:
@Schemaannotations with descriptions and examples3. AuthorizationMapper.java (
openespi-common/.../mapper/usage/)Updated all three mapper methods:
toDto()- Added mappings for new XSD-compliant fieldstoEntity()- Added mappings for new XSD-compliant fieldsupdateEntity()- Added mappings for new XSD-compliant fields4. pom.xml (
openespi-common/)Added dependency:
Breaking Change Details
What Changed
Before (Incorrect):
XML elements were in non-compliant order, missing several XSD-required fields
After (ESPI 4.0 Compliant):
XML elements match exact sequence defined in
espi.xsdlines 264-343Impact Assessment
✅ Likely safe:
/Authorization/*[2]) will return different elementsMigration Guide
For third-party consumers:
/Authorization/customerResourceURI(good) vs/Authorization/*[13](bad)For internal services:
Database Impact
No migration needed:
customer_resource_uricolumn already exists in V1 migration (line 279)Testing
Tests Run
Test Results
AuthorizationRepositoryTest (specific test):
Affected modules (full test suite):
Known Test Suite Issue
Note: Default
mvn testdoesn't run tests due to pre-existing surefire configuration mismatch (searches for**/*Tests.javabut files are named*Test.java). This is a separate issue not addressed in this PR. Tests were verified using-Dtest=AuthorizationRepositoryTestand module-specific testing.Other Module Test Failures
openespi-authserver has pre-existing test failures (12 failures, 123 errors) unrelated to this PR. This module is independent and does not depend on openespi-common.
XSD Compliance Verification
ESPI 4.0 XSD Reference
openespi-common/src/main/resources/schema/ESPI_4.0/espi.xsdFields Now Compliant
Security Considerations
accessToken,refreshToken) marked@XmlTransientand excluded from XML outputReferences
openespi-common/src/main/resources/schema/ESPI_4.0/espi.xsdopenespi-common/src/main/resources/db/migration/V1__Create_Base_Tables.sqlopenespi-common/src/test/resources/fixtures/Authorization-Entry-Anonymized.xmlChecklist
🤖 Generated with Claude Code