4.2.1
Release 4.2.1 (#238)
This release updates the OAuthScopes enum and its usage to synchronize with the current Checkout.com API specification, remove deprecated scopes, and improve test coverage. The main focus is on aligning the SDK's OAuth scope definitions with the official API spec, removing outdated values, adding missing ones, and ensuring correctness through comprehensive tests.
OAuth scope enum updates:
- Added missing scopes to
OAuthScopes, includingCOMPLIANCE_REQUESTS,COMPLIANCE_REQUESTS_READ,COMPLIANCE_REQUESTS_RESPOND, andVAULT_TOKENS_METADATA, which are required by some API operations but were not previously declared. [1] [2] - Removed deprecated or retired scopes such as
ISSUING_CARD_MGMT,ISSUING_CLIENT,MARKETPLACE,MIDDLEWARE_GATEWAY,MIDDLEWARE_PAYMENT_CONTEXT, and ensured remaining scopes are alphabetically ordered for maintainability. - Added a detailed docstring to the
OAuthScopesenum explaining its correspondence to the API spec and clarifying subtle differences between similar scopes.
Test improvements and validation:
- Added new tests to
tests/oauth_scopes_test.pyto verify that all documented and newly added scopes are present, distinguish between similar but distinct scopes, and ensure every enum member has a unique, non-blank wire value. - Introduced checks to guarantee that enum members remain alphabetically ordered and no duplicate wire values exist, preventing subtle bugs and improving maintainability.
Integration test updates:
- Updated integration tests to use the correct, non-retired scopes (
ACCOUNTSinstead ofMARKETPLACEfor payout schedules, andISSUING_CARD_MANAGEMENT_READ/WRITEinstead of retired issuing scopes), with comments explaining the changes and referencing the API spec. [1] [2]