-
-
Notifications
You must be signed in to change notification settings - Fork 963
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: added sms support to courier #1941
Conversation
5c80670
to
0ffa6b7
Compare
I try to be as close as possible to Twillio API contract for sending sms. Also I tested this PR and #1938 in local setup, it works fine. |
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.
Hey, this looks awesome! We would need some docs for this as well: https://www.ory.sh/kratos/docs/concepts/email-sms#sending-sms
Once you mark it for ready for review, I'll finalize the review :)
0ffa6b7
to
6d7978a
Compare
Added documentation for sending SMS using courier |
7bc9f03
to
eb11b41
Compare
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.
Thank you, this is looking grand! :)
Since I forgot to mention this in the other PR. Could you please add to the documentation how to use phone numbers as part of the identity traits over at
- https://www.ory.sh/kratos/docs/next/self-service/flows/verify-email-account-activation#verification-link-method
- https://www.ory.sh/kratos/docs/next/concepts/identity-schema
Thank you :)
Regarding the SMS sending logic, I think you could probably reuse the logic we have for the web hooks! Those allow you to:
This could allow us to integrate with a lot of providers such as twilio and others out of the box :) |
9b786b5
to
268d099
Compare
Once you need another review, just re-request review from me :) |
15e1048
to
f82d446
Compare
f82d446
to
c4ab5cf
Compare
@alexey-reshetnik just to let you know. The code updates message status twice. The second time generating an error. |
c4ab5cf
to
49e1894
Compare
@splaunov thank you. Included fix in the commit |
@aeneasr added JsonNet support for making requests from the courier. Moved request forming logic to separate package, and added additional functionality to it:
Now it must be configurable with most SMS providers |
8684de0
to
9d239d4
Compare
e1b3608
to
0ad653f
Compare
Hi @Benehiko |
Codecov Report
@@ Coverage Diff @@
## master #1941 +/- ##
==========================================
- Coverage 75.88% 75.85% -0.04%
==========================================
Files 298 308 +10
Lines 15917 16111 +194
==========================================
+ Hits 12079 12221 +142
- Misses 2979 3012 +33
- Partials 859 878 +19
Continue to review full report at Codecov.
|
Added documentation: ory/docs#601 |
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 job! This looks really good :)
I just have one last request, we just need some failure cases for the schema fixtures then this would be good to go IMO :)
selfservice: | ||
default_browser_return_url: "#/definitions/defaultReturnTo" | ||
|
||
dsn: foo | ||
|
||
identity: | ||
schemas: | ||
- id: default | ||
url: https://example.com | ||
|
||
courier: | ||
smtp: | ||
connection_uri: smtps://foo:bar@my-mailserver:1234/ | ||
from_address: [email protected] | ||
sms: | ||
enabled: true | ||
from: "+19592155527" | ||
request_config: | ||
url: https://sms.example.com | ||
method: POST | ||
body: file://request.config.twilio.jsonnet | ||
header: | ||
'Content-Type': "application/x-www-form-urlencoded" |
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!
Shall I take a look also soon? Or do you want to address more things first? |
You can take a look :) |
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.
From my side, this looks good :)
c96f4a6
to
d379672
Compare
d379672
to
0ad2961
Compare
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.
Thank you to everyone involved, this looks fantastic. I have added a few things and also ensured that SSRF can't happen if configured. I left a few comments for some easy-to-add tests but otherwise this is good to ship!
Related issue(s)
Checklist
introduces a new feature.
contributing code guidelines.
vulnerability. If this pull request addresses a security. vulnerability, I
confirm that I got green light (please contact
[email protected]) from the maintainers to push
the changes.
works.
Further Comments