Skip to content

feat: Add enableProductPurchaseLegacyApi option to disable legacy IAP validation#10228

Merged
mtrezza merged 1 commit intoparse-community:alphafrom
mtrezza:fix/deprecate-iap-validation-api
Mar 17, 2026
Merged

feat: Add enableProductPurchaseLegacyApi option to disable legacy IAP validation#10228
mtrezza merged 1 commit intoparse-community:alphafrom
mtrezza:fix/deprecate-iap-validation-api

Conversation

@mtrezza
Copy link
Member

@mtrezza mtrezza commented Mar 17, 2026

Issue

Add server option enableProductPurchaseLegacyApi to control the legacy product purchase API (_Product class and /validate_purchase endpoint). The option defaults to true for backward compatibility and is immediately deprecated. The entire feature will be removed in a future major version.

Tasks

  • Add new tests
  • Add changes to documentation (guides, changelogs, code comments, etc.)

Summary by CodeRabbit

  • Documentation

    • Added deprecation notice for the legacy product purchase API, warning it will be removed in a future major version.
    • Introduced configuration option enableProductPurchaseLegacyApi to control the legacy API behavior.
  • Tests

    • Added test coverage for deprecation logging and endpoint enablement/disablement validation.

…AP validation

Add server option to control the legacy product purchase API (`_Product` class and `/validate_purchase` endpoint). The option defaults to `true` for backward compatibility and is immediately deprecated. The entire feature will be removed in a future major version.
@parse-github-assistant
Copy link

🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review.

Tip

  • Keep pull requests small. Large PRs will be rejected. Break complex features into smaller, incremental PRs.
  • Use Test Driven Development. Write failing tests before implementing functionality. Ensure tests pass.
  • Group code into logical blocks. Add a short comment before each block to explain its purpose.
  • We offer conceptual guidance. Coding is up to you. PRs must be merge-ready for human review.
  • Our review focuses on concept, not quality. PRs with code issues will be rejected. Use an AI agent.
  • Human review time is precious. Avoid review ping-pong. Inspect and test your AI-generated code.

Note

Please respond to review comments from AI agents just like you would to comments from a human reviewer. Let the reviewer resolve their own comments, unless they have reviewed and accepted your commit, or agreed with your explanation for why the feedback was incorrect.

Caution

Pull requests must be written using an AI agent with human supervision. Pull requests written entirely by a human will likely be rejected, because of lower code quality, higher review effort and the higher risk of introducing bugs. Please note that AI review comments on this pull request alone do not satisfy this requirement.

@parseplatformorg
Copy link
Contributor

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@coderabbitai
Copy link

coderabbitai bot commented Mar 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a2622a37-bf31-4b7a-8b87-e0bade80b8dd

📥 Commits

Reviewing files that changed from the base of the PR and between 1551faa and 39d8dad.

📒 Files selected for processing (7)
  • spec/Deprecator.spec.js
  • spec/PurchaseValidation.spec.js
  • src/Deprecator/Deprecations.js
  • src/Options/Definitions.js
  • src/Options/docs.js
  • src/Options/index.js
  • src/ParseServer.ts

📝 Walkthrough

Walkthrough

This pull request introduces deprecation infrastructure for the legacy product purchase API. A new configuration option enableProductPurchaseLegacyApi is added to the Parse Server options system with deprecation warnings, the IAPValidationRouter is conditionally mounted based on this flag, and comprehensive tests validate both the deprecation logging and route behavior.

Changes

Cohort / File(s) Summary
Deprecation System
spec/Deprecator.spec.js, src/Deprecator/Deprecations.js
Added deprecation entry for enableProductPurchaseLegacyApi with solution text advising against use of the undocumented legacy API. New tests verify deprecation logging behavior when the flag is set or absent.
Configuration Options
src/Options/Definitions.js, src/Options/docs.js, src/Options/index.js
Added new boolean option enableProductPurchaseLegacyApi to the ParseServerOptions configuration schema with environment variable binding (PARSE_SERVER_ENABLE_PRODUCT_PURCHASE_LEGACY_API), default value of true, and deprecation notice in documentation.
Route Management & Testing
src/ParseServer.ts, spec/PurchaseValidation.spec.js
Modified router initialization to conditionally include IAPValidationRouter only when enableProductPurchaseLegacyApi is not explicitly false. Added tests verifying endpoint disablement based on the flag and default behavior.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding an option to control/disable the legacy IAP validation feature, which aligns with the core purpose of this PR.
Description check ✅ Passed The description covers the issue and approach with clear task completion marks, though it does not explicitly address the full template structure with all optional sections like security checks.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.60%. Comparing base (1551faa) to head (39d8dad).
⚠️ Report is 2 commits behind head on alpha.

Additional details and impacted files
@@           Coverage Diff           @@
##            alpha   #10228   +/-   ##
=======================================
  Coverage   92.60%   92.60%           
=======================================
  Files         192      192           
  Lines       16322    16324    +2     
  Branches      199      200    +1     
=======================================
+ Hits        15115    15117    +2     
  Misses       1190     1190           
  Partials       17       17           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mtrezza mtrezza merged commit 622ee85 into parse-community:alpha Mar 17, 2026
22 of 24 checks passed
parseplatformorg pushed a commit that referenced this pull request Mar 17, 2026
# [9.6.0-alpha.33](9.6.0-alpha.32...9.6.0-alpha.33) (2026-03-17)

### Features

* Add `enableProductPurchaseLegacyApi` option to disable legacy IAP validation ([#10228](#10228)) ([622ee85](622ee85))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 9.6.0-alpha.33

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

Labels

state:released-alpha Released as alpha version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants