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: add certificate based authentication for smtp client #2351

Merged
merged 1 commit into from
Apr 14, 2022

Conversation

alexGNX
Copy link
Contributor

@alexGNX alexGNX commented Mar 30, 2022

This is an implementation of certificate based authentication for the smtp client, as described in design document #2350

  • 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 green light (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.

@codecov
Copy link

codecov bot commented Mar 30, 2022

Codecov Report

Merging #2351 (e1cb6b1) into master (f23ef2f) will decrease coverage by 0.03%.
The diff coverage is 60.00%.

❗ Current head e1cb6b1 differs from pull request most recent head db1bd7b. Consider uploading reports for the commit db1bd7b to get more accurate results

@@            Coverage Diff             @@
##           master    #2351      +/-   ##
==========================================
- Coverage   76.54%   76.50%   -0.04%     
==========================================
  Files         315      318       +3     
  Lines       17320    17316       -4     
==========================================
- Hits        13257    13248       -9     
- Misses       3127     3132       +5     
  Partials      936      936              
Impacted Files Coverage Δ
courier/smtp.go 67.79% <50.00%> (+7.21%) ⬆️
driver/config/config.go 81.87% <100.00%> (+0.12%) ⬆️
cmd/jsonnet/lint.go 31.57% <0.00%> (-16.43%) ⬇️
cmd/jsonnet/format.go 37.50% <0.00%> (-12.50%) ⬇️
cmd/identities/list.go 64.51% <0.00%> (-8.66%) ⬇️
cmd/root.go 66.66% <0.00%> (-7.25%) ⬇️
cmd/identities/validate.go 62.12% <0.00%> (-3.64%) ⬇️
cmd/identities/import.go 78.26% <0.00%> (-3.56%) ⬇️
persistence/sql/persister_courier.go 85.00% <0.00%> (-3.34%) ⬇️
session/test/persistence.go 98.61% <0.00%> (-1.39%) ⬇️
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e505513...db1bd7b. Read the comment docs.

Copy link
Member

@aeneasr aeneasr left a comment

Choose a reason for hiding this comment

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

Awesome, thank you for your contribution! This looks pretty good and I have some ideas how to improve it further :)

clientCertPath := deps.CourierConfig(ctx).CourierSMTPClientCertPath()
clientKeyPath := deps.CourierConfig(ctx).CourierSMTPClientKeyPath()

if clientCertPath != "" && clientKeyPath != "" {
Copy link
Member

Choose a reason for hiding this comment

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

Would it be possible to provide a test for this?

Copy link
Contributor Author

@alexGNX alexGNX Apr 11, 2022

Choose a reason for hiding this comment

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

Hi! I added some unit tests

Copy link
Member

@aeneasr aeneasr left a comment

Choose a reason for hiding this comment

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

Awesome, thank you for adding tests! This looks perfect now. As a last item, could you please add a section to the docs, explaining how to use this feature? The perfect place for it would be here:

https://github.com/ory/docs/edit/master/docs/kratos/concepts/email-sms.md

@alexGNX
Copy link
Contributor Author

alexGNX commented Apr 12, 2022

@aeneasr Sure, here is the MR for the documentation: 753

@aeneasr
Copy link
Member

aeneasr commented Apr 14, 2022

Awesome, thank you! 🎉 Your contribution makes Ory better :)

@aeneasr aeneasr merged commit 7200037 into ory:master Apr 14, 2022
@aeneasr aeneasr self-assigned this Apr 14, 2022
@vinckr
Copy link
Member

vinckr commented Apr 19, 2022

Hello @alexGNX
Congrats on merging your first PR in Ory 🎉 !
Your contribution will soon be helping secure millions of identities around the globe 🌏.
As a small token of appreciation we send all our first time contributors a gift package to welcome them to the community.
Please drop me an email and I will forward you the form to claim your Ory swag!

peturgeorgievv pushed a commit to senteca/kratos-fork that referenced this pull request Jun 30, 2023
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

3 participants