databricks-tellr 0.4.3.dev13__tar.gz → 0.4.3.dev14__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.
- {databricks_tellr-0.4.3.dev13 → databricks_tellr-0.4.3.dev14}/PKG-INFO +1 -1
- {databricks_tellr-0.4.3.dev13 → databricks_tellr-0.4.3.dev14}/databricks_tellr/secret_key.py +22 -4
- {databricks_tellr-0.4.3.dev13 → databricks_tellr-0.4.3.dev14}/databricks_tellr.egg-info/PKG-INFO +1 -1
- {databricks_tellr-0.4.3.dev13 → databricks_tellr-0.4.3.dev14}/pyproject.toml +1 -1
- {databricks_tellr-0.4.3.dev13 → databricks_tellr-0.4.3.dev14}/README.md +0 -0
- {databricks_tellr-0.4.3.dev13 → databricks_tellr-0.4.3.dev14}/databricks_tellr/__init__.py +0 -0
- {databricks_tellr-0.4.3.dev13 → databricks_tellr-0.4.3.dev14}/databricks_tellr/_templates/app.yaml.template +0 -0
- {databricks_tellr-0.4.3.dev13 → databricks_tellr-0.4.3.dev14}/databricks_tellr/_templates/requirements.txt.template +0 -0
- {databricks_tellr-0.4.3.dev13 → databricks_tellr-0.4.3.dev14}/databricks_tellr/deploy.py +0 -0
- {databricks_tellr-0.4.3.dev13 → databricks_tellr-0.4.3.dev14}/databricks_tellr/identifiers.py +0 -0
- {databricks_tellr-0.4.3.dev13 → databricks_tellr-0.4.3.dev14}/databricks_tellr.egg-info/SOURCES.txt +0 -0
- {databricks_tellr-0.4.3.dev13 → databricks_tellr-0.4.3.dev14}/databricks_tellr.egg-info/dependency_links.txt +0 -0
- {databricks_tellr-0.4.3.dev13 → databricks_tellr-0.4.3.dev14}/databricks_tellr.egg-info/requires.txt +0 -0
- {databricks_tellr-0.4.3.dev13 → databricks_tellr-0.4.3.dev14}/databricks_tellr.egg-info/top_level.txt +0 -0
- {databricks_tellr-0.4.3.dev13 → databricks_tellr-0.4.3.dev14}/setup.cfg +0 -0
{databricks_tellr-0.4.3.dev13 → databricks_tellr-0.4.3.dev14}/databricks_tellr/secret_key.py
RENAMED
|
@@ -19,6 +19,7 @@ from typing import Any
|
|
|
19
19
|
|
|
20
20
|
import requests
|
|
21
21
|
from cryptography.fernet import Fernet
|
|
22
|
+
from databricks.sdk.errors import NotFound
|
|
22
23
|
from databricks.sdk.service.apps import (
|
|
23
24
|
App,
|
|
24
25
|
AppResource,
|
|
@@ -113,6 +114,21 @@ def preflight_lakebase_privileges(cur: Any, schema_name: str) -> None:
|
|
|
113
114
|
|
|
114
115
|
|
|
115
116
|
def _looks_absent(exc: Exception) -> bool:
|
|
117
|
+
"""True when *exc* means the secret/scope genuinely does not exist.
|
|
118
|
+
|
|
119
|
+
The SDK raises a typed ``NotFound`` (subclass ``ResourceDoesNotExist``,
|
|
120
|
+
``error_code == "RESOURCE_DOES_NOT_EXIST"``) whose ``str()`` is a human
|
|
121
|
+
message like ``"Failed to get secret X for scope Y"`` that does NOT contain
|
|
122
|
+
the code — so match on the exception TYPE (and ``error_code``), never the
|
|
123
|
+
message text. A permission denial is a distinct ``PermissionDenied`` (403)
|
|
124
|
+
that is not a ``NotFound``, so it is correctly NOT treated as absent — the
|
|
125
|
+
guard against overwriting a live key still holds.
|
|
126
|
+
"""
|
|
127
|
+
if isinstance(exc, NotFound):
|
|
128
|
+
return True
|
|
129
|
+
if getattr(exc, "error_code", None) == "RESOURCE_DOES_NOT_EXIST":
|
|
130
|
+
return True
|
|
131
|
+
# Fallback for un-typed errors that still name the code in their text.
|
|
116
132
|
return "RESOURCE_DOES_NOT_EXIST" in str(exc).upper()
|
|
117
133
|
|
|
118
134
|
|
|
@@ -129,11 +145,13 @@ def read_secret_key(ws: Any, scope: str, key: str) -> str | None:
|
|
|
129
145
|
except Exception as exc: # noqa: BLE001
|
|
130
146
|
if _looks_absent(exc):
|
|
131
147
|
return None
|
|
148
|
+
_code = getattr(exc, "error_code", None)
|
|
132
149
|
raise SecretKeyError(
|
|
133
|
-
f"Could not read secret {scope}/{key}:
|
|
134
|
-
f"'
|
|
135
|
-
f"
|
|
136
|
-
f"
|
|
150
|
+
f"Could not read secret {scope}/{key}: "
|
|
151
|
+
f"[{type(exc).__name__}{'/' + _code if _code else ''}] {exc}. "
|
|
152
|
+
f"This is not a recognized 'not found' error (most likely a permission "
|
|
153
|
+
f"problem) — refusing to continue rather than risk overwriting a key "
|
|
154
|
+
f"that may already protect stored credentials."
|
|
137
155
|
) from exc
|
|
138
156
|
|
|
139
157
|
if resp is None or not resp.value:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{databricks_tellr-0.4.3.dev13 → databricks_tellr-0.4.3.dev14}/databricks_tellr/identifiers.py
RENAMED
|
File without changes
|
{databricks_tellr-0.4.3.dev13 → databricks_tellr-0.4.3.dev14}/databricks_tellr.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{databricks_tellr-0.4.3.dev13 → databricks_tellr-0.4.3.dev14}/databricks_tellr.egg-info/requires.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|