Skip to content

feat(marketplace-entitlement): emulate AWS Marketplace Entitlement API - #3340

Merged
pgermosen merged 1 commit into
floci-io:mainfrom
KenkoGeek:feat/marketplace-entitlement
Sep 10, 2026
Merged

feat(marketplace-entitlement): emulate AWS Marketplace Entitlement API#3340
pgermosen merged 1 commit into
floci-io:mainfrom
KenkoGeek:feat/marketplace-entitlement

Conversation

@KenkoGeek

Copy link
Copy Markdown
Contributor

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

  • Bug fix (fix:)
  • New feature (feat:)
  • Breaking change (feat!: or fix!:)
  • Docs / chore

AWS Compatibility

Reviewed against the current AWS Marketplace Entitlement Service API reference and SDK wire contract. The handler exposes only GetEntitlements and preserves the documented regional restriction. make docs-check and git diff --check pass. Heavy local Maven execution was intentionally not run on this machine; CI is expected to execute the full test suite.

Checklist

  • ./mvnw test passes locally
  • New or updated integration test added
  • Commit messages follow Conventional Commits

@greptile-apps

greptile-apps Bot commented Sep 10, 2026

Copy link
Copy Markdown

Greptile Summary

Adds AWS Marketplace Entitlement Service emulation through the shared AWS JSON routing infrastructure.

  • Implements GetEntitlements with validation, filtering, deterministic pagination, persistent account-aware storage, and the us-east-1 restriction.
  • Registers Marketplace Entitlement protocol targets and CBOR/JSON routing.
  • Adds unit, integration, and AWS SDK compatibility coverage.
  • Updates generated service metadata and Marketplace documentation.

Confidence Score: 5/5

The PR appears safe to merge; no actionable new failures remain, and all previous findings are resolved.

The implementation now includes the required service layers and tests, rejects overflowing MaxResults values before integer narrowing, and exposes pre-seeded entitlement state through account-aware persistence. All previous review threads were manually resolved.

Important Files Changed

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
Loading

Reviews (7): Last reviewed commit: "feat(marketplace-entitlement): emulate A..." | Re-trigger Greptile

@github-actions

Copy link
Copy Markdown

🎉 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:

  • Link the issue this fixes with Closes #N in the description
  • Commits follow Conventional Commits (feat(s3): ..., fix(dynamodb): ...)
  • Behaviour changes come with a test — see CONTRIBUTING.md

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.

@github-actions github-actions Bot added the over-pr-limit Author has more than 5 open PRs — advisory only label Sep 10, 2026
@github-actions

Copy link
Copy Markdown

👋 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 over-pr-limit label helps maintainers see at a glance which PRs to prioritize.

If some of these PRs are stacked or intentionally related, just say so here and a maintainer will take that into account.

@KenkoGeek
KenkoGeek force-pushed the feat/marketplace-entitlement branch 2 times, most recently from 116678d to 237b10d Compare September 10, 2026 05:14
@KenkoGeek

Copy link
Copy Markdown
Contributor Author

Addressed the review while keeping the public surface AWS-compatible. The Marketplace Entitlement Service is read-only in AWS (GetEntitlements is its only public operation), so this PR intentionally does not add a custom mutation endpoint. I removed the dead internal writer, added service-level coverage that pre-seeds the account-aware marketplace-entitlements.json backend, and documented the persistent/pre-seeded state path for local environments. The Controller/model layers and ServiceTest are also now present in 237b10d.

@hectorvent hectorvent added enhancement New feature or request marketplace AWS marketplace labels Sep 10, 2026
@KenkoGeek
KenkoGeek force-pushed the feat/marketplace-entitlement branch from 237b10d to 13bc253 Compare September 10, 2026 13:47

@pgermosen pgermosen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@pgermosen pgermosen added the waiting-author Review posted; waiting on the PR author to respond label Sep 10, 2026
@KenkoGeek
KenkoGeek force-pushed the feat/marketplace-entitlement branch 2 times, most recently from 2940a0c to 1681c68 Compare September 10, 2026 15:29

@pgermosen pgermosen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@KenkoGeek
KenkoGeek force-pushed the feat/marketplace-entitlement branch from c255e82 to 6568bf4 Compare September 10, 2026 18:40

@pgermosen pgermosen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@pgermosen pgermosen removed the waiting-author Review posted; waiting on the PR author to respond label Sep 10, 2026
@pgermosen
pgermosen merged commit 87f2c2d into floci-io:main Sep 10, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request marketplace AWS marketplace over-pr-limit Author has more than 5 open PRs — advisory only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants