Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /MTSWebServices_syncmaster /syncmaster /settings /credentials.py
| # SPDX-FileCopyrightText: 2023-present MTS PJSC | |
| # SPDX-License-Identifier: Apache-2.0 | |
| import textwrap | |
| from pydantic import BaseModel, Field | |
| class CredentialsEncryptionSettings(BaseModel): | |
| """Settings for encrypting & decrypting credential data stored in database. | |
| Connecting to source and target databases, file systems and so on requires credentials to be passed. | |
| For now, SyncMaster stores all credentials in database table `credentials`, in encrypted form. | |
| This is done by symmetric algorithm [Fernet](https://cryptography.io/en/latest/fernet/). | |
| Before starting SyncMaster, generate a new key using the following example: | |
| ```python | |
| >>> from cryptography.fernet import Fernet | |
| >>> Fernet.generate_key().decode('utf-8') | |
| UBgPTioFrtH2unlC4XFDiGf5sYfzbdSf_VgiUSaQc94= | |
| ``` | |
| Examples | |
| -------- | |
| ```yaml title="config.yml" | |
| encryption: | |
| secret_key: UBgPTioFrtH2unlC4XFDiGf5sYfzbdSf_VgiUSaQc94= | |
| ``` | |
| """ | |
| secret_key: str = Field( | |
| description=textwrap.dedent( | |
| "Secret key for encrypting/decrypting credentials stored in database.", | |
| ), | |
| ) | |
Xet Storage Details
- Size:
- 1.14 kB
- Xet hash:
- be75541d7b004d7165d897fb35585cbfc196832f687c47fa7dbb2b9f9e94dfa7
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.