Skip to content

Commit e8a2ac3

Browse files
Throw ValueError if environment not one of the supported values
Python does not enforce typing, meaning invalid types are possible
1 parent 3172236 commit e8a2ac3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

appstoreserverlibrary/api_client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,8 +466,10 @@ def __init__(self, signing_key: bytes, key_id: str, issuer_id: str, bundle_id: s
466466
self._base_url = "https://api.storekit.itunes.apple.com"
467467
elif environment == Environment.LOCAL_TESTING:
468468
self._base_url = "https://local-testing-base-url"
469-
else:
469+
elif environment == Environment.SANDBOX:
470470
self._base_url = "https://api.storekit-sandbox.itunes.apple.com"
471+
else:
472+
raise ValueError("Invalid environment provided")
471473
self._signing_key = serialization.load_pem_private_key(signing_key, password=None, backend=default_backend())
472474
self._key_id = key_id
473475
self._issuer_id = issuer_id

0 commit comments

Comments
 (0)