-
-
Notifications
You must be signed in to change notification settings - Fork 748
Fix re-authentication in retry logic by resolving auth endpoint via Bag() #448
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
Changes from 2 commits
d6ddbe2
a1b4925
438e8e8
b0474fb
194d7e0
642fd28
7b239bb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,8 +32,13 @@ func (t *appstore) Bag(input BagInput) (BagOutput, error) { | |
| return BagOutput{}, fmt.Errorf("received unexpected status code: %d", res.StatusCode) | ||
| } | ||
|
|
||
| authEndpoint := res.Data.URLBag.AuthEndpoint | ||
| if authEndpoint == "" { | ||
| authEndpoint = fmt.Sprintf("https://%s%s", PrivateAppStoreAPIDomain, PrivateAppStoreAPIPathAuthenticate) | ||
| } | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not so sure about this. The reason we retrieve the auth endpoint from the bag now is that the previous hardcoded endpoint was unstable and started failing as of a few weeks ago. What is the reason to have the fallback here? Does the bag endpoint omit the auth endpoint in some cases?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've removed it and instead use a DefaultAuthEndpoint constant directly in the retry paths.
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I meant why do we need to use the default auth endpoint in first place? Can't the retry use the endpoint from the bag, or have you encountered cases where the bag was omitting the endpoints? |
||
|
|
||
| return BagOutput{ | ||
| AuthEndpoint: res.Data.URLBag.AuthEndpoint, | ||
| AuthEndpoint: authEndpoint, | ||
| }, nil | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, good catch. I had missed this before.