brynq-sdk-azure 2.0.3__tar.gz → 3.0.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.0
2
2
  Name: brynq_sdk_azure
3
- Version: 2.0.3
3
+ Version: 3.0.0
4
4
  Summary: Azure wrapper from BrynQ
5
5
  Home-page: UNKNOWN
6
6
  Author: BrynQ
@@ -1,16 +1,17 @@
1
1
  from brynq_sdk_brynq import BrynQ
2
2
  from azure.storage.blob import BlobServiceClient, BlobClient, ContainerClient, generate_account_sas, ResourceTypes, AccountSasPermissions
3
- from typing import Union, List, Tuple
3
+ from typing import Union, List, Tuple, Literal, Optional
4
4
  from datetime import datetime, timedelta
5
5
 
6
6
 
7
7
  class BlobStorage(BrynQ):
8
- def __init__(self, label: Union[str, List]):
8
+ def __init__(self, system_type: Optional[Literal['source', 'target']] = None):
9
9
  super().__init__()
10
- self.blob_service_client = self.__get_authentication(label=label)
10
+ self.blob_service_client = self._get_authentication(system_type)
11
11
 
12
- def __get_authentication(self, label):
13
- credentials = self.get_system_credential(system='azure-blob-storage', label=label)
12
+ def _get_authentication(self, system_type):
13
+ credentials = self.interfaces.credentials.get(system='azure-blob-storage', system_type=system_type)
14
+ credentials = credentials.get('data')
14
15
  storage_account_name = credentials['storage_account_name']
15
16
  storage_account_key = credentials['storage_account_key']
16
17
  sas_token = generate_account_sas(
@@ -8,19 +8,20 @@ import json
8
8
  import pandas as pd
9
9
  from pandas import json_normalize
10
10
  from msal import ConfidentialClientApplication
11
- from typing import Union, List
11
+ from typing import Union, List, Literal, Optional
12
12
  import os
13
13
 
14
14
  class Entra(BrynQ):
15
15
 
16
- def __init__(self, label: Union[str, List], debug: bool = False):
16
+ def __init__(self, system_type: Optional[Literal['source', 'target']] = None, debug: bool = False):
17
17
  super().__init__()
18
- self.headers = self.__get_headers(label=label)
18
+ self.headers = self.__get_headers(system_type)
19
19
  self.endpoint = "https://graph.microsoft.com/v1.0"
20
20
  self.timeout = 3600
21
21
 
22
- def __get_headers(self, label):
23
- credentials = self.get_system_credential(system='azure-entra-token', label=label)
22
+ def __get_headers(self, system_type):
23
+ credentials = self.interfaces.credentials.get(system='azure-entra-token', system_type=system_type)
24
+ credentials = credentials.get('data')
24
25
  tenant_id = credentials['tenant_id']
25
26
  client_id = credentials['client_id']
26
27
  client_secret = credentials['client_secret']
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.0
2
2
  Name: brynq-sdk-azure
3
- Version: 2.0.3
3
+ Version: 3.0.0
4
4
  Summary: Azure wrapper from BrynQ
5
5
  Home-page: UNKNOWN
6
6
  Author: BrynQ
@@ -1,4 +1,4 @@
1
- brynq-sdk-brynq>=2
1
+ brynq-sdk-brynq<5,>=4
2
2
  azure-storage-file-share>=12.6.0
3
3
  azure-storage-blob>=12.16.0
4
4
  msal==1.22.0
@@ -2,7 +2,7 @@ from setuptools import setup, find_namespace_packages
2
2
 
3
3
  setup(
4
4
  name='brynq_sdk_azure',
5
- version='2.0.3',
5
+ version='3.0.0',
6
6
  description='Azure wrapper from BrynQ',
7
7
  long_description='Azure wrapper from BrynQ',
8
8
  author='BrynQ',
@@ -10,7 +10,7 @@ setup(
10
10
  packages=find_namespace_packages(include=['brynq_sdk*']),
11
11
  license='BrynQ License',
12
12
  install_requires=[
13
- 'brynq-sdk-brynq>=2',
13
+ 'brynq-sdk-brynq>=4,<5',
14
14
  'azure-storage-file-share>=12.6.0',
15
15
  'azure-storage-blob>=12.16.0',
16
16
  'msal==1.22.0'