Skip to content

Commit

Permalink
Generate API Token Does Not Require PW
Browse files Browse the repository at this point in the history
  • Loading branch information
AvocadoMoon committed Apr 22, 2024
1 parent bc0cc3c commit 99ee0e6
Show file tree
Hide file tree
Showing 15 changed files with 87 additions and 285 deletions.
6 changes: 3 additions & 3 deletions python-restclient/docs/PublicationResourceApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ Name | Type | Description | Notes
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | OK | - |
**401** | Not Authorized | - |
**403** | Not Allowed | - |
**401** | Not Authorized | - |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

Expand Down Expand Up @@ -145,8 +145,8 @@ void (empty response body)
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**204** | No Content | - |
**401** | Not Authorized | - |
**403** | Not Allowed | - |
**401** | Not Authorized | - |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

Expand Down Expand Up @@ -342,8 +342,8 @@ Name | Type | Description | Notes
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | OK | - |
**401** | Not Authorized | - |
**403** | Not Allowed | - |
**401** | Not Authorized | - |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

20 changes: 6 additions & 14 deletions python-restclient/docs/UsersResourceApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Method | HTTP request | Description


# **get_legacy_api_token**
> AccesTokenRepresentationRecord get_legacy_api_token(user_id=user_id, user_password=user_password, client_id=client_id)
> AccesTokenRepresentationRecord get_legacy_api_token()
Get token for legacy API

Expand All @@ -36,13 +36,10 @@ configuration = vcell_client.Configuration(
with vcell_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = vcell_client.UsersResourceApi(api_client)
user_id = 'user_id_example' # str | (optional)
user_password = 'user_password_example' # str | (optional)
client_id = 'client_id_example' # str | (optional)

try:
# Get token for legacy API
api_response = api_instance.get_legacy_api_token(user_id=user_id, user_password=user_password, client_id=client_id)
api_response = api_instance.get_legacy_api_token()
print("The response of UsersResourceApi->get_legacy_api_token:\n")
pprint(api_response)
except Exception as e:
Expand All @@ -52,12 +49,7 @@ with vcell_client.ApiClient(configuration) as api_client:


### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user_id** | **str**| | [optional]
**user_password** | **str**| | [optional]
**client_id** | **str**| | [optional]
This endpoint does not need any parameter.

### Return type

Expand All @@ -69,7 +61,7 @@ No authorization required

### HTTP request headers

- **Content-Type**: application/x-www-form-urlencoded
- **Content-Type**: Not defined
- **Accept**: application/json

### HTTP response details
Expand Down Expand Up @@ -202,8 +194,8 @@ This endpoint does not need any parameter.
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | OK | - |
**401** | Not Authorized | - |
**403** | Not Allowed | - |
**401** | Not Authorized | - |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

Expand Down Expand Up @@ -273,8 +265,8 @@ Name | Type | Description | Notes
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | OK | - |
**401** | Not Authorized | - |
**403** | Not Allowed | - |
**401** | Not Authorized | - |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

2 changes: 0 additions & 2 deletions python-restclient/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ urllib3 = ">= 1.25.3"
python-dateutil = ">=2.8.2"
pydantic = ">=2"
typing-extensions = ">=4.7.1"
requests-oauth2client = "^1.5.1"
jupyter = "^1.0.0"

[tool.poetry.dev-dependencies]
pytest = ">=7.2.1"
Expand Down
24 changes: 12 additions & 12 deletions python-restclient/vcell_client/api/publication_resource_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ def create_publication(

_response_types_map: Dict[str, Optional[str]] = {
'200': "int",
'401': None,
'403': None
'403': None,
'401': None

}
response_data = self.api_client.call_api(
Expand Down Expand Up @@ -171,8 +171,8 @@ def create_publication_with_http_info(

_response_types_map: Dict[str, Optional[str]] = {
'200': "int",
'401': None,
'403': None
'403': None,
'401': None

}
response_data = self.api_client.call_api(
Expand Down Expand Up @@ -240,8 +240,8 @@ def create_publication_without_preload_content(

_response_types_map: Dict[str, Optional[str]] = {
'200': "int",
'401': None,
'403': None
'403': None,
'401': None

}
response_data = self.api_client.call_api(
Expand Down Expand Up @@ -1131,8 +1131,8 @@ def update_publication(

_response_types_map: Dict[str, Optional[str]] = {
'200': "Publication",
'401': None,
'403': None
'403': None,
'401': None

}
response_data = self.api_client.call_api(
Expand Down Expand Up @@ -1200,8 +1200,8 @@ def update_publication_with_http_info(

_response_types_map: Dict[str, Optional[str]] = {
'200': "Publication",
'401': None,
'403': None
'403': None,
'401': None

}
response_data = self.api_client.call_api(
Expand Down Expand Up @@ -1269,8 +1269,8 @@ def update_publication_without_preload_content(

_response_types_map: Dict[str, Optional[str]] = {
'200': "Publication",
'401': None,
'403': None
'403': None,
'401': None

}
response_data = self.api_client.call_api(
Expand Down
84 changes: 12 additions & 72 deletions python-restclient/vcell_client/api/users_resource_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
except ImportError:
from typing_extensions import Annotated

from pydantic import StrictStr

from typing import Optional

from vcell_client.models.acces_token_representation_record import AccesTokenRepresentationRecord
Expand Down Expand Up @@ -54,9 +52,6 @@ def __init__(self, api_client=None) -> None:
@validate_call
def get_legacy_api_token(
self,
user_id: Optional[StrictStr] = None,
user_password: Optional[StrictStr] = None,
client_id: Optional[StrictStr] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Expand All @@ -73,12 +68,6 @@ def get_legacy_api_token(
"""Get token for legacy API
:param user_id:
:type user_id: str
:param user_password:
:type user_password: str
:param client_id:
:type client_id: str
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
Expand All @@ -102,9 +91,6 @@ def get_legacy_api_token(
""" # noqa: E501

_param = self._get_legacy_api_token_serialize(
user_id=user_id,
user_password=user_password,
client_id=client_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
Expand All @@ -129,9 +115,6 @@ def get_legacy_api_token(
@validate_call
def get_legacy_api_token_with_http_info(
self,
user_id: Optional[StrictStr] = None,
user_password: Optional[StrictStr] = None,
client_id: Optional[StrictStr] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Expand All @@ -148,12 +131,6 @@ def get_legacy_api_token_with_http_info(
"""Get token for legacy API
:param user_id:
:type user_id: str
:param user_password:
:type user_password: str
:param client_id:
:type client_id: str
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
Expand All @@ -177,9 +154,6 @@ def get_legacy_api_token_with_http_info(
""" # noqa: E501

_param = self._get_legacy_api_token_serialize(
user_id=user_id,
user_password=user_password,
client_id=client_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
Expand All @@ -204,9 +178,6 @@ def get_legacy_api_token_with_http_info(
@validate_call
def get_legacy_api_token_without_preload_content(
self,
user_id: Optional[StrictStr] = None,
user_password: Optional[StrictStr] = None,
client_id: Optional[StrictStr] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Expand All @@ -223,12 +194,6 @@ def get_legacy_api_token_without_preload_content(
"""Get token for legacy API
:param user_id:
:type user_id: str
:param user_password:
:type user_password: str
:param client_id:
:type client_id: str
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
Expand All @@ -252,9 +217,6 @@ def get_legacy_api_token_without_preload_content(
""" # noqa: E501

_param = self._get_legacy_api_token_serialize(
user_id=user_id,
user_password=user_password,
client_id=client_id,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
Expand All @@ -274,9 +236,6 @@ def get_legacy_api_token_without_preload_content(

def _get_legacy_api_token_serialize(
self,
user_id,
user_password,
client_id,
_request_auth,
_content_type,
_headers,
Expand All @@ -300,12 +259,6 @@ def _get_legacy_api_token_serialize(
# process the query parameters
# process the header parameters
# process the form parameters
if user_id is not None:
_form_params.append(('user_id', user_id))
if user_password is not None:
_form_params.append(('user_password', user_password))
if client_id is not None:
_form_params.append(('client_id', client_id))
# process the body parameter


Expand All @@ -316,19 +269,6 @@ def _get_legacy_api_token_serialize(
]
)

# set the HTTP header `Content-Type`
if _content_type:
_header_params['Content-Type'] = _content_type
else:
_default_content_type = (
self.api_client.select_header_content_type(
[
'application/x-www-form-urlencoded'
]
)
)
if _default_content_type is not None:
_header_params['Content-Type'] = _default_content_type

# authentication setting
_auth_settings: List[str] = [
Expand Down Expand Up @@ -645,8 +585,8 @@ def get_v_cell_identity(

_response_types_map: Dict[str, Optional[str]] = {
'200': "UserIdentityJSONSafe",
'401': None,
'403': None
'403': None,
'401': None

}
response_data = self.api_client.call_api(
Expand Down Expand Up @@ -710,8 +650,8 @@ def get_v_cell_identity_with_http_info(

_response_types_map: Dict[str, Optional[str]] = {
'200': "UserIdentityJSONSafe",
'401': None,
'403': None
'403': None,
'401': None

}
response_data = self.api_client.call_api(
Expand Down Expand Up @@ -775,8 +715,8 @@ def get_v_cell_identity_without_preload_content(

_response_types_map: Dict[str, Optional[str]] = {
'200': "UserIdentityJSONSafe",
'401': None,
'403': None
'403': None,
'401': None

}
response_data = self.api_client.call_api(
Expand Down Expand Up @@ -899,8 +839,8 @@ def set_v_cell_identity(

_response_types_map: Dict[str, Optional[str]] = {
'200': "bool",
'401': None,
'403': None
'403': None,
'401': None

}
response_data = self.api_client.call_api(
Expand Down Expand Up @@ -968,8 +908,8 @@ def set_v_cell_identity_with_http_info(

_response_types_map: Dict[str, Optional[str]] = {
'200': "bool",
'401': None,
'403': None
'403': None,
'401': None

}
response_data = self.api_client.call_api(
Expand Down Expand Up @@ -1037,8 +977,8 @@ def set_v_cell_identity_without_preload_content(

_response_types_map: Dict[str, Optional[str]] = {
'200': "bool",
'401': None,
'403': None
'403': None,
'401': None

}
response_data = self.api_client.call_api(
Expand Down
Loading

0 comments on commit 99ee0e6

Please sign in to comment.