-
Notifications
You must be signed in to change notification settings - Fork 1
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: review notes + webhooks PLATFORM-8899 #97
Conversation
230eb83
to
599ad32
Compare
identity/handler.go
Outdated
// 204: emptyResponse | ||
// 404: jsonError | ||
// 500: jsonError | ||
func (h *Handler) deleteMultifactorCredential(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { |
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.
Note: It should be removed once we migrate to new API.
Note: New API will return 404 for not existing credential
@@ -179,6 +180,7 @@ func (e *WebHook) ExecutePostVerificationHook(_ http.ResponseWriter, req *http.R | |||
RequestURL: x.RequestURL(req).String(), | |||
RequestCookies: cookies(req), | |||
Identity: id, | |||
HookType: "VerificationPostHook", |
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.
Note: Previously it was LoginPreHook
@@ -204,6 +207,7 @@ func (e *WebHook) ExecutePostRecoveryHook(_ http.ResponseWriter, req *http.Reque | |||
RequestURL: x.RequestURL(req).String(), | |||
RequestCookies: cookies(req), | |||
Identity: session.Identity, | |||
HookType: "RecoveryPostHook", |
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.
Note: Previously it was PostRecoveryHook
a18ee93
to
af00b58
Compare
driver/registry_default_settings.go
Outdated
@@ -11,7 +11,7 @@ import ( | |||
) | |||
|
|||
func (m *RegistryDefault) PostSettingsPrePersistHooks(ctx context.Context, settingsType string) (b []settings.PostHookPrePersistExecutor) { | |||
for _, v := range m.getHooks(settingsType, m.Config().SelfServiceFlowSettingsAfterHooks(ctx, settingsType)) { | |||
for _, v := range m.getHooks(settingsType, filter(m.Config().SelfServiceFlowSettingsAfterHooks(ctx, settingsType), config.PrePersist)) { |
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.
TODO: check if all filter
calls are in place
selfservice/hook/web_hook.go
Outdated
@@ -484,7 +509,8 @@ func (e *WebHook) execute(ctx context.Context, data *templateContext) error { | |||
if resp.StatusCode >= http.StatusBadRequest { | |||
span.SetStatus(codes.Error, "HTTP status code >= 400") | |||
if canInterrupt || parseResponse { | |||
if err := parseWebhookResponse(resp, data.Identity); err != nil { | |||
// TODO: double-check if we could use upstream `parseWebhookResponse` |
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.
TODO:
httpClient = e.deps.NamedHTTPClient( | ||
ctx, | ||
data.HookType+conf.sum, | ||
httpx.ResilientClientWithMaxRetry(conf.retries), | ||
httpx.ResilientClientWithConnectionTimeout(conf.timeout), | ||
httpx.ResilientClientWithMinxRetryWait(conf.minWait), | ||
httpx.ResilientClientWithMaxRetryWait(conf.maxWait), | ||
) |
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.
Maybe we could push this change to upstream
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.
I think we should add ACs to all such tickets
# Conflicts: # driver/registry_default_settings.go
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## fandom_master_1_0_0 #97 +/- ##
====================================================
Coverage 76.78% 76.78%
====================================================
Files 330 330
Lines 22006 22006
====================================================
Hits 16897 16897
Misses 3813 3813
Partials 1296 1296 ☔ View full report in Codecov by Sentry. |
See #95 and #96