apache-airflow-providers-hashicorp 3.6.4__tar.gz → 3.7.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.

Potentially problematic release.


This version of apache-airflow-providers-hashicorp might be problematic. Click here for more details.

Files changed (12) hide show
  1. {apache_airflow_providers_hashicorp-3.6.4 → apache_airflow_providers_hashicorp-3.7.0}/PKG-INFO +12 -9
  2. {apache_airflow_providers_hashicorp-3.6.4 → apache_airflow_providers_hashicorp-3.7.0}/README.rst +5 -5
  3. {apache_airflow_providers_hashicorp-3.6.4 → apache_airflow_providers_hashicorp-3.7.0}/airflow/providers/hashicorp/__init__.py +3 -3
  4. {apache_airflow_providers_hashicorp-3.6.4 → apache_airflow_providers_hashicorp-3.7.0}/airflow/providers/hashicorp/_internal_client/vault_client.py +34 -8
  5. {apache_airflow_providers_hashicorp-3.6.4 → apache_airflow_providers_hashicorp-3.7.0}/airflow/providers/hashicorp/get_provider_info.py +4 -2
  6. {apache_airflow_providers_hashicorp-3.6.4 → apache_airflow_providers_hashicorp-3.7.0}/airflow/providers/hashicorp/hooks/vault.py +1 -0
  7. {apache_airflow_providers_hashicorp-3.6.4 → apache_airflow_providers_hashicorp-3.7.0}/airflow/providers/hashicorp/secrets/vault.py +6 -0
  8. {apache_airflow_providers_hashicorp-3.6.4 → apache_airflow_providers_hashicorp-3.7.0}/pyproject.toml +8 -4
  9. {apache_airflow_providers_hashicorp-3.6.4 → apache_airflow_providers_hashicorp-3.7.0}/airflow/providers/hashicorp/LICENSE +0 -0
  10. {apache_airflow_providers_hashicorp-3.6.4 → apache_airflow_providers_hashicorp-3.7.0}/airflow/providers/hashicorp/_internal_client/__init__.py +0 -0
  11. {apache_airflow_providers_hashicorp-3.6.4 → apache_airflow_providers_hashicorp-3.7.0}/airflow/providers/hashicorp/hooks/__init__.py +0 -0
  12. {apache_airflow_providers_hashicorp-3.6.4 → apache_airflow_providers_hashicorp-3.7.0}/airflow/providers/hashicorp/secrets/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: apache-airflow-providers-hashicorp
3
- Version: 3.6.4
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.6.0
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.6.4/changelog.html
28
- Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-hashicorp/3.6.4
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.6.4``
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.6.4/>`_.
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.6.0``
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.6.4/changelog.html>`_.
136
+ `changelog <https://airflow.apache.org/docs/apache-airflow-providers-hashicorp/3.7.0/changelog.html>`_.
@@ -42,7 +42,7 @@
42
42
 
43
43
  Package ``apache-airflow-providers-hashicorp``
44
44
 
45
- Release: ``3.6.4``
45
+ Release: ``3.7.0``
46
46
 
47
47
 
48
48
  Hashicorp including `Hashicorp Vault <https://www.vaultproject.io/>`__
@@ -55,7 +55,7 @@ This is a provider package for ``hashicorp`` provider. All classes for this prov
55
55
  are in ``airflow.providers.hashicorp`` python package.
56
56
 
57
57
  You can find package information and changelog for the provider
58
- in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-hashicorp/3.6.4/>`_.
58
+ in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-hashicorp/3.7.0/>`_.
59
59
 
60
60
  Installation
61
61
  ------------
@@ -64,7 +64,7 @@ You can install this package on top of an existing Airflow 2 installation (see `
64
64
  for the minimum Airflow version supported) via
65
65
  ``pip install apache-airflow-providers-hashicorp``
66
66
 
67
- The package supports the following python versions: 3.8,3.9,3.10,3.11
67
+ The package supports the following python versions: 3.8,3.9,3.10,3.11,3.12
68
68
 
69
69
  Requirements
70
70
  ------------
@@ -72,7 +72,7 @@ Requirements
72
72
  ================== ==================
73
73
  PIP package Version required
74
74
  ================== ==================
75
- ``apache-airflow`` ``>=2.6.0``
75
+ ``apache-airflow`` ``>=2.7.0``
76
76
  ``hvac`` ``>=1.1.0``
77
77
  ================== ==================
78
78
 
@@ -96,4 +96,4 @@ Dependent package
96
96
  ==================================================================================================== ==========
97
97
 
98
98
  The changelog for the provider package can be found in the
99
- `changelog <https://airflow.apache.org/docs/apache-airflow-providers-hashicorp/3.6.4/changelog.html>`_.
99
+ `changelog <https://airflow.apache.org/docs/apache-airflow-providers-hashicorp/3.7.0/changelog.html>`_.
@@ -27,7 +27,7 @@ import packaging.version
27
27
 
28
28
  __all__ = ["__version__"]
29
29
 
30
- __version__ = "3.6.4"
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.6.0"
38
+ "2.7.0"
39
39
  ):
40
40
  raise RuntimeError(
41
- f"The package `apache-airflow-providers-hashicorp:{__version__}` needs Apache Airflow 2.6.0+"
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.auth_mount_point:
322
- _client.auth.aws.iam_login(
323
- access_key=self.key_id,
324
- secret_key=self.secret_id,
325
- role=self.role_id,
326
- mount_point=self.auth_mount_point,
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
- _client.auth.aws.iam_login(access_key=self.key_id, secret_key=self.secret_id, role=self.role_id)
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": 1709555759,
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.6.0", "hvac>=1.1.0"],
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
  }
@@ -15,6 +15,7 @@
15
15
  # specific language governing permissions and limitations
16
16
  # under the License.
17
17
  """Hook for HashiCorp Vault."""
18
+
18
19
  from __future__ import annotations
19
20
 
20
21
  import json
@@ -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,
@@ -28,7 +28,7 @@ build-backend = "flit_core.buildapi"
28
28
 
29
29
  [project]
30
30
  name = "apache-airflow-providers-hashicorp"
31
- version = "3.6.4"
31
+ version = "3.7.0"
32
32
  description = "Provider package apache-airflow-providers-hashicorp for Apache Airflow"
33
33
  readme = "README.rst"
34
34
  authors = [
@@ -51,17 +51,18 @@ classifiers = [
51
51
  "Programming Language :: Python :: 3.9",
52
52
  "Programming Language :: Python :: 3.10",
53
53
  "Programming Language :: Python :: 3.11",
54
+ "Programming Language :: Python :: 3.12",
54
55
  "Topic :: System :: Monitoring",
55
56
  ]
56
57
  requires-python = "~=3.8"
57
58
  dependencies = [
58
- "apache-airflow>=2.6.0",
59
+ "apache-airflow>=2.7.0",
59
60
  "hvac>=1.1.0",
60
61
  ]
61
62
 
62
63
  [project.urls]
63
- "Documentation" = "https://airflow.apache.org/docs/apache-airflow-providers-hashicorp/3.6.4"
64
- "Changelog" = "https://airflow.apache.org/docs/apache-airflow-providers-hashicorp/3.6.4/changelog.html"
64
+ "Documentation" = "https://airflow.apache.org/docs/apache-airflow-providers-hashicorp/3.7.0"
65
+ "Changelog" = "https://airflow.apache.org/docs/apache-airflow-providers-hashicorp/3.7.0/changelog.html"
65
66
  "Bug Tracker" = "https://github.com/apache/airflow/issues"
66
67
  "Source Code" = "https://github.com/apache/airflow"
67
68
  "Slack Chat" = "https://s.apache.org/airflow-slack"
@@ -74,6 +75,9 @@ provider_info = "airflow.providers.hashicorp.get_provider_info:get_provider_info
74
75
  "google" = [
75
76
  "apache-airflow-providers-google",
76
77
  ]
78
+ "boto3" = [
79
+ "boto3>=1.33.0",
80
+ ]
77
81
 
78
82
  [tool.flit.module]
79
83
  name = "airflow.providers.hashicorp"