2828class VaultModule (Protocol ):
2929 def read_object (self , * , object_id : str ) -> VaultObject :
3030 """
31- Get a Vault object with the decrypted value.
31+ Get a Vault object with the value decrypted .
3232
3333 Kwargs:
3434 object_id (str): The unique identifier for the object.
@@ -81,12 +81,12 @@ def create_object(
8181 key_context : KeyContext ,
8282 ) -> ObjectMetadata :
8383 """
84- Create a new Vault object.
84+ Create a new Vault encrypted object.
8585
8686 Kwargs:
8787 name (str): The name of the object.
8888 value (str): The value to encrypt and store.
89- key_context (KeyContext): A set of key-value dictionary pairs that determines which root keys to use
89+ key_context (KeyContext): A set of key-value dictionary pairs that determines which root keys to use when encrypting data.
9090
9191 Returns:
9292 VaultObject: The created vault object.
@@ -119,7 +119,7 @@ def delete_object(
119119 object_id : str ,
120120 ) -> None :
121121 """
122- Permanently delete a Vault encrypted object.
122+ Permanently delete a Vault encrypted object. Warning: this cannont be undone.
123123
124124 Kwargs:
125125 object_id (str): The unique identifier for the object.
@@ -132,7 +132,7 @@ def create_data_key(self, *, key_context: KeyContext) -> DataKeyPair:
132132 The encrypted data key MUST be stored by the application, as it cannot be retrieved after generation.
133133
134134 Kwargs:
135- key_context (KeyContext): A set of key-value dictionary pairs that determines which root keys to use
135+ key_context (KeyContext): A set of key-value dictionary pairs that determines which root keys to use when encrypting data.
136136 """
137137 ...
138138
@@ -157,7 +157,11 @@ def decrypt_data_key(
157157 ...
158158
159159 def encrypt (
160- self , * , data : str , context : KeyContext , associated_data : Optional [str ] = None
160+ self ,
161+ * ,
162+ data : str ,
163+ key_context : KeyContext ,
164+ associated_data : Optional [str ] = None ,
161165 ) -> str :
162166 """
163167 Encrypt data locally using AES-GCM with a data key derived from the provided context.
@@ -168,7 +172,7 @@ def encrypt(
168172
169173 Kwargs:
170174 data (str): The plaintext data to encrypt.
171- context (KeyContext): A set of key-value dictionary pairs that determines which root keys to use for key derivation .
175+ key_context (KeyContext): A set of key-value dictionary pairs that determines which root keys to use when encrypting data .
172176 associated_data (str): Additional authenticated data (AAD) that will be authenticated but not encrypted. (Optional)
173177
174178 Returns:
@@ -382,9 +386,13 @@ def decrypt_data_key(
382386 )
383387
384388 def encrypt (
385- self , * , data : str , context : KeyContext , associated_data : Optional [str ] = None
389+ self ,
390+ * ,
391+ data : str ,
392+ key_context : KeyContext ,
393+ associated_data : Optional [str ] = None ,
386394 ) -> str :
387- key_pair = self .create_data_key (key_context = context )
395+ key_pair = self .create_data_key (key_context = key_context )
388396
389397 key = self ._base64_to_bytes (key_pair .data_key .key )
390398 key_blob = self ._base64_to_bytes (key_pair .encrypted_keys )
0 commit comments