Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def require_freemail(identity_with_nickname):
"""
Return the given identity's Freemail address.
Abort with an error message if the given identity does not have a
Freemail address / context.
:param identity_with_nickname: @
"""
nickname, identity = _parse_name(identity_with_nickname)
re_encode = base64.b32encode(fcp.node.base64decode(identity))
# Remove trailing '=' padding.
re_encode = re_encode.rstrip('=')
# Freemail addresses are lower case.
address = nickname + '@' + re_encode + '.freemail'
return address.lower()