更新代码

This commit is contained in:
2025-09-14 18:05:12 +08:00
parent ba18997410
commit d83f30c07b
4 changed files with 476 additions and 9 deletions

View File

@@ -218,7 +218,28 @@ def create_auth_challenge(
request_body["scopes"] = scopes
return _make_request('POST', url, headers, request_body=request_body)
def perform_auth_challenge(
def get_auth_methods(
account: str,
) -> dict:
"""获取认证方式"""
url = f"{DOMAIN}/api/auth/challenge/{account}/factors"
headers = {
'accept': 'application/json',
}
return _make_request('GET', url, headers)
def send_verification_code(
id: str,
factor_id: str,
) -> dict:
"""发送验证码"""
url = f"{DOMAIN}/api/auth/challenge/{id}/factors/{factor_id}"
headers = {
'accept': 'application/json',
}
return _make_request('POST', url, headers)
def perform_auth_challenge_password(
challenge_id: str,
factor_id: str,
password: str