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
Add email templates for email token #907
Conversation
Codecov Report
@@ Coverage Diff @@
## master #907 +/- ##
==========================================
+ Coverage 95.38% 95.76% +0.37%
==========================================
Files 129 129
Lines 15913 17344 +1431
==========================================
+ Hits 15179 16609 +1430
- Misses 734 735 +1
Continue to review full report at Codecov.
|
Also test sending email challenge with new email scheme with email.identifier.
privacyidea/lib/tokens/emailtoken.py
Outdated
try: | ||
f = open(message[5:], "r") | ||
message = f.read() | ||
f.close() |
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.
Minor nitpick: I think it would be cooler to use Python with
(like we already do in some other places):
with open(message[5:], "r") as f:
message = f.read()
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.
right
#: lib/tokens/vascotoken.py:100 | ||
msgid "VASCO Token: Authentication using VASCO tokens" | ||
msgstr "" | ||
|
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.
Ah, I forgot this in my PR :-(
privacyidea/lib/tokens/emailtoken.py
Outdated
message = f.read() | ||
f.close() | ||
except Exception as e: # pragma: no cover | ||
log.warning(u"Failed to read email template: {0!r}".format(e)) |
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.
In case the file could not be opened, the email message will be the action value of the policy, e.g. file:/etc/privacyidea/email-template.txt
-- we could instead revert to a default value?
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.
right.
Closes #684
99.37% <88.88%> (+0.02%)
95.79% <0%> (+1.68%)
Continue to review full report at Codecov.
file:/etc/privacyidea/email-template.txt
-- we could instead revert to a default value?