dnastack-client-library 3.1.208__py3-none-any.whl → 3.1.210__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.
- dnastack/client/workbench/workflow/models.py +1 -0
- dnastack/constants.py +1 -1
- dnastack/http/authenticators/oauth2_adapter/cloud_providers.py +42 -0
- {dnastack_client_library-3.1.208.dist-info → dnastack_client_library-3.1.210.dist-info}/METADATA +2 -1
- {dnastack_client_library-3.1.208.dist-info → dnastack_client_library-3.1.210.dist-info}/RECORD +9 -9
- {dnastack_client_library-3.1.208.dist-info → dnastack_client_library-3.1.210.dist-info}/WHEEL +0 -0
- {dnastack_client_library-3.1.208.dist-info → dnastack_client_library-3.1.210.dist-info}/entry_points.txt +0 -0
- {dnastack_client_library-3.1.208.dist-info → dnastack_client_library-3.1.210.dist-info}/licenses/LICENSE +0 -0
- {dnastack_client_library-3.1.208.dist-info → dnastack_client_library-3.1.210.dist-info}/top_level.txt +0 -0
dnastack/constants.py
CHANGED
|
@@ -4,12 +4,15 @@ from enum import Enum
|
|
|
4
4
|
from pydantic import BaseModel, Field
|
|
5
5
|
import logging
|
|
6
6
|
|
|
7
|
+
import boto3
|
|
8
|
+
|
|
7
9
|
from dnastack.common.tracing import Span
|
|
8
10
|
from dnastack.http.client_factory import HttpClientFactory
|
|
9
11
|
|
|
10
12
|
|
|
11
13
|
class CloudProvider(str, Enum):
|
|
12
14
|
GCP = "gcp"
|
|
15
|
+
AWS = "aws"
|
|
13
16
|
|
|
14
17
|
|
|
15
18
|
class CloudMetadataProvider(ABC):
|
|
@@ -89,6 +92,44 @@ class GCPMetadataProvider(CloudMetadataProvider):
|
|
|
89
92
|
return None
|
|
90
93
|
|
|
91
94
|
|
|
95
|
+
class AWSMetadataProvider(CloudMetadataProvider):
|
|
96
|
+
"""Amazon Web Services metadata provider using STS GetWebIdentityToken."""
|
|
97
|
+
|
|
98
|
+
def __init__(self, timeout: int = 5):
|
|
99
|
+
super().__init__(timeout)
|
|
100
|
+
self._session: Optional[boto3.Session] = None
|
|
101
|
+
|
|
102
|
+
@property
|
|
103
|
+
def name(self) -> str:
|
|
104
|
+
return CloudProvider.AWS.value
|
|
105
|
+
|
|
106
|
+
def is_available(self) -> bool:
|
|
107
|
+
"""Check if AWS credentials are available."""
|
|
108
|
+
try:
|
|
109
|
+
self._session = boto3.Session()
|
|
110
|
+
credentials = self._session.get_credentials()
|
|
111
|
+
return credentials is not None
|
|
112
|
+
except Exception:
|
|
113
|
+
return False
|
|
114
|
+
|
|
115
|
+
def get_identity_token(self, audience: str, trace_context: Span) -> Optional[str]:
|
|
116
|
+
"""Fetch AWS identity token from STS GetWebIdentityToken."""
|
|
117
|
+
try:
|
|
118
|
+
if self._session is None:
|
|
119
|
+
self._session = boto3.Session()
|
|
120
|
+
|
|
121
|
+
sts_client = self._session.client('sts')
|
|
122
|
+
response = sts_client.get_web_identity_token(Audience=[audience])
|
|
123
|
+
token = response.get('WebIdentityToken')
|
|
124
|
+
if token:
|
|
125
|
+
self._logger.debug(f'Successfully fetched AWS identity token for audience: {audience}')
|
|
126
|
+
return token
|
|
127
|
+
|
|
128
|
+
except Exception as e:
|
|
129
|
+
self._logger.warning(f'Failed to fetch AWS identity token: {e}')
|
|
130
|
+
return None
|
|
131
|
+
|
|
132
|
+
|
|
92
133
|
class CloudMetadataConfig(BaseModel):
|
|
93
134
|
"""Configuration model for cloud metadata provider."""
|
|
94
135
|
timeout: int = Field(5, ge=1, le=30, description="Timeout for metadata service request (1-30 seconds).")
|
|
@@ -98,6 +139,7 @@ class CloudProviderFactory:
|
|
|
98
139
|
"""Factory for creating cloud metadata providers."""
|
|
99
140
|
_providers = {
|
|
100
141
|
CloudProvider.GCP: GCPMetadataProvider,
|
|
142
|
+
CloudProvider.AWS: AWSMetadataProvider,
|
|
101
143
|
}
|
|
102
144
|
|
|
103
145
|
@classmethod
|
{dnastack_client_library-3.1.208.dist-info → dnastack_client_library-3.1.210.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dnastack-client-library
|
|
3
|
-
Version: 3.1.
|
|
3
|
+
Version: 3.1.210
|
|
4
4
|
Summary: DNAstack's GA4GH library and CLI
|
|
5
5
|
Author-email: DNAstack <devs@dnastack.com>
|
|
6
6
|
License: Apache License, Version 2.0
|
|
@@ -36,6 +36,7 @@ Requires-Dist: python-dotenv
|
|
|
36
36
|
Requires-Dist: pip>=21.3.1
|
|
37
37
|
Requires-Dist: packaging>=21.3
|
|
38
38
|
Requires-Dist: selenium>=4.1.0
|
|
39
|
+
Requires-Dist: boto3>=1.42.30
|
|
39
40
|
Provides-Extra: test
|
|
40
41
|
Requires-Dist: selenium>=3.141.0; extra == "test"
|
|
41
42
|
Requires-Dist: pyjwt>=2.1.0; extra == "test"
|
{dnastack_client_library-3.1.208.dist-info → dnastack_client_library-3.1.210.dist-info}/RECORD
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
dnastack/__init__.py,sha256=mslf7se8vBSK_HkqWTGPdibeVhT4xyKXgzQBV7dEK1M,333
|
|
2
2
|
dnastack/__main__.py,sha256=EKmtIs4TBseQJi-OT_U6LqRyKLiyrGTBuTQg9zE-G2I,4376
|
|
3
|
-
dnastack/constants.py,sha256=
|
|
3
|
+
dnastack/constants.py,sha256=al1WENDsROj5TU4lEl-ZbiXs_uPphuz-93GmXSlFSN4,113
|
|
4
4
|
dnastack/feature_flags.py,sha256=UMNDB07R_ep6Fx3iClhzwOpkWfyYnb418FpoJo50CGs,1411
|
|
5
5
|
dnastack/json_path.py,sha256=TyghhDf7nGQmnsUWBhenU_fKsE_Ez-HLVER6HgH5-hU,2700
|
|
6
6
|
dnastack/omics_cli.py,sha256=ZppKZTHv_XjUUZyRIzSkx0Ug5ODAYrCOTsU0ezCOVrA,3694
|
|
@@ -154,7 +154,7 @@ dnastack/client/workbench/workbench_user_service/client.py,sha256=ZpMOFw5L3NxbC2
|
|
|
154
154
|
dnastack/client/workbench/workbench_user_service/models.py,sha256=P8WmocouYthi4gnHzNJT2F3iExWTt_2MUnskexN6Rxs,126
|
|
155
155
|
dnastack/client/workbench/workflow/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
156
156
|
dnastack/client/workbench/workflow/client.py,sha256=UCNGy9SsIOIQuP5AFgFB0WH1ZUvO0ShSaPjrcTN4aMU,22351
|
|
157
|
-
dnastack/client/workbench/workflow/models.py,sha256=
|
|
157
|
+
dnastack/client/workbench/workflow/models.py,sha256=3xT8kbG8dDmDzc9_0XXIW8tC1U_sC2sg1N4sJ0i3iEk,6044
|
|
158
158
|
dnastack/client/workbench/workflow/utils.py,sha256=Qoo5eENmG8HGKqz-aYiKNzlLgdxHWIcge825b00aSt0,4641
|
|
159
159
|
dnastack/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
160
160
|
dnastack/common/auth_manager.py,sha256=22j70VdOEcp1TC2EQps6NkgO8BX70vZdAxsMy6rbY-8,8828
|
|
@@ -193,14 +193,14 @@ dnastack/http/authenticators/oauth2.py,sha256=6shpSY9v7Ccs6Iy4GjWgx22uq9r_wkEg3z
|
|
|
193
193
|
dnastack/http/authenticators/oauth2_adapter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
194
194
|
dnastack/http/authenticators/oauth2_adapter/abstract.py,sha256=Tm4Nnroo5_vp0UgZHhcEDVRRbhIrvVdfPr8nTyihoH4,2832
|
|
195
195
|
dnastack/http/authenticators/oauth2_adapter/client_credential.py,sha256=2iVOof4YZEVGizDRDBISbv8U_xIemtUnHzzxa3mxswc,2770
|
|
196
|
-
dnastack/http/authenticators/oauth2_adapter/cloud_providers.py,sha256=
|
|
196
|
+
dnastack/http/authenticators/oauth2_adapter/cloud_providers.py,sha256=sWto8WfK2-8xjx3SbrRMIaYg2V8cwohR1XIU6xTXzfA,5763
|
|
197
197
|
dnastack/http/authenticators/oauth2_adapter/device_code_flow.py,sha256=dXI5CyUcsqYg6gf5vDC_3eY6Cc-H1C8W7FeD_24j92A,6750
|
|
198
198
|
dnastack/http/authenticators/oauth2_adapter/factory.py,sha256=ZtNXOklWEim-26ooNoPp3ji_hRg1vf4fHHnY94F0wLI,1087
|
|
199
199
|
dnastack/http/authenticators/oauth2_adapter/models.py,sha256=7UsC8DkStMBx7Bz_xHQNi_J1UO_H4nfHme7oBhokj2I,1339
|
|
200
200
|
dnastack/http/authenticators/oauth2_adapter/token_exchange.py,sha256=nSuAsSKWa_UNqHSbPMOEk4komaFITYAnE04Sk5WOrLc,6332
|
|
201
|
-
dnastack_client_library-3.1.
|
|
202
|
-
dnastack_client_library-3.1.
|
|
203
|
-
dnastack_client_library-3.1.
|
|
204
|
-
dnastack_client_library-3.1.
|
|
205
|
-
dnastack_client_library-3.1.
|
|
206
|
-
dnastack_client_library-3.1.
|
|
201
|
+
dnastack_client_library-3.1.210.dist-info/licenses/LICENSE,sha256=uwybO-wUbQhxkosgjhJlxmYATMy-AzoULFO9FUedE34,11580
|
|
202
|
+
dnastack_client_library-3.1.210.dist-info/METADATA,sha256=DxmcsoMA0TASeosG23sqF_-ynT2tY0bHUEvZ8wS6U9U,1791
|
|
203
|
+
dnastack_client_library-3.1.210.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
204
|
+
dnastack_client_library-3.1.210.dist-info/entry_points.txt,sha256=Y6OeicsiyGn3-8D-SiV4NiKlJgXfkSqK88kFBR6R1rY,89
|
|
205
|
+
dnastack_client_library-3.1.210.dist-info/top_level.txt,sha256=P2RgRyqJ7hfNy1wLVRoVLJYEppUVkCX3syGK9zBqkt8,9
|
|
206
|
+
dnastack_client_library-3.1.210.dist-info/RECORD,,
|
{dnastack_client_library-3.1.208.dist-info → dnastack_client_library-3.1.210.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|