Skip to content

Recomended way to do credentials interpolation #2514

@jkolash

Description

@jkolash

Feature Request / Improvement

I would like to be able to use the .pyiceberg.yaml but not have hardcoded credentials.

I want to be able to refer to a secrets manager key/value

Currently I can do

pre_interpolated_config = pyiceberg.catalog._ENV_CONFIG.get_catalog_config("iceberg_rest")

# Looks up secrets in a secrets manager based on some pattern such as op://vault/secret/field for 1password.
config = interpolate_configs_and_secrets(pre_interpolated_config) 

pyiceberg.catalog.load_catalog("iceberg_rest", **config)

But that relies on using _ENV_CONFIG which is internal. How can I do this via a supported way? I would like to be able to write my own credentials interpolation function and not have that part of pyiceberg, as that would be specific to each users secrets manager setup such as hashicorp vault, 1password, aws secrets manager, etc..

I see two potential approaches

  1. Allow getting the config before load_catalog() in an officially supported way, not _ENV_CONFIG.
  2. Officially support interpolating credentials via a custom interpolator that can be registered. It simply remaps each entry in a config map.)

I think approach 1 is the lighter lift.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions