Fixed incorrect key info endpoint (#13633)

This commit is contained in:
Daniel Barker
2025-08-15 11:10:06 -07:00
committed by GitHub
parent 99f30fe5b7
commit 47edecd5bc
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -236,7 +236,7 @@ class KeysManagementClient:
UnauthorizedError: If the request fails with a 401 status code
requests.exceptions.RequestException: If the request fails with any other error
"""
url = f"{self._base_url}/keys/info?key={key}"
url = f"{self._base_url}/key/info?key={key}"
request = requests.Request("GET", url, headers=self._get_headers())
if return_request:
+4 -4
View File
@@ -370,7 +370,7 @@ def test_info_request_minimal(client, base_url, api_key):
"""Test info request with minimal parameters"""
request = client.info(key="test-key", return_request=True)
assert request.method == "GET"
assert request.url == f"{base_url}/keys/info?key=test-key"
assert request.url == f"{base_url}/key/info?key=test-key"
assert request.headers["Content-Type"] == "application/json"
assert request.headers["Authorization"] == f"Bearer {api_key}"
@@ -387,7 +387,7 @@ def test_info_mock_response(client):
}
responses.add(
responses.GET,
f"{client._base_url}/keys/info?key=test-key",
f"{client._base_url}/key/info?key=test-key",
json=mock_response,
status=200,
)
@@ -400,7 +400,7 @@ def test_info_unauthorized_error(client):
"""Test that info raises UnauthorizedError for 401 responses"""
responses.add(
responses.GET,
f"{client._base_url}/keys/info?key=test-key",
f"{client._base_url}/key/info?key=test-key",
status=401,
json={"error": "Unauthorized"},
)
@@ -413,7 +413,7 @@ def test_info_server_error(client):
"""Test that info raises HTTPError for server errors"""
responses.add(
responses.GET,
f"{client._base_url}/keys/info?key=test-key",
f"{client._base_url}/key/info?key=test-key",
status=500,
json={"error": "Internal Server Error"},
)