Skip to content

Commit 0e70591

Browse files
authored
Merge pull request #18 from onepanelio/feat/onepanelio.core.688-login
feat: added login api
2 parents 1bafd51 + b8fd4ae commit 0e70591

92 files changed

Lines changed: 1249 additions & 139 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ Onepanel API
33

44
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
55

6-
- API version: 0.14.1
7-
- Package version: v0.14.1
6+
- API version: 0.15.0
7+
- Package version: 0.15.0
88
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
99
For more information, please visit [https://github.com/onepanelio/core](https://github.com/onepanelio/core)
1010

@@ -79,13 +79,13 @@ configuration = onepanel.core.api.Configuration(
7979
with onepanel.core.api.ApiClient(configuration) as api_client:
8080
# Create an instance of the API class
8181
api_instance = onepanel.core.api.AuthServiceApi(api_client)
82-
body = onepanel.core.api.IsAuthorized() # IsAuthorized |
82+
body = onepanel.core.api.GetAccessTokenRequest() # GetAccessTokenRequest |
8383

8484
try:
85-
api_response = api_instance.is_authorized(body)
85+
api_response = api_instance.get_access_token(body)
8686
pprint(api_response)
8787
except ApiException as e:
88-
print("Exception when calling AuthServiceApi->is_authorized: %s\n" % e)
88+
print("Exception when calling AuthServiceApi->get_access_token: %s\n" % e)
8989

9090
```
9191

@@ -95,8 +95,8 @@ All URIs are relative to *http://localhost:8888*
9595

9696
Class | Method | HTTP request | Description
9797
------------ | ------------- | ------------- | -------------
98+
*AuthServiceApi* | [**get_access_token**](docs/AuthServiceApi.md#get_access_token) | **POST** /apis/v1beta1/auth/get_access_token |
9899
*AuthServiceApi* | [**is_authorized**](docs/AuthServiceApi.md#is_authorized) | **POST** /apis/v1beta1/auth |
99-
*AuthServiceApi* | [**is_valid_token**](docs/AuthServiceApi.md#is_valid_token) | **POST** /apis/v1beta1/auth/token |
100100
*ConfigServiceApi* | [**get_config**](docs/ConfigServiceApi.md#get_config) | **GET** /apis/v1beta1/config |
101101
*CronWorkflowServiceApi* | [**create_cron_workflow**](docs/CronWorkflowServiceApi.md#create_cron_workflow) | **POST** /apis/v1beta1/{namespace}/cron_workflow |
102102
*CronWorkflowServiceApi* | [**delete_cron_workflow**](docs/CronWorkflowServiceApi.md#delete_cron_workflow) | **DELETE** /apis/v1beta1/{namespace}/cron_workflows/{uid} |
@@ -106,6 +106,7 @@ Class | Method | HTTP request | Description
106106
*CronWorkflowServiceApi* | [**update_cron_workflow**](docs/CronWorkflowServiceApi.md#update_cron_workflow) | **PUT** /apis/v1beta1/{namespace}/cron_workflow/{uid} |
107107
*LabelServiceApi* | [**add_labels**](docs/LabelServiceApi.md#add_labels) | **POST** /apis/v1beta1/{namespace}/{resource}/{uid}/labels |
108108
*LabelServiceApi* | [**delete_label**](docs/LabelServiceApi.md#delete_label) | **DELETE** /apis/v1beta1/{namespace}/{resource}/{uid}/labels/{key} |
109+
*LabelServiceApi* | [**get_available_labels**](docs/LabelServiceApi.md#get_available_labels) | **GET** /apis/v1beta1/labels/{namespace}/{resource}/labels |
109110
*LabelServiceApi* | [**get_labels**](docs/LabelServiceApi.md#get_labels) | **GET** /apis/v1beta1/{namespace}/{resource}/{uid}/labels |
110111
*LabelServiceApi* | [**replace_labels**](docs/LabelServiceApi.md#replace_labels) | **PUT** /apis/v1beta1/{namespace}/{resource}/{uid}/labels |
111112
*NamespaceServiceApi* | [**create_namespace**](docs/NamespaceServiceApi.md#create_namespace) | **POST** /apis/v1beta1/namespaces |
@@ -175,6 +176,8 @@ Class | Method | HTTP request | Description
175176
- [DeleteSecretKeyResponse](docs/DeleteSecretKeyResponse.md)
176177
- [DeleteSecretResponse](docs/DeleteSecretResponse.md)
177178
- [File](docs/File.md)
179+
- [GetAccessTokenRequest](docs/GetAccessTokenRequest.md)
180+
- [GetAccessTokenResponse](docs/GetAccessTokenResponse.md)
178181
- [GetConfigResponse](docs/GetConfigResponse.md)
179182
- [GetLabelsResponse](docs/GetLabelsResponse.md)
180183
- [GetWorkflowExecutionMetricsResponse](docs/GetWorkflowExecutionMetricsResponse.md)
@@ -185,8 +188,6 @@ Class | Method | HTTP request | Description
185188
- [GrpcGatewayRuntimeStreamError](docs/GrpcGatewayRuntimeStreamError.md)
186189
- [IsAuthorized](docs/IsAuthorized.md)
187190
- [IsAuthorizedResponse](docs/IsAuthorizedResponse.md)
188-
- [IsValidTokenRequest](docs/IsValidTokenRequest.md)
189-
- [IsValidTokenResponse](docs/IsValidTokenResponse.md)
190191
- [KeyValue](docs/KeyValue.md)
191192
- [Labels](docs/Labels.md)
192193
- [ListCronWorkflowsResponse](docs/ListCronWorkflowsResponse.md)

docs/AuthServiceApi.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ All URIs are relative to *http://localhost:8888*
44

55
Method | HTTP request | Description
66
------------- | ------------- | -------------
7+
[**get_access_token**](AuthServiceApi.md#get_access_token) | **POST** /apis/v1beta1/auth/get_access_token |
78
[**is_authorized**](AuthServiceApi.md#is_authorized) | **POST** /apis/v1beta1/auth |
8-
[**is_valid_token**](AuthServiceApi.md#is_valid_token) | **POST** /apis/v1beta1/auth/token |
99

1010

11-
# **is_authorized**
12-
> IsAuthorizedResponse is_authorized(body)
11+
# **get_access_token**
12+
> GetAccessTokenResponse get_access_token(body)
1313
1414

1515

@@ -47,24 +47,24 @@ configuration = onepanel.core.api.Configuration(
4747
with onepanel.core.api.ApiClient(configuration) as api_client:
4848
# Create an instance of the API class
4949
api_instance = onepanel.core.api.AuthServiceApi(api_client)
50-
body = onepanel.core.api.IsAuthorized() # IsAuthorized |
50+
body = onepanel.core.api.GetAccessTokenRequest() # GetAccessTokenRequest |
5151

5252
try:
53-
api_response = api_instance.is_authorized(body)
53+
api_response = api_instance.get_access_token(body)
5454
pprint(api_response)
5555
except ApiException as e:
56-
print("Exception when calling AuthServiceApi->is_authorized: %s\n" % e)
56+
print("Exception when calling AuthServiceApi->get_access_token: %s\n" % e)
5757
```
5858

5959
### Parameters
6060

6161
Name | Type | Description | Notes
6262
------------- | ------------- | ------------- | -------------
63-
**body** | [**IsAuthorized**](IsAuthorized.md)| |
63+
**body** | [**GetAccessTokenRequest**](GetAccessTokenRequest.md)| |
6464

6565
### Return type
6666

67-
[**IsAuthorizedResponse**](IsAuthorizedResponse.md)
67+
[**GetAccessTokenResponse**](GetAccessTokenResponse.md)
6868

6969
### Authorization
7070

@@ -83,8 +83,8 @@ Name | Type | Description | Notes
8383

8484
[[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)
8585

86-
# **is_valid_token**
87-
> IsValidTokenResponse is_valid_token(body)
86+
# **is_authorized**
87+
> IsAuthorizedResponse is_authorized(body)
8888
8989

9090

@@ -122,24 +122,24 @@ configuration = onepanel.core.api.Configuration(
122122
with onepanel.core.api.ApiClient(configuration) as api_client:
123123
# Create an instance of the API class
124124
api_instance = onepanel.core.api.AuthServiceApi(api_client)
125-
body = onepanel.core.api.IsValidTokenRequest() # IsValidTokenRequest |
125+
body = onepanel.core.api.IsAuthorized() # IsAuthorized |
126126

127127
try:
128-
api_response = api_instance.is_valid_token(body)
128+
api_response = api_instance.is_authorized(body)
129129
pprint(api_response)
130130
except ApiException as e:
131-
print("Exception when calling AuthServiceApi->is_valid_token: %s\n" % e)
131+
print("Exception when calling AuthServiceApi->is_authorized: %s\n" % e)
132132
```
133133

134134
### Parameters
135135

136136
Name | Type | Description | Notes
137137
------------- | ------------- | ------------- | -------------
138-
**body** | [**IsValidTokenRequest**](IsValidTokenRequest.md)| |
138+
**body** | [**IsAuthorized**](IsAuthorized.md)| |
139139

140140
### Return type
141141

142-
[**IsValidTokenResponse**](IsValidTokenResponse.md)
142+
[**IsAuthorizedResponse**](IsAuthorizedResponse.md)
143143

144144
### Authorization
145145

docs/GetAccessTokenRequest.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# GetAccessTokenRequest
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**username** | **str** | | [optional]
7+
**token** | **str** | | [optional]
8+
9+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+

docs/GetAccessTokenResponse.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# GetAccessTokenResponse
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**domain** | **str** | | [optional]
7+
**access_token** | **str** | | [optional]
8+
**username** | **str** | | [optional]
9+
10+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
11+
12+

docs/LabelServiceApi.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Method | HTTP request | Description
66
------------- | ------------- | -------------
77
[**add_labels**](LabelServiceApi.md#add_labels) | **POST** /apis/v1beta1/{namespace}/{resource}/{uid}/labels |
88
[**delete_label**](LabelServiceApi.md#delete_label) | **DELETE** /apis/v1beta1/{namespace}/{resource}/{uid}/labels/{key} |
9+
[**get_available_labels**](LabelServiceApi.md#get_available_labels) | **GET** /apis/v1beta1/labels/{namespace}/{resource}/labels |
910
[**get_labels**](LabelServiceApi.md#get_labels) | **GET** /apis/v1beta1/{namespace}/{resource}/{uid}/labels |
1011
[**replace_labels**](LabelServiceApi.md#replace_labels) | **PUT** /apis/v1beta1/{namespace}/{resource}/{uid}/labels |
1112

@@ -172,6 +173,87 @@ Name | Type | Description | Notes
172173

173174
[[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)
174175

176+
# **get_available_labels**
177+
> GetLabelsResponse get_available_labels(namespace, resource, key_like=key_like, skip_keys=skip_keys)
178+
179+
180+
181+
### Example
182+
183+
* Api Key Authentication (Bearer):
184+
```python
185+
from __future__ import print_function
186+
import time
187+
import onepanel.core.api
188+
from onepanel.core.api.rest import ApiException
189+
from pprint import pprint
190+
# Defining the host is optional and defaults to http://localhost:8888
191+
# See configuration.py for a list of all supported configuration parameters.
192+
configuration = onepanel.core.api.Configuration(
193+
host = "http://localhost:8888"
194+
)
195+
196+
# The client must configure the authentication and authorization parameters
197+
# in accordance with the API server security policy.
198+
# Examples for each auth method are provided below, use the example that
199+
# satisfies your auth use case.
200+
201+
# Configure API key authorization: Bearer
202+
configuration = onepanel.core.api.Configuration(
203+
host = "http://localhost:8888",
204+
api_key = {
205+
'authorization': 'YOUR_API_KEY'
206+
}
207+
)
208+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
209+
# configuration.api_key_prefix['authorization'] = 'Bearer'
210+
211+
# Enter a context with an instance of the API client
212+
with onepanel.core.api.ApiClient(configuration) as api_client:
213+
# Create an instance of the API class
214+
api_instance = onepanel.core.api.LabelServiceApi(api_client)
215+
namespace = 'namespace_example' # str |
216+
resource = 'resource_example' # str |
217+
key_like = 'key_like_example' # str | (optional)
218+
skip_keys = 'skip_keys_example' # str | (optional)
219+
220+
try:
221+
api_response = api_instance.get_available_labels(namespace, resource, key_like=key_like, skip_keys=skip_keys)
222+
pprint(api_response)
223+
except ApiException as e:
224+
print("Exception when calling LabelServiceApi->get_available_labels: %s\n" % e)
225+
```
226+
227+
### Parameters
228+
229+
Name | Type | Description | Notes
230+
------------- | ------------- | ------------- | -------------
231+
**namespace** | **str**| |
232+
**resource** | **str**| |
233+
**key_like** | **str**| | [optional]
234+
**skip_keys** | **str**| | [optional]
235+
236+
### Return type
237+
238+
[**GetLabelsResponse**](GetLabelsResponse.md)
239+
240+
### Authorization
241+
242+
[Bearer](../README.md#Bearer)
243+
244+
### HTTP request headers
245+
246+
- **Content-Type**: Not defined
247+
- **Accept**: application/json, application/octet-stream
248+
249+
### HTTP response details
250+
| Status code | Description | Response headers |
251+
|-------------|-------------|------------------|
252+
**200** | A successful response. | - |
253+
**0** | An unexpected error response | - |
254+
255+
[[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)
256+
175257
# **get_labels**
176258
> GetLabelsResponse get_labels(namespace, resource, uid)
177259

docs/LogInRequest.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# LogInRequest
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**username** | **str** | | [optional]
7+
**token_hash** | **str** | | [optional]
8+
9+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+

docs/LogInResponse.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# LogInResponse
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**domain** | **str** | | [optional]
7+
**token** | **str** | | [optional]
8+
**username** | **str** | | [optional]
9+
10+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
11+
12+

onepanel/core/api/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
88
Onepanel API # noqa: E501
99
10-
The version of the OpenAPI document: 0.14.1
10+
The version of the OpenAPI document: 0.15.0
1111
Generated by: https://openapi-generator.tech
1212
"""
1313

1414

1515
from __future__ import absolute_import
1616

17-
__version__ = "v0.14.1"
17+
__version__ = "0.15.0"
1818

1919
# import apis into sdk package
2020
from onepanel.core.api.api.auth_service_api import AuthServiceApi
@@ -48,6 +48,8 @@
4848
from onepanel.core.api.models.delete_secret_key_response import DeleteSecretKeyResponse
4949
from onepanel.core.api.models.delete_secret_response import DeleteSecretResponse
5050
from onepanel.core.api.models.file import File
51+
from onepanel.core.api.models.get_access_token_request import GetAccessTokenRequest
52+
from onepanel.core.api.models.get_access_token_response import GetAccessTokenResponse
5153
from onepanel.core.api.models.get_config_response import GetConfigResponse
5254
from onepanel.core.api.models.get_labels_response import GetLabelsResponse
5355
from onepanel.core.api.models.get_workflow_execution_metrics_response import GetWorkflowExecutionMetricsResponse
@@ -58,8 +60,6 @@
5860
from onepanel.core.api.models.grpc_gateway_runtime_stream_error import GrpcGatewayRuntimeStreamError
5961
from onepanel.core.api.models.is_authorized import IsAuthorized
6062
from onepanel.core.api.models.is_authorized_response import IsAuthorizedResponse
61-
from onepanel.core.api.models.is_valid_token_request import IsValidTokenRequest
62-
from onepanel.core.api.models.is_valid_token_response import IsValidTokenResponse
6363
from onepanel.core.api.models.key_value import KeyValue
6464
from onepanel.core.api.models.labels import Labels
6565
from onepanel.core.api.models.list_cron_workflows_response import ListCronWorkflowsResponse

0 commit comments

Comments
 (0)