Skip to content

Use provided axios instance for credentials refresh operations#193

Merged
ewanharris merged 1 commit into
openfga:mainfrom
Siddhant-K-code:fix/credentials-axios-instance
Jan 8, 2025
Merged

Use provided axios instance for credentials refresh operations#193
ewanharris merged 1 commit into
openfga:mainfrom
Siddhant-K-code:fix/credentials-axios-instance

Conversation

@Siddhant-K-code

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

Copy link
Copy Markdown
Member

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

@wassil wassil left a comment

Copy link
Copy Markdown

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

codecov-commenter commented Jan 8, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.65%. Comparing base (006b5c4) to head (691afea).
⚠️ Report is 129 commits behind head on main.

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ewanharris ewanharris left a comment

Copy link
Copy Markdown
Member

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
@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