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

fix: emit SelfServiceMethodUsed in SettingsSucceeded event #4056

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

hperl
Copy link
Contributor

@hperl hperl commented Aug 26, 2024

This PR fixes the SelfServiceMethodUsed attribute in the SettingsSucceeded event, which previously was always empty.

Related issue(s)

Checklist

  • I have read the contributing guidelines.
  • I have referenced an issue containing the design document if my change
    introduces a new feature.
  • I am following the
    contributing code guidelines.
  • I have read the security policy.
  • I confirm that this pull request does not address a security
    vulnerability. If this pull request addresses a security vulnerability, I
    confirm that I got the approval (please contact
    security@ory.sh) from the maintainers to push
    the changes.
  • I have added tests that prove my fix is effective or that my feature
    works.
  • I have added or changed the documentation.

Further Comments

@hperl hperl requested a review from jonas-jonas August 26, 2024 06:48
@hperl hperl self-assigned this Aug 26, 2024
@@ -282,7 +282,8 @@ func (e *HookExecutor) PostSettingsHook(w http.ResponseWriter, r *http.Request,
WithField("flow_method", settingsType).
Debug("Completed all PostSettingsPrePersistHooks and PostSettingsPostPersistHooks.")

trace.SpanFromContext(r.Context()).AddEvent(events.NewSettingsSucceeded(r.Context(), i.ID, string(ctxUpdate.Flow.Type), ctxUpdate.Flow.Active.String()))
trace.SpanFromContext(r.Context()).AddEvent(events.NewSettingsSucceeded(
r.Context(), i.ID, string(ctxUpdate.Flow.Type), ctxUpdate.Session.AMR))
Copy link
Member

Choose a reason for hiding this comment

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

Isn't ctxUpdate.Session.AMR the method used to authenticate the session?

I would expect that field to contain "profile", "password", etc. depending on which group the user updated in the settings.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it is the method used in the session. Should it be the group that got updated? Maybe that makes more sense, but it is not clear.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I think it should be.

@hperl hperl force-pushed the hperl/fix-SettingsSucceeded-SelfServiceMethodUsed branch from 3fb644d to 99955fa Compare August 26, 2024 07:04
Copy link
Member

@jonas-jonas jonas-jonas left a comment

Choose a reason for hiding this comment

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

Brilliant!

Copy link

codecov bot commented Aug 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.34%. Comparing base (6ceb2f1) to head (99955fa).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4056      +/-   ##
==========================================
- Coverage   78.35%   78.34%   -0.02%     
==========================================
  Files         370      370              
  Lines       26128    26129       +1     
==========================================
- Hits        20473    20470       -3     
- Misses       4094     4096       +2     
- Partials     1561     1563       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@aeneasr aeneasr merged commit 76af303 into master Aug 26, 2024
29 checks passed
@aeneasr aeneasr deleted the hperl/fix-SettingsSucceeded-SelfServiceMethodUsed branch August 26, 2024 10:09
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.

3 participants