Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions packages/pangea-sdk/pangea/asyncio/services/authn.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ def __init__(
) -> None:
super().__init__(token, config, logger_name=logger_name)

async def check(self, token: str) -> PangeaResponse[m.ClientTokenCheckResult]:
async def check(self, token: m.Token) -> PangeaResponse[m.ClientTokenCheckResult]:
"""
Check a token

Expand All @@ -446,22 +446,19 @@ async def check(self, token: str) -> PangeaResponse[m.ClientTokenCheckResult]:
OperationId: authn_post_v2_client_token_check

Args:
token (str): A token value
token: A token value

Returns:
A PangeaResponse with a token and its information in the response.result field.
Available response fields can be found in our
[API Documentation](https://pangea.cloud/docs/api/authn/flow#/v2/client/token/check-post).

Examples:
response = authn.client.token_endpoints.check(
response = await authn.client.token_endpoints.check(
token="ptu_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a",
)
"""
input = m.ClientTokenCheckRequest(token=token)
return await self.request.post(
"v2/client/token/check", m.ClientTokenCheckResult, data=input.model_dump(exclude_none=True)
)
return await self.request.post("v2/client/token/check", m.ClientTokenCheckResult, data={"token": token})

class UserAsync(ServiceBaseAsync):
service_name = _SERVICE_NAME
Expand Down
9 changes: 3 additions & 6 deletions packages/pangea-sdk/pangea/services/authn/authn.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ def __init__(
):
super().__init__(token, config, logger_name=logger_name)

def check(self, token: str) -> PangeaResponse[m.ClientTokenCheckResult]:
def check(self, token: m.Token) -> PangeaResponse[m.ClientTokenCheckResult]:
"""
Check a token

Expand All @@ -447,7 +447,7 @@ def check(self, token: str) -> PangeaResponse[m.ClientTokenCheckResult]:
OperationId: authn_post_v2_client_token_check

Args:
token (str): A token value
token: A token value

Returns:
A PangeaResponse with a token and its information in the response.result field.
Expand All @@ -459,10 +459,7 @@ def check(self, token: str) -> PangeaResponse[m.ClientTokenCheckResult]:
token="ptu_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a",
)
"""
input = m.ClientTokenCheckRequest(token=token)
return self.request.post(
"v2/client/token/check", m.ClientTokenCheckResult, data=input.model_dump(exclude_none=True)
)
return self.request.post("v2/client/token/check", m.ClientTokenCheckResult, data={"token": token})

class User(ServiceBase):
service_name = _SERVICE_NAME
Expand Down
Loading