Skip to content

fix(mixins): Add headers and timeout to FindAllChildrenCommandMixin …#385

Open
telesoho wants to merge 1 commit intogetlago:mainfrom
telesoho:main
Open

fix(mixins): Add headers and timeout to FindAllChildrenCommandMixin …#385
telesoho wants to merge 1 commit intogetlago:mainfrom
telesoho:main

Conversation

@telesoho
Copy link

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}/charges could return 401 Unauthorized even when the API key was valid for other plan operations.

This change adds:

  • headers=make_headers(api_key=self.api_key)
  • timeout=timetour

to the child find_all GET request, aligning it with other authenticated client calls.

Why

plan find/update calls were successful, but child collection fetches failed with 401 due to missing Bearer auth headers in this specific mixin path.

Testing

  • Ran test suite: python3 -m pytest tests
  • Verified no linter/type issues introduced in the modified file.
  • Manually validated that child collection requests now include auth headers and no longer fail with unauthorized responses under valid credentials.

Labels

  • bug
  • improvement

@cla-check-bot
Copy link

cla-check-bot bot commented Mar 24, 2026

Welcome, @telesoho!

Thanks for your first contribution!

Before we proceed with the review, please sign the Contributor License Agreement:

Sign the CLA

Once signed, this PR will be automatically updated.

@cla-check-bot
Copy link

cla-check-bot bot commented Mar 24, 2026

Thanks, @telesoho! 🎉

Your CLA has been signed and is now on file. We'll proceed with the review shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant