Beispiel #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()
Beispiel #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()
Beispiel #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()
Beispiel #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()
Beispiel #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()
Beispiel #6
0
    def _unset_attribute(self, owner, attribute_key):
        if attribute_key in owner.attributes:
            del owner.attributes[attribute_key]

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

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

        return no_content()
Beispiel #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()
Beispiel #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()
Beispiel #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()
Beispiel #12
0
    def _unset_attribute(self, owner, attribute_key):
        if attribute_key in owner.attributes:
            del owner.attributes[attribute_key]

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

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

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

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

        return no_content()
Beispiel #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()