robotframework-openapitools 0.1.3__tar.gz → 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/PKG-INFO +1 -1
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/pyproject.toml +1 -1
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/OpenApiDriver/openapi_executors.py +20 -4
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/OpenApiDriver/openapidriver.libspec +21 -4
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/OpenApiDriver/openapidriver.py +363 -362
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/OpenApiLibCore/dto_base.py +314 -314
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/OpenApiLibCore/openapi_libcore.libspec +16 -16
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/OpenApiLibCore/openapi_libcore.py +49 -4
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/LICENSE +0 -0
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/docs/README.md +0 -0
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/OpenApiDriver/__init__.py +0 -0
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/OpenApiDriver/openapi_reader.py +0 -0
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/OpenApiDriver/py.typed +0 -0
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/OpenApiLibCore/__init__.py +0 -0
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/OpenApiLibCore/dto_utils.py +0 -0
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/OpenApiLibCore/oas_cache.py +0 -0
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/OpenApiLibCore/py.typed +0 -0
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/OpenApiLibCore/value_utils.py +0 -0
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/roboswag/__init__.py +0 -0
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/roboswag/__main__.py +0 -0
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/roboswag/auth.py +0 -0
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/roboswag/cli.py +0 -0
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/roboswag/core.py +0 -0
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/roboswag/generate/__init__.py +0 -0
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/roboswag/generate/generate.py +0 -0
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/roboswag/generate/models/__init__.py +0 -0
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/roboswag/generate/models/api.py +0 -0
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/roboswag/generate/models/definition.py +0 -0
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/roboswag/generate/models/endpoint.py +0 -0
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/roboswag/generate/models/parameter.py +0 -0
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/roboswag/generate/models/response.py +0 -0
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/roboswag/generate/models/tag.py +0 -0
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/roboswag/generate/models/utils.py +0 -0
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/roboswag/generate/templates/api_init.jinja +0 -0
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/roboswag/generate/templates/models.jinja +0 -0
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/roboswag/generate/templates/paths.jinja +0 -0
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/roboswag/logger.py +0 -0
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/roboswag/validate/__init__.py +0 -0
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/roboswag/validate/core.py +0 -0
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/roboswag/validate/schema.py +0 -0
- {robotframework_openapitools-0.1.3 → robotframework_openapitools-0.2.0}/src/roboswag/validate/text_response.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: robotframework-openapitools
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.2.0
|
4
4
|
Summary: A set of Robot Framework libraries to test APIs for which the OAS is available.
|
5
5
|
Home-page: https://github.com/MarketSquare/robotframework-openapitools
|
6
6
|
License: Apache-2.0
|
@@ -109,7 +109,25 @@ class OpenApiExecutors(OpenApiLibCore): # pylint: disable=too-many-instance-att
|
|
109
109
|
url=url,
|
110
110
|
verify=False,
|
111
111
|
)
|
112
|
-
|
112
|
+
if response.status_code != 401:
|
113
|
+
raise AssertionError(f"Response {response.status_code} was not 401.")
|
114
|
+
|
115
|
+
@keyword
|
116
|
+
def test_forbidden(self, path: str, method: str) -> None:
|
117
|
+
"""
|
118
|
+
Perform a request for `method` on the `path`, with the provided authorization.
|
119
|
+
|
120
|
+
This keyword only passes if the response code is 403: Forbidden.
|
121
|
+
|
122
|
+
For this keyword to pass, the authorization parameters used to initialize the
|
123
|
+
library should grant insufficient access rights to the target endpoint.
|
124
|
+
> Note: No headers or (json) body are send with the request. For security
|
125
|
+
reasons, the access rights validation should be checked first.
|
126
|
+
"""
|
127
|
+
url: str = run_keyword("get_valid_url", path, method)
|
128
|
+
response: Response = run_keyword("authorized_request", url, method)
|
129
|
+
if response.status_code != 403:
|
130
|
+
raise AssertionError(f"Response {response.status_code} was not 403.")
|
113
131
|
|
114
132
|
@keyword
|
115
133
|
def test_invalid_url(
|
@@ -260,9 +278,7 @@ class OpenApiExecutors(OpenApiLibCore): # pylint: disable=too-many-instance-att
|
|
260
278
|
params = request_data.get_required_params()
|
261
279
|
headers = request_data.get_required_headers()
|
262
280
|
json_data = (
|
263
|
-
request_data.
|
264
|
-
if request_data.has_body
|
265
|
-
else None
|
281
|
+
request_data.get_minimal_body_dict() if request_data.has_body else None
|
266
282
|
)
|
267
283
|
original_data = None
|
268
284
|
if method == "PATCH":
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<keywordspec name="OpenApiDriver" type="LIBRARY" format="HTML" scope="SUITE" generated="2024-04-
|
3
|
-
<version>0.
|
2
|
+
<keywordspec name="OpenApiDriver" type="LIBRARY" format="HTML" scope="SUITE" generated="2024-04-12T13:08:14+00:00" specversion="5" source="/workspaces/robotframework-openapitools/src/OpenApiDriver/openapidriver.py" lineno="352">
|
3
|
+
<version>0.2.0</version>
|
4
4
|
<doc><p>Visit the <a href="https://github.com/MarketSquare/robotframework-openapidriver">library page</a> for an introduction and examples.</p></doc>
|
5
5
|
<tags>
|
6
6
|
</tags>
|
@@ -199,7 +199,7 @@
|
|
199
199
|
</init>
|
200
200
|
</inits>
|
201
201
|
<keywords>
|
202
|
-
<kw name="Test Endpoint" source="/workspaces/robotframework-openapitools/src/OpenApiDriver/openapi_executors.py" lineno="
|
202
|
+
<kw name="Test Endpoint" source="/workspaces/robotframework-openapitools/src/OpenApiDriver/openapi_executors.py" lineno="175">
|
203
203
|
<arguments repr="path: str, method: str, status_code: int">
|
204
204
|
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="path: str">
|
205
205
|
<name>path</name>
|
@@ -219,7 +219,23 @@
|
|
219
219
|
<p>The keyword calls other keywords to generate the neccesary data to perform the desired operation and validate the response against the openapi document.</p></doc>
|
220
220
|
<shortdoc>Validate that performing the `method` operation on `path` results in a `status_code` response.</shortdoc>
|
221
221
|
</kw>
|
222
|
-
<kw name="Test
|
222
|
+
<kw name="Test Forbidden" source="/workspaces/robotframework-openapitools/src/OpenApiDriver/openapi_executors.py" lineno="116">
|
223
|
+
<arguments repr="path: str, method: str">
|
224
|
+
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="path: str">
|
225
|
+
<name>path</name>
|
226
|
+
<type name="str" typedoc="string">str</type>
|
227
|
+
</arg>
|
228
|
+
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="method: str">
|
229
|
+
<name>method</name>
|
230
|
+
<type name="str" typedoc="string">str</type>
|
231
|
+
</arg>
|
232
|
+
</arguments>
|
233
|
+
<doc><p>Perform a request for <span class="name">method</span> on the <a href="#type-Path" class="name">path</a>, with the provided authorization.</p>
|
234
|
+
<p>This keyword only passes if the response code is 403: Forbidden.</p>
|
235
|
+
<p>For this keyword to pass, the authorization parameters used to initialize the library should grant insufficient access rights to the target endpoint. &gt; Note: No headers or (json) body are send with the request. For security reasons, the access rights validation should be checked first.</p></doc>
|
236
|
+
<shortdoc>Perform a request for `method` on the `path`, with the provided authorization.</shortdoc>
|
237
|
+
</kw>
|
238
|
+
<kw name="Test Invalid Url" source="/workspaces/robotframework-openapitools/src/OpenApiDriver/openapi_executors.py" lineno="133">
|
223
239
|
<arguments repr="path: str, method: str, expected_status_code: int = 404">
|
224
240
|
<arg kind="POSITIONAL_OR_NAMED" required="true" repr="path: str">
|
225
241
|
<name>path</name>
|
@@ -361,6 +377,7 @@
|
|
361
377
|
<usages>
|
362
378
|
<usage>__init__</usage>
|
363
379
|
<usage>Test Endpoint</usage>
|
380
|
+
<usage>Test Forbidden</usage>
|
364
381
|
<usage>Test Invalid Url</usage>
|
365
382
|
<usage>Test Unauthorized</usage>
|
366
383
|
</usages>
|