Skip to content

Reject non-integer Advanced Commerce offer period counts - #216

Open
Shubham-Padkonde wants to merge 1 commit into
apple:mainfrom
Shubham-Padkonde:fix/integer-period-count
Open

Shubham-Padkonde wants to merge 1 commit into
apple:mainfrom
Shubham-Padkonde:fix/integer-period-count

Conversation

@Shubham-Padkonde

Copy link
Copy Markdown

AdvancedCommerceOffer(periodCount=1.5, ...), periodCount=float('nan'), and periodCount=True currently pass validation even though the API requires an integer number of periods. Range comparisons alone do not enforce that contract, and comparisons with NaN are both false.

Require an integer, excluding booleans, before checking the existing 1–12 range. Tests cover constructing the public model with invalid values and every valid period count. Six regression cases fail before the change.

Validation: 223 offline tests pass on Python 3.12. The full 224-test run has one unrelated live OCSP connection-reset error (test_apple_chain_is_valid_with_ocsp_and_strict); the remaining tests pass.

This branch has not been deployed

No deployments
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