miso-client 0.1.0__py3-none-any.whl → 0.2.0__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.
Potentially problematic release.
This version of miso-client might be problematic. Click here for more details.
- miso_client/__init__.py +83 -81
- miso_client/errors.py +9 -4
- miso_client/models/config.py +56 -35
- miso_client/services/__init__.py +5 -5
- miso_client/services/auth.py +65 -48
- miso_client/services/cache.py +42 -41
- miso_client/services/encryption.py +18 -17
- miso_client/services/logger.py +109 -95
- miso_client/services/permission.py +27 -36
- miso_client/services/redis.py +17 -15
- miso_client/services/role.py +25 -36
- miso_client/utils/__init__.py +3 -3
- miso_client/utils/config_loader.py +24 -16
- miso_client/utils/data_masker.py +27 -28
- miso_client/utils/http_client.py +91 -81
- miso_client/utils/jwt_tools.py +14 -17
- {miso_client-0.1.0.dist-info → miso_client-0.2.0.dist-info}/METADATA +37 -1
- miso_client-0.2.0.dist-info/RECORD +23 -0
- miso_client-0.1.0.dist-info/RECORD +0 -23
- {miso_client-0.1.0.dist-info → miso_client-0.2.0.dist-info}/WHEEL +0 -0
- {miso_client-0.1.0.dist-info → miso_client-0.2.0.dist-info}/licenses/LICENSE +0 -0
- {miso_client-0.1.0.dist-info → miso_client-0.2.0.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: miso-client
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Python client SDK for AI Fabrix authentication, authorization, and logging
|
|
5
5
|
Home-page: https://github.com/aifabrix/miso-client-python
|
|
6
6
|
Author: AI Fabrix Team
|
|
@@ -366,6 +366,40 @@ ENCRYPTION_KEY=your-32-byte-encryption-key
|
|
|
366
366
|
|
|
367
367
|
---
|
|
368
368
|
|
|
369
|
+
### Testing with API Key
|
|
370
|
+
|
|
371
|
+
**What happens:** When `API_KEY` is set in your `.env` file, you can authenticate requests using the API key as a bearer token, bypassing OAuth2 authentication. This is useful for testing without setting up Keycloak.
|
|
372
|
+
|
|
373
|
+
```python
|
|
374
|
+
from miso_client import MisoClient, load_config
|
|
375
|
+
|
|
376
|
+
client = MisoClient(load_config())
|
|
377
|
+
await client.initialize()
|
|
378
|
+
|
|
379
|
+
# Use API_KEY as bearer token (for testing only)
|
|
380
|
+
api_key_token = "your-api-key-from-env"
|
|
381
|
+
is_valid = await client.validate_token(api_key_token)
|
|
382
|
+
# Returns True if token matches API_KEY from .env
|
|
383
|
+
|
|
384
|
+
user = await client.get_user(api_key_token)
|
|
385
|
+
# Returns None (API key auth doesn't provide user info)
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
**Configuration:**
|
|
389
|
+
|
|
390
|
+
```bash
|
|
391
|
+
# Add to .env for testing
|
|
392
|
+
API_KEY=your-test-api-key-here
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
**Important:**
|
|
396
|
+
- API_KEY authentication bypasses OAuth2 validation completely
|
|
397
|
+
- User information methods (`get_user()`, `get_user_info()`) return `None` when using API_KEY
|
|
398
|
+
- Token validation returns `True` if the bearer token matches the configured `API_KEY`
|
|
399
|
+
- This feature is intended for testing and development only
|
|
400
|
+
|
|
401
|
+
---
|
|
402
|
+
|
|
369
403
|
## 🔧 Configuration
|
|
370
404
|
|
|
371
405
|
```python
|
|
@@ -380,6 +414,7 @@ config = MisoClientConfig(
|
|
|
380
414
|
port=6379,
|
|
381
415
|
),
|
|
382
416
|
log_level="info", # Optional: 'debug' | 'info' | 'warn' | 'error'
|
|
417
|
+
api_key="your-test-api-key", # Optional: API key for testing (bypasses OAuth2)
|
|
383
418
|
cache={ # Optional: Cache TTL settings
|
|
384
419
|
"role_ttl": 900, # Role cache TTL (default: 900s)
|
|
385
420
|
"permission_ttl": 900, # Permission cache TTL (default: 900s)
|
|
@@ -490,6 +525,7 @@ MISO_CONTROLLER_URL=http://localhost:3000
|
|
|
490
525
|
REDIS_HOST=localhost
|
|
491
526
|
REDIS_PORT=6379
|
|
492
527
|
MISO_LOG_LEVEL=info
|
|
528
|
+
API_KEY=your-test-api-key # Optional: For testing (bypasses OAuth2)
|
|
493
529
|
```
|
|
494
530
|
|
|
495
531
|
---
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
miso_client/__init__.py,sha256=H0JVn58XgxnWEG3IPDsxUskI1Mzi-rPRcGAsimMtDBE,13665
|
|
2
|
+
miso_client/errors.py,sha256=d3yHX7kV6KckDD3-8bHWZs_jPoKRCjV9KLIP6ZEeXBc,1148
|
|
3
|
+
miso_client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
miso_client/models/__init__.py,sha256=Oy03VQKAqg0FGZiWfcNdSgOA-PzfbdQDX_1sqfv_r-U,67
|
|
5
|
+
miso_client/models/config.py,sha256=TLckmwajrdnJpMTsjCtaFkz8wFAXcEQJfKjXQ8ww6vM,8024
|
|
6
|
+
miso_client/services/__init__.py,sha256=2ok62Z9kaS0Zze-OxRkxEJ4JidzN9jL_pzGMOxpZppQ,489
|
|
7
|
+
miso_client/services/auth.py,sha256=hYnHEoTNgeH_g0ItoVDq99fBZCZX0o-0o-9gRxqZYmw,5465
|
|
8
|
+
miso_client/services/cache.py,sha256=lXcLcRm56snOX3AQiEKi-j7FIikCLYnEK2HXxBkxm2M,6510
|
|
9
|
+
miso_client/services/encryption.py,sha256=8512ACLt0P8t3W_CGzmG0JRSvzDinvjPRvkifdDxIRs,3022
|
|
10
|
+
miso_client/services/logger.py,sha256=TiEyapqHMHRwaLud8pVr-Z__dNXI1x244C7RXsWu1XI,16583
|
|
11
|
+
miso_client/services/permission.py,sha256=GOGRAaXSfPKTXqEqbR0XP8hrA-YQgVFbHPxD-gGBUyA,6853
|
|
12
|
+
miso_client/services/redis.py,sha256=BWfgXoSOyyGrB9cf_kTY0lZwfbjUWQhkiOyFFSp590M,5348
|
|
13
|
+
miso_client/services/role.py,sha256=qmxhk54QUGCjCuCWm_ruDlTq7iT9yOicfUvdRVkFKUI,5517
|
|
14
|
+
miso_client/utils/__init__.py,sha256=HArSxVKrmCqFkqFOPwe1i3B2IBHJ1vRqYu98c_KASV0,366
|
|
15
|
+
miso_client/utils/config_loader.py,sha256=yZk4pXNIBu3i61KqxM8QwsjraM0xhqUcH2THl8-DMu0,3027
|
|
16
|
+
miso_client/utils/data_masker.py,sha256=pClygH2pL9c1tIbMTUbtzV17sJ4glXsX4MNH3VQU7Wc,4361
|
|
17
|
+
miso_client/utils/http_client.py,sha256=XJzioRqig5dE8_H87WyNpWRKh0sc_-wo8d_g0Fsl9QA,12930
|
|
18
|
+
miso_client/utils/jwt_tools.py,sha256=-pvz5nk5BztEnhFnL-dtOv8Q5E0G2oh4RwFrVk2rVpg,1981
|
|
19
|
+
miso_client-0.2.0.dist-info/licenses/LICENSE,sha256=3hoU8LdT9_EIFIx6FjMk5sQnVCBMX3FRIOzqqy5im4c,1076
|
|
20
|
+
miso_client-0.2.0.dist-info/METADATA,sha256=XnAYeXWPeriCfpBJrUyy_vSvn_GhrZ0pGXqtdY6GFGI,17251
|
|
21
|
+
miso_client-0.2.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
22
|
+
miso_client-0.2.0.dist-info/top_level.txt,sha256=8i_FNeRn8PRy6scnXOpVr-IJYsArkqIvxRMTZPtik9E,12
|
|
23
|
+
miso_client-0.2.0.dist-info/RECORD,,
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
miso_client/__init__.py,sha256=lL254-VN8Q8SV4nJwiTMYEWrYUpBzzG_uxNlNlQKuog,14205
|
|
2
|
-
miso_client/errors.py,sha256=XEa0bbYoP4mH6n8GuTquf-qD4tkCr-Ca3QIWOKZJtxQ,1143
|
|
3
|
-
miso_client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
miso_client/models/__init__.py,sha256=Oy03VQKAqg0FGZiWfcNdSgOA-PzfbdQDX_1sqfv_r-U,67
|
|
5
|
-
miso_client/models/config.py,sha256=PFiIp8fouoGGBUAu9ODwsVwhuW78v-iqEvDPBQ0YK5Q,7759
|
|
6
|
-
miso_client/services/__init__.py,sha256=DfiZJ45MWQvVqwp0kyxjuK9ngiO3nW8zcdBqd7VOD7Y,488
|
|
7
|
-
miso_client/services/auth.py,sha256=NrVX5MXaLqWinoWB7bAvEurTONkjVm2HlvDJPnmOkKU,4863
|
|
8
|
-
miso_client/services/cache.py,sha256=gu5Ykbh43vrBb9hLvl6OXstGKFZpUUyIAa4fifj6KW8,6786
|
|
9
|
-
miso_client/services/encryption.py,sha256=kQsES7oCs1l8vTmy1G9mI6eXXvrfdNuXMpZzG_xUX0M,3145
|
|
10
|
-
miso_client/services/logger.py,sha256=tpj-N3Rq4dfkJteNu7rt_KniOFkf5eyhuTbFcapM-Nk,16789
|
|
11
|
-
miso_client/services/permission.py,sha256=6vT9BV_NX9dJ7moSN5CBILjEn9u6do9IAeR4k3Fp9Q8,7210
|
|
12
|
-
miso_client/services/redis.py,sha256=4ov5Pu1xKDqSUNMDx9rTvbsTuM4jwaRUrpSiLAzIU_I,5478
|
|
13
|
-
miso_client/services/role.py,sha256=j4qCyYBXinubEpa0Yy_XPqFANuQHSQl0BILugRXM5WY,5896
|
|
14
|
-
miso_client/utils/__init__.py,sha256=YErXOQ6cqaxflEC7JCQuV_XbPU4NTAdBhbe4L5tv73o,365
|
|
15
|
-
miso_client/utils/config_loader.py,sha256=a2Jj8sd_IN8EhCjk3mtdMK1Z3MAG0P8IYThCd66dk3k,2912
|
|
16
|
-
miso_client/utils/data_masker.py,sha256=PJ-8ro2zuzS_XkjB5aV_DjY9NAjnlynJhsy41nFr408,4570
|
|
17
|
-
miso_client/utils/http_client.py,sha256=L9004iavGVM67BIJTl9_aI0rzV6fMSi0WPZi1h-CgTY,13347
|
|
18
|
-
miso_client/utils/jwt_tools.py,sha256=W1WFA_J1YU1Ng-IcsA9KdUTPda4pqIy7TF7nvXl2KLk,2061
|
|
19
|
-
miso_client-0.1.0.dist-info/licenses/LICENSE,sha256=3hoU8LdT9_EIFIx6FjMk5sQnVCBMX3FRIOzqqy5im4c,1076
|
|
20
|
-
miso_client-0.1.0.dist-info/METADATA,sha256=ocOKMvNYl5VKFXr5NbD7FtdwWfMM947h0Rt4lgLRJR0,16006
|
|
21
|
-
miso_client-0.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
22
|
-
miso_client-0.1.0.dist-info/top_level.txt,sha256=8i_FNeRn8PRy6scnXOpVr-IJYsArkqIvxRMTZPtik9E,12
|
|
23
|
-
miso_client-0.1.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|