finish v1 py sdk mvp

This commit is contained in:
Kenneth Bingham 2025-02-27 15:46:47 -05:00
parent 7545eeadb3
commit 0074ad8ff5
No known key found for this signature in database
GPG Key ID: 31709281860130B6
6 changed files with 10 additions and 11 deletions

View File

@ -1,3 +1,2 @@
openziti==0.8.1
requests==2.31.0
zrok
requests

View File

@ -1,3 +1,4 @@
zrok
flask
requests
waitress

View File

@ -37,9 +37,9 @@ def CreateAccess(root: Root, request: model.AccessRequest) -> model.Access:
res = ShareApi(zrok).access(body=out)
except Exception as e:
raise Exception("unable to create access", e)
return model.Access(Token=res.frontend_token,
return model.Access(Token=res['frontendToken'],
ShareToken=request.ShareToken,
BackendMode=res.backend_mode)
BackendMode=res['backendMode'])
def DeleteAccess(root: Root, acc: model.Access):

View File

@ -89,7 +89,6 @@ class Root:
"""Check if the client version is compatible with the API."""
metadata_api = zrok.MetadataApi(zrock_client)
try:
print(f"Sending client version: {V}") # Log the version being sent
data, status_code, headers = metadata_api.client_version_check_with_http_info(body={"clientVersion": V})
# Check if the response status code is 200 OK

View File

@ -34,7 +34,7 @@ class AccessRequest(object):
attribute_map = {
'env_zid': 'envZId',
'shr_token': 'shrToken'
'shr_token': 'shareToken'
}
def __init__(self, env_zid=None, shr_token=None): # noqa: E501