Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use provided axios instance for credentials refresh operations #193

Merged

Conversation

Siddhant-K-code
Copy link
Contributor

@Siddhant-K-code Siddhant-K-code commented Jan 7, 2025

Description

This PR ensures that when users provide a custom axios instance to OpenFgaClient, it's consistently used throughout all SDK operations - including credential refresh requests. Previously, credential refresh operations were using the global axios instance, which caused issues for users with custom network configurations like VPC or proxy setups.

References

fixes #183

Review Checklist

  • I have clicked on "allow edits by maintainers".
  • I have added documentation for new/changed functionality in this PR or in a PR to openfga.dev [Provide a link to any relevant PRs in the references section above]
  • The correct base branch is being used, if not main
  • I have added tests to validate that the change in functionality is working as expected

Copy link

@wassil wassil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for doing this!
Looks good to me, I did it the same way when fixing this locally.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.65%. Comparing base (006b5c4) to head (691afea).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #193   +/-   ##
=======================================
  Coverage   87.65%   87.65%           
=======================================
  Files          23       23           
  Lines        1142     1142           
  Branches      198      179   -19     
=======================================
  Hits         1001     1001           
  Misses         83       83           
  Partials       58       58           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@ewanharris ewanharris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ewanharris ewanharris added this pull request to the merge queue Jan 8, 2025
Merged via the queue into openfga:main with commit 24f8188 Jan 8, 2025
9 checks passed
@Siddhant-K-code Siddhant-K-code deleted the fix/credentials-axios-instance branch January 8, 2025 12:39
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.

Credentials don't use axios instance provided when creating the client
4 participants