Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
204ea94
fix(storage): omit credentials from saved jobs
eywalker Nov 28, 2026
db48578
fix(storage): handle legacy DSNs without psycopg
eywalker Nov 28, 2026
7163a6d
fix(storage): preserve public Delta options in saved jobs
eywalker Nov 28, 2026
477d14a
Merge remote-tracking branch 'origin/main' into eywalker/itl-1394-sav…
eywalker Nov 28, 2026
596feb2
fix(storage): complete Delta job credential redaction
eywalker Nov 28, 2026
d59a0bd
Merge remote-tracking branch 'origin/main' into eywalker/itl-1394-sav…
eywalker Nov 28, 2026
5baba64
fix(storage): redact credentials from unresolved job bindings
eywalker Nov 28, 2026
cb79c8c
fix(storage): preserve retained connection settings
eywalker Nov 29, 2026
6939a59
Merge remote-tracking branch 'origin/main' into eywalker/itl-1394-sav…
eywalker Nov 29, 2026
d8a8d20
fix(postgresql): preserve newer DSN options when saving jobs
eywalker Nov 29, 2026
3f5e9c9
Merge remote-tracking branch 'origin/main' into eywalker/itl-1394-sav…
eywalker Nov 29, 2026
9226504
fix(storage): preserve non-URL Delta option values
eywalker Nov 29, 2026
4ec6191
Merge remote-tracking branch 'origin/main' into eywalker/itl-1394-sav…
eywalker Nov 29, 2026
365f8b3
fix(storage): simplify saved credential handling
eywalker Nov 29, 2026
b438fc6
fix(storage): type psycopg conninfo serialization
eywalker Nov 29, 2026
5a27254
fix(delta): parse URL credentials before saving
eywalker Nov 29, 2026
4e002c0
Merge remote-tracking branch 'origin/main' into eywalker/itl-1394-sav…
eywalker Nov 29, 2026
0737514
fix(delta): preserve local storage roots when saving jobs
eywalker Nov 29, 2026
3778254
Merge remote-tracking branch 'origin/main' into eywalker/itl-1394-sav…
eywalker Nov 29, 2026
06e387c
fix(storage): preserve values outside credential option keys
eywalker Nov 29, 2026
c52ba10
fix(postgresql): pass the base conninfo explicitly
eywalker Nov 29, 2026
835a973
Merge remote-tracking branch 'origin/main' into eywalker/itl-1394-sav…
eywalker Nov 29, 2026
8db6067
fix(delta): omit credential aliases from saved jobs
eywalker Nov 29, 2026
113e8c4
test(delta): type the pinned credential key set
eywalker Nov 29, 2026
46dd148
fix(delta): preserve credential file locators and role identifiers
eywalker Nov 29, 2026
8f93297
Merge remote-tracking branch 'origin/main' into eywalker/itl-1394-sav…
eywalker Nov 29, 2026
e8d024d
fix(delta): preserve credential identifiers in saved jobs
eywalker Nov 29, 2026
a73f25f
Merge remote-tracking branch 'origin/main' into eywalker/itl-1394-sav…
eywalker Nov 29, 2026
8697058
test(storage): skip Windows-invalid Delta roots on Windows
eywalker Nov 29, 2026
665fa5e
docs(storage): clarify saved credential behavior
eywalker Nov 29, 2026
ca1773b
chore: merge main into ITL-1394
eywalker Nov 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions changelog.d/ITL-1394.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
### Breaking changes and migration

- Saved job files omit known Delta options carrying secret values and PostgreSQL connection
secrets that psycopg parses. Provide omitted credentials through the storage
backend's environment or credential provider, pass the configured database to
`PipelineJob.load()`, or bind a source that could not be rebuilt with
`job.bind(sources=...)`.
- When a reloaded S3 Delta database has a saved access-key ID and no matching
secret in its storage options, `list_table_paths()` raises
`TableListingNotSupportedError` with a missing-secret cause, so pass a database
configured with both credential options to `PipelineJob.load()`.

### Fixed

- Delta databases, PostgreSQL connectors and their source wrappers apply the storage
backend's credential-key list when saving jobs, including OpenDAL and Unity Catalog
aliases for Delta. Earlier files still load with their recorded settings.
- Saved Delta databases keep access-key IDs verbatim and omit the secret half of
each recognized access-key pair. They also retain account names, client and tenant
IDs, usernames, roots, endpoints, regions, credential-file paths, and AWS role
identifiers.
- Resaving a legacy job applies the same credential rules to retained source
and database configurations, including nested storage wrappers. PostgreSQL uses
psycopg to serialize the remaining connection settings after omitting secret keywords.

### Known limitations

- A credential embedded in a URL or path value is saved as given (ITL-1708). Pass
credentials through the dedicated options or the environment.
Save a job backed by `DeltaTableDatabase("az://fixtures/data?sig=example")` to see
`?sig=example` in its saved `root_uri`.
- PostgreSQL connection strings are saved as given when psycopg is unavailable
or cannot parse them.
58 changes: 48 additions & 10 deletions docs/concepts/pipeline-job.md
Original file line number Diff line number Diff line change
Expand Up @@ -556,16 +556,38 @@ the **Nodes** table below the picture for each node's columns and status.

## Saving and loading

`job.save(path)` writes the job to a JSON file: the graph, the database's location (and the
result database's, when one was given) and how each source was configured. `PipelineJob.load(path)` reads it back, for example in a later
Python session. An `InMemoryArrowDatabase` has no location to record, so here the database
is passed again; `PipelineJob.load(path, database=...)` is also how you point a loaded job
at a database that has moved, and `PipelineJob.load(path, result_database=...)` at a result
database. A connector database (SQLite, PostgreSQL, SpiralDB) is never rebuilt from the
file: pass it, built over your connector, or the load raises an error that names what to
pass. Saving a loaded job writes the database actually bound, the one you passed, in place of
the recorded one. The recorded one is kept only while nothing is bound in its slot, which
happens when a database of another kind could not be rebuilt and none was passed. The file records each node's own Arrow types, so saving types
`job.save(path)` writes the graph, database locations and source settings to a JSON file.
For an access-key pair, Delta saves the access-key ID and omits the secret access key.
It also omits the other secret values listed in
[Delta storage options omitted on save](#delta-storage-options-omitted-on-save).
It saves all other values verbatim, including account names, client and tenant IDs,
usernames, credential-file paths, role ARNs, and AWS external IDs.
For PostgreSQL, when psycopg parses the connection string and finds `password`,
`sslpassword`, or `oauth_client_secret`, it serializes the remaining settings. This
includes omitting a URI password that psycopg returns as the `password` keyword.
If psycopg is unavailable, cannot parse the string, or finds no secret keywords,
the connection string is saved as given. A user-written `PollingSource` implementer
is responsible for keeping credentials out of its `to_config()` return value.

**Known limitation (ITL-1708).** A credential embedded in a URL or path value is saved
as given. Pass credentials through the dedicated options or the environment.
Save a job backed by `DeltaTableDatabase("az://fixtures/data?sig=example")` to see
`?sig=example` in the saved `root_uri`.

`PipelineJob.load(path)` reads the job back, for example in a later Python session.
Supply omitted credentials again through the backend's environment or its usual
credential provider, such as a PostgreSQL password file. Supply a
database explicitly with `PipelineJob.load(path, database=...)` or
`PipelineJob.load(path, result_database=...)` when it needs explicit credentials or has
moved. When a reloaded S3 Delta database has a saved access-key ID and no matching secret
in its storage options, `list_table_paths()` raises `TableListingNotSupportedError` with
a missing-secret cause, so pass a database configured with both credential options to
`PipelineJob.load()`. For a connector database (SQLite, PostgreSQL, SpiralDB), always
pass the database built over your connector. If a source cannot be rebuilt, bind it after loading with
`job.bind(sources={...})`. Saving a loaded job writes the bound database's settings when
available and otherwise keeps the recorded settings.

The file records each node's own Arrow types, so saving types
every node from its inputs' types, as previewing an empty job does, and costs what that
preview costs: a pipeline whose joins keep many system-tag columns saves as slowly as it
previews.
Expand Down Expand Up @@ -618,6 +640,22 @@ inputs that is not known to be commutative (`MergeJoin`, `SemiJoin`, or an opera
cannot be rebuilt in this process); build the job from its code and save it again. A file
whose multi-input operators are all commutative (`Join`, `Rejoin`) loads as before.

### Delta storage options omitted on save

Delta matches these option names case-insensitively.

| Options | Names omitted |
| --- | --- |
| AWS | `aws_secret_access_key`, `aws_secret_access_key_dynamodb`, `aws_session_token`, `aws_session_token_dynamodb`, `aws_sse_customer_key_base64`, `aws_token` |
| Azure | `azure_client_secret`, `azure_fabric_session_token`, `azure_storage_access_key`, `azure_storage_account_key`, `azure_storage_client_secret`, `azure_storage_master_key`, `azure_storage_sas_key`, `azure_storage_sas_token`, `azure_storage_token` |
| Google Cloud | `google_bearer_token`, `google_service_account_key` |
| Databricks and Unity Catalog | `databricks_access_token`, `databricks_client_secret`, `databricks_token`, `unity_access_token`, `unity_client_secret` |
| Unprefixed names | `access_key`, `access_token`, `account_key`, `bearer_token`, `certificate_password`, `client_secret`, `fabric_session_token`, `master_key`, `sas_key`, `sas_token`, `secret_access_key`, `service_account_key`, `session_token`, `sse_customer_key_base64`, `token` |
| OpenDAL AWS and S3 options | `opendal.aws_secret_access_key`, `opendal.aws_session_token`, `opendal.aws_sse_customer_key_base64`, `opendal.aws_token`, `opendal.server_side_encryption_customer_key` |
| OpenDAL Azure options | `opendal.azure_storage_access_key`, `opendal.azure_storage_account_key`, `opendal.azure_storage_master_key`, `opendal.azure_storage_sas_key`, `opendal.azure_storage_sas_token` |
| OpenDAL Google Cloud and TOS options | `opendal.google_service_account_key`, `opendal.tos_secret_access_key`, `opendal.tos_security_token`, `opendal.volcengine_secret_access_key`, `opendal.volcengine_session_token` |
| Other OpenDAL names | `opendal.access_key`, `opendal.access_key_secret`, `opendal.account_key`, `opendal.application_key`, `opendal.client_secret`, `opendal.credential`, `opendal.delegation`, `opendal.encryption_key`, `opendal.master_key`, `opendal.password`, `opendal.sas_key`, `opendal.sas_token`, `opendal.secret_access_key`, `opendal.secret_key`, `opendal.security_token`, `opendal.service_account_key`, `opendal.session_token`, `opendal.temp_url_key`, `opendal.token` |

## How it connects to other concepts

- A job records applications of [Function Pods](function-pods.md) and
Expand Down
22 changes: 22 additions & 0 deletions docs/dev/design_issues/ITL-1394-JB1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## `src/orcapod/pipeline/job.py`

### JB1 — Saved jobs expose cloud and PostgreSQL credentials
**Status:** resolved
**Severity:** high
**Issue:** ITL-1394

Delta database configs can contain credentials supplied directly or through a UPath.
PostgreSQL connector and table source configs can contain passwords in connection
strings. Saving a job exposes those values in plain text, including in wrapped configs.

**Fix:** Delta omits options whose values carry secret material, including OpenDAL
and Unity Catalog aliases. It saves access-key IDs verbatim and omits the secret
half of each recognized pair. It also preserves credential-file locators, role
identifiers including AWS external IDs, and other settings verbatim. The PostgreSQL
connector uses psycopg to omit `password`, `sslpassword`,
and `oauth_client_secret` and serialize the remaining settings when any of those
keys are parsed. Otherwise the connection string is saved verbatim. Older files
still load their recorded values. Subsequent saves apply the same storage rules
to retained configs, including nested bindings. Unknown config types are retained
as saved and trigger a credential warning. Credentials embedded in Delta URL or
path values are saved as given (ITL-1708).
23 changes: 22 additions & 1 deletion src/orcapod/core/sources/cached_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import logging
from datetime import datetime
from collections.abc import Iterator
from typing import Any, ClassVar, TYPE_CHECKING
from typing import Any, ClassVar, TYPE_CHECKING, cast

import pyarrow as pa
from typing_extensions import override
Expand Down Expand Up @@ -215,6 +215,27 @@ def to_config(
# rebuilt takes it from there (serialization._source_proxy_from_config).
}

@classmethod
def config_for_resave(cls, config: dict[str, Any]) -> dict[str, Any]:
"""Apply the save policies of the retained source and cache database."""
from orcapod.pipeline.serialization import (
database_config_for_resave,
source_config_for_resave,
)

saved = dict(config)
inner = config.get("inner_source")
if isinstance(inner, dict):
saved["inner_source"] = source_config_for_resave(
cast("dict[str, Any]", inner), block="inner_source"
)
cache = config.get("cache_database")
if isinstance(cache, dict):
saved["cache_database"] = database_config_for_resave(
cast("dict[str, Any]", cache), block="cache_database"
)
return saved

@classmethod
def from_config(
cls,
Expand Down
7 changes: 7 additions & 0 deletions src/orcapod/core/sources/db_table_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,13 @@ def to_config(self, db_registry=None) -> dict[str, Any]:
**self._identity_config(),
}

@classmethod
def config_for_resave(cls, config: dict[str, Any]) -> dict[str, Any]:
"""Apply the save policy of the retained connector."""
from orcapod.pipeline.serialization import connector_owner_config_for_resave

return connector_owner_config_for_resave(config)

@classmethod
def from_config(cls, config: dict[str, Any], db_registry=None) -> DBTableSource:
"""Not yet implemented — requires a connector factory registry.
Expand Down
17 changes: 16 additions & 1 deletion src/orcapod/core/sources/derived_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import dataclasses
from collections.abc import Collection, Mapping
from datetime import datetime
from typing import TYPE_CHECKING, Any, ClassVar
from typing import TYPE_CHECKING, Any, ClassVar, cast

import pyarrow as pa

Expand Down Expand Up @@ -433,6 +433,21 @@ def to_config(self, db_registry: Any = None) -> dict[str, Any]:
config.update(self._identity_config())
return config

@classmethod
def config_for_resave(cls, config: dict[str, Any]) -> dict[str, Any]:
"""Apply the save policy of the retained origin."""
from orcapod.pipeline.serialization import source_config_for_resave

origin = config.get("origin")
if not isinstance(origin, dict):
return config
return {
**config,
"origin": source_config_for_resave(
cast("dict[str, Any]", origin), block="origin"
),
}

@classmethod
def from_config(
cls, config: dict[str, Any], db_registry: Any = None
Expand Down
16 changes: 9 additions & 7 deletions src/orcapod/core/sources/postgresql_table_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def __init__(
*,
tag_only_columns: TagOnlyColumns = (),
) -> None:
self._dsn = dsn # store before try — needed by to_config even if super() raises
self._dsn = dsn
connector = PostgreSQLConnector(
dsn
) # outside try — if this raises, finally never runs
Expand Down Expand Up @@ -273,13 +273,15 @@ def _open_connector(self) -> Iterator[PostgreSQLConnector]:
connector.close()

def to_config(self, db_registry=None) -> dict[str, Any]:
"""Serialize source configuration to a JSON-compatible dict."""
# super().to_config() calls self._connector.to_config(), which reads only
# self._connector._dsn (a stored string) — safe even though the connector
# was closed after construction.
"""Serialize the source using the connector's saved connection settings."""
base = super().to_config()
base.pop("connector", None)
return {**base, "source_type": self.SOURCE_KIND, "dsn": self._dsn}
connector = base.pop("connector")
return {**base, "dsn": connector["dsn"]}

@classmethod
def config_for_resave(cls, config: dict[str, Any]) -> dict[str, Any]:
"""Apply the connector's policy to the DSN stored directly on this source."""
return PostgreSQLConnector.config_for_resave(config)

@classmethod
def from_config(
Expand Down
8 changes: 6 additions & 2 deletions src/orcapod/core/sources/source_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,12 @@ def head(
# -------------------------------------------------------------------------

def to_config(self, db_registry=None) -> dict[str, Any]:
"""Return the original source's config (preserves source_type)."""
return dict(self._source_config)
"""Return the original source's config with its save policy applied."""
from orcapod.pipeline.serialization import source_config_for_resave

return source_config_for_resave(
dict(self._source_config), block=f"source proxy {self.source_id!r}"
)

@classmethod
def from_config(cls, config: dict[str, Any], db_registry=None) -> SourceProxy:
Expand Down
7 changes: 7 additions & 0 deletions src/orcapod/databases/connector_arrow_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -1195,6 +1195,13 @@ def to_config(self, db_registry: Any = None) -> dict[str, Any]:
"max_hierarchy_depth": self.max_hierarchy_depth,
}

@classmethod
def config_for_resave(cls, config: dict[str, Any]) -> dict[str, Any]:
"""Apply the save policy of the retained connector."""
from orcapod.pipeline.serialization import connector_owner_config_for_resave

return connector_owner_config_for_resave(config)

@classmethod
def from_config(cls, config: dict[str, Any]) -> ConnectorArrowDatabase:
"""Refuse: a connector is not rebuilt from a saved configuration (ITL-1391).
Expand Down
Loading
Loading