This repository has been archived by the owner on Jun 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
79436ec
commit c6bf9f0
Showing
9 changed files
with
107 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from infisical.api.models import GetServiceTokenKeyResponse | ||
from requests import Session | ||
|
||
|
||
def get_service_token_data_key_req( | ||
api_request: Session, | ||
) -> GetServiceTokenKeyResponse: | ||
"""Send request again Infisical API to fetch service token data v3 key. | ||
:param api_request: The :class:`requests.Session` instance used to perform the request | ||
:return: Returns the API response as-is | ||
""" | ||
response = api_request.get("/api/v3/service-token/me/key") | ||
|
||
return GetServiceTokenKeyResponse.parse_obj(response.json()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,22 @@ | ||
from typing import Dict, Optional | ||
from typing import Dict, Optional, Union | ||
|
||
from pydantic import BaseModel | ||
from requests import Session | ||
from typing_extensions import Literal | ||
|
||
|
||
class WorkspaceConfig(BaseModel): | ||
workspace_id: str | ||
workspace_key: str | ||
|
||
class ServiceTokenCredentials(BaseModel): | ||
service_token_key: str | ||
|
||
class ServiceTokenV3Credentials(BaseModel): | ||
public_key: str | ||
private_key: str | ||
|
||
class ClientConfig(BaseModel): | ||
auth_mode: Literal["service_token"] | ||
credentials: Dict[Literal["service_token_key"], str] | ||
auth_mode: Literal["service_token", "service_token_v3"] | ||
credentials: Union[ServiceTokenCredentials, ServiceTokenV3Credentials] | ||
workspace_config: Optional[WorkspaceConfig] | ||
cache_ttl: int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters