Skip to content

fix: correct usage of the sdk method header#142

Merged
ewanharris merged 1 commit into
mainfrom
fix/stop-sending-headers
Oct 25, 2024
Merged

fix: correct usage of the sdk method header#142
ewanharris merged 1 commit into
mainfrom
fix/stop-sending-headers

Conversation

@ewanharris

Copy link
Copy Markdown
Member

Description

Currently the Python SDK is sending the sdk method header for all requests, the expectation (and behaviour in other SDKs) for this header is that it is only sent for SDK methods that are wrappers of APIs as the intent is to provide a way for implementors of OpenFGA to track usage of these SDK wrapper methods.

So it should be sent for:

  • read_latest_authorization_model
  • write
    • Should also send CLIENT_BULK_REQUEST_ID_HEADER when not in transaction mode
  • write_tuples
    • Should also send CLIENT_BULK_REQUEST_ID_HEADER when not in transaction mode (handled via write)
  • delete_tuples
    • Should also send CLIENT_BULK_REQUEST_ID_HEADER when not in transaction mode (handled via write)
  • batch_check
    • Should also send CLIENT_BULK_REQUEST_ID_HEADER
  • list_relations
    • Should also send CLIENT_BULK_REQUEST_ID_HEADER when not in transaction mode

References

openfga/sdk-generator#435

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

If you haven't done so yet, we would appreciate it if you could star the OpenFGA repository. :)

@ewanharris ewanharris requested a review from a team as a code owner October 25, 2024 17:26
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.07%. Comparing base (64d19e0) to head (b6c1f2d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #142      +/-   ##
==========================================
- Coverage   69.17%   69.07%   -0.10%     
==========================================
  Files         122      122              
  Lines        9771     9741      -30     
==========================================
- Hits         6759     6729      -30     
  Misses       3012     3012              

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

@evansims evansims left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@ewanharris ewanharris added this pull request to the merge queue Oct 25, 2024
Merged via the queue into main with commit 9a33c4a Oct 25, 2024
@ewanharris ewanharris deleted the fix/stop-sending-headers branch October 25, 2024 17:35
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.

3 participants