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

refactor(auth): replace use of deprecated ErrOTPRequired #1009

Merged
merged 6 commits into from
Sep 22, 2023

Conversation

EtienneM
Copy link
Member

@EtienneM EtienneM commented Sep 18, 2023

Related to Scalingo/go-scalingo#360

Fix Scalingo/go-scalingo#324
Fix Scalingo/go-scalingo#326

  • Add a changelog entry in the section "To Be Released" of CHANGELOG.md

@EtienneM EtienneM self-assigned this Sep 18, 2023
@EtienneM EtienneM changed the title refactor(auth): replace use of deprecated ErrOTPRequired refactor(auth): replace use of deprecated ErrOTPRequired Sep 18, 2023
@EtienneM EtienneM force-pushed the fix/go-scalingo/360/ErrOTPRequired_duplication branch from ba73dcc to 7dade04 Compare September 18, 2023 14:44
@@ -11,12 +11,12 @@ import (
"time"

"github.com/pkg/errors"
errgo "gopkg.in/errgo.v1"
Copy link
Member Author

Choose a reason for hiding this comment

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

I removed this dependency from this file and it had a lot of side effects, sorry.. 😅

@EtienneM EtienneM force-pushed the fix/go-scalingo/360/ErrOTPRequired_duplication branch 3 times, most recently from c3148c3 to 2d32d21 Compare September 20, 2023 13:57
@EtienneM EtienneM force-pushed the fix/go-scalingo/360/ErrOTPRequired_duplication branch from 2d32d21 to 5dde6ad Compare September 21, 2023 13:52
@EtienneM EtienneM marked this pull request as ready for review September 21, 2023 13:53
Copy link
Contributor

@ipfaze ipfaze left a comment

Choose a reason for hiding this comment

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

Still some improvements possible but otherwise LGTM

config/auth.go Outdated
@@ -43,7 +43,7 @@ func Auth(ctx context.Context) (*scalingo.User, string, error) {
if err == nil {
break
} else if scalingoerrors.RootCause(err) == io.EOF {
Copy link
Contributor

Choose a reason for hiding this comment

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

issue(non-blocking): Can you change the deprecated function .RootCause() to the function .Is()

@@ -11,12 +11,12 @@ import (
"time"

"github.com/pkg/errors"
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: Is it possible to replace all existing errors to scalingoerrors?
It will freed us from the use of another deprecated package

Copy link
Member Author

Choose a reason for hiding this comment

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

It's not possible. We declare some public variable, for instance on line 24:

var (
	ErrAuthenticationFailed = errors.New("authentication failed")
)

scalingoerrors requires a context and we have no context available here.

Copy link
Contributor

@ipfaze ipfaze left a comment

Choose a reason for hiding this comment

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

LGTM then 👍

@EtienneM EtienneM merged commit ff9c7c7 into master Sep 22, 2023
4 checks passed
@EtienneM EtienneM deleted the fix/go-scalingo/360/ErrOTPRequired_duplication branch September 22, 2023 07:22
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.

App run event wording is wrongly formatted App restart event wording is confusing
2 participants