示例#1
0
文件: init.py 项目: kent74cn/gitosis
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))
示例#2
0
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))
示例#3
0
def ssh_extract_user(pubkey):
    _, user = pubkey.rsplit(None, 1)
    if ssh.isSafeUsername(user):
        return user
    else:
        raise InsecureSSHKeyUsername(repr(user))
示例#4
0
def ssh_extract_user(pubkey):
    _, user = pubkey.rsplit(None, 1)
    if ssh.isSafeUsername(user):
        return user
    else:
        raise InsecureSSHKeyUsername(repr(user))