Skip to content

feat: make async environment trust configurable - #357

Open
whoalin1 wants to merge 1 commit into
openfga:mainfrom
whoalin1:devin/1796125142-configurable-trust-env
Open

whoalin1 wants to merge 1 commit into
openfga:mainfrom
whoalin1:devin/1796125142-configurable-trust-env

Conversation

@whoalin1

@whoalin1 whoalin1 commented Dec 1, 2026

Copy link
Copy Markdown

Summary

Contributes to #337.

The async client's aiohttp.ClientSession was always created with trust_env=True. aiohttp resolves netrc credentials and environment proxy settings on every request when that mode is enabled, which the issue reporter measured as substantial per-request CPU overhead in SDK check() calls.

Configuration now exposes a trust_env option and RESTClientObject passes it through to aiohttp. The default remains True, preserving existing behavior; applications that manage credentials and proxies explicitly can set it to False to avoid the repeated executor work. Duck-typed configurations without the new attribute retain the previous default.

Validation:

  • uv run pytest -q -m 'not integration' --cov-fail-under 60 --cov openfga_sdk test: 646 passed, 12 deselected, 2 subtests passed; coverage 70.78%
  • uv run ruff check .
  • uv run ruff format --check .: 181 files already formatted

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@whoalin1
whoalin1 requested a review from a team as a code owner December 1, 2026 11:40
@linux-foundation-easycla

Copy link
Copy Markdown

CLA Not Signed

@coderabbitai

coderabbitai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 31 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 211a5d12-93c3-494d-8b3f-0fdd8cedc064
Commits

Reviewing files that changed from the base of the PR and between 60caaa5 and cdd8948.

Files selected for processing: 3

  • openfga_sdk/configuration.py
  • openfga_sdk/rest.py
  • test/rest_test.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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