Ask for email unless --allow-unsafe-registration

Add new option that explicitly allows to not provide an email.
Fixes #414
This commit is contained in:
Miquel Ruiz
2015-11-16 16:57:48 -08:00
committed by Peter Eckersley
parent fc07238804
commit 36842b7bbb
2 changed files with 15 additions and 3 deletions
+12 -2
View File
@@ -139,9 +139,9 @@ def _determine_account(args, config):
elif len(accounts) == 1:
acc = accounts[0]
else: # no account registered yet
if args.email is None:
if args.email is None and not args.allow_unsafe_registration:
args.email = display_ops.get_email()
if not args.email: # get_email might return ""
else:
args.email = None
def _tos_cb(regr):
@@ -842,6 +842,16 @@ def prepare_and_parse_args(plugins, args):
helpful.add(
None, "-t", "--text", dest="text_mode", action="store_true",
help="Use the text output instead of the curses UI.")
helpful.add(
None, "--allow-unsafe-registration", action="store_true",
help="Specifying this flag enables registering an account with no "
"email address. This is strongly discouraged, because in the "
"event of key loss or account compromise you will irrevocably "
"lose access to your account. You will also be unable to receive "
"notice about impending expiration of revocation of your "
"certificates. Updates to the Subscriber Agreement will still "
"affect you, and will be effective N days after posting an "
"update to the web site.")
helpful.add(None, "-m", "--email", help=config_help("email"))
# positional arg shadows --domains, instead of appending, and
# --domains is useful, because it can be stored in config
+3 -1
View File
@@ -124,7 +124,9 @@ def get_email():
"""
while True:
code, email = zope.component.getUtility(interfaces.IDisplay).input(
"Enter email address (used for urgent notices and lost key recovery)")
"Enter email address (mandatory since no "
"--allow-unsafe-registration was provided)"
"(used for urgent notices and lost key recovery)")
if code == display_util.OK:
if le_util.safe_email(email):