mirror of
https://github.com/openziti/zrok.git
synced 2025-08-09 08:05:04 +02:00
initial work on token revocation
This commit is contained in:
@ -1 +1 @@
|
||||
3.0.51
|
||||
3.0.52
|
@ -3,4 +3,3 @@ six >= 1.10
|
||||
python_dateutil >= 2.5.3
|
||||
setuptools >= 21.0.0
|
||||
urllib3 >= 1.15.1
|
||||
openziti >= 0.8.1
|
@ -41,6 +41,7 @@ from zrok_api.models.error_message import ErrorMessage
|
||||
from zrok_api.models.frontend import Frontend
|
||||
from zrok_api.models.frontends import Frontends
|
||||
from zrok_api.models.identity_body import IdentityBody
|
||||
from zrok_api.models.inline_response200 import InlineResponse200
|
||||
from zrok_api.models.inline_response201 import InlineResponse201
|
||||
from zrok_api.models.invite_request import InviteRequest
|
||||
from zrok_api.models.invite_token_generate_request import InviteTokenGenerateRequest
|
||||
@ -57,6 +58,7 @@ from zrok_api.models.register_request import RegisterRequest
|
||||
from zrok_api.models.register_response import RegisterResponse
|
||||
from zrok_api.models.reset_password_request import ResetPasswordRequest
|
||||
from zrok_api.models.reset_password_request_body import ResetPasswordRequestBody
|
||||
from zrok_api.models.reset_token_body import ResetTokenBody
|
||||
from zrok_api.models.share import Share
|
||||
from zrok_api.models.share_request import ShareRequest
|
||||
from zrok_api.models.share_response import ShareResponse
|
||||
|
@ -493,6 +493,99 @@ class AccountApi(object):
|
||||
_request_timeout=params.get('_request_timeout'),
|
||||
collection_formats=collection_formats)
|
||||
|
||||
def reset_token(self, **kwargs): # noqa: E501
|
||||
"""reset_token # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.reset_token(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param ResetTokenBody body:
|
||||
:return: InlineResponse200
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.reset_token_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.reset_token_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def reset_token_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""reset_token # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.reset_token_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param ResetTokenBody body:
|
||||
:return: InlineResponse200
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['body'] # noqa: E501
|
||||
all_params.append('async_req')
|
||||
all_params.append('_return_http_data_only')
|
||||
all_params.append('_preload_content')
|
||||
all_params.append('_request_timeout')
|
||||
|
||||
params = locals()
|
||||
for key, val in six.iteritems(params['kwargs']):
|
||||
if key not in all_params:
|
||||
raise TypeError(
|
||||
"Got an unexpected keyword argument '%s'"
|
||||
" to method reset_token" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['application/zrok.v1+json']) # noqa: E501
|
||||
|
||||
# HTTP header `Content-Type`
|
||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||
['application/zrok.v1+json']) # noqa: E501
|
||||
|
||||
# Authentication setting
|
||||
auth_settings = [] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/resetToken', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='InlineResponse200', # noqa: E501
|
||||
auth_settings=auth_settings,
|
||||
async_req=params.get('async_req'),
|
||||
_return_http_data_only=params.get('_return_http_data_only'),
|
||||
_preload_content=params.get('_preload_content', True),
|
||||
_request_timeout=params.get('_request_timeout'),
|
||||
collection_formats=collection_formats)
|
||||
|
||||
def verify(self, **kwargs): # noqa: E501
|
||||
"""verify # noqa: E501
|
||||
|
||||
|
@ -219,9 +219,12 @@ class Configuration(six.with_metaclass(TypeWithDefault, object)):
|
||||
|
||||
:return: The token for basic HTTP authentication.
|
||||
"""
|
||||
return urllib3.util.make_headers(
|
||||
basic_auth=self.username + ':' + self.password
|
||||
).get('authorization')
|
||||
token = ""
|
||||
if self.username or self.password:
|
||||
token = urllib3.util.make_headers(
|
||||
basic_auth=self.username + ':' + self.password
|
||||
).get('authorization')
|
||||
return token
|
||||
|
||||
def auth_settings(self):
|
||||
"""Gets Auth Settings dict for api client.
|
||||
|
@ -31,6 +31,7 @@ from zrok_api.models.error_message import ErrorMessage
|
||||
from zrok_api.models.frontend import Frontend
|
||||
from zrok_api.models.frontends import Frontends
|
||||
from zrok_api.models.identity_body import IdentityBody
|
||||
from zrok_api.models.inline_response200 import InlineResponse200
|
||||
from zrok_api.models.inline_response201 import InlineResponse201
|
||||
from zrok_api.models.invite_request import InviteRequest
|
||||
from zrok_api.models.invite_token_generate_request import InviteTokenGenerateRequest
|
||||
@ -47,6 +48,7 @@ from zrok_api.models.register_request import RegisterRequest
|
||||
from zrok_api.models.register_response import RegisterResponse
|
||||
from zrok_api.models.reset_password_request import ResetPasswordRequest
|
||||
from zrok_api.models.reset_password_request_body import ResetPasswordRequestBody
|
||||
from zrok_api.models.reset_token_body import ResetTokenBody
|
||||
from zrok_api.models.share import Share
|
||||
from zrok_api.models.share_request import ShareRequest
|
||||
from zrok_api.models.share_response import ShareResponse
|
||||
|
110
sdk/python/sdk/zrok/zrok_api/models/inline_response200.py
Normal file
110
sdk/python/sdk/zrok/zrok_api/models/inline_response200.py
Normal file
@ -0,0 +1,110 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
zrok
|
||||
|
||||
zrok client access # noqa: E501
|
||||
|
||||
OpenAPI spec version: 0.3.0
|
||||
|
||||
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
"""
|
||||
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
class InlineResponse200(object):
|
||||
"""NOTE: This class is auto generated by the swagger code generator program.
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
"""
|
||||
Attributes:
|
||||
swagger_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
swagger_types = {
|
||||
'token': 'str'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'token': 'token'
|
||||
}
|
||||
|
||||
def __init__(self, token=None): # noqa: E501
|
||||
"""InlineResponse200 - a model defined in Swagger""" # noqa: E501
|
||||
self._token = None
|
||||
self.discriminator = None
|
||||
if token is not None:
|
||||
self.token = token
|
||||
|
||||
@property
|
||||
def token(self):
|
||||
"""Gets the token of this InlineResponse200. # noqa: E501
|
||||
|
||||
|
||||
:return: The token of this InlineResponse200. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._token
|
||||
|
||||
@token.setter
|
||||
def token(self, token):
|
||||
"""Sets the token of this InlineResponse200.
|
||||
|
||||
|
||||
:param token: The token of this InlineResponse200. # noqa: E501
|
||||
:type: str
|
||||
"""
|
||||
|
||||
self._token = token
|
||||
|
||||
def to_dict(self):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
for attr, _ in six.iteritems(self.swagger_types):
|
||||
value = getattr(self, attr)
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
if issubclass(InlineResponse200, dict):
|
||||
for key, value in self.items():
|
||||
result[key] = value
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, InlineResponse200):
|
||||
return False
|
||||
|
||||
return self.__dict__ == other.__dict__
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
return not self == other
|
110
sdk/python/sdk/zrok/zrok_api/models/reset_token_body.py
Normal file
110
sdk/python/sdk/zrok/zrok_api/models/reset_token_body.py
Normal file
@ -0,0 +1,110 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
zrok
|
||||
|
||||
zrok client access # noqa: E501
|
||||
|
||||
OpenAPI spec version: 0.3.0
|
||||
|
||||
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
"""
|
||||
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
class ResetTokenBody(object):
|
||||
"""NOTE: This class is auto generated by the swagger code generator program.
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
"""
|
||||
Attributes:
|
||||
swagger_types (dict): The key is attribute name
|
||||
and the value is attribute type.
|
||||
attribute_map (dict): The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
swagger_types = {
|
||||
'email_address': 'str'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
'email_address': 'emailAddress'
|
||||
}
|
||||
|
||||
def __init__(self, email_address=None): # noqa: E501
|
||||
"""ResetTokenBody - a model defined in Swagger""" # noqa: E501
|
||||
self._email_address = None
|
||||
self.discriminator = None
|
||||
if email_address is not None:
|
||||
self.email_address = email_address
|
||||
|
||||
@property
|
||||
def email_address(self):
|
||||
"""Gets the email_address of this ResetTokenBody. # noqa: E501
|
||||
|
||||
|
||||
:return: The email_address of this ResetTokenBody. # noqa: E501
|
||||
:rtype: str
|
||||
"""
|
||||
return self._email_address
|
||||
|
||||
@email_address.setter
|
||||
def email_address(self, email_address):
|
||||
"""Sets the email_address of this ResetTokenBody.
|
||||
|
||||
|
||||
:param email_address: The email_address of this ResetTokenBody. # noqa: E501
|
||||
:type: str
|
||||
"""
|
||||
|
||||
self._email_address = email_address
|
||||
|
||||
def to_dict(self):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
for attr, _ in six.iteritems(self.swagger_types):
|
||||
value = getattr(self, attr)
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
if issubclass(ResetTokenBody, dict):
|
||||
for key, value in self.items():
|
||||
result[key] = value
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""Returns the string representation of the model"""
|
||||
return pprint.pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""For `print` and `pprint`"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Returns true if both objects are equal"""
|
||||
if not isinstance(other, ResetTokenBody):
|
||||
return False
|
||||
|
||||
return self.__dict__ == other.__dict__
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
return not self == other
|
@ -42,11 +42,11 @@ class RESTResponse(io.IOBase):
|
||||
|
||||
def getheaders(self):
|
||||
"""Returns a dictionary of the response headers."""
|
||||
return self.urllib3_response.getheaders()
|
||||
return self.urllib3_response.headers
|
||||
|
||||
def getheader(self, name, default=None):
|
||||
"""Returns a given response header."""
|
||||
return self.urllib3_response.getheader(name, default)
|
||||
return self.urllib3_response.headers.get(name, default)
|
||||
|
||||
|
||||
class RESTClientObject(object):
|
||||
|
Reference in New Issue
Block a user