示例#1
0
def test_create_key(api):
    username = '******'
    password = '******'
    key = UserData.from_userpass_pair(username, password,
                                      api.get_cluster_uuid()).key
    key = key[20:40].encode('hex')
    assert core.create_key(username, password) == key
示例#2
0
def create_user(cluster, email, password=None, quota=None):
    """Creates user in given vcluster."""
    key = core.create_key(email, password) if password \
        else core.generate_user_key()
    desc = {} if cluster.is_root else core.add_vcluster_to_desc(cluster, {})

    sx.createUser(email, userType='normal', userKey=key, desc=desc,
                  quota=quota)
示例#3
0
def create_user(email, password=None):
    """Creates a user."""

    if password:
        key = core.create_key(email, password)
    else:
        key = core.generate_user_key()

    api.createUser(email, userType='normal', userKey=key)
示例#4
0
def create_user(email, password=None):
    """Creates a user."""

    if password:
        key = core.create_key(email, password)
    else:
        key = core.generate_user_key()

    api.createUser(email, userType='normal', userKey=key)
示例#5
0
 def consume(self, password):
     """Set the password and delete all tokens."""
     sx.modifyUser(self.email, create_key(self.email, password))
     UserPasswordReset.objects.filter(email=self.email).delete()
示例#6
0
 def consume(self, password):
     """Set the password and delete all tokens."""
     api.modifyUser(self.email, create_key(self.email, password))
     UserPasswordReset.objects.filter(email=self.email).delete()