Skip to content

Commit 5c00d79

Browse files
committed
fix: refactor api to use frontier models
- recently shield got refactored as frontier Signed-off-by: Kush Sharma <[email protected]>
1 parent 1363c8a commit 5c00d79

File tree

1,520 files changed

+120112
-120103
lines changed

Some content is hidden

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

1,520 files changed

+120112
-120103
lines changed

.openapi-generator/FILES

+266-266
Large diffs are not rendered by default.

Makefile

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
PROTON_COMMIT := 7bbaf3c22f37e9c9db5fc7982483bc0a6bd6a050
1+
PROTON_COMMIT := 2738405d4d289163a09db4983b6dddd27e8dc37e
22
.PHONY: clean genclient genspec
33

44
genclient: clean genspec ## Generate the client using openapi-generator
55
@openapi-generator generate -g python -o "." \
66
-i "./etc/openapi.json" -c ./etc/openapi.conf.yaml \
77
--git-user-id raystack \
8-
--git-repo-id "shield-python" \
8+
--git-repo-id "frontier-python" \
99
--git-host github.com
1010
@rm -f .gitlab-ci.yml .travis.yml
1111
@echo " > client generated"
@@ -15,11 +15,11 @@ clean:
1515
grep -v api_example.py | grep -v Makefile | grep -v README.md | grep -v example | \
1616
grep -v pyproject.toml | \
1717
xargs rm -rf
18-
@rm -rf test __pycache__ docs shield_api
18+
@rm -rf test __pycache__ docs frontier_api
1919
@echo " > autogenerated files deleted"
2020

21-
genspec: ## Generate the openapi v3 spec using raystack/shield generated v2 spec
21+
genspec: ## Generate the openapi v3 spec using raystack/frontier generated v2 spec
2222
@echo " > generating openapiv3 spec"
2323
@curl -X 'GET' \
24-
'https://converter.swagger.io/api/convert?url=https%3A%2F%2Fraw.githubusercontent.com%2Fraystack%2Fshield%2F${PROTON_COMMIT}%2Fproto%2Fapidocs.swagger.yaml' \
24+
'https://converter.swagger.io/api/convert?url=https%3A%2F%2Fraw.githubusercontent.com%2Fraystack%2Ffrontier%2F${PROTON_COMMIT}%2Fproto%2Fapidocs.swagger.yaml' \
2525
-H 'accept: application/json' > ./etc/openapi.json

README.md

+134-128
Large diffs are not rendered by default.

api_example.py

+12-9
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
import time
44
from pprint import pprint
5-
from shield_api import *
6-
from shield_api.apis.tags import user_api
7-
from shield_api.model.rpc_status import RpcStatus
8-
from shield_api.model.v1beta1_list_users_response import V1beta1ListUsersResponse
9-
from shield_api.model.v1beta1_list_auth_strategies_response import V1beta1ListAuthStrategiesResponse
5+
from frontier_api import *
6+
from frontier_api.apis.tags import user_api
7+
from frontier_api.model.rpc_status import RpcStatus
8+
from frontier_api.model.v1beta1_list_users_response import V1beta1ListUsersResponse
9+
from frontier_api.model.v1beta1_list_auth_strategies_response import V1beta1ListAuthStrategiesResponse
1010

1111
HOST = "http://127.0.0.1:7400"
1212

@@ -20,11 +20,14 @@ def fetch_users():
2020
# Enter a context with an instance of the API client
2121
with ApiClient(configuration) as api_client:
2222
# Create an instance of the API class
23-
api_instance = user_api.ShieldServiceListUsers(api_client)
23+
api_instance = user_api.FrontierServiceListUsers(api_client)
2424
try:
25-
api_response = api_instance.shield_service_list_users()
25+
api_response = api_instance.frontier_service_list_users()
2626
assert isinstance(api_response.body, V1beta1ListUsersResponse)
2727
pprint(api_response.body)
2828
except ApiException as e:
29-
print("Exception when calling user_api->ShieldServiceListUsers: %s\n" % e)
30-
fetch_users()
29+
print("Exception when calling user_api->FrontierServiceListUsers: %s\n" % e)
30+
31+
32+
if __name__ == "__main__":
33+
fetch_users()

docs/apis/tags/AuditLogApi.md

+92-92
Large diffs are not rendered by default.

docs/apis/tags/AuthnApi.md

+230-230
Large diffs are not rendered by default.

docs/apis/tags/AuthzApi.md

+90-90
Large diffs are not rendered by default.

docs/apis/tags/GroupApi.md

+291-291
Large diffs are not rendered by default.

docs/apis/tags/MetaSchemaApi.md

+144-144
Large diffs are not rendered by default.

docs/apis/tags/NamespaceApi.md

+60-60
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<a id="__pageTop"></a>
2-
# shield_api.apis.tags.namespace_api.NamespaceApi
2+
# frontier_api.apis.tags.namespace_api.NamespaceApi
33

44
All URIs are relative to *http://127.0.0.1:7400*
55

66
Method | HTTP request | Description
77
------------- | ------------- | -------------
8-
[**shield_service_get_namespace**](#shield_service_get_namespace) | **get** /v1beta1/namespaces/{id} | Get namespace
9-
[**shield_service_list_namespaces**](#shield_service_list_namespaces) | **get** /v1beta1/namespaces | Get all namespaces
8+
[**frontier_service_get_namespace**](#frontier_service_get_namespace) | **get** /v1beta1/namespaces/{id} | Get namespace
9+
[**frontier_service_list_namespaces**](#frontier_service_list_namespaces) | **get** /v1beta1/namespaces | Get all namespaces
1010

11-
# **shield_service_get_namespace**
12-
<a id="shield_service_get_namespace"></a>
13-
> V1beta1GetNamespaceResponse shield_service_get_namespace(id)
11+
# **frontier_service_get_namespace**
12+
<a id="frontier_service_get_namespace"></a>
13+
> V1beta1GetNamespaceResponse frontier_service_get_namespace(id)
1414
1515
Get namespace
1616

@@ -20,14 +20,14 @@ Returns a namespace by ID
2020

2121
* Basic Authentication (Basic):
2222
```python
23-
import shield_api
24-
from shield_api.apis.tags import namespace_api
25-
from shield_api.model.v1beta1_get_namespace_response import V1beta1GetNamespaceResponse
26-
from shield_api.model.rpc_status import RpcStatus
23+
import frontier_api
24+
from frontier_api.apis.tags import namespace_api
25+
from frontier_api.model.rpc_status import RpcStatus
26+
from frontier_api.model.v1beta1_get_namespace_response import V1beta1GetNamespaceResponse
2727
from pprint import pprint
2828
# Defining the host is optional and defaults to http://127.0.0.1:7400
2929
# See configuration.py for a list of all supported configuration parameters.
30-
configuration = shield_api.Configuration(
30+
configuration = frontier_api.Configuration(
3131
host = "http://127.0.0.1:7400"
3232
)
3333

@@ -37,12 +37,12 @@ configuration = shield_api.Configuration(
3737
# satisfies your auth use case.
3838

3939
# Configure HTTP basic authorization: Basic
40-
configuration = shield_api.Configuration(
40+
configuration = frontier_api.Configuration(
4141
username = 'YOUR_USERNAME',
4242
password = 'YOUR_PASSWORD'
4343
)
4444
# Enter a context with an instance of the API client
45-
with shield_api.ApiClient(configuration) as api_client:
45+
with frontier_api.ApiClient(configuration) as api_client:
4646
# Create an instance of the API class
4747
api_instance = namespace_api.NamespaceApi(api_client)
4848

@@ -52,12 +52,12 @@ with shield_api.ApiClient(configuration) as api_client:
5252
}
5353
try:
5454
# Get namespace
55-
api_response = api_instance.shield_service_get_namespace(
55+
api_response = api_instance.frontier_service_get_namespace(
5656
path_params=path_params,
5757
)
5858
pprint(api_response)
59-
except shield_api.ApiException as e:
60-
print("Exception when calling NamespaceApi->shield_service_get_namespace: %s\n" % e)
59+
except frontier_api.ApiException as e:
60+
print("Exception when calling NamespaceApi->frontier_service_get_namespace: %s\n" % e)
6161
```
6262
### Parameters
6363

@@ -88,15 +88,15 @@ str, | str, | |
8888
Code | Class | Description
8989
------------- | ------------- | -------------
9090
n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned
91-
200 | [ApiResponseFor200](#shield_service_get_namespace.ApiResponseFor200) | A successful response.
92-
400 | [ApiResponseFor400](#shield_service_get_namespace.ApiResponseFor400) | Bad Request - The request was malformed or contained invalid parameters.
93-
401 | [ApiResponseFor401](#shield_service_get_namespace.ApiResponseFor401) | Unauthorized - Authentication is required
94-
403 | [ApiResponseFor403](#shield_service_get_namespace.ApiResponseFor403) | Forbidden - User does not have permission to access the resource
95-
404 | [ApiResponseFor404](#shield_service_get_namespace.ApiResponseFor404) | Not Found - The requested resource was not found
96-
500 | [ApiResponseFor500](#shield_service_get_namespace.ApiResponseFor500) | Internal Server Error. Returned when theres is something wrong with Shield server.
97-
default | [ApiResponseForDefault](#shield_service_get_namespace.ApiResponseForDefault) | An unexpected error response.
98-
99-
#### shield_service_get_namespace.ApiResponseFor200
91+
200 | [ApiResponseFor200](#frontier_service_get_namespace.ApiResponseFor200) | A successful response.
92+
400 | [ApiResponseFor400](#frontier_service_get_namespace.ApiResponseFor400) | Bad Request - The request was malformed or contained invalid parameters.
93+
401 | [ApiResponseFor401](#frontier_service_get_namespace.ApiResponseFor401) | Unauthorized - Authentication is required
94+
403 | [ApiResponseFor403](#frontier_service_get_namespace.ApiResponseFor403) | Forbidden - User does not have permission to access the resource
95+
404 | [ApiResponseFor404](#frontier_service_get_namespace.ApiResponseFor404) | Not Found - The requested resource was not found
96+
500 | [ApiResponseFor500](#frontier_service_get_namespace.ApiResponseFor500) | Internal Server Error. Returned when theres is something wrong with Frontier server.
97+
default | [ApiResponseForDefault](#frontier_service_get_namespace.ApiResponseForDefault) | An unexpected error response.
98+
99+
#### frontier_service_get_namespace.ApiResponseFor200
100100
Name | Type | Description | Notes
101101
------------- | ------------- | ------------- | -------------
102102
response | urllib3.HTTPResponse | Raw response |
@@ -109,7 +109,7 @@ Type | Description | Notes
109109
[**V1beta1GetNamespaceResponse**](../../models/V1beta1GetNamespaceResponse.md) | |
110110

111111

112-
#### shield_service_get_namespace.ApiResponseFor400
112+
#### frontier_service_get_namespace.ApiResponseFor400
113113
Name | Type | Description | Notes
114114
------------- | ------------- | ------------- | -------------
115115
response | urllib3.HTTPResponse | Raw response |
@@ -122,7 +122,7 @@ Type | Description | Notes
122122
[**RpcStatus**](../../models/RpcStatus.md) | |
123123

124124

125-
#### shield_service_get_namespace.ApiResponseFor401
125+
#### frontier_service_get_namespace.ApiResponseFor401
126126
Name | Type | Description | Notes
127127
------------- | ------------- | ------------- | -------------
128128
response | urllib3.HTTPResponse | Raw response |
@@ -135,7 +135,7 @@ Type | Description | Notes
135135
[**RpcStatus**](../../models/RpcStatus.md) | |
136136

137137

138-
#### shield_service_get_namespace.ApiResponseFor403
138+
#### frontier_service_get_namespace.ApiResponseFor403
139139
Name | Type | Description | Notes
140140
------------- | ------------- | ------------- | -------------
141141
response | urllib3.HTTPResponse | Raw response |
@@ -148,7 +148,7 @@ Type | Description | Notes
148148
[**RpcStatus**](../../models/RpcStatus.md) | |
149149

150150

151-
#### shield_service_get_namespace.ApiResponseFor404
151+
#### frontier_service_get_namespace.ApiResponseFor404
152152
Name | Type | Description | Notes
153153
------------- | ------------- | ------------- | -------------
154154
response | urllib3.HTTPResponse | Raw response |
@@ -161,7 +161,7 @@ Type | Description | Notes
161161
[**RpcStatus**](../../models/RpcStatus.md) | |
162162

163163

164-
#### shield_service_get_namespace.ApiResponseFor500
164+
#### frontier_service_get_namespace.ApiResponseFor500
165165
Name | Type | Description | Notes
166166
------------- | ------------- | ------------- | -------------
167167
response | urllib3.HTTPResponse | Raw response |
@@ -174,7 +174,7 @@ Type | Description | Notes
174174
[**RpcStatus**](../../models/RpcStatus.md) | |
175175

176176

177-
#### shield_service_get_namespace.ApiResponseForDefault
177+
#### frontier_service_get_namespace.ApiResponseForDefault
178178
Name | Type | Description | Notes
179179
------------- | ------------- | ------------- | -------------
180180
response | urllib3.HTTPResponse | Raw response |
@@ -193,26 +193,26 @@ Type | Description | Notes
193193

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

196-
# **shield_service_list_namespaces**
197-
<a id="shield_service_list_namespaces"></a>
198-
> V1beta1ListNamespacesResponse shield_service_list_namespaces()
196+
# **frontier_service_list_namespaces**
197+
<a id="frontier_service_list_namespaces"></a>
198+
> V1beta1ListNamespacesResponse frontier_service_list_namespaces()
199199
200200
Get all namespaces
201201

202-
Returns the list of all namespaces in a Shield instance
202+
Returns the list of all namespaces in a Frontier instance
203203

204204
### Example
205205

206206
* Basic Authentication (Basic):
207207
```python
208-
import shield_api
209-
from shield_api.apis.tags import namespace_api
210-
from shield_api.model.v1beta1_list_namespaces_response import V1beta1ListNamespacesResponse
211-
from shield_api.model.rpc_status import RpcStatus
208+
import frontier_api
209+
from frontier_api.apis.tags import namespace_api
210+
from frontier_api.model.v1beta1_list_namespaces_response import V1beta1ListNamespacesResponse
211+
from frontier_api.model.rpc_status import RpcStatus
212212
from pprint import pprint
213213
# Defining the host is optional and defaults to http://127.0.0.1:7400
214214
# See configuration.py for a list of all supported configuration parameters.
215-
configuration = shield_api.Configuration(
215+
configuration = frontier_api.Configuration(
216216
host = "http://127.0.0.1:7400"
217217
)
218218

@@ -222,22 +222,22 @@ configuration = shield_api.Configuration(
222222
# satisfies your auth use case.
223223

224224
# Configure HTTP basic authorization: Basic
225-
configuration = shield_api.Configuration(
225+
configuration = frontier_api.Configuration(
226226
username = 'YOUR_USERNAME',
227227
password = 'YOUR_PASSWORD'
228228
)
229229
# Enter a context with an instance of the API client
230-
with shield_api.ApiClient(configuration) as api_client:
230+
with frontier_api.ApiClient(configuration) as api_client:
231231
# Create an instance of the API class
232232
api_instance = namespace_api.NamespaceApi(api_client)
233233

234234
# example, this endpoint has no required or optional parameters
235235
try:
236236
# Get all namespaces
237-
api_response = api_instance.shield_service_list_namespaces()
237+
api_response = api_instance.frontier_service_list_namespaces()
238238
pprint(api_response)
239-
except shield_api.ApiException as e:
240-
print("Exception when calling NamespaceApi->shield_service_list_namespaces: %s\n" % e)
239+
except frontier_api.ApiException as e:
240+
print("Exception when calling NamespaceApi->frontier_service_list_namespaces: %s\n" % e)
241241
```
242242
### Parameters
243243
This endpoint does not need any parameter.
@@ -247,15 +247,15 @@ This endpoint does not need any parameter.
247247
Code | Class | Description
248248
------------- | ------------- | -------------
249249
n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned
250-
200 | [ApiResponseFor200](#shield_service_list_namespaces.ApiResponseFor200) | A successful response.
251-
400 | [ApiResponseFor400](#shield_service_list_namespaces.ApiResponseFor400) | Bad Request - The request was malformed or contained invalid parameters.
252-
401 | [ApiResponseFor401](#shield_service_list_namespaces.ApiResponseFor401) | Unauthorized - Authentication is required
253-
403 | [ApiResponseFor403](#shield_service_list_namespaces.ApiResponseFor403) | Forbidden - User does not have permission to access the resource
254-
404 | [ApiResponseFor404](#shield_service_list_namespaces.ApiResponseFor404) | Not Found - The requested resource was not found
255-
500 | [ApiResponseFor500](#shield_service_list_namespaces.ApiResponseFor500) | Internal Server Error. Returned when theres is something wrong with Shield server.
256-
default | [ApiResponseForDefault](#shield_service_list_namespaces.ApiResponseForDefault) | An unexpected error response.
257-
258-
#### shield_service_list_namespaces.ApiResponseFor200
250+
200 | [ApiResponseFor200](#frontier_service_list_namespaces.ApiResponseFor200) | A successful response.
251+
400 | [ApiResponseFor400](#frontier_service_list_namespaces.ApiResponseFor400) | Bad Request - The request was malformed or contained invalid parameters.
252+
401 | [ApiResponseFor401](#frontier_service_list_namespaces.ApiResponseFor401) | Unauthorized - Authentication is required
253+
403 | [ApiResponseFor403](#frontier_service_list_namespaces.ApiResponseFor403) | Forbidden - User does not have permission to access the resource
254+
404 | [ApiResponseFor404](#frontier_service_list_namespaces.ApiResponseFor404) | Not Found - The requested resource was not found
255+
500 | [ApiResponseFor500](#frontier_service_list_namespaces.ApiResponseFor500) | Internal Server Error. Returned when theres is something wrong with Frontier server.
256+
default | [ApiResponseForDefault](#frontier_service_list_namespaces.ApiResponseForDefault) | An unexpected error response.
257+
258+
#### frontier_service_list_namespaces.ApiResponseFor200
259259
Name | Type | Description | Notes
260260
------------- | ------------- | ------------- | -------------
261261
response | urllib3.HTTPResponse | Raw response |
@@ -268,7 +268,7 @@ Type | Description | Notes
268268
[**V1beta1ListNamespacesResponse**](../../models/V1beta1ListNamespacesResponse.md) | |
269269

270270

271-
#### shield_service_list_namespaces.ApiResponseFor400
271+
#### frontier_service_list_namespaces.ApiResponseFor400
272272
Name | Type | Description | Notes
273273
------------- | ------------- | ------------- | -------------
274274
response | urllib3.HTTPResponse | Raw response |
@@ -281,7 +281,7 @@ Type | Description | Notes
281281
[**RpcStatus**](../../models/RpcStatus.md) | |
282282

283283

284-
#### shield_service_list_namespaces.ApiResponseFor401
284+
#### frontier_service_list_namespaces.ApiResponseFor401
285285
Name | Type | Description | Notes
286286
------------- | ------------- | ------------- | -------------
287287
response | urllib3.HTTPResponse | Raw response |
@@ -294,7 +294,7 @@ Type | Description | Notes
294294
[**RpcStatus**](../../models/RpcStatus.md) | |
295295

296296

297-
#### shield_service_list_namespaces.ApiResponseFor403
297+
#### frontier_service_list_namespaces.ApiResponseFor403
298298
Name | Type | Description | Notes
299299
------------- | ------------- | ------------- | -------------
300300
response | urllib3.HTTPResponse | Raw response |
@@ -307,7 +307,7 @@ Type | Description | Notes
307307
[**RpcStatus**](../../models/RpcStatus.md) | |
308308

309309

310-
#### shield_service_list_namespaces.ApiResponseFor404
310+
#### frontier_service_list_namespaces.ApiResponseFor404
311311
Name | Type | Description | Notes
312312
------------- | ------------- | ------------- | -------------
313313
response | urllib3.HTTPResponse | Raw response |
@@ -320,7 +320,7 @@ Type | Description | Notes
320320
[**RpcStatus**](../../models/RpcStatus.md) | |
321321

322322

323-
#### shield_service_list_namespaces.ApiResponseFor500
323+
#### frontier_service_list_namespaces.ApiResponseFor500
324324
Name | Type | Description | Notes
325325
------------- | ------------- | ------------- | -------------
326326
response | urllib3.HTTPResponse | Raw response |
@@ -333,7 +333,7 @@ Type | Description | Notes
333333
[**RpcStatus**](../../models/RpcStatus.md) | |
334334

335335

336-
#### shield_service_list_namespaces.ApiResponseForDefault
336+
#### frontier_service_list_namespaces.ApiResponseForDefault
337337
Name | Type | Description | Notes
338338
------------- | ------------- | ------------- | -------------
339339
response | urllib3.HTTPResponse | Raw response |

0 commit comments

Comments
 (0)