Show More
@@ -64,7 +64,7 b' from rhodecode.lib.jsonalchemy import Mu' | |||||
64 | JsonRaw |
|
64 | JsonRaw | |
65 | from rhodecode.lib.ext_json import json |
|
65 | from rhodecode.lib.ext_json import json | |
66 | from rhodecode.lib.caching_query import FromCache |
|
66 | from rhodecode.lib.caching_query import FromCache | |
67 |
from rhodecode.lib.encrypt import AESCipher, validate_and_ |
|
67 | from rhodecode.lib.encrypt import AESCipher, validate_and_decrypt_data | |
68 | from rhodecode.lib.encrypt2 import Encryptor |
|
68 | from rhodecode.lib.encrypt2 import Encryptor | |
69 | from rhodecode.lib.exceptions import ( |
|
69 | from rhodecode.lib.exceptions import ( | |
70 | ArtifactMetadataDuplicate, ArtifactMetadataBadValueType) |
|
70 | ArtifactMetadataDuplicate, ArtifactMetadataBadValueType) | |
@@ -197,7 +197,7 b' class EncryptedTextValue(TypeDecorator):' | |||||
197 | algo = rhodecode.CONFIG.get('rhodecode.encrypted_values.algorithm') or 'aes' |
|
197 | algo = rhodecode.CONFIG.get('rhodecode.encrypted_values.algorithm') or 'aes' | |
198 | enc_strict_mode = str2bool(rhodecode.CONFIG.get('rhodecode.encrypted_values.strict') or True) |
|
198 | enc_strict_mode = str2bool(rhodecode.CONFIG.get('rhodecode.encrypted_values.strict') or True) | |
199 | if algo == 'aes': |
|
199 | if algo == 'aes': | |
200 |
decrypted_data = validate_and_ |
|
200 | decrypted_data = validate_and_decrypt_data(value, ENCRYPTION_KEY, enc_strict_mode) | |
201 | elif algo == 'fernet': |
|
201 | elif algo == 'fernet': | |
202 | return Encryptor(ENCRYPTION_KEY).decrypt(value) |
|
202 | return Encryptor(ENCRYPTION_KEY).decrypt(value) | |
203 | else: |
|
203 | else: |
@@ -64,7 +64,7 b' from rhodecode.lib.jsonalchemy import Mu' | |||||
64 | JsonRaw |
|
64 | JsonRaw | |
65 | from rhodecode.lib.ext_json import json |
|
65 | from rhodecode.lib.ext_json import json | |
66 | from rhodecode.lib.caching_query import FromCache |
|
66 | from rhodecode.lib.caching_query import FromCache | |
67 |
from rhodecode.lib.encrypt import AESCipher, validate_and_ |
|
67 | from rhodecode.lib.encrypt import AESCipher, validate_and_decrypt_data | |
68 | from rhodecode.lib.encrypt2 import Encryptor |
|
68 | from rhodecode.lib.encrypt2 import Encryptor | |
69 | from rhodecode.lib.exceptions import ( |
|
69 | from rhodecode.lib.exceptions import ( | |
70 | ArtifactMetadataDuplicate, ArtifactMetadataBadValueType) |
|
70 | ArtifactMetadataDuplicate, ArtifactMetadataBadValueType) | |
@@ -197,7 +197,7 b' class EncryptedTextValue(TypeDecorator):' | |||||
197 | algo = rhodecode.CONFIG.get('rhodecode.encrypted_values.algorithm') or 'aes' |
|
197 | algo = rhodecode.CONFIG.get('rhodecode.encrypted_values.algorithm') or 'aes' | |
198 | enc_strict_mode = str2bool(rhodecode.CONFIG.get('rhodecode.encrypted_values.strict') or True) |
|
198 | enc_strict_mode = str2bool(rhodecode.CONFIG.get('rhodecode.encrypted_values.strict') or True) | |
199 | if algo == 'aes': |
|
199 | if algo == 'aes': | |
200 |
decrypted_data = validate_and_ |
|
200 | decrypted_data = validate_and_decrypt_data(value, ENCRYPTION_KEY, enc_strict_mode) | |
201 | elif algo == 'fernet': |
|
201 | elif algo == 'fernet': | |
202 | return Encryptor(ENCRYPTION_KEY).decrypt(value) |
|
202 | return Encryptor(ENCRYPTION_KEY).decrypt(value) | |
203 | else: |
|
203 | else: |
@@ -64,7 +64,7 b' from rhodecode.lib.jsonalchemy import Mu' | |||||
64 | JsonRaw |
|
64 | JsonRaw | |
65 | from rhodecode.lib.ext_json import json |
|
65 | from rhodecode.lib.ext_json import json | |
66 | from rhodecode.lib.caching_query import FromCache |
|
66 | from rhodecode.lib.caching_query import FromCache | |
67 |
from rhodecode.lib.encrypt import AESCipher, validate_and_ |
|
67 | from rhodecode.lib.encrypt import AESCipher, validate_and_decrypt_data | |
68 | from rhodecode.lib.encrypt2 import Encryptor |
|
68 | from rhodecode.lib.encrypt2 import Encryptor | |
69 | from rhodecode.lib.exceptions import ( |
|
69 | from rhodecode.lib.exceptions import ( | |
70 | ArtifactMetadataDuplicate, ArtifactMetadataBadValueType) |
|
70 | ArtifactMetadataDuplicate, ArtifactMetadataBadValueType) | |
@@ -197,7 +197,7 b' class EncryptedTextValue(TypeDecorator):' | |||||
197 | algo = rhodecode.CONFIG.get('rhodecode.encrypted_values.algorithm') or 'aes' |
|
197 | algo = rhodecode.CONFIG.get('rhodecode.encrypted_values.algorithm') or 'aes' | |
198 | enc_strict_mode = str2bool(rhodecode.CONFIG.get('rhodecode.encrypted_values.strict') or True) |
|
198 | enc_strict_mode = str2bool(rhodecode.CONFIG.get('rhodecode.encrypted_values.strict') or True) | |
199 | if algo == 'aes': |
|
199 | if algo == 'aes': | |
200 |
decrypted_data = validate_and_ |
|
200 | decrypted_data = validate_and_decrypt_data(value, ENCRYPTION_KEY, enc_strict_mode) | |
201 | elif algo == 'fernet': |
|
201 | elif algo == 'fernet': | |
202 | return Encryptor(ENCRYPTION_KEY).decrypt(value) |
|
202 | return Encryptor(ENCRYPTION_KEY).decrypt(value) | |
203 | else: |
|
203 | else: |
@@ -64,7 +64,7 b' from rhodecode.lib.jsonalchemy import Mu' | |||||
64 | JsonRaw |
|
64 | JsonRaw | |
65 | from rhodecode.lib.ext_json import json |
|
65 | from rhodecode.lib.ext_json import json | |
66 | from rhodecode.lib.caching_query import FromCache |
|
66 | from rhodecode.lib.caching_query import FromCache | |
67 |
from rhodecode.lib.encrypt import AESCipher, validate_and_ |
|
67 | from rhodecode.lib.encrypt import AESCipher, validate_and_decrypt_data | |
68 | from rhodecode.lib.encrypt2 import Encryptor |
|
68 | from rhodecode.lib.encrypt2 import Encryptor | |
69 | from rhodecode.lib.exceptions import ( |
|
69 | from rhodecode.lib.exceptions import ( | |
70 | ArtifactMetadataDuplicate, ArtifactMetadataBadValueType) |
|
70 | ArtifactMetadataDuplicate, ArtifactMetadataBadValueType) | |
@@ -202,7 +202,7 b' class EncryptedTextValue(TypeDecorator):' | |||||
202 | algo = rhodecode.CONFIG.get('rhodecode.encrypted_values.algorithm') or 'aes' |
|
202 | algo = rhodecode.CONFIG.get('rhodecode.encrypted_values.algorithm') or 'aes' | |
203 | enc_strict_mode = str2bool(rhodecode.CONFIG.get('rhodecode.encrypted_values.strict') or True) |
|
203 | enc_strict_mode = str2bool(rhodecode.CONFIG.get('rhodecode.encrypted_values.strict') or True) | |
204 | if algo == 'aes': |
|
204 | if algo == 'aes': | |
205 |
decrypted_data = validate_and_ |
|
205 | decrypted_data = validate_and_decrypt_data(value, ENCRYPTION_KEY, enc_strict_mode) | |
206 | elif algo == 'fernet': |
|
206 | elif algo == 'fernet': | |
207 | return Encryptor(ENCRYPTION_KEY).decrypt(value) |
|
207 | return Encryptor(ENCRYPTION_KEY).decrypt(value) | |
208 | else: |
|
208 | else: |
General Comments 0
You need to be logged in to leave comments.
Login now