Skip to content

Conversation

@sophiehouser
Copy link
Contributor

@sophiehouser sophiehouser commented Oct 3, 2025

We're removing the AuthenticatedContext pattern from the SDK since it's unidiomatic in Go to extend the context, save it as an attribute and use it to store data across multiple requests. We were previously using the AuthenticatedContext to save the request token across requests. It meant we didn't need to get the token freshly on every request. Instead we now store the token in the client and have users pass the same client to every request.

This will be a breaking change and will change the function signature of SDK functions.

This PR also creates a CONTRIBUTING.md file.

Summary of changes

  • Moves all the token generation logic to the client
  • Condenses code into one client package
  • Makes the GenerateToken function a method on Client
  • Removes MockTokenParams because the same functionality could be achieved with a GetTokenParams object

fixes FRA-6031

@sophiehouser sophiehouser changed the title [WIP] Refactor to remove AuthenticatedContext and pass client to query functions Refactor to remove AuthenticatedContext and pass client to query functions Oct 6, 2025
@sophiehouser sophiehouser marked this pull request as ready for review October 6, 2025 15:34
Copy link
Contributor

@vigneshwerv vigneshwerv left a comment

Choose a reason for hiding this comment

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

I think we should probably bump the major version to 3 and release it, when you merge the PR?

Should we update the README to include a guide for migrating from 1.x,2.x to 3.x?

sophiehouser and others added 2 commits October 6, 2025 16:26
Co-authored-by: Vigneshwer Vaidyanathan <[email protected]>
@sophiehouser sophiehouser merged commit 99f5f2d into dev Oct 6, 2025
6 checks passed
@sophiehouser sophiehouser deleted the use-custom-client branch October 6, 2025 22:29
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