fix(mixins): Add headers and timeout to FindAllChildrenCommandMixin …#385
Open
telesoho wants to merge 1 commit intogetlago:mainfrom
Open
fix(mixins): Add headers and timeout to FindAllChildrenCommandMixin …#385telesoho wants to merge 1 commit intogetlago:mainfrom
telesoho wants to merge 1 commit intogetlago:mainfrom
Conversation
Welcome, @telesoho!Thanks for your first contribution! Before we proceed with the review, please sign the Contributor License Agreement: Once signed, this PR will be automatically updated. |
Thanks, @telesoho! 🎉Your CLA has been signed and is now on file. We'll proceed with the review shortly. |
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.
Summary
This PR fixes unauthorized errors when listing child resources (e.g. plan charges) through the Python client.
In
FindAllChildrenCommandMixin.find_all()(lago_python_client/mixins.py), the GET request was sent without authentication headers.As a result, endpoints like
GET /api/v1/plans/{code}/chargescould return401 Unauthorizedeven when the API key was valid for other plan operations.This change adds:
headers=make_headers(api_key=self.api_key)timeout=timetourto the child
find_allGET request, aligning it with other authenticated client calls.Why
plan find/updatecalls were successful, but child collection fetches failed with 401 due to missing Bearer auth headers in this specific mixin path.Testing
python3 -m pytest testsLabels