fdc-shared-kernel 0.0.5__tar.gz → 0.0.6__tar.gz
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.
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/PKG-INFO +1 -1
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/pyproject.toml +1 -1
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/fdc_shared_kernel.egg-info/PKG-INFO +1 -1
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/config/__init__.py +1 -1
- fdc_shared_kernel-0.0.6/src/shared_kernel/interfaces/__init__.py +2 -0
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/messaging/nats_databus.py +2 -2
- fdc_shared_kernel-0.0.6/src/shared_kernel/security/__init__.py +1 -0
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/security/key_vault/__init__.py +3 -3
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/security/key_vault/aws_secret_manager.py +14 -4
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/security/key_vault/azure_keyvault.py +24 -5
- fdc_shared_kernel-0.0.5/src/shared_kernel/interfaces/__init__.py +0 -2
- fdc_shared_kernel-0.0.5/src/shared_kernel/security/__init__.py +0 -1
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/README.md +0 -0
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/README_pypi.md +0 -0
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/requirements.txt +0 -0
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/setup.cfg +0 -0
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/fdc_shared_kernel.egg-info/SOURCES.txt +0 -0
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/fdc_shared_kernel.egg-info/dependency_links.txt +0 -0
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/fdc_shared_kernel.egg-info/requires.txt +0 -0
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/fdc_shared_kernel.egg-info/top_level.txt +0 -0
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/__init__.py +0 -0
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/database/__init__.py +0 -0
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/exceptions/__init__.py +0 -0
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/exceptions/configuration_exceptions.py +0 -0
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/exceptions/custom_exceptions.py +0 -0
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/exceptions/data_validation_exceptions.py +0 -0
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/exceptions/http_exceptions.py +0 -0
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/exceptions/infrastructure_exceptions.py +0 -0
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/exceptions/operational_exceptions.py +0 -0
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/exceptions/security_exceptions.py +0 -0
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/interfaces/databus.py +0 -0
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/interfaces/keyvault.py +0 -0
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/logger/__init__.py +0 -0
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/messaging/__init__.py +0 -0
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/models/__init__.py +0 -0
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/tests/__init__.py +0 -0
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/tests/config/test_config.py +0 -0
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/tests/logger/test_logger.py +0 -0
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/tests/messaging/test_nats_interface.py +0 -0
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/tests/utils/test_data_validators.py +0 -0
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/tests/utils/test_date_format_utils.py +0 -0
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/tests/utils/test_string_utils.py +0 -0
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/utils/__init__.py +0 -0
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/utils/data_validators_utils.py +0 -0
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/utils/date_format_utils.py +0 -0
- {fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/utils/string_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: fdc_shared_kernel
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.6
|
|
4
4
|
Summary: Shared library for microservice
|
|
5
5
|
Author-email: Shikhil S <shikhil.s@dbizsolution.com>, Ahammed Akdham N <ahammedakdham.n@dbizsolution.com>
|
|
6
6
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: fdc_shared_kernel
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.6
|
|
4
4
|
Summary: Shared library for microservice
|
|
5
5
|
Author-email: Shikhil S <shikhil.s@dbizsolution.com>, Ahammed Akdham N <ahammedakdham.n@dbizsolution.com>
|
|
6
6
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -2,7 +2,7 @@ import os
|
|
|
2
2
|
from typing import Any
|
|
3
3
|
from dotenv import load_dotenv, find_dotenv
|
|
4
4
|
from shared_kernel.exceptions import MissingConfiguration, InvalidConfiguration
|
|
5
|
-
from
|
|
5
|
+
from shared_kernel.logger import Logger
|
|
6
6
|
|
|
7
7
|
logger = Logger('SHARED_KERNEL')
|
|
8
8
|
|
{fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/messaging/nats_databus.py
RENAMED
|
@@ -2,8 +2,8 @@ import json
|
|
|
2
2
|
from nats.aio.client import Client as NATS
|
|
3
3
|
from nats.js.api import ConsumerConfig, DeliverPolicy, StreamConfig
|
|
4
4
|
from typing import Callable, Any, List, Union
|
|
5
|
-
from
|
|
6
|
-
from
|
|
5
|
+
from shared_kernel.interfaces import DataBus
|
|
6
|
+
from shared_kernel.logger import Logger
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class NATSDataBus(DataBus):
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from shared_kernel.security.key_vault import *
|
{fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/security/key_vault/__init__.py
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
from
|
|
2
|
-
from
|
|
3
|
-
from
|
|
1
|
+
from shared_kernel.interfaces import KeyVaultInterface
|
|
2
|
+
from shared_kernel.security.key_vault.aws_secret_manager import AWSSecretsManager
|
|
3
|
+
from shared_kernel.security.key_vault.azure_keyvault import AzureKeyVault
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
class KeyVaultFactory:
|
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
import boto3
|
|
2
2
|
from botocore.exceptions import ClientError
|
|
3
|
-
from
|
|
4
|
-
from
|
|
3
|
+
from shared_kernel.interfaces import KeyVaultInterface
|
|
4
|
+
from shared_kernel.logger import Logger
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
class AWSSecretsManager(KeyVaultInterface):
|
|
8
|
-
|
|
8
|
+
_instance = None
|
|
9
|
+
|
|
10
|
+
def __new__(cls, config: dict = None):
|
|
11
|
+
if cls._instance is None:
|
|
12
|
+
if config is None:
|
|
13
|
+
raise ValueError("Configuration must be provided for the first initialization.")
|
|
14
|
+
cls._instance = super(AWSSecretsManager, cls).__new__(cls)
|
|
15
|
+
cls._instance._initialize(config)
|
|
16
|
+
return cls._instance
|
|
17
|
+
|
|
18
|
+
def _initialize(self, config: dict):
|
|
9
19
|
"""
|
|
10
20
|
Initialize the AWS Secrets Manager connection with the given configuration.
|
|
11
21
|
|
|
12
22
|
Args:
|
|
13
|
-
config (dict): Configuration dictionary containing region_name, aws_access_key_id,
|
|
23
|
+
config (dict): Configuration dictionary containing region_name, aws_access_key_id, aws_secret_access_key
|
|
14
24
|
"""
|
|
15
25
|
self._region_name = config.get('region_name')
|
|
16
26
|
self._aws_access_key_id = config.get('AWS_SERVER_PUBLIC_KEY')
|
|
@@ -1,16 +1,35 @@
|
|
|
1
|
-
from azure.identity import
|
|
1
|
+
from azure.identity import ClientSecretCredential
|
|
2
2
|
from azure.keyvault.secrets import SecretClient
|
|
3
|
-
from
|
|
4
|
-
from
|
|
3
|
+
from shared_kernel.interfaces import KeyVaultInterface
|
|
4
|
+
from shared_kernel.logger import Logger
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
class AzureKeyVault(KeyVaultInterface):
|
|
8
|
-
|
|
8
|
+
_instance = None
|
|
9
|
+
|
|
10
|
+
def __new__(cls, config: dict = None):
|
|
11
|
+
"""
|
|
12
|
+
Create or return the singleton instance of AzureKeyVault.
|
|
13
|
+
|
|
14
|
+
Args:
|
|
15
|
+
config (dict, optional): Configuration dictionary containing 'vault_url', 'tenant_id', 'client_id', and 'client_secret'.
|
|
16
|
+
|
|
17
|
+
Returns:
|
|
18
|
+
AzureKeyVault: The singleton instance of the class.
|
|
19
|
+
"""
|
|
20
|
+
if cls._instance is None:
|
|
21
|
+
if config is None:
|
|
22
|
+
raise ValueError("Configuration must be provided for the first instance creation.")
|
|
23
|
+
cls._instance = super(AzureKeyVault, cls).__new__(cls)
|
|
24
|
+
cls._instance.__initialize(config)
|
|
25
|
+
return cls._instance
|
|
26
|
+
|
|
27
|
+
def __initialize(self, config: dict):
|
|
9
28
|
"""
|
|
10
29
|
Initialize the Azure Key Vault connection with the given configuration.
|
|
11
30
|
|
|
12
31
|
Args:
|
|
13
|
-
config (dict): Configuration dictionary containing 'vault_url'.
|
|
32
|
+
config (dict): Configuration dictionary containing 'vault_url', 'tenant_id', 'client_id', and 'client_secret'.
|
|
14
33
|
"""
|
|
15
34
|
self._vault_url = config.get('vault_url')
|
|
16
35
|
self._credential = ClientSecretCredential(
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
from src.shared_kernel.security.key_vault import *
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/fdc_shared_kernel.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/fdc_shared_kernel.egg-info/requires.txt
RENAMED
|
File without changes
|
{fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/fdc_shared_kernel.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/exceptions/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/exceptions/http_exceptions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/interfaces/keyvault.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/tests/config/test_config.py
RENAMED
|
File without changes
|
{fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/tests/logger/test_logger.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/utils/data_validators_utils.py
RENAMED
|
File without changes
|
{fdc_shared_kernel-0.0.5 → fdc_shared_kernel-0.0.6}/src/shared_kernel/utils/date_format_utils.py
RENAMED
|
File without changes
|
|
File without changes
|