feat(marketplace-entitlement): emulate AWS Marketplace Entitlement API - #3340
Conversation
|
| Filename | Overview |
|---|---|
| src/main/java/io/github/hectorvent/floci/services/marketplace/MarketplaceEntitlementService.java | Implements validated, filtered, deterministic, account-aware retrieval and pagination for entitlement records. |
| src/main/java/io/github/hectorvent/floci/services/marketplace/MarketplaceEntitlementController.java | Dispatches the supported GetEntitlements operation to the service layer. |
| src/main/java/io/github/hectorvent/floci/core/common/ResolvedServiceCatalog.java | Registers the Marketplace Entitlement target and supported shared protocols. |
| src/main/java/io/github/hectorvent/floci/core/common/AwsJson11Controller.java | Routes Marketplace Entitlement JSON 1.1 requests to the new controller. |
| src/main/java/io/github/hectorvent/floci/core/common/AwsJsonCborController.java | Adds Marketplace Entitlement dispatch for the shared JSON/CBOR path. |
| src/test/java/io/github/hectorvent/floci/services/marketplace/MarketplaceEntitlementServiceTest.java | Covers persisted filtering, numeric validation, overflow rejection, product constraints, and regional restrictions. |
| src/test/java/io/github/hectorvent/floci/services/marketplace/MarketplaceEntitlementIntegrationTest.java | Verifies routing, AWS-style errors, empty results, filter validation, and regional enforcement. |
| compatibility-tests/sdk-test-java/src/test/java/com/floci/test/MarketplaceEntitlementTest.java | Confirms compatibility with the AWS SDK Marketplace Entitlement wire contract. |
Sequence Diagram
sequenceDiagram
participant SDK as AWS SDK Client
participant Router as Shared AWS JSON Router
participant Controller as MarketplaceEntitlementController
participant Service as MarketplaceEntitlementService
participant Storage as AccountAwareStorageBackend
SDK->>Router: AWSMPEntitlementService.GetEntitlements
Router->>Controller: handle(action, request, region)
Controller->>Service: getEntitlements(request, region)
Service->>Service: Validate region, filters, pagination
Service->>Storage: Scan product-scoped entitlements
Storage-->>Service: Account-isolated records
Service->>Service: Filter, sort, and paginate
Service-->>Controller: Entitlements and optional NextToken
Controller-->>SDK: HTTP 200 AWS JSON response
Reviews (7): Last reviewed commit: "feat(marketplace-entitlement): emulate A..." | Re-trigger Greptile
|
🎉 Thanks for your first pull request to Floci! Your CI checks need a maintainer to approve them before they run. That is GitHub's standard gate on first-time contributors, not a problem with your PR — so if the checks look like they are doing nothing, that is why. Once a maintainer approves, CI and the compatibility suite start automatically. Nothing is needed from you in the meantime. While you wait, a couple of things that make review faster:
Come join us in Slack — it is the fastest way to reach maintainers if you get stuck, or want feedback on an approach before investing more time in it. |
|
👋 Thanks for the pull request! It looks like you now have 10 open pull requests in this repository, which is above our advisory limit of 5. To keep the review backlog focused and make sure every contribution gets proper attention, we ask contributors to shepherd their existing PRs to the finish line before opening new ones — responding to review feedback, rebasing, or closing any that are no longer needed. Here is your list of open PRs. Nothing is blocked and this PR stays open — this is just a friendly nudge. The If some of these PRs are stacked or intentionally related, just say so here and a maintainer will take that into account. |
116678d to
237b10d
Compare
|
Addressed the review while keeping the public surface AWS-compatible. The Marketplace Entitlement Service is read-only in AWS ( |
237b10d to
13bc253
Compare
pgermosen
left a comment
There was a problem hiding this comment.
Checked GetEntitlements against the live API reference: ProductCode bounds, the four filter keys, the CustomerIdentifier/CustomerAWSAccountId mutual exclusivity, the union-within-a-key/intersect-across-keys filter semantics, MaxResults bounds, the InvalidParameterException error type, and the us-east-1-only restriction (verified that independently too) all match exactly. Nice work.
Two things. MarketplaceEntitlementRecord is a new model class that's never referenced anywhere in this diff, MarketplaceEntitlementService works directly on JsonNode instead, so it looks like a leftover from an earlier draft. Worth wiring it up or dropping it.
This also needs a rebase against main: #3338 (Marketplace Catalog) merged first and landed the same marketplace.md, MarketplaceServiceConfig, and marketplace catalog-descriptor entries this PR also adds.
2940a0c to
1681c68
Compare
pgermosen
left a comment
There was a problem hiding this comment.
This has conflicts now, both #3338 and #3339 landed since and they touch the same marketplace.md/EmulatorConfig/ResolvedServiceCatalog spots this PR does. Same fix as those two needed: one combined "marketplace" descriptor carrying Catalog's REST_JSON controller, Agreement's JSON target prefix, and this one's JSON+CBOR/AWSMPEntitlementService prefix together, plus one merged docs page.
Good news, MarketplaceEntitlementRecord is wired up now, that's resolved.
1681c68 to
c255e82
Compare
c255e82 to
6568bf4
Compare
pgermosen
left a comment
There was a problem hiding this comment.
Confirmed the rebase landed cleanly: one combined descriptor with all three protocols and both target prefixes, no duplication, and MarketplaceEntitlementRecord is wired up. The no-write-path resolution is the right call too, real GetEntitlements has no corresponding write API either, so removing the dead writer and documenting pre-seeding the persistent backend instead of inventing a non-AWS endpoint matches how AWS actually works. Approving.
Summary
Adds AWS Marketplace Entitlement Service emulation as an independent Marketplace API-family contribution. Includes GetEntitlements routing, filters, pagination, account-aware persistence, us-east-1 restriction, integration coverage, docs, and an AWS SDK compatibility smoke test.
This is one of the API-family splits of the previous combined Marketplace contribution (#3303).
Type of change
fix:)feat:)feat!:orfix!:)AWS Compatibility
Reviewed against the current AWS Marketplace Entitlement Service API reference and SDK wire contract. The handler exposes only
GetEntitlementsand preserves the documented regional restriction.make docs-checkandgit diff --checkpass. Heavy local Maven execution was intentionally not run on this machine; CI is expected to execute the full test suite.Checklist
./mvnw testpasses locally