- exception worldline.connect.sdk.webhooks.api_version_mismatch_exception.ApiVersionMismatchException(event_api_version: str, sdk_api_version: str)[source]¶
Bases:
RuntimeErrorRepresents an error because a webhooks event has an API version that this version of the SDK does not support.
- property event_api_version: str¶
- Returns:
The API version from the webhooks event.
- property sdk_api_version: str¶
- Returns:
The API version that this version of the SDK supports.
- class worldline.connect.sdk.webhooks.in_memory_secret_key_store.InMemorySecretKeyStore[source]¶
Bases:
SecretKeyStoreAn in-memory secret key store. This implementation can be used in applications where secret keys can be specified at application startup.
- __abstractmethods__ = frozenset({})¶
- __annotations__ = {}¶
- get_secret_key(key_id: str) str[source]¶
- Returns:
The secret key for the given key ID. Never None.
- Raises:
SecretKeyNotAvailableException – If the secret key for the given key ID is not available.
- static instance() InMemorySecretKeyStore[source]¶
- exception worldline.connect.sdk.webhooks.secret_key_not_available_exception.SecretKeyNotAvailableException(key_id: str, message: str | None = None, cause: Exception | None = None)[source]¶
Bases:
SignatureValidationExceptionRepresents an error that causes a secret key to not be available.
- property key_id: str¶
- class worldline.connect.sdk.webhooks.secret_key_store.SecretKeyStore[source]¶
Bases:
ABCA store of secret keys. Implementations could store secret keys in a database, on disk, etc.
- __abstractmethods__ = frozenset({'get_secret_key'})¶
- __annotations__ = {}¶
- abstractmethod get_secret_key(key_id: str) str[source]¶
- Returns:
The secret key for the given key ID. Never None.
- Raises:
SecretKeyNotAvailableException – If the secret key for the given key ID is not available.
- exception worldline.connect.sdk.webhooks.signature_validation_exception.SignatureValidationException(message: str | None = None, cause: Exception | None = None)[source]¶
Bases:
RuntimeErrorRepresents an error while validating webhooks signatures.
- __annotations__ = {}¶
- class worldline.connect.sdk.webhooks.signature_validator.SignatureValidator(secret_key_store: SecretKeyStore)[source]¶
Bases:
objectValidator for webhooks signatures.
- property secret_key_store: SecretKeyStore¶
- validate(body: str | bytes, request_headers: Sequence[RequestHeader]) None[source]¶
Validates the given body using the given request headers.
- Raises:
SignatureValidationException – If the body could not be validated successfully.
- class worldline.connect.sdk.webhooks.webhooks.Webhooks[source]¶
Bases:
objectWorldline Global Collect platform factory for several webhooks components.
- static v1() V1WebhooksFactory[source]¶