mirror of
https://github.com/openziti/zrok.git
synced 2025-06-19 17:27:54 +02:00
finish v1 py sdk mvp
This commit is contained in:
parent
7545eeadb3
commit
0074ad8ff5
@ -1,4 +1,4 @@
|
||||
{
|
||||
"packageName":"zrok_api",
|
||||
"projectName":"zrok_sdk"
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,2 @@
|
||||
openziti==0.8.1
|
||||
requests==2.31.0
|
||||
zrok
|
||||
zrok
|
||||
requests
|
@ -1,3 +1,4 @@
|
||||
zrok
|
||||
flask
|
||||
requests
|
||||
waitress
|
||||
|
@ -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):
|
||||
|
@ -89,16 +89,15 @@ 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
|
||||
if status_code != 200:
|
||||
raise Exception(f"Client version check failed: Unexpected status code {status_code}")
|
||||
|
||||
|
||||
# Success case - status code is 200 and empty response body is expected
|
||||
return
|
||||
|
||||
|
||||
except Exception as e:
|
||||
raise Exception(f"Client version check failed: {str(e)}")
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user