Skip to content

Commit 683d508

Browse files
committed
make api key validation path a constant
1 parent 1239d82 commit 683d508

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

workos/api_keys.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from workos.utils.http_client import AsyncHTTPClient, SyncHTTPClient
66
from workos.utils.request_helper import REQUEST_METHOD_POST
77

8+
API_KEY_VALIDATION_PATH = "api_keys/validations"
89

910

1011
class ApiKeysModule(Protocol):
@@ -33,7 +34,7 @@ def __init__(self, http_client: SyncHTTPClient):
3334

3435
def validate_api_key(self, *, value: str) -> ApiKey:
3536
response = self._http_client.request(
36-
"api_keys/validations", method=REQUEST_METHOD_POST, json={
37+
API_KEY_VALIDATION_PATH, method=REQUEST_METHOD_POST, json={
3738
"value": value}
3839
)
3940
return ApiKey.model_validate(response["api_key"])
@@ -47,7 +48,7 @@ def __init__(self, http_client: AsyncHTTPClient):
4748

4849
async def validate_api_key(self, *, value: str) -> ApiKey:
4950
response = await self._http_client.request(
50-
"api_keys/validations", method=REQUEST_METHOD_POST, json={
51+
API_KEY_VALIDATION_PATH, method=REQUEST_METHOD_POST, json={
5152
"value": value}
5253
)
5354
return ApiKey.model_validate(response["api_key"])

0 commit comments

Comments
 (0)