Secure and extensible credential management SDK for Python applications.
Project description
🔐 infra-core-sdk
Secure and extensible credential management SDK for Python applications.
🚀 Features
- 🔐 Automatic encryption (Fernet)
- 📦 Multiple credential support (
name) - ⚙️ Decoupled setup and load flows
- 📁 Automatic path management
- 🧩 Modular and extensible architecture
📦 Installation
pip install infra-core-sdk
🧩 Usage
🔹 Define your credentials model
from dataclasses import dataclass
from infra_core import BaseCredentials
@dataclass(frozen=True)
class MyCreds(BaseCredentials):
api_token: str
🔹 Save credentials (setup)
from infra_core import FernetEncryption
from infra_core.credentials.setup.credentials_setup_service import CredentialsSetupService
setup = CredentialsSetupService(FernetEncryption)
setup.setup(
MyCreds(api_token="123"),
name="pipefy"
)
🔹 Load credentials
from infra_core import CredentialsLoader, FernetEncryption
creds = CredentialsLoader.load(
MyCreds,
FernetEncryption,
name="pipefy"
)
print(creds.api_token)
📁 Generated structure
your_project/
├── secret/
│ ├── secret.key
│ ├── pipefy.json
🔄 Multiple credentials
setup.setup(..., name="aws")
setup.setup(..., name="stripe")
🔐 Encryption
Default
from infra_core import FernetEncryption
Custom implementation
class CustomEncryption:
def encrypt(self, value: str) -> str:
...
def decrypt(self, value: str) -> str:
...
⚠️ Important rules
❌ Do NOT manually create keys
Fernet.generate_key()
FernetEncryption(key)
✅ Let the SDK manage it
CredentialsSetupService(FernetEncryption)
🧠 How it works
SETUP:
→ generates key
→ encrypts data
→ saves file
LOAD:
→ reads key
→ decrypts data
→ returns typed object
🧪 Development
pip install -e .[dev]
pytest
📄 License
MIT
👨💻 Author
Rafael Cavalcante
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
infra_core_sdk-0.1.1.tar.gz
(15.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file infra_core_sdk-0.1.1.tar.gz.
File metadata
- Download URL: infra_core_sdk-0.1.1.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5fecd1bfd1f08d5195ec32050db542eb28bf9287969a44adc4ad3569ea2b822a
|
|
| MD5 |
2ae21873b92f600f0ca6997e84326ff1
|
|
| BLAKE2b-256 |
9e5d38fdf34145cc0a5cbf4c0125ae54e9b74854a3e0be201b99a8daeaac8eea
|
File details
Details for the file infra_core_sdk-0.1.1-py3-none-any.whl.
File metadata
- Download URL: infra_core_sdk-0.1.1-py3-none-any.whl
- Upload date:
- Size: 20.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db58a7ed0e1182d1a75ce0e1124274b5bcdab54d99e5e997e6a3831112e0a05b
|
|
| MD5 |
4e383f76d786e652de95b7b3da2308d3
|
|
| BLAKE2b-256 |
e8bd4fddc0f83c03eea8f91344902aa5c66f624f8ba7de7fcb3df9d8aa083d31
|