Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic auth for /system/restore #120

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions nethsm-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1839,6 +1839,9 @@ paths:
multipart/form-data:
schema:
$ref: "#/components/schemas/RestoreRequest"
security:
- {}
- basic: []
x-annotation-role:
- Public
x-annotation-state:
Expand Down
2 changes: 2 additions & 0 deletions nethsm/client/configurations/api_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class SecurityIndexInfoRequired(typing.TypedDict):
"paths//system/factory-reset/post/security": typing.Literal[0],
"paths//system/info/get/security": typing.Literal[0],
"paths//system/reboot/post/security": typing.Literal[0],
"paths//system/restore/post/security": typing.Literal[0, 1],
"paths//system/shutdown/post/security": typing.Literal[0],
"paths//system/update/post/security": typing.Literal[0],
"paths//users/get/security": typing.Literal[0],
Expand Down Expand Up @@ -411,6 +412,7 @@ def get_security_requirement_object(
"paths//system/factory-reset/post/security",
"paths//system/info/get/security",
"paths//system/reboot/post/security",
"paths//system/restore/post/security",
"paths//system/shutdown/post/security",
"paths//system/update/post/security",
"paths//users/get/security",
Expand Down
20 changes: 19 additions & 1 deletion nethsm/client/paths/system_restore/post/operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
"""

from nethsm.client import api_client, exceptions
from nethsm.client import api_client, exceptions, security_schemes
from nethsm.client.shared_imports.operation_imports import * # pyright: ignore [reportWildcardImportFromLibrary]
from nethsm.client.components.schema import restore_request

Expand All @@ -16,6 +16,15 @@
response_412,
)
from . import request_body
from .security import (
security_requirement_object_0,
security_requirement_object_1,
)

_security: typing.List[security_schemes.SecurityRequirementObject] = [
security_requirement_object_0.security_requirement_object,
security_requirement_object_1.security_requirement_object,
]


__StatusCodeToResponse = typing.TypedDict(
Expand Down Expand Up @@ -55,6 +64,7 @@ def _system_restore_post(
*,
skip_deserialization: typing.Literal[False] = False,
content_type: typing.Literal["multipart/form-data"] = "multipart/form-data",
security_index: typing.Optional[int] = None,
server_index: typing.Optional[int] = None,
stream: bool = False,
timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None,
Expand All @@ -71,6 +81,7 @@ def _system_restore_post(
*,
skip_deserialization: typing.Literal[True],
content_type: typing.Literal["multipart/form-data"] = "multipart/form-data",
security_index: typing.Optional[int] = None,
server_index: typing.Optional[int] = None,
stream: bool = False,
timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None,
Expand All @@ -86,6 +97,7 @@ def _system_restore_post(
*,
skip_deserialization: bool = False,
content_type: typing.Literal["multipart/form-data"] = "multipart/form-data",
security_index: typing.Optional[int] = None,
server_index: typing.Optional[int] = None,
stream: bool = False,
timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None,
Expand All @@ -108,6 +120,11 @@ class instances
host = self.api_client.configuration.get_server_url(
"servers", server_index
)
security_requirement_object = self.api_client.configuration.get_security_requirement_object(
"paths//system/restore/post/security",
_security,
security_index
)

raw_response = self.api_client.call_api(
resource_path=used_path,
Expand All @@ -116,6 +133,7 @@ class instances
headers=headers,
fields=fields,
body=serialized_body,
security_requirement_object=security_requirement_object,
stream=stream,
timeout=timeout,
)
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# coding: utf-8

"""
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
"""

from nethsm.client import security_schemes

security_requirement_object: security_schemes.SecurityRequirementObject = {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# coding: utf-8

"""
Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
"""

from nethsm.client import security_schemes

security_requirement_object: security_schemes.SecurityRequirementObject = {
"basic": (),
}
Loading