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

Replace gopkg.in/auth0.v5 with github.com/auth0/go-auth0 #395

Merged
merged 1 commit into from
Feb 24, 2022

Conversation

sergiught
Copy link
Contributor

@sergiught sergiught commented Feb 22, 2022

Description

This PR replaces gopkg.in/auth0.v5 (github.com/go-auth0/auth0) with github.com/auth0/go-auth0 as we now have brought the SDK within the Auth0 org.

Checklist

  • I have added documentation for new/changed functionality in this PR or in auth0.com/docs
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not master

@sergiught sergiught changed the base branch from main to patch/remove-vendor February 23, 2022 12:03
Copy link
Contributor Author

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

Adding comments around the code to give further context on some breaking changes withing the Go SDK.

PRs that introduced the breaking changes:

//
// https://auth0.com/docs/api/management/v2/#!/Actions/get_triggers
ListTriggers(opts ...management.RequestOption) (l *management.ActionTriggerList, err error)
Triggers(opts ...management.RequestOption) (l *management.ActionTriggerList, err error)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The ListTriggers has been deprecated in favor of Triggers. The func signature remains the same.

//
// See: https://auth0.com/docs/api/management/v2/#!/Organizations/patch_organizations_by_id
Update(o *management.Organization, opts ...management.RequestOption) error
Update(id string, o *management.Organization, opts ...management.RequestOption) error
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The signature of this func has changed within the Go SDK to better align how all CRUD funcs behave.

@@ -201,7 +202,7 @@ auth0 actions create --n myaction -t post-login -d "lodash=4.0.0" -s "API_KEY=va

action := &management.Action{
Name: &inputs.Name,
SupportedTriggers: []management.ActionTrigger{
SupportedTriggers: []*management.ActionTrigger{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This has also been changed to a slice of pointers within the Go SDK.

}

if isAnyColorSet {
o.Branding.Colors = map[string]string{}
o.Branding.Colors = map[string]interface{}{}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This has also changed within the Go SDK, however the underlying field values remain strings. That's why further down we cast again to .(string).

@sergiught sergiught marked this pull request as ready for review February 23, 2022 12:13
@sergiught sergiught requested a review from a team February 23, 2022 12:16
@sergiught sergiught self-assigned this Feb 23, 2022
Base automatically changed from patch/remove-vendor to main February 23, 2022 15:18
@sergiught sergiught merged commit cc0f607 into main Feb 24, 2022
@sergiught sergiught deleted the patch/go-auth0 branch February 24, 2022 14:30
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.

2 participants