Repository navigation
Core: Accept REST auth configuration from environment variables - #4451
Open
Anurag-S1ngh wants to merge 2 commits into
Open
Anurag-S1ngh wants to merge 2 commits into
Anurag-S1ngh wants to merge 2 commits into
Conversation
Configuration from environment variables arrives as flat strings, so a JSON encoded auth value was treated as an object and failed with AttributeError. Decode JSON strings, merge flattened auth.* keys, and normalize dashed option names before the auth manager is created.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this change
Catalog configuration from environment variables arrives as flat strings, so a JSON encoded
authvalue was treated as an object._create_session()then called.get()on a string and failed withAttributeError.Parse the auth configuration from three shapes: an object (unchanged), a JSON string, and flattened
auth.type/auth.<type>.<param>keys. Dashed option names such asclient-idare normalized to the constructor's snake_case names. Invalid JSON and non-object values raise a clearValueError.Are these changes tested?
Yes. New tests in
tests/catalog/test_rest.pycover a JSON string, flattened keys, dashed key normalization, and invalid JSON.tests/catalog/test_rest.pypasses.Are there any user-facing changes?
Yes. REST catalogs can be configured through
PYICEBERG_CATALOG__<NAME>__AUTHenvironment variables as described in the issue.