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: review notes + webhooks PLATFORM-8899 #97

Merged
merged 9 commits into from
Feb 19, 2024

Conversation

mmeller-wikia
Copy link

See #95 and #96

// 204: emptyResponse
// 404: jsonError
// 500: jsonError
func (h *Handler) deleteMultifactorCredential(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
Copy link
Author

@mmeller-wikia mmeller-wikia Feb 5, 2024

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",
Copy link
Author

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",
Copy link
Author

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

@mmeller-wikia mmeller-wikia mentioned this pull request Feb 5, 2024
7 tasks
@adpaste adpaste force-pushed the fandom_master_1_0_0 branch 2 times, most recently from a18ee93 to af00b58 Compare February 6, 2024 10:14
@@ -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)) {
Copy link
Author

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

@@ -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`
Copy link
Author

Choose a reason for hiding this comment

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

TODO:

Comment on lines +412 to +419
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),
)
Copy link
Author

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

Copy link

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

@adpaste adpaste marked this pull request as ready for review February 19, 2024 07:53
@adpaste adpaste changed the title PLATFORM-8899 Review notes refactor: review notes + webhooks PLATFORM-8899 Feb 19, 2024
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (73ca47b) 76.78% compared to head (73ca47b) 76.78%.

❗ Current head 73ca47b differs from pull request most recent head 078e2b2. Consider uploading reports for the commit 078e2b2 to get more accurate results

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.
📢 Have feedback on the report? Share it here.

@adpaste adpaste merged commit a4381c7 into fandom_master_1_0_0 Feb 19, 2024
16 of 17 checks passed
@adpaste adpaste deleted the PLATFORM-8899-CR branch February 19, 2024 09:44
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.

5 participants