Exemple #1
0
    def unbind_yubikey(self, request, username_or_id, prefix):
        user = self._get_user(request, username_or_id)
        try:
            del user.yubikeys[prefix]
        except KeyError:
            raise exc.HTTPNotFound

        return no_content()
Exemple #2
0
    def unbind_yubikey(self, request, username_or_id, prefix):
        user = self._get_user(request, username_or_id)
        try:
            del user.yubikeys[prefix]
        except KeyError:
            raise exc.HTTPNotFound

        return no_content()
Exemple #3
0
    def rename_user(self, request, username_or_id, username):
        user = self._get_user(request, username_or_id)
        try:
            request.auth.get_user(username)
            return json_error('User "%s" already exists!' % username)
        except:
            user.name = username

        return no_content()
Exemple #4
0
    def rename_user(self, request, username_or_id, username):
        user = self._get_user(request, username_or_id)
        try:
            request.auth.get_user(username)
            return json_error('User "%s" already exists!' % username)
        except:
            user.name = username

        return no_content()
Exemple #5
0
    def bind_yubikey(self, request, username_or_id, yubikey):
        user = self._get_user(request, username_or_id)
        user.assign_yubikey(yubikey)

        return no_content()
Exemple #6
0
    def _unset_attribute(self, owner, attribute_key):
        if attribute_key in owner.attributes:
            del owner.attributes[attribute_key]

        return no_content()
Exemple #7
0
    def _set_attribute(self, request, owner, key, value):
        owner.attributes[key] = value

        return no_content()
Exemple #8
0
    def delete_user(self, request, username_or_id):
        user = self._get_user(request, username_or_id)
        user.delete()

        return no_content()
Exemple #9
0
    def reset_password(self, request, username_or_id, password):
        user = self._get_user(request, username_or_id)
        user.set_password(password)

        return no_content()
Exemple #10
0
    def reset_password(self, request, username_or_id, password):
        user = self._get_user(request, username_or_id)
        user.set_password(password)

        return no_content()
Exemple #11
0
    def bind_yubikey(self, request, username_or_id, yubikey):
        user = self._get_user(request, username_or_id)
        user.assign_yubikey(yubikey)

        return no_content()
Exemple #12
0
    def _unset_attribute(self, owner, attribute_key):
        if attribute_key in owner.attributes:
            del owner.attributes[attribute_key]

        return no_content()
Exemple #13
0
    def _set_attribute(self, request, owner, key, value):
        owner.attributes[key] = value

        return no_content()
Exemple #14
0
    def delete_user(self, request, username_or_id):
        user = self._get_user(request, username_or_id)
        user.delete()

        return no_content()
Exemple #15
0
    def delete_yubikey(self, request, prefix):
        yubikey = self._get_yubikey(request, prefix)
        yubikey.delete()

        return no_content()
Exemple #16
0
    def delete_yubikey(self, request, prefix):
        yubikey = self._get_yubikey(request, prefix)
        yubikey.delete()

        return no_content()
Exemple #17
0
    def unbind_yubikey(self, request, username_or_id, prefix):
        user = self._get_user(request, username_or_id)
        del user.yubikeys[prefix]

        return no_content()