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

feat: webhooks support setting client cookies #3716

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

brahmlower
Copy link
Contributor

Related issue(s)

None- I've added this without any prior discussion.

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

Hey folks, it's been a while 👋 Hope you all had a good winter break!

My team realized it would be helpful if we could set an additional cookie via the post-login webhook for some of our users, and so I went ahead and added support for doing just that 😁 This PR is a functional proof of concept.

A webhook response with the following would set a cookie named "foo" with the value "bar":

{
  "cookies": [
    {
      "name": "foo",
      "value": "bar"
    }
  ]
}

As I see it, the only remaining work this branch needs is:

  • tests
  • docs
  • any security checks/guards that you guys think would be appropriate

Before working on that though, I wanted to check in with you guys first to see if this is a feature you'd be interested in merging.

Copy link

codecov bot commented Jan 26, 2024

Codecov Report

Attention: Patch coverage is 46.15385% with 28 lines in your changes are missing coverage. Please review.

Project coverage is 77.93%. Comparing base (d01b670) to head (5242e84).
Report is 1 commits behind head on master.

Files Patch % Lines
selfservice/hook/web_hook.go 46.15% 27 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3716      +/-   ##
==========================================
- Coverage   77.98%   77.93%   -0.06%     
==========================================
  Files         359      359              
  Lines       25190    25213      +23     
==========================================
+ Hits        19644    19649       +5     
- Misses       4039     4056      +17     
- Partials     1507     1508       +1     

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

@brahmlower brahmlower force-pushed the feat/webhooks-support-setting-cookies branch from 081c763 to 5242e84 Compare March 23, 2024 00:36
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.

None yet

1 participant