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

[SDK-4226] Update all methods to accept a ctx argument #212

Merged
merged 7 commits into from
May 24, 2023

Conversation

ewanharris
Copy link
Contributor

🔧 Changes

Updates all methods to now accept a context.Context parameter directly rather than via the Context or WithContext helper.

For example

// Passing Context on Management Client creation
auth0API, err := management.New(
	domain,
	management.WithClientCredentials(clientID, clientSecret),
	management.WithContext(context.Background()),
)

// Passing Context on an API call
clients, err := auth0API.Client.List(management.Context(context.Background()))

is now

// Passing Context on Management Client creation
auth0API, err := management.New(
	domain,
	management.WithClientCredentials(context.Background(), clientID, clientSecret),
)

// Passing Context on an API call
clients, err := auth0API.Client.List(context.Background())

📚 References

🔬 Testing

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

⚠️ Breaking Change

  • Usage of the WithClientCredentials and WithClientCredentialsAndAudience functions must now pass a Context as the first argument
  • Usage of any API method must pass a Context as the first argument
  • management.WithContext and management.Context helpers have been removed, in favour of the above two options of passing the Context as the first argument

@ewanharris ewanharris requested a review from a team as a code owner May 22, 2023 11:11
@codecov-commenter
Copy link

codecov-commenter commented May 22, 2023

Codecov Report

❗ No coverage uploaded for pull request base (beta@1431d36). Click here to learn what that means.
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##             beta     #212   +/-   ##
=======================================
  Coverage        ?   95.28%           
=======================================
  Files           ?       38           
  Lines           ?     7358           
  Branches        ?        0           
=======================================
  Hits            ?     7011           
  Misses          ?      276           
  Partials        ?       71           

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

sergiught
sergiught previously approved these changes May 22, 2023
Copy link
Contributor

@sergiught sergiught left a comment

Choose a reason for hiding this comment

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

💪🏻

MIGRATION_GUIDE.md Outdated Show resolved Hide resolved
MIGRATION_GUIDE.md Outdated Show resolved Hide resolved
MIGRATION_GUIDE.md Outdated Show resolved Hide resolved
Co-authored-by: Sergiu Ghitea <28300158+sergiught@users.noreply.github.com>
@ewanharris ewanharris merged commit c5c2784 into beta May 24, 2023
@ewanharris ewanharris deleted the feat/SDK-4226-pass-context branch May 24, 2023 09:17
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.

None yet

3 participants