osdu-python-client 0.12.0__py3-none-any.whl → 0.13.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.
@@ -7,7 +7,6 @@ providers self-register on import. Built-in registry entries:
7
7
  - ``azure_msal`` — Azure / Entra ID via MSAL (interactive, device flow, client credentials, workload identity).
8
8
  - ``aws_cognito`` — AWS via OAuth2 client credentials against a Cognito/custom token endpoint.
9
9
  - ``gcp_iam`` — GCP via google-auth (service account JSON or Application Default Credentials).
10
- - ``ibm_iam`` — IBM via Keycloak OIDC (resource owner password).
11
10
 
12
11
  For unsupported CSPs, pass your own ``TokenProvider`` to ``OsduClient`` and
13
12
  ignore this whole machinery.
@@ -28,7 +27,6 @@ from osdu_python_client.auth import ci as _ci # noqa: F401
28
27
  from osdu_python_client.auth import aws as _aws # noqa: F401
29
28
  from osdu_python_client.auth import azure as _azure # noqa: F401
30
29
  from osdu_python_client.auth import gcp as _gcp # noqa: F401
31
- from osdu_python_client.auth import ibm as _ibm # noqa: F401
32
30
  from osdu_python_client.auth.aws import AwsClientCredentialsProvider, AwsConfig
33
31
  from osdu_python_client.auth.azure import (
34
32
  AzureMsalConfig,
@@ -39,7 +37,6 @@ from osdu_python_client.auth.azure import (
39
37
  )
40
38
  from osdu_python_client.auth.ci import CiConfig, CiKeycloakProvider
41
39
  from osdu_python_client.auth.gcp import GcpConfig, GcpTokenProvider
42
- from osdu_python_client.auth.ibm import IbmConfig, IbmKeycloakProvider
43
40
 
44
41
  __all__ = [
45
42
  # Community / baremetal
@@ -57,9 +54,6 @@ __all__ = [
57
54
  # GCP
58
55
  "GcpConfig",
59
56
  "GcpTokenProvider",
60
- # IBM
61
- "IbmConfig",
62
- "IbmKeycloakProvider",
63
57
  # Base
64
58
  "TokenProvider",
65
59
  "TokenProviderFactory",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: osdu-python-client
3
- Version: 0.12.0
3
+ Version: 0.13.0
4
4
  Summary: Python client for OSDU services
5
5
  Author: OSDU team
6
6
  License-Expression: Apache-2.0
@@ -9,13 +9,13 @@ Project-URL: Repository, https://community.opengroup.org/osdu/platform/system/sd
9
9
  Project-URL: Documentation, https://community.opengroup.org/osdu/platform/system/sdks/osdu-python-client/-/blob/main/docs/usage.md
10
10
  Project-URL: Issues, https://community.opengroup.org/osdu/platform/system/sdks/osdu-python-client/-/issues
11
11
  Classifier: Programming Language :: Python :: 3
12
- Classifier: Programming Language :: Python :: 3.10
13
12
  Classifier: Programming Language :: Python :: 3.11
14
13
  Classifier: Programming Language :: Python :: 3.12
15
14
  Classifier: Programming Language :: Python :: 3.13
16
15
  Classifier: Programming Language :: Python :: 3.14
16
+ Classifier: Programming Language :: Python :: 3.15
17
17
  Classifier: Operating System :: OS Independent
18
- Requires-Python: >=3.10
18
+ Requires-Python: >=3.11
19
19
  Description-Content-Type: text/markdown
20
20
  License-File: LICENSE
21
21
  Requires-Dist: attrs>=26.1.0
@@ -27,15 +27,12 @@ Requires-Dist: msal>=1.35.1; extra == "azure"
27
27
  Requires-Dist: azure-identity>=1.14.0; extra == "azure"
28
28
  Provides-Extra: gcp
29
29
  Requires-Dist: google-auth[requests]>=2.0.0; extra == "gcp"
30
- Provides-Extra: ibm
31
- Requires-Dist: python-keycloak>=3.0.0; extra == "ibm"
32
30
  Provides-Extra: parquet
33
31
  Requires-Dist: pyarrow>=17.0.0; extra == "parquet"
34
32
  Provides-Extra: all-csp
35
33
  Requires-Dist: msal>=1.35.1; extra == "all-csp"
36
34
  Requires-Dist: azure-identity>=1.14.0; extra == "all-csp"
37
35
  Requires-Dist: google-auth[requests]>=2.0.0; extra == "all-csp"
38
- Requires-Dist: python-keycloak>=3.0.0; extra == "all-csp"
39
36
  Provides-Extra: dev
40
37
  Requires-Dist: pytest==9.0.3; extra == "dev"
41
38
  Requires-Dist: pytest-asyncio>=0.24.0; extra == "dev"
@@ -65,7 +62,6 @@ The base install supports Community/baremetal (Keycloak client credentials) and
65
62
  |-------|-------|---------|
66
63
  | Azure / Entra ID | `azure` | `pip install 'osdu-python-client[azure]'` |
67
64
  | GCP | `gcp` | `pip install 'osdu-python-client[gcp]'` |
68
- | IBM | `ibm` | `pip install 'osdu-python-client[ibm]'` |
69
65
  | All providers | `all-csp` | `pip install 'osdu-python-client[all-csp]'` |
70
66
 
71
67
  Feature extras:
@@ -74,7 +70,7 @@ Feature extras:
74
70
  |---------|-------|---------|
75
71
  | Wellbore DDMS Parquet bulk data (`pyarrow`) | `parquet` | `pip install 'osdu-python-client[parquet]'` |
76
72
 
77
- Python 3.10+ is required (tested on 3.10 through 3.14).
73
+ Python 3.11+ is required (tested on 3.11 through 3.15).
78
74
 
79
75
  ## Quick Start
80
76
 
@@ -183,7 +179,6 @@ Auth is pluggable via `AUTH_PROVIDER`. Azure MSAL is built in; other CSPs can be
183
179
  | `azure_msal` | built-in | `CLIENT_ID`, `AUTHORITY`, `SCOPES`, `AUTH_MODE` |
184
180
  | `aws_cognito` | stub | bring your own `TokenProvider` |
185
181
  | `gcp_iam` | stub | bring your own `TokenProvider` |
186
- | `ibm_iam` | stub | bring your own `TokenProvider` |
187
182
 
188
183
  ### Azure MSAL flows
189
184
 
@@ -9,13 +9,12 @@ osdu_python_client/hooks.py,sha256=_VxWw1iEoEELfgJysar0jwDcdJesTF5WCrRhgY3j3cw,5
9
9
  osdu_python_client/logging_setup.py,sha256=lIOhkzg9BOsET2TbaNNdNJPT0C1-6-4ae5c7UOEX3hs,1286
10
10
  osdu_python_client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  osdu_python_client/transport.py,sha256=eKQQUduqNACGmdHW8mpgobFYe9OwLm_zwBmSo64XSiA,10528
12
- osdu_python_client/auth/__init__.py,sha256=yUfClGNUgwP1RP7e_EJnTNslcJDY4NNTJmfoD0Rr_s4,2478
12
+ osdu_python_client/auth/__init__.py,sha256=XQE8ON2wV4r8zuKXj_4-VncsxNLz-w6x_TfK9d8Vdso,2221
13
13
  osdu_python_client/auth/_base.py,sha256=GMvdYiXcbRPglG5zGZbLnGfCdNUh2C7-RwVHwFB2QRM,1967
14
14
  osdu_python_client/auth/aws.py,sha256=wT9w7YkQsa91l9qcYoYpCqRiNVZ7eegmQJKEvLdcYYI,3423
15
15
  osdu_python_client/auth/azure.py,sha256=CvtCm_Nmlx_4xd_NijqnQ16Cq_dCcqh3DwtK7Zclfb0,14815
16
16
  osdu_python_client/auth/ci.py,sha256=Hoc9WYGfhK2lWm8jdyXmttkG8Z7vGK-yLQo_Pdjmvu0,3613
17
17
  osdu_python_client/auth/gcp.py,sha256=KsqOB3f-sLZUbBysq87G91lWa_HZf_0I7ocuVqfnSVE,3540
18
- osdu_python_client/auth/ibm.py,sha256=huaVxSCwbpTsm0LAU1v6T2u-TugJRitsCY4NRHgD4CY,3502
19
18
  osdu_python_client/generated/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
19
  osdu_python_client/generated/crs_catalog/__init__.py,sha256=6KA3gogFOGN5Qetfvwfn4dKMB6g8H-07W0m1aDsx7xI,166
21
20
  osdu_python_client/generated/crs_catalog/_facade.pyi,sha256=_9YFnza97cyk3R9LY4Nb9lWAvlD5Ls2W7XiUsUAHKvo,5065
@@ -956,8 +955,8 @@ osdu_python_client/services/__init__.py,sha256=_ZJwu7SBUPudjm_Kotd5vjSo_nQKlUh4S
956
955
  osdu_python_client/services/facade.py,sha256=pXDYYfVcn3Ls1L1It6tVOv-gZgD8uKg8K9JmEn_kbDc,6544
957
956
  osdu_python_client/services/registry.py,sha256=T8norw7WM3RucbktjENpA00CTnRu3chn9KzAAfddviA,5459
958
957
  osdu_python_client/services/wellbore_ddms.py,sha256=3DunJJcjcn0DRx_ONgm14xl3ikrz6AoQs_JYKwFsEwY,20756
959
- osdu_python_client-0.12.0.dist-info/licenses/LICENSE,sha256=mbmpdYp4WedCVTL1gTJqhNVnR6h012ht-b3eG9xYM3A,11418
960
- osdu_python_client-0.12.0.dist-info/METADATA,sha256=yyek5k28BGOGTxVj4HP0TVPXtx3BkFAma8Ib_U8KwHk,15152
961
- osdu_python_client-0.12.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
962
- osdu_python_client-0.12.0.dist-info/top_level.txt,sha256=1WpzwJhlCok7kjThasFuwXMOk7lfy_GaubVUv0217Ck,19
963
- osdu_python_client-0.12.0.dist-info/RECORD,,
958
+ osdu_python_client-0.13.0.dist-info/licenses/LICENSE,sha256=mbmpdYp4WedCVTL1gTJqhNVnR6h012ht-b3eG9xYM3A,11418
959
+ osdu_python_client-0.13.0.dist-info/METADATA,sha256=tqQP2JHGlmEoi8Zs76U72TPirMtypqr2rljNZCya3Qc,14908
960
+ osdu_python_client-0.13.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
961
+ osdu_python_client-0.13.0.dist-info/top_level.txt,sha256=1WpzwJhlCok7kjThasFuwXMOk7lfy_GaubVUv0217Ck,19
962
+ osdu_python_client-0.13.0.dist-info/RECORD,,
@@ -1,102 +0,0 @@
1
- """IBM auth provider using Keycloak OIDC (Resource Owner Password Credentials).
2
-
3
- OSDU-on-IBM deployments authenticate via a Keycloak server. Requires
4
- ``python-keycloak``; install with ``pip install 'osdu-python-client[ibm]'``.
5
-
6
- Required environment variables (or .env entries):
7
-
8
- IBM_KEYCLOAK_URI — Keycloak server URL (e.g. https://keycloak.example.com/auth/)
9
- IBM_REALM_NAME — Keycloak realm name
10
- IBM_CLIENT_ID — Keycloak client ID
11
- IBM_CLIENT_SECRET — Keycloak client secret
12
- IBM_USERNAME — user login
13
- IBM_PASSWORD — user password
14
- IBM_VERIFY_SSL — set to "false" to disable SSL verification (default: true)
15
- """
16
-
17
- from __future__ import annotations
18
-
19
- import logging
20
- import threading
21
- import time
22
- from typing import TYPE_CHECKING
23
-
24
- from pydantic_settings import BaseSettings, SettingsConfigDict
25
-
26
- from osdu_python_client.auth._base import TokenProvider, register_provider
27
- from osdu_python_client.errors import OsduAuthError, OsduConfigError
28
-
29
- if TYPE_CHECKING:
30
- from osdu_python_client.config import OsduConfig
31
-
32
- log = logging.getLogger(__name__)
33
-
34
-
35
- class IbmConfig(BaseSettings):
36
- """IBM/Keycloak auth settings, loaded from the same ``.env`` as OsduConfig."""
37
-
38
- ibm_keycloak_uri: str
39
- ibm_realm_name: str
40
- ibm_client_id: str
41
- ibm_client_secret: str
42
- ibm_username: str
43
- ibm_password: str
44
- ibm_verify_ssl: bool = True
45
-
46
- model_config = SettingsConfigDict(
47
- env_file=".env",
48
- env_file_encoding="utf-8",
49
- extra="ignore",
50
- )
51
-
52
-
53
- class IbmKeycloakProvider:
54
- """Token provider for OSDU-on-IBM using Keycloak OIDC."""
55
-
56
- def __init__(self, config: IbmConfig) -> None:
57
- self._config = config
58
- self._lock = threading.Lock()
59
- self._token: str | None = None
60
- self._expires_at: float = 0.0
61
-
62
- def get_token(self, force_refresh: bool = False) -> str:
63
- with self._lock:
64
- if force_refresh or self._token is None or time.monotonic() >= self._expires_at:
65
- self._fetch()
66
- return self._token # type: ignore[return-value]
67
-
68
- def _fetch(self) -> None:
69
- try:
70
- from keycloak import KeycloakOpenID
71
- except ImportError as exc:
72
- raise OsduConfigError(
73
- "python-keycloak is required for IBM auth. "
74
- "Install it with: pip install 'osdu-python-client[ibm]'"
75
- ) from exc
76
-
77
- cfg = self._config
78
- log.debug("acquiring IBM token from %s realm=%s", cfg.ibm_keycloak_uri, cfg.ibm_realm_name)
79
- kc = KeycloakOpenID(
80
- server_url=cfg.ibm_keycloak_uri,
81
- realm_name=cfg.ibm_realm_name,
82
- client_id=cfg.ibm_client_id,
83
- client_secret_key=cfg.ibm_client_secret,
84
- verify=cfg.ibm_verify_ssl,
85
- )
86
- token_response = kc.token(cfg.ibm_username, cfg.ibm_password)
87
- refreshed = kc.refresh_token(token_response["refresh_token"])
88
- token = refreshed.get("access_token")
89
- if not token:
90
- raise OsduAuthError(f"IBM Keycloak token refresh returned no access_token: {refreshed}")
91
-
92
- expires_in = int(refreshed.get("expires_in", 300))
93
- self._token = token
94
- self._expires_at = time.monotonic() + expires_in - 30 # 30s early-refresh buffer
95
- log.debug("IBM token acquired, expires in %ds", expires_in)
96
-
97
-
98
- def _factory(_config: "OsduConfig") -> TokenProvider:
99
- return IbmKeycloakProvider(IbmConfig())
100
-
101
-
102
- register_provider("ibm_iam", _factory)