Skip to content

feat(suggestions): block auto-fix for AEM Edge sites on PLG and FREE_TRIAL tiers#2271

Open
ravverma wants to merge 3 commits intomainfrom
feat/block-autofix-aem-edge-plg-free-trial
Open

feat(suggestions): block auto-fix for AEM Edge sites on PLG and FREE_TRIAL tiers#2271
ravverma wants to merge 3 commits intomainfrom
feat/block-autofix-aem-edge-plg-free-trial

Conversation

@ravverma
Copy link
Copy Markdown
Contributor

Summary

  • Blocks the autofixSuggestions endpoint for AEM Edge sites enrolled on PLG or FREE_TRIAL ASO tiers, returning a 403 unauthorized response to the frontend
  • Uses TierClient.createForSite + checkValidEntitlement() to resolve both the entitlement tier and active site enrollment — the block only fires when both are present (entitlement tier is PLG/FREE_TRIAL and siteEnrollment is non-null)
  • Logs a warn message with the site ID for observability: Auto-fix blocked for site {siteId}: not supported for AEM Edge sites on PLG tier
  • Fails open: if the entitlement check itself throws, a warn is logged and the request proceeds normally
  • 100% branch and statement coverage on suggestions.js; 3 new tests cover PLG block, FREE_TRIAL block, and the no-enrollment pass-through case

…TRIAL tiers

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ravverma ravverma requested a review from solaris007 April 27, 2026 09:41
@ravverma
Copy link
Copy Markdown
Contributor Author

@solaris007 from review POV,
these two PRs will not be released
#2267
https://github.com/adobe/spacecat-auth-service/pull/557
I have created this one to fix the flow
thanks
cc: @mimchome

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions
Copy link
Copy Markdown

This PR will trigger a minor release when merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant