Add support for backfillips

This commit is contained in:
2024-09-10 11:51:53 +02:00
parent 4fb45c41bd
commit bdba6db42d
5 changed files with 48 additions and 7 deletions

View File

@ -9,6 +9,7 @@ from flask import jsonify
from hsapi_client import Node, User, Route, PreAuthKey
from hsapi_client.preauthkeys import (v1CreatePreAuthKeyRequest,
v1ExpirePreAuthKeyRequest)
from hsapi_client.nodes import v1BackfillNodeIPsResponse
log = logging.getLogger()
@ -104,3 +105,10 @@ def expirePKA(userName: str, key: str):
PreAuthKey().expire(req)
return redirect(url_for('main.user', userName=userName))
@rest_blueprint.route('/backfillips', methods=['POST'])
@auth.authorize_admins('default')
def backfillips():
response = Node().backfillips()
return jsonify(response.changes)