opensecureconf-client 1.0.2__py3-none-any.whl → 2.0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- opensecureconf_client-2.0.2.dist-info/METADATA +1289 -0
- opensecureconf_client-2.0.2.dist-info/RECORD +6 -0
- opensecureconf_client.py +477 -22
- opensecureconf_client-1.0.2.dist-info/METADATA +0 -229
- opensecureconf_client-1.0.2.dist-info/RECORD +0 -6
- {opensecureconf_client-1.0.2.dist-info → opensecureconf_client-2.0.2.dist-info}/WHEEL +0 -0
- {opensecureconf_client-1.0.2.dist-info → opensecureconf_client-2.0.2.dist-info}/licenses/LICENSE +0 -0
- {opensecureconf_client-1.0.2.dist-info → opensecureconf_client-2.0.2.dist-info}/top_level.txt +0 -0
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: opensecureconf-client
|
|
3
|
-
Version: 1.0.2
|
|
4
|
-
Summary: Python client library for OpenSecureConf encrypted configuration management API
|
|
5
|
-
Author-email: Alessandro Pioli <alessandro.pioli+apioli-pypi@gmail.com>
|
|
6
|
-
Maintainer-email: Alessandro Pioli <alessandro.pioli+apioli-pypi@gmail.com>
|
|
7
|
-
License: MIT
|
|
8
|
-
Project-URL: Homepage, https://github.com/lordraw77/OpenSecureConf
|
|
9
|
-
Project-URL: Documentation, https://github.com/lordraw77/OpenSecureConf#readme
|
|
10
|
-
Project-URL: Repository, https://github.com/lordraw77/OpenSecureConf
|
|
11
|
-
Project-URL: Issues, https://github.com/lordraw77/OpenSecureConf/issues
|
|
12
|
-
Keywords: configuration,encryption,api-client,secure,config-management
|
|
13
|
-
Classifier: Development Status :: 4 - Beta
|
|
14
|
-
Classifier: Intended Audience :: Developers
|
|
15
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
-
Classifier: Programming Language :: Python :: 3
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
23
|
-
Classifier: Topic :: Security :: Cryptography
|
|
24
|
-
Requires-Python: >=3.8
|
|
25
|
-
Description-Content-Type: text/markdown
|
|
26
|
-
License-File: LICENSE
|
|
27
|
-
Requires-Dist: requests>=2.28.0
|
|
28
|
-
Provides-Extra: dev
|
|
29
|
-
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
30
|
-
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
|
31
|
-
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
32
|
-
Requires-Dist: flake8>=6.0.0; extra == "dev"
|
|
33
|
-
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
34
|
-
Dynamic: license-file
|
|
35
|
-
|
|
36
|
-
# OpenSecureConf Python Client
|
|
37
|
-
|
|
38
|
-
A Python client library for interacting with the [OpenSecureConf API](https://github.com/lordraw77/OpenSecureConf), which provides encrypted configuration management with multithreading support.
|
|
39
|
-
|
|
40
|
-
## Features
|
|
41
|
-
|
|
42
|
-
- 🔐 **Encrypted Configuration Management**: Securely store and retrieve encrypted configurations
|
|
43
|
-
- 🚀 **Simple API**: Intuitive interface for CRUD operations
|
|
44
|
-
- 🛡️ **Type-Safe**: Fully typed with comprehensive error handling
|
|
45
|
-
- ⚡ **Async Support**: Works with OpenSecureConf's asynchronous API
|
|
46
|
-
- 🔄 **Context Manager**: Automatic resource cleanup
|
|
47
|
-
- 📦 **Lightweight**: Minimal dependencies (only `requests`)
|
|
48
|
-
|
|
49
|
-
## Installation
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
pip install opensecureconf-client
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
## Quick Start
|
|
56
|
-
|
|
57
|
-
```python
|
|
58
|
-
from opensecureconf_client import OpenSecureConfClient
|
|
59
|
-
|
|
60
|
-
# Initialize the client
|
|
61
|
-
client = OpenSecureConfClient(
|
|
62
|
-
base_url="http://localhost:9000",
|
|
63
|
-
user_key="my-secure-key-min-8-chars"
|
|
64
|
-
)
|
|
65
|
-
|
|
66
|
-
# Create a configuration
|
|
67
|
-
config = client.create(
|
|
68
|
-
key="database",
|
|
69
|
-
value={"host": "localhost", "port": 5432, "username": "admin"},
|
|
70
|
-
category="production"
|
|
71
|
-
)
|
|
72
|
-
|
|
73
|
-
# Read a configuration
|
|
74
|
-
config = client.read("database")
|
|
75
|
-
print(config["value"]) # {'host': 'localhost', 'port': 5432, 'username': 'admin'}
|
|
76
|
-
|
|
77
|
-
# Update a configuration
|
|
78
|
-
client.update(
|
|
79
|
-
key="database",
|
|
80
|
-
value={"host": "db.example.com", "port": 5432, "username": "admin"}
|
|
81
|
-
)
|
|
82
|
-
|
|
83
|
-
# List all configurations
|
|
84
|
-
configs = client.list_all(category="production")
|
|
85
|
-
for cfg in configs:
|
|
86
|
-
print(f"{cfg['key']}: {cfg['value']}")
|
|
87
|
-
|
|
88
|
-
# Delete a configuration
|
|
89
|
-
client.delete("database")
|
|
90
|
-
|
|
91
|
-
# Close the client (or use context manager)
|
|
92
|
-
client.close()
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
## Using Context Manager
|
|
96
|
-
|
|
97
|
-
```python
|
|
98
|
-
from opensecureconf_client import OpenSecureConfClient
|
|
99
|
-
|
|
100
|
-
with OpenSecureConfClient(base_url="http://localhost:9000", user_key="my-key") as client:
|
|
101
|
-
config = client.create("app", {"version": "1.0.0"})
|
|
102
|
-
print(config)
|
|
103
|
-
# Session automatically closed
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
## API Reference
|
|
107
|
-
|
|
108
|
-
### `OpenSecureConfClient`
|
|
109
|
-
|
|
110
|
-
Main client class for interacting with the OpenSecureConf API.
|
|
111
|
-
|
|
112
|
-
#### Constructor
|
|
113
|
-
|
|
114
|
-
```python
|
|
115
|
-
OpenSecureConfClient(
|
|
116
|
-
base_url: str,
|
|
117
|
-
user_key: str,
|
|
118
|
-
timeout: int = 30,
|
|
119
|
-
verify_ssl: bool = True
|
|
120
|
-
)
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
**Parameters:**
|
|
124
|
-
- `base_url`: The base URL of the OpenSecureConf API server
|
|
125
|
-
- `user_key`: User encryption key for authentication (minimum 8 characters)
|
|
126
|
-
- `timeout`: Request timeout in seconds (default: 30)
|
|
127
|
-
- `verify_ssl`: Whether to verify SSL certificates (default: True)
|
|
128
|
-
|
|
129
|
-
#### Methods
|
|
130
|
-
|
|
131
|
-
##### `get_service_info() -> Dict[str, Any]`
|
|
132
|
-
|
|
133
|
-
Get information about the OpenSecureConf service.
|
|
134
|
-
|
|
135
|
-
##### `create(key: str, value: Dict[str, Any], category: Optional[str] = None) -> Dict[str, Any]`
|
|
136
|
-
|
|
137
|
-
Create a new encrypted configuration entry.
|
|
138
|
-
|
|
139
|
-
##### `read(key: str) -> Dict[str, Any]`
|
|
140
|
-
|
|
141
|
-
Read and decrypt a configuration entry by key.
|
|
142
|
-
|
|
143
|
-
##### `update(key: str, value: Dict[str, Any], category: Optional[str] = None) -> Dict[str, Any]`
|
|
144
|
-
|
|
145
|
-
Update an existing configuration entry.
|
|
146
|
-
|
|
147
|
-
##### `delete(key: str) -> Dict[str, str]`
|
|
148
|
-
|
|
149
|
-
Delete a configuration entry permanently.
|
|
150
|
-
|
|
151
|
-
##### `list_all(category: Optional[str] = None) -> List[Dict[str, Any]]`
|
|
152
|
-
|
|
153
|
-
List all configurations with optional category filter.
|
|
154
|
-
|
|
155
|
-
## Error Handling
|
|
156
|
-
|
|
157
|
-
The client provides specific exceptions for different error scenarios:
|
|
158
|
-
|
|
159
|
-
```python
|
|
160
|
-
from opensecureconf_client import (
|
|
161
|
-
OpenSecureConfClient,
|
|
162
|
-
AuthenticationError,
|
|
163
|
-
ConfigurationNotFoundError,
|
|
164
|
-
ConfigurationExistsError,
|
|
165
|
-
OpenSecureConfError
|
|
166
|
-
)
|
|
167
|
-
|
|
168
|
-
try:
|
|
169
|
-
config = client.create("mykey", {"data": "value"})
|
|
170
|
-
except AuthenticationError:
|
|
171
|
-
print("Invalid user key")
|
|
172
|
-
except ConfigurationExistsError:
|
|
173
|
-
print("Configuration already exists")
|
|
174
|
-
except ConfigurationNotFoundError:
|
|
175
|
-
print("Configuration not found")
|
|
176
|
-
except OpenSecureConfError as e:
|
|
177
|
-
print(f"API error: {e}")
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
## Exception Hierarchy
|
|
181
|
-
|
|
182
|
-
- `OpenSecureConfError` (base exception)
|
|
183
|
-
- `AuthenticationError` - Invalid or missing user key
|
|
184
|
-
- `ConfigurationNotFoundError` - Configuration key does not exist
|
|
185
|
-
- `ConfigurationExistsError` - Configuration key already exists
|
|
186
|
-
|
|
187
|
-
## Requirements
|
|
188
|
-
|
|
189
|
-
- Python 3.8 or higher
|
|
190
|
-
- requests >= 2.28.0
|
|
191
|
-
|
|
192
|
-
## Development
|
|
193
|
-
|
|
194
|
-
### Setting Up Development Environment
|
|
195
|
-
|
|
196
|
-
```bash
|
|
197
|
-
# Clone the repository
|
|
198
|
-
git clone https://github.com/lordraw77/OpenSecureConf.git
|
|
199
|
-
cd opensecureconf-client
|
|
200
|
-
|
|
201
|
-
# Install with development dependencies
|
|
202
|
-
pip install -e ".[dev]"
|
|
203
|
-
|
|
204
|
-
# Run tests
|
|
205
|
-
pytest
|
|
206
|
-
|
|
207
|
-
# Run tests with coverage
|
|
208
|
-
pytest --cov=opensecureconf_client
|
|
209
|
-
|
|
210
|
-
# Format code
|
|
211
|
-
black opensecureconf_client.py
|
|
212
|
-
|
|
213
|
-
# Lint code
|
|
214
|
-
flake8 opensecureconf_client.py
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
## License
|
|
218
|
-
|
|
219
|
-
MIT License - see LICENSE file for details
|
|
220
|
-
|
|
221
|
-
## Contributing
|
|
222
|
-
|
|
223
|
-
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
224
|
-
|
|
225
|
-
## Links
|
|
226
|
-
|
|
227
|
-
- [OpenSecureConf API Documentation](https://github.com/lordraw77/OpenSecureConf)
|
|
228
|
-
- [Issue Tracker](https://github.com/lordraw77/OpenSecureConf/issues)
|
|
229
|
-
- [PyPI Package](https://pypi.org/project/opensecureconf-client/)
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
opensecureconf_client.py,sha256=XAOTSQkqq2l196vAdDjqrPZoAPyg7h8odqU4RLSdBW0,10365
|
|
2
|
-
opensecureconf_client-1.0.2.dist-info/licenses/LICENSE,sha256=mvMdzinneV_-L01ddrHOBgbutNS8tjT1m7loT7VTWbI,1073
|
|
3
|
-
opensecureconf_client-1.0.2.dist-info/METADATA,sha256=1FLbQM4xRK9Pyaq-Fp_OuaRsGPYhrfawoD8QCNOPuNE,6497
|
|
4
|
-
opensecureconf_client-1.0.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
5
|
-
opensecureconf_client-1.0.2.dist-info/top_level.txt,sha256=J7NP3hD92OUdqseJLlbzgPuG_ovqkURRyw7iBJJeDVE,22
|
|
6
|
-
opensecureconf_client-1.0.2.dist-info/RECORD,,
|
|
File without changes
|
{opensecureconf_client-1.0.2.dist-info → opensecureconf_client-2.0.2.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
{opensecureconf_client-1.0.2.dist-info → opensecureconf_client-2.0.2.dist-info}/top_level.txt
RENAMED
|
File without changes
|