Skip to content

Commit 9fe162c

Browse files
committed
[QI2-1175] Auth Config
1 parent feea72b commit 9fe162c

File tree

12 files changed

+584
-2
lines changed

12 files changed

+584
-2
lines changed

.openapi-generator/FILES

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
compute_api_client/__init__.py
22
compute_api_client/api/__init__.py
33
compute_api_client/api/algorithms_api.py
4+
compute_api_client/api/auth_config_api.py
45
compute_api_client/api/backend_api.py
56
compute_api_client/api/backend_types_api.py
67
compute_api_client/api/batch_jobs_api.py
@@ -26,6 +27,8 @@ compute_api_client/docs/Algorithm.md
2627
compute_api_client/docs/AlgorithmIn.md
2728
compute_api_client/docs/AlgorithmType.md
2829
compute_api_client/docs/AlgorithmsApi.md
30+
compute_api_client/docs/AuthConfig.md
31+
compute_api_client/docs/AuthConfigApi.md
2932
compute_api_client/docs/Backend.md
3033
compute_api_client/docs/BackendApi.md
3134
compute_api_client/docs/BackendIn.md
@@ -114,6 +117,7 @@ compute_api_client/models/__init__.py
114117
compute_api_client/models/algorithm.py
115118
compute_api_client/models/algorithm_in.py
116119
compute_api_client/models/algorithm_type.py
120+
compute_api_client/models/auth_config.py
117121
compute_api_client/models/backend.py
118122
compute_api_client/models/backend_in.py
119123
compute_api_client/models/backend_patch.py

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ Class | Method | HTTP request | Description
7575
*AlgorithmsApi* | [**read_algorithm_algorithms_id_get**](compute_api_client/docs/AlgorithmsApi.md#read_algorithm_algorithms_id_get) | **GET** /algorithms/{id} | Retrieve algorithm
7676
*AlgorithmsApi* | [**read_algorithms_algorithms_get**](compute_api_client/docs/AlgorithmsApi.md#read_algorithms_algorithms_get) | **GET** /algorithms | List algorithms
7777
*AlgorithmsApi* | [**update_algorithm_algorithms_id_put**](compute_api_client/docs/AlgorithmsApi.md#update_algorithm_algorithms_id_put) | **PUT** /algorithms/{id} | Update algorithm
78+
*AuthConfigApi* | [**auth_config_auth_config_get**](compute_api_client/docs/AuthConfigApi.md#auth_config_auth_config_get) | **GET** /auth_config | Get suggested authentication configuration
7879
*BackendApi* | [**create_backend_backends_post**](compute_api_client/docs/BackendApi.md#create_backend_backends_post) | **POST** /backends | Create backend
7980
*BackendApi* | [**read_backend_backends_id_get**](compute_api_client/docs/BackendApi.md#read_backend_backends_id_get) | **GET** /backends/{id} | Retrieve backend
8081
*BackendApi* | [**read_backend_self_backends_me_get**](compute_api_client/docs/BackendApi.md#read_backend_self_backends_me_get) | **GET** /backends/me | Retrieve backend
@@ -150,6 +151,7 @@ Class | Method | HTTP request | Description
150151
- [Algorithm](compute_api_client/docs/Algorithm.md)
151152
- [AlgorithmIn](compute_api_client/docs/AlgorithmIn.md)
152153
- [AlgorithmType](compute_api_client/docs/AlgorithmType.md)
154+
- [AuthConfig](compute_api_client/docs/AuthConfig.md)
153155
- [Backend](compute_api_client/docs/Backend.md)
154156
- [BackendIn](compute_api_client/docs/BackendIn.md)
155157
- [BackendPatch](compute_api_client/docs/BackendPatch.md)
@@ -227,7 +229,7 @@ Authentication schemes defined for the API:
227229

228230
- **Type**: OAuth
229231
- **Flow**: accessCode
230-
- **Authorization URL**: https://auth.qi2.quantum-inspire.com/realms/oidc_staging/protocol/openid-connect/auth
232+
- **Authorization URL**: https://auth.qi2.quantum-inspire.com/realms/oidc_development/protocol/openid-connect/auth
231233
- **Scopes**: N/A
232234

233235
<a id="backend"></a>

compute_api_client/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
# import apis into sdk package
2020
from compute_api_client.api.algorithms_api import AlgorithmsApi
21+
from compute_api_client.api.auth_config_api import AuthConfigApi
2122
from compute_api_client.api.backend_api import BackendApi
2223
from compute_api_client.api.backend_types_api import BackendTypesApi
2324
from compute_api_client.api.batch_jobs_api import BatchJobsApi
@@ -52,6 +53,7 @@
5253
from compute_api_client.models.algorithm import Algorithm
5354
from compute_api_client.models.algorithm_in import AlgorithmIn
5455
from compute_api_client.models.algorithm_type import AlgorithmType
56+
from compute_api_client.models.auth_config import AuthConfig
5557
from compute_api_client.models.backend import Backend
5658
from compute_api_client.models.backend_in import BackendIn
5759
from compute_api_client.models.backend_patch import BackendPatch

compute_api_client/api/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
# import apis into api package
44
from compute_api_client.api.algorithms_api import AlgorithmsApi
5+
from compute_api_client.api.auth_config_api import AuthConfigApi
56
from compute_api_client.api.backend_api import BackendApi
67
from compute_api_client.api.backend_types_api import BackendTypesApi
78
from compute_api_client.api.batch_jobs_api import BatchJobsApi
Lines changed: 286 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,286 @@
1+
# coding: utf-8
2+
3+
"""
4+
Quantum Inspire 2
5+
6+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7+
8+
The version of the OpenAPI document: 0.1.0
9+
Generated by OpenAPI Generator (https://openapi-generator.tech)
10+
11+
Do not edit the class manually.
12+
""" # noqa: E501
13+
14+
15+
import io
16+
import warnings
17+
18+
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
19+
from typing import Dict, List, Optional, Tuple, Union, Any
20+
21+
try:
22+
from typing import Annotated
23+
except ImportError:
24+
from typing_extensions import Annotated
25+
26+
from compute_api_client.models.auth_config import AuthConfig
27+
28+
from compute_api_client.api_client import ApiClient
29+
from compute_api_client.api_response import ApiResponse
30+
from compute_api_client.rest import RESTResponseType
31+
32+
33+
class AuthConfigApi:
34+
"""NOTE: This class is auto generated by OpenAPI Generator
35+
Ref: https://openapi-generator.tech
36+
37+
Do not edit the class manually.
38+
"""
39+
40+
def __init__(self, api_client=None) -> None:
41+
if api_client is None:
42+
api_client = ApiClient.get_default()
43+
self.api_client = api_client
44+
45+
46+
@validate_call
47+
async def auth_config_auth_config_get(
48+
self,
49+
_request_timeout: Union[
50+
None,
51+
Annotated[StrictFloat, Field(gt=0)],
52+
Tuple[
53+
Annotated[StrictFloat, Field(gt=0)],
54+
Annotated[StrictFloat, Field(gt=0)]
55+
]
56+
] = None,
57+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
58+
_content_type: Optional[StrictStr] = None,
59+
_headers: Optional[Dict[StrictStr, Any]] = None,
60+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
61+
) -> AuthConfig:
62+
"""Get suggested authentication configuration
63+
64+
65+
:param _request_timeout: timeout setting for this request. If one
66+
number provided, it will be total request
67+
timeout. It can also be a pair (tuple) of
68+
(connection, read) timeouts.
69+
:type _request_timeout: int, tuple(int, int), optional
70+
:param _request_auth: set to override the auth_settings for an a single
71+
request; this effectively ignores the
72+
authentication in the spec for a single request.
73+
:type _request_auth: dict, optional
74+
:param _content_type: force content-type for the request.
75+
:type _content_type: str, Optional
76+
:param _headers: set to override the headers for a single
77+
request; this effectively ignores the headers
78+
in the spec for a single request.
79+
:type _headers: dict, optional
80+
:param _host_index: set to override the host_index for a single
81+
request; this effectively ignores the host_index
82+
in the spec for a single request.
83+
:type _host_index: int, optional
84+
:return: Returns the result object.
85+
""" # noqa: E501
86+
87+
_param = self._auth_config_auth_config_get_serialize(
88+
_request_auth=_request_auth,
89+
_content_type=_content_type,
90+
_headers=_headers,
91+
_host_index=_host_index
92+
)
93+
94+
_response_types_map: Dict[str, Optional[str]] = {
95+
'200': "AuthConfig"
96+
97+
}
98+
response_data = await self.api_client.call_api(
99+
*_param,
100+
_request_timeout=_request_timeout
101+
)
102+
await response_data.read()
103+
return self.api_client.response_deserialize(
104+
response_data=response_data,
105+
response_types_map=_response_types_map,
106+
).data
107+
108+
109+
@validate_call
110+
async def auth_config_auth_config_get_with_http_info(
111+
self,
112+
_request_timeout: Union[
113+
None,
114+
Annotated[StrictFloat, Field(gt=0)],
115+
Tuple[
116+
Annotated[StrictFloat, Field(gt=0)],
117+
Annotated[StrictFloat, Field(gt=0)]
118+
]
119+
] = None,
120+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
121+
_content_type: Optional[StrictStr] = None,
122+
_headers: Optional[Dict[StrictStr, Any]] = None,
123+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
124+
) -> ApiResponse[AuthConfig]:
125+
"""Get suggested authentication configuration
126+
127+
128+
:param _request_timeout: timeout setting for this request. If one
129+
number provided, it will be total request
130+
timeout. It can also be a pair (tuple) of
131+
(connection, read) timeouts.
132+
:type _request_timeout: int, tuple(int, int), optional
133+
:param _request_auth: set to override the auth_settings for an a single
134+
request; this effectively ignores the
135+
authentication in the spec for a single request.
136+
:type _request_auth: dict, optional
137+
:param _content_type: force content-type for the request.
138+
:type _content_type: str, Optional
139+
:param _headers: set to override the headers for a single
140+
request; this effectively ignores the headers
141+
in the spec for a single request.
142+
:type _headers: dict, optional
143+
:param _host_index: set to override the host_index for a single
144+
request; this effectively ignores the host_index
145+
in the spec for a single request.
146+
:type _host_index: int, optional
147+
:return: Returns the result object.
148+
""" # noqa: E501
149+
150+
_param = self._auth_config_auth_config_get_serialize(
151+
_request_auth=_request_auth,
152+
_content_type=_content_type,
153+
_headers=_headers,
154+
_host_index=_host_index
155+
)
156+
157+
_response_types_map: Dict[str, Optional[str]] = {
158+
'200': "AuthConfig"
159+
160+
}
161+
response_data = await self.api_client.call_api(
162+
*_param,
163+
_request_timeout=_request_timeout
164+
)
165+
await response_data.read()
166+
return self.api_client.response_deserialize(
167+
response_data=response_data,
168+
response_types_map=_response_types_map,
169+
)
170+
171+
172+
@validate_call
173+
async def auth_config_auth_config_get_without_preload_content(
174+
self,
175+
_request_timeout: Union[
176+
None,
177+
Annotated[StrictFloat, Field(gt=0)],
178+
Tuple[
179+
Annotated[StrictFloat, Field(gt=0)],
180+
Annotated[StrictFloat, Field(gt=0)]
181+
]
182+
] = None,
183+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
184+
_content_type: Optional[StrictStr] = None,
185+
_headers: Optional[Dict[StrictStr, Any]] = None,
186+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
187+
) -> RESTResponseType:
188+
"""Get suggested authentication configuration
189+
190+
191+
:param _request_timeout: timeout setting for this request. If one
192+
number provided, it will be total request
193+
timeout. It can also be a pair (tuple) of
194+
(connection, read) timeouts.
195+
:type _request_timeout: int, tuple(int, int), optional
196+
:param _request_auth: set to override the auth_settings for an a single
197+
request; this effectively ignores the
198+
authentication in the spec for a single request.
199+
:type _request_auth: dict, optional
200+
:param _content_type: force content-type for the request.
201+
:type _content_type: str, Optional
202+
:param _headers: set to override the headers for a single
203+
request; this effectively ignores the headers
204+
in the spec for a single request.
205+
:type _headers: dict, optional
206+
:param _host_index: set to override the host_index for a single
207+
request; this effectively ignores the host_index
208+
in the spec for a single request.
209+
:type _host_index: int, optional
210+
:return: Returns the result object.
211+
""" # noqa: E501
212+
213+
_param = self._auth_config_auth_config_get_serialize(
214+
_request_auth=_request_auth,
215+
_content_type=_content_type,
216+
_headers=_headers,
217+
_host_index=_host_index
218+
)
219+
220+
_response_types_map: Dict[str, Optional[str]] = {
221+
'200': "AuthConfig"
222+
223+
}
224+
response_data = await self.api_client.call_api(
225+
*_param,
226+
_request_timeout=_request_timeout
227+
)
228+
return response_data.response
229+
230+
231+
def _auth_config_auth_config_get_serialize(
232+
self,
233+
_request_auth,
234+
_content_type,
235+
_headers,
236+
_host_index,
237+
) -> Tuple:
238+
239+
_host = None
240+
241+
_collection_formats: Dict[str, str] = {
242+
243+
}
244+
245+
_path_params: Dict[str, str] = {}
246+
_query_params: List[Tuple[str, str]] = []
247+
_header_params: Dict[str, Optional[str]] = _headers or {}
248+
_form_params: List[Tuple[str, str]] = []
249+
_files: Dict[str, str] = {}
250+
_body_params: Optional[bytes] = None
251+
252+
# process the path parameters
253+
# process the query parameters
254+
# process the header parameters
255+
# process the form parameters
256+
# process the body parameter
257+
258+
259+
# set the HTTP header `Accept`
260+
_header_params['Accept'] = self.api_client.select_header_accept(
261+
[
262+
'application/json'
263+
]
264+
)
265+
266+
267+
# authentication setting
268+
_auth_settings: List[str] = [
269+
]
270+
271+
return self.api_client.param_serialize(
272+
method='GET',
273+
resource_path='/auth_config',
274+
path_params=_path_params,
275+
query_params=_query_params,
276+
header_params=_header_params,
277+
body=_body_params,
278+
post_params=_form_params,
279+
files=_files,
280+
auth_settings=_auth_settings,
281+
collection_formats=_collection_formats,
282+
_host=_host,
283+
_request_auth=_request_auth
284+
)
285+
286+

compute_api_client/docs/AuthConfig.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# AuthConfig
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**client_id** | **str** | |
8+
**audience** | **str** | |
9+
**well_known_endpoint** | **str** | |
10+
11+
## Example
12+
13+
```python
14+
from compute_api_client.models.auth_config import AuthConfig
15+
16+
# TODO update the JSON string below
17+
json = "{}"
18+
# create an instance of AuthConfig from a JSON string
19+
auth_config_instance = AuthConfig.from_json(json)
20+
# print the JSON string representation of the object
21+
print AuthConfig.to_json()
22+
23+
# convert the object into a dict
24+
auth_config_dict = auth_config_instance.to_dict()
25+
# create an instance of AuthConfig from a dict
26+
auth_config_form_dict = auth_config.from_dict(auth_config_dict)
27+
```
28+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
29+
30+

0 commit comments

Comments
 (0)