You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This method will add the field level encryption in the generated OpenApi client, taking care of encrypting request and decrypting response payloads, but also of updating HTTP headers when needed, automatically, without manually calling `encrypt_payload()`/`decrypt_payload()` functions for each API request or response.
# requests and responses will be automatically encrypted and decrypted
295
295
# accordingly with the configuration object used
296
296
297
297
# ... use the (decrypted) response object here ...
298
298
decrypted = response.json()
299
299
300
300
```
301
+
302
+
##### Usage of both `add_signing_layer` and `add_encryption_layer`:
303
+
304
+
In order to use both signing and encryption layers, a defined order is required as signing library should calculate the hash of the encrypted payload.
305
+
According to the above the signing layer must be applied first in order to work as inner layer. The outer layer - encryption - will be executed first, providing the signing layer the encrypted payload to sign.
306
+
307
+
Example:
308
+
309
+
```python
310
+
from oauth1.signer_interceptor import add_signing_layer
311
+
from client_encryption.field_level_encryption_config import FieldLevelEncryptionConfig
312
+
from client_encryption.api_encryption import add_encryption_layer
313
+
from swagger_client.api_client import ApiClient # import generated swagger ApiClient
0 commit comments