apache-airflow-providers-hashicorp 3.6.4__py3-none-any.whl → 3.7.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 apache-airflow-providers-hashicorp might be problematic. Click here for more details.
- airflow/providers/hashicorp/__init__.py +3 -3
- airflow/providers/hashicorp/_internal_client/vault_client.py +34 -8
- airflow/providers/hashicorp/get_provider_info.py +4 -2
- airflow/providers/hashicorp/hooks/vault.py +1 -0
- airflow/providers/hashicorp/secrets/vault.py +6 -0
- {apache_airflow_providers_hashicorp-3.6.4.dist-info → apache_airflow_providers_hashicorp-3.7.0.dist-info}/METADATA +12 -9
- apache_airflow_providers_hashicorp-3.7.0.dist-info/RECORD +13 -0
- apache_airflow_providers_hashicorp-3.6.4.dist-info/RECORD +0 -13
- {apache_airflow_providers_hashicorp-3.6.4.dist-info → apache_airflow_providers_hashicorp-3.7.0.dist-info}/WHEEL +0 -0
- {apache_airflow_providers_hashicorp-3.6.4.dist-info → apache_airflow_providers_hashicorp-3.7.0.dist-info}/entry_points.txt +0 -0
|
@@ -27,7 +27,7 @@ import packaging.version
|
|
|
27
27
|
|
|
28
28
|
__all__ = ["__version__"]
|
|
29
29
|
|
|
30
|
-
__version__ = "3.
|
|
30
|
+
__version__ = "3.7.0"
|
|
31
31
|
|
|
32
32
|
try:
|
|
33
33
|
from airflow import __version__ as airflow_version
|
|
@@ -35,8 +35,8 @@ except ImportError:
|
|
|
35
35
|
from airflow.version import version as airflow_version
|
|
36
36
|
|
|
37
37
|
if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
|
|
38
|
-
"2.
|
|
38
|
+
"2.7.0"
|
|
39
39
|
):
|
|
40
40
|
raise RuntimeError(
|
|
41
|
-
f"The package `apache-airflow-providers-hashicorp:{__version__}` needs Apache Airflow 2.
|
|
41
|
+
f"The package `apache-airflow-providers-hashicorp:{__version__}` needs Apache Airflow 2.7.0+"
|
|
42
42
|
)
|
|
@@ -74,6 +74,9 @@ class _VaultClient(LoggingMixin):
|
|
|
74
74
|
:param key_id: Key ID for Authentication (for ``aws_iam`` and ''azure`` auth_type).
|
|
75
75
|
:param secret_id: Secret ID for Authentication (for ``approle``, ``aws_iam`` and ``azure`` auth_types).
|
|
76
76
|
:param role_id: Role ID for Authentication (for ``approle``, ``aws_iam`` auth_types).
|
|
77
|
+
:param assume_role_kwargs: AWS assume role param.
|
|
78
|
+
See AWS STS Docs:
|
|
79
|
+
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sts/client/assume_role.html
|
|
77
80
|
:param kubernetes_role: Role for Authentication (for ``kubernetes`` auth_type).
|
|
78
81
|
:param kubernetes_jwt_path: Path for kubernetes jwt token (for ``kubernetes`` auth_type, default:
|
|
79
82
|
``/var/run/secrets/kubernetes.io/serviceaccount/token``).
|
|
@@ -103,6 +106,7 @@ class _VaultClient(LoggingMixin):
|
|
|
103
106
|
password: str | None = None,
|
|
104
107
|
key_id: str | None = None,
|
|
105
108
|
secret_id: str | None = None,
|
|
109
|
+
assume_role_kwargs: dict | None = None,
|
|
106
110
|
role_id: str | None = None,
|
|
107
111
|
kubernetes_role: str | None = None,
|
|
108
112
|
kubernetes_jwt_path: str | None = "/var/run/secrets/kubernetes.io/serviceaccount/token",
|
|
@@ -161,6 +165,7 @@ class _VaultClient(LoggingMixin):
|
|
|
161
165
|
self.key_id = key_id
|
|
162
166
|
self.secret_id = secret_id
|
|
163
167
|
self.role_id = role_id
|
|
168
|
+
self.assume_role_kwargs = assume_role_kwargs
|
|
164
169
|
self.kubernetes_role = kubernetes_role
|
|
165
170
|
self.kubernetes_jwt_path = kubernetes_jwt_path
|
|
166
171
|
self.gcp_key_path = gcp_key_path
|
|
@@ -318,15 +323,36 @@ class _VaultClient(LoggingMixin):
|
|
|
318
323
|
)
|
|
319
324
|
|
|
320
325
|
def _auth_aws_iam(self, _client: hvac.Client) -> None:
|
|
321
|
-
if self.
|
|
322
|
-
|
|
323
|
-
access_key
|
|
324
|
-
secret_key
|
|
325
|
-
role
|
|
326
|
-
|
|
327
|
-
)
|
|
326
|
+
if self.key_id and self.secret_id:
|
|
327
|
+
auth_args = {
|
|
328
|
+
"access_key": self.key_id,
|
|
329
|
+
"secret_key": self.secret_id,
|
|
330
|
+
"role": self.role_id,
|
|
331
|
+
}
|
|
328
332
|
else:
|
|
329
|
-
|
|
333
|
+
import boto3
|
|
334
|
+
|
|
335
|
+
if self.assume_role_kwargs:
|
|
336
|
+
sts_client = boto3.client("sts")
|
|
337
|
+
credentials = sts_client.assume_role(**self.assume_role_kwargs)
|
|
338
|
+
auth_args = {
|
|
339
|
+
"access_key": credentials["Credentials"]["AccessKeyId"],
|
|
340
|
+
"secret_key": credentials["Credentials"]["SecretAccessKey"],
|
|
341
|
+
"session_token": credentials["Credentials"]["SessionToken"],
|
|
342
|
+
}
|
|
343
|
+
else:
|
|
344
|
+
session = boto3.Session()
|
|
345
|
+
credentials = session.get_credentials()
|
|
346
|
+
auth_args = {
|
|
347
|
+
"access_key": credentials.access_key,
|
|
348
|
+
"secret_key": credentials.secret_key,
|
|
349
|
+
"session_token": credentials.token,
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
if self.auth_mount_point:
|
|
353
|
+
auth_args["mount_point"] = self.auth_mount_point
|
|
354
|
+
|
|
355
|
+
_client.auth.aws.iam_login(**auth_args)
|
|
330
356
|
|
|
331
357
|
def _auth_approle(self, _client: hvac.Client) -> None:
|
|
332
358
|
if self.auth_mount_point:
|
|
@@ -28,8 +28,9 @@ def get_provider_info():
|
|
|
28
28
|
"name": "Hashicorp",
|
|
29
29
|
"description": "Hashicorp including `Hashicorp Vault <https://www.vaultproject.io/>`__\n",
|
|
30
30
|
"state": "ready",
|
|
31
|
-
"source-date-epoch":
|
|
31
|
+
"source-date-epoch": 1714476565,
|
|
32
32
|
"versions": [
|
|
33
|
+
"3.7.0",
|
|
33
34
|
"3.6.4",
|
|
34
35
|
"3.6.3",
|
|
35
36
|
"3.6.2",
|
|
@@ -57,7 +58,7 @@ def get_provider_info():
|
|
|
57
58
|
"1.0.1",
|
|
58
59
|
"1.0.0",
|
|
59
60
|
],
|
|
60
|
-
"dependencies": ["apache-airflow>=2.
|
|
61
|
+
"dependencies": ["apache-airflow>=2.7.0", "hvac>=1.1.0"],
|
|
61
62
|
"integrations": [
|
|
62
63
|
{
|
|
63
64
|
"integration-name": "Hashicorp Vault",
|
|
@@ -79,4 +80,5 @@ def get_provider_info():
|
|
|
79
80
|
}
|
|
80
81
|
],
|
|
81
82
|
"secrets-backends": ["airflow.providers.hashicorp.secrets.vault.VaultBackend"],
|
|
83
|
+
"additional-extras": [{"name": "boto3", "dependencies": ["boto3>=1.33.0"]}],
|
|
82
84
|
}
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
# specific language governing permissions and limitations
|
|
17
17
|
# under the License.
|
|
18
18
|
"""Objects relating to sourcing connections & variables from Hashicorp Vault."""
|
|
19
|
+
|
|
19
20
|
from __future__ import annotations
|
|
20
21
|
|
|
21
22
|
from typing import TYPE_CHECKING
|
|
@@ -73,6 +74,9 @@ class VaultBackend(BaseSecretsBackend, LoggingMixin):
|
|
|
73
74
|
:param key_id: Key ID for Authentication (for ``aws_iam`` and ''azure`` auth_type).
|
|
74
75
|
:param secret_id: Secret ID for Authentication (for ``approle``, ``aws_iam`` and ``azure`` auth_types).
|
|
75
76
|
:param role_id: Role ID for Authentication (for ``approle``, ``aws_iam`` auth_types).
|
|
77
|
+
:param assume_role_kwargs: AWS assume role param.
|
|
78
|
+
See AWS STS Docs:
|
|
79
|
+
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sts/client/assume_role.html
|
|
76
80
|
:param kubernetes_role: Role for Authentication (for ``kubernetes`` auth_type).
|
|
77
81
|
:param kubernetes_jwt_path: Path for kubernetes jwt token (for ``kubernetes`` auth_type, default:
|
|
78
82
|
``/var/run/secrets/kubernetes.io/serviceaccount/token``).
|
|
@@ -106,6 +110,7 @@ class VaultBackend(BaseSecretsBackend, LoggingMixin):
|
|
|
106
110
|
key_id: str | None = None,
|
|
107
111
|
secret_id: str | None = None,
|
|
108
112
|
role_id: str | None = None,
|
|
113
|
+
assume_role_kwargs: dict | None = None,
|
|
109
114
|
kubernetes_role: str | None = None,
|
|
110
115
|
kubernetes_jwt_path: str = "/var/run/secrets/kubernetes.io/serviceaccount/token",
|
|
111
116
|
gcp_key_path: str | None = None,
|
|
@@ -146,6 +151,7 @@ class VaultBackend(BaseSecretsBackend, LoggingMixin):
|
|
|
146
151
|
key_id=key_id,
|
|
147
152
|
secret_id=secret_id,
|
|
148
153
|
role_id=role_id,
|
|
154
|
+
assume_role_kwargs=assume_role_kwargs,
|
|
149
155
|
kubernetes_role=kubernetes_role,
|
|
150
156
|
kubernetes_jwt_path=kubernetes_jwt_path,
|
|
151
157
|
gcp_key_path=gcp_key_path,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: apache-airflow-providers-hashicorp
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.7.0
|
|
4
4
|
Summary: Provider package apache-airflow-providers-hashicorp for Apache Airflow
|
|
5
5
|
Keywords: airflow-provider,hashicorp,airflow,integration
|
|
6
6
|
Author-email: Apache Software Foundation <dev@airflow.apache.org>
|
|
@@ -19,17 +19,20 @@ Classifier: Programming Language :: Python :: 3.8
|
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.9
|
|
20
20
|
Classifier: Programming Language :: Python :: 3.10
|
|
21
21
|
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
23
|
Classifier: Topic :: System :: Monitoring
|
|
23
|
-
Requires-Dist: apache-airflow>=2.
|
|
24
|
+
Requires-Dist: apache-airflow>=2.7.0
|
|
24
25
|
Requires-Dist: hvac>=1.1.0
|
|
26
|
+
Requires-Dist: boto3>=1.33.0 ; extra == "boto3"
|
|
25
27
|
Requires-Dist: apache-airflow-providers-google ; extra == "google"
|
|
26
28
|
Project-URL: Bug Tracker, https://github.com/apache/airflow/issues
|
|
27
|
-
Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-hashicorp/3.
|
|
28
|
-
Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-hashicorp/3.
|
|
29
|
+
Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-hashicorp/3.7.0/changelog.html
|
|
30
|
+
Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-hashicorp/3.7.0
|
|
29
31
|
Project-URL: Slack Chat, https://s.apache.org/airflow-slack
|
|
30
32
|
Project-URL: Source Code, https://github.com/apache/airflow
|
|
31
33
|
Project-URL: Twitter, https://twitter.com/ApacheAirflow
|
|
32
34
|
Project-URL: YouTube, https://www.youtube.com/channel/UCSXwxpWZQ7XZ1WL3wqevChA/
|
|
35
|
+
Provides-Extra: boto3
|
|
33
36
|
Provides-Extra: google
|
|
34
37
|
|
|
35
38
|
|
|
@@ -76,7 +79,7 @@ Provides-Extra: google
|
|
|
76
79
|
|
|
77
80
|
Package ``apache-airflow-providers-hashicorp``
|
|
78
81
|
|
|
79
|
-
Release: ``3.
|
|
82
|
+
Release: ``3.7.0``
|
|
80
83
|
|
|
81
84
|
|
|
82
85
|
Hashicorp including `Hashicorp Vault <https://www.vaultproject.io/>`__
|
|
@@ -89,7 +92,7 @@ This is a provider package for ``hashicorp`` provider. All classes for this prov
|
|
|
89
92
|
are in ``airflow.providers.hashicorp`` python package.
|
|
90
93
|
|
|
91
94
|
You can find package information and changelog for the provider
|
|
92
|
-
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-hashicorp/3.
|
|
95
|
+
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-hashicorp/3.7.0/>`_.
|
|
93
96
|
|
|
94
97
|
Installation
|
|
95
98
|
------------
|
|
@@ -98,7 +101,7 @@ You can install this package on top of an existing Airflow 2 installation (see `
|
|
|
98
101
|
for the minimum Airflow version supported) via
|
|
99
102
|
``pip install apache-airflow-providers-hashicorp``
|
|
100
103
|
|
|
101
|
-
The package supports the following python versions: 3.8,3.9,3.10,3.11
|
|
104
|
+
The package supports the following python versions: 3.8,3.9,3.10,3.11,3.12
|
|
102
105
|
|
|
103
106
|
Requirements
|
|
104
107
|
------------
|
|
@@ -106,7 +109,7 @@ Requirements
|
|
|
106
109
|
================== ==================
|
|
107
110
|
PIP package Version required
|
|
108
111
|
================== ==================
|
|
109
|
-
``apache-airflow`` ``>=2.
|
|
112
|
+
``apache-airflow`` ``>=2.7.0``
|
|
110
113
|
``hvac`` ``>=1.1.0``
|
|
111
114
|
================== ==================
|
|
112
115
|
|
|
@@ -130,4 +133,4 @@ Dependent package
|
|
|
130
133
|
==================================================================================================== ==========
|
|
131
134
|
|
|
132
135
|
The changelog for the provider package can be found in the
|
|
133
|
-
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-hashicorp/3.
|
|
136
|
+
`changelog <https://airflow.apache.org/docs/apache-airflow-providers-hashicorp/3.7.0/changelog.html>`_.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
airflow/providers/hashicorp/LICENSE,sha256=ywUBpKZc7Jb96rVt5I3IDbg7dIJAbUSHkuoDcF3jbH4,13569
|
|
2
|
+
airflow/providers/hashicorp/__init__.py,sha256=7tzswygZ8TCQhYXDblarFr8anGBhJOxGq5NpnXCxHWA,1584
|
|
3
|
+
airflow/providers/hashicorp/get_provider_info.py,sha256=cc57L-afbIWFV3nw_G1i-5XMo-lklVjplGR4Btm-xMA,2887
|
|
4
|
+
airflow/providers/hashicorp/_internal_client/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
|
5
|
+
airflow/providers/hashicorp/_internal_client/vault_client.py,sha256=-56JrdsuVmGRadQ2a4EudeIViFNbFfZtMSGC-Tn4IQA,22534
|
|
6
|
+
airflow/providers/hashicorp/hooks/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
|
7
|
+
airflow/providers/hashicorp/hooks/vault.py,sha256=FWz-aA2otpMox1jdoXCapY6yWqV-vYmC3ycnW5YYRwA,18790
|
|
8
|
+
airflow/providers/hashicorp/secrets/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
|
9
|
+
airflow/providers/hashicorp/secrets/vault.py,sha256=_jxZqLbHnqp047Rza5e5HA5cm7ZR2TRg7O1GKGWFpuA,12245
|
|
10
|
+
apache_airflow_providers_hashicorp-3.7.0.dist-info/entry_points.txt,sha256=M338G3KvFSRu5IqEFm5Qheg_myVuQbsN_2EbAwcgqk4,105
|
|
11
|
+
apache_airflow_providers_hashicorp-3.7.0.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
|
|
12
|
+
apache_airflow_providers_hashicorp-3.7.0.dist-info/METADATA,sha256=6ERmIHkhxCikcjvIeBVAivB9x6OXhcTo3VtW3DMvJRI,5931
|
|
13
|
+
apache_airflow_providers_hashicorp-3.7.0.dist-info/RECORD,,
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
airflow/providers/hashicorp/LICENSE,sha256=ywUBpKZc7Jb96rVt5I3IDbg7dIJAbUSHkuoDcF3jbH4,13569
|
|
2
|
-
airflow/providers/hashicorp/__init__.py,sha256=e17chsniXN7cjIbFlGyK04MY8AGqq6pLXHteXuiapL8,1584
|
|
3
|
-
airflow/providers/hashicorp/get_provider_info.py,sha256=K5T_ECTUlem7K8yG6EDRk9LfA544VqEV1vKbIh8Zzlw,2781
|
|
4
|
-
airflow/providers/hashicorp/_internal_client/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
|
5
|
-
airflow/providers/hashicorp/_internal_client/vault_client.py,sha256=dEz6fLLt5zFSHy2YI2w2jlVzU-a0zzFM6v_hcJ3YYuM,21435
|
|
6
|
-
airflow/providers/hashicorp/hooks/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
|
7
|
-
airflow/providers/hashicorp/hooks/vault.py,sha256=P1XdqaBdAbZb7qa4q-f0zo7fUDNj2V67uGs4YAZ-PCM,18789
|
|
8
|
-
airflow/providers/hashicorp/secrets/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
|
|
9
|
-
airflow/providers/hashicorp/secrets/vault.py,sha256=uYnw-EpdXyw0sj8QrVzHNhhTgtkDSFmIH77NYIkiRH8,11954
|
|
10
|
-
apache_airflow_providers_hashicorp-3.6.4.dist-info/entry_points.txt,sha256=M338G3KvFSRu5IqEFm5Qheg_myVuQbsN_2EbAwcgqk4,105
|
|
11
|
-
apache_airflow_providers_hashicorp-3.6.4.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
|
|
12
|
-
apache_airflow_providers_hashicorp-3.6.4.dist-info/METADATA,sha256=Yjkt3YfGfFLZLYgrqksRix0uO6w1nl2CvneNGgj4ids,5805
|
|
13
|
-
apache_airflow_providers_hashicorp-3.6.4.dist-info/RECORD,,
|
|
File without changes
|