def ssh_extract_user(pubkey): _, user = pubkey.rsplit(None, 1) if ssh.isSafeUsername(user): # gitolite alike: user.pub = [email protected], but user.pub != [email protected] if user.rfind("@") > user.rfind("."): user = user.rsplit("@", 1)[0] return user else: raise InsecureSSHKeyUsername(repr(user))
def ssh_extract_user(pubkey): _, user = pubkey.rsplit(None, 1) if ssh.isSafeUsername(user): # gitolite alike: user.pub = [email protected], but user.pub != [email protected] if user.rfind('@') > user.rfind('.'): user = user.rsplit('@', 1)[0] return user else: raise InsecureSSHKeyUsername(repr(user))
def ssh_extract_user(pubkey): _, user = pubkey.rsplit(None, 1) if ssh.isSafeUsername(user): return user else: raise InsecureSSHKeyUsername(repr(user))