diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/.openapi-generator/FILES b/services/TS29222_CAPIF_Access_Control_Policy_API/.openapi-generator/FILES index 9024036c49dbed352a31b1de587254487b3cf568..eeda92fd5bcfe53d25713964b3ddc9a8a64b43b3 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/.openapi-generator/FILES +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/.openapi-generator/FILES @@ -1,27 +1,28 @@ .dockerignore .gitignore +.openapi-generator-ignore .travis.yml Dockerfile README.md git_push.sh -openapi_server/__init__.py -openapi_server/__main__.py -openapi_server/controllers/__init__.py -openapi_server/controllers/default_controller.py -openapi_server/controllers/security_controller_.py -openapi_server/encoder.py -openapi_server/models/__init__.py -openapi_server/models/access_control_policy_list.py -openapi_server/models/api_invoker_policy.py -openapi_server/models/base_model_.py -openapi_server/models/invalid_param.py -openapi_server/models/problem_details.py -openapi_server/models/time_range_list.py -openapi_server/openapi/openapi.yaml -openapi_server/test/__init__.py -openapi_server/test/test_default_controller.py -openapi_server/typing_utils.py -openapi_server/util.py +capif_acl/__init__.py +capif_acl/__main__.py +capif_acl/controllers/__init__.py +capif_acl/controllers/default_controller.py +capif_acl/controllers/security_controller.py +capif_acl/encoder.py +capif_acl/models/__init__.py +capif_acl/models/access_control_policy_list.py +capif_acl/models/api_invoker_policy.py +capif_acl/models/base_model.py +capif_acl/models/invalid_param.py +capif_acl/models/problem_details.py +capif_acl/models/time_range_list.py +capif_acl/openapi/openapi.yaml +capif_acl/test/__init__.py +capif_acl/test/test_default_controller.py +capif_acl/typing_utils.py +capif_acl/util.py requirements.txt setup.py test-requirements.txt diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/.openapi-generator/VERSION b/services/TS29222_CAPIF_Access_Control_Policy_API/.openapi-generator/VERSION index 4be2c727ad97a7352120a34d6bd4afa3f77e2ff2..18bb4182dd01428f1d4c3c2145501ee5d40455a3 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/.openapi-generator/VERSION +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/.openapi-generator/VERSION @@ -1 +1 @@ -6.5.0 \ No newline at end of file +7.5.0 diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/README.md b/services/TS29222_CAPIF_Access_Control_Policy_API/README.md index 40feae4be1daaa8b8b1987f5fb318f79e56391b4..1222b0aaa2f6cd49ca656fe3a9c8ba7505ee9ccc 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/README.md +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/README.md @@ -42,8 +42,8 @@ To run the server on a Docker container, please execute the following from the r ```bash # building the image -docker build -t openapi_server . +docker build -t capif_acl . # starting up a container -docker run -p 8080:8080 openapi_server +docker run -p 8080:8080 capif_acl ``` \ No newline at end of file diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/controllers/default_controller.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/controllers/default_controller.py index 52174b1eee09160d184a65d3d412954f187240db..bb5a8ee66be1f856995f98b31fc2a1afc5158da7 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/controllers/default_controller.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/controllers/default_controller.py @@ -1,3 +1,11 @@ +import connexion +from typing import Dict +from typing import Tuple +from typing import Union + +from capif_acl.models.access_control_policy_list import AccessControlPolicyList # noqa: E501 +from capif_acl.models.problem_details import ProblemDetails # noqa: E501 +from capif_acl import util from functools import wraps from flask import request, current_app @@ -6,7 +14,6 @@ from cryptography.hazmat.backends import default_backend from ..core.accesscontrolpolicyapi import accessControlPolicyApi - def cert_validation(): def _cert_validation(f): @wraps(f) @@ -24,7 +31,6 @@ def cert_validation(): return __cert_validation return _cert_validation - @cert_validation() def access_control_policy_list_service_api_id_get(service_api_id, aef_id, api_invoker_id=None, supported_features=None): # noqa: E501 """access_control_policy_list_service_api_id_get diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/controllers/security_controller_.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/controllers/security_controller.py similarity index 100% rename from services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/controllers/security_controller_.py rename to services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/controllers/security_controller.py diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/encoder.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/encoder.py index 80bad8fa9220ab873e044b7adc0a849746088ad5..c0b0f8ed1e45b0d65ece6448e0a1894414d47af2 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/encoder.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/encoder.py @@ -1,7 +1,6 @@ from connexion.apps.flask_app import FlaskJSONEncoder -import six -from models.base_model_ import Model +from capif_acl.models.base_model import Model class JSONEncoder(FlaskJSONEncoder): @@ -10,7 +9,7 @@ class JSONEncoder(FlaskJSONEncoder): def default(self, o): if isinstance(o, Model): dikt = {} - for attr, _ in six.iteritems(o.openapi_types): + for attr in o.openapi_types: value = getattr(o, attr) if value is None and not self.include_nulls: continue diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/__init__.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/__init__.py index 4c4e60f91034863564e2c69f9c75a1d883d6990d..43aa01510ca1555d6ae03a34cc218ce97831fd23 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/__init__.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/__init__.py @@ -1,7 +1,4 @@ -# coding: utf-8 - # flake8: noqa -from __future__ import absolute_import # import models into model package from capif_acl.models.access_control_policy_list import AccessControlPolicyList from capif_acl.models.api_invoker_policy import ApiInvokerPolicy diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/access_control_policy_list.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/access_control_policy_list.py index b3cacd4164aab94158436597b462dc967f91a2f7..a851ac32261fd3721a82f77505c5cf69f79f3b30 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/access_control_policy_list.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/access_control_policy_list.py @@ -1,11 +1,8 @@ -# coding: utf-8 - -from __future__ import absolute_import from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 -from capif_acl.models.base_model_ import Model +from capif_acl.models.base_model import Model from capif_acl.models.api_invoker_policy import ApiInvokerPolicy from capif_acl import util @@ -45,7 +42,7 @@ class AccessControlPolicyList(Model): return util.deserialize_model(dikt, cls) @property - def api_invoker_policies(self): + def api_invoker_policies(self) -> List[ApiInvokerPolicy]: """Gets the api_invoker_policies of this AccessControlPolicyList. Policy of each API invoker. # noqa: E501 @@ -56,7 +53,7 @@ class AccessControlPolicyList(Model): return self._api_invoker_policies @api_invoker_policies.setter - def api_invoker_policies(self, api_invoker_policies): + def api_invoker_policies(self, api_invoker_policies: List[ApiInvokerPolicy]): """Sets the api_invoker_policies of this AccessControlPolicyList. Policy of each API invoker. # noqa: E501 diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/api_invoker_policy.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/api_invoker_policy.py index 86ffec0cf84c8c867ebbd8db1594eb2746140591..a22e84c5d0fea626662d8c7f11f0e3b0748c5a1d 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/api_invoker_policy.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/api_invoker_policy.py @@ -1,11 +1,8 @@ -# coding: utf-8 - -from __future__ import absolute_import from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 -from capif_acl.models.base_model_ import Model +from capif_acl.models.base_model import Model from capif_acl.models.time_range_list import TimeRangeList from capif_acl import util @@ -60,7 +57,7 @@ class ApiInvokerPolicy(Model): return util.deserialize_model(dikt, cls) @property - def api_invoker_id(self): + def api_invoker_id(self) -> str: """Gets the api_invoker_id of this ApiInvokerPolicy. API invoker ID assigned by the CAPIF core function # noqa: E501 @@ -71,7 +68,7 @@ class ApiInvokerPolicy(Model): return self._api_invoker_id @api_invoker_id.setter - def api_invoker_id(self, api_invoker_id): + def api_invoker_id(self, api_invoker_id: str): """Sets the api_invoker_id of this ApiInvokerPolicy. API invoker ID assigned by the CAPIF core function # noqa: E501 @@ -85,7 +82,7 @@ class ApiInvokerPolicy(Model): self._api_invoker_id = api_invoker_id @property - def allowed_total_invocations(self): + def allowed_total_invocations(self) -> int: """Gets the allowed_total_invocations of this ApiInvokerPolicy. Total number of invocations allowed on the service API by the API invoker. # noqa: E501 @@ -96,7 +93,7 @@ class ApiInvokerPolicy(Model): return self._allowed_total_invocations @allowed_total_invocations.setter - def allowed_total_invocations(self, allowed_total_invocations): + def allowed_total_invocations(self, allowed_total_invocations: int): """Sets the allowed_total_invocations of this ApiInvokerPolicy. Total number of invocations allowed on the service API by the API invoker. # noqa: E501 @@ -108,7 +105,7 @@ class ApiInvokerPolicy(Model): self._allowed_total_invocations = allowed_total_invocations @property - def allowed_invocations_per_second(self): + def allowed_invocations_per_second(self) -> int: """Gets the allowed_invocations_per_second of this ApiInvokerPolicy. Invocations per second allowed on the service API by the API invoker. # noqa: E501 @@ -119,7 +116,7 @@ class ApiInvokerPolicy(Model): return self._allowed_invocations_per_second @allowed_invocations_per_second.setter - def allowed_invocations_per_second(self, allowed_invocations_per_second): + def allowed_invocations_per_second(self, allowed_invocations_per_second: int): """Sets the allowed_invocations_per_second of this ApiInvokerPolicy. Invocations per second allowed on the service API by the API invoker. # noqa: E501 @@ -131,7 +128,7 @@ class ApiInvokerPolicy(Model): self._allowed_invocations_per_second = allowed_invocations_per_second @property - def allowed_invocation_time_range_list(self): + def allowed_invocation_time_range_list(self) -> List[TimeRangeList]: """Gets the allowed_invocation_time_range_list of this ApiInvokerPolicy. The time ranges during which the invocations are allowed on the service API by the API invoker. # noqa: E501 @@ -142,7 +139,7 @@ class ApiInvokerPolicy(Model): return self._allowed_invocation_time_range_list @allowed_invocation_time_range_list.setter - def allowed_invocation_time_range_list(self, allowed_invocation_time_range_list): + def allowed_invocation_time_range_list(self, allowed_invocation_time_range_list: List[TimeRangeList]): """Sets the allowed_invocation_time_range_list of this ApiInvokerPolicy. The time ranges during which the invocations are allowed on the service API by the API invoker. # noqa: E501 diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/base_model_.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/base_model.py similarity index 95% rename from services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/base_model_.py rename to services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/base_model.py index cce5379c767ede112d5fdcdcffa34403bddb2884..fed13c9063cbe37ed84c0f21277fc66d7cd48868 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/base_model_.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/base_model.py @@ -1,6 +1,5 @@ import pprint -import six import typing from capif_acl import util @@ -8,7 +7,7 @@ from capif_acl import util T = typing.TypeVar('T') -class Model(object): +class Model: # openapiTypes: The key is attribute name and the # value is attribute type. openapi_types: typing.Dict[str, type] = {} @@ -29,7 +28,7 @@ class Model(object): """ result = {} - for attr, _ in six.iteritems(self.openapi_types): + for attr in self.openapi_types: value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/invalid_param.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/invalid_param.py index 88606c4107c7ac4b408a0548af2feb398233b555..a6789dc208edb61dbd24e16d0b40818638ae4467 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/invalid_param.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/invalid_param.py @@ -1,11 +1,8 @@ -# coding: utf-8 - -from __future__ import absolute_import from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 -from capif_acl.models.base_model_ import Model +from capif_acl.models.base_model import Model from capif_acl import util @@ -48,7 +45,7 @@ class InvalidParam(Model): return util.deserialize_model(dikt, cls) @property - def param(self): + def param(self) -> str: """Gets the param of this InvalidParam. Attribute's name encoded as a JSON Pointer, or header's name. # noqa: E501 @@ -59,7 +56,7 @@ class InvalidParam(Model): return self._param @param.setter - def param(self, param): + def param(self, param: str): """Sets the param of this InvalidParam. Attribute's name encoded as a JSON Pointer, or header's name. # noqa: E501 @@ -73,7 +70,7 @@ class InvalidParam(Model): self._param = param @property - def reason(self): + def reason(self) -> str: """Gets the reason of this InvalidParam. A human-readable reason, e.g. \"must be a positive integer\". # noqa: E501 @@ -84,7 +81,7 @@ class InvalidParam(Model): return self._reason @reason.setter - def reason(self, reason): + def reason(self, reason: str): """Sets the reason of this InvalidParam. A human-readable reason, e.g. \"must be a positive integer\". # noqa: E501 diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/problem_details.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/problem_details.py index 25caab4e29a65d9df08d966a551618c69a2ffa45..ec494ca7d112f254c7460c45a08664488240971a 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/problem_details.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/problem_details.py @@ -1,11 +1,8 @@ -# coding: utf-8 - -from __future__ import absolute_import from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 -from capif_acl.models.base_model_ import Model +from capif_acl.models.base_model import Model from capif_acl.models.invalid_param import InvalidParam import re from capif_acl import util @@ -82,7 +79,7 @@ class ProblemDetails(Model): return util.deserialize_model(dikt, cls) @property - def type(self): + def type(self) -> str: """Gets the type of this ProblemDetails. string providing an URI formatted according to IETF RFC 3986. # noqa: E501 @@ -93,7 +90,7 @@ class ProblemDetails(Model): return self._type @type.setter - def type(self, type): + def type(self, type: str): """Sets the type of this ProblemDetails. string providing an URI formatted according to IETF RFC 3986. # noqa: E501 @@ -105,10 +102,10 @@ class ProblemDetails(Model): self._type = type @property - def title(self): + def title(self) -> str: """Gets the title of this ProblemDetails. - A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem. # noqa: E501 + A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem. # noqa: E501 :return: The title of this ProblemDetails. :rtype: str @@ -116,10 +113,10 @@ class ProblemDetails(Model): return self._title @title.setter - def title(self, title): + def title(self, title: str): """Sets the title of this ProblemDetails. - A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem. # noqa: E501 + A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem. # noqa: E501 :param title: The title of this ProblemDetails. :type title: str @@ -128,7 +125,7 @@ class ProblemDetails(Model): self._title = title @property - def status(self): + def status(self) -> int: """Gets the status of this ProblemDetails. The HTTP status code for this occurrence of the problem. # noqa: E501 @@ -139,7 +136,7 @@ class ProblemDetails(Model): return self._status @status.setter - def status(self, status): + def status(self, status: int): """Sets the status of this ProblemDetails. The HTTP status code for this occurrence of the problem. # noqa: E501 @@ -151,7 +148,7 @@ class ProblemDetails(Model): self._status = status @property - def detail(self): + def detail(self) -> str: """Gets the detail of this ProblemDetails. A human-readable explanation specific to this occurrence of the problem. # noqa: E501 @@ -162,7 +159,7 @@ class ProblemDetails(Model): return self._detail @detail.setter - def detail(self, detail): + def detail(self, detail: str): """Sets the detail of this ProblemDetails. A human-readable explanation specific to this occurrence of the problem. # noqa: E501 @@ -174,7 +171,7 @@ class ProblemDetails(Model): self._detail = detail @property - def instance(self): + def instance(self) -> str: """Gets the instance of this ProblemDetails. string providing an URI formatted according to IETF RFC 3986. # noqa: E501 @@ -185,7 +182,7 @@ class ProblemDetails(Model): return self._instance @instance.setter - def instance(self, instance): + def instance(self, instance: str): """Sets the instance of this ProblemDetails. string providing an URI formatted according to IETF RFC 3986. # noqa: E501 @@ -197,10 +194,10 @@ class ProblemDetails(Model): self._instance = instance @property - def cause(self): + def cause(self) -> str: """Gets the cause of this ProblemDetails. - A machine-readable application error cause specific to this occurrence of the problem. This IE should be present and provide application-related error information, if available. # noqa: E501 + A machine-readable application error cause specific to this occurrence of the problem. This IE should be present and provide application-related error information, if available. # noqa: E501 :return: The cause of this ProblemDetails. :rtype: str @@ -208,10 +205,10 @@ class ProblemDetails(Model): return self._cause @cause.setter - def cause(self, cause): + def cause(self, cause: str): """Sets the cause of this ProblemDetails. - A machine-readable application error cause specific to this occurrence of the problem. This IE should be present and provide application-related error information, if available. # noqa: E501 + A machine-readable application error cause specific to this occurrence of the problem. This IE should be present and provide application-related error information, if available. # noqa: E501 :param cause: The cause of this ProblemDetails. :type cause: str @@ -220,10 +217,10 @@ class ProblemDetails(Model): self._cause = cause @property - def invalid_params(self): + def invalid_params(self) -> List[InvalidParam]: """Gets the invalid_params of this ProblemDetails. - Description of invalid parameters, for a request rejected due to invalid parameters. # noqa: E501 + Description of invalid parameters, for a request rejected due to invalid parameters. # noqa: E501 :return: The invalid_params of this ProblemDetails. :rtype: List[InvalidParam] @@ -231,10 +228,10 @@ class ProblemDetails(Model): return self._invalid_params @invalid_params.setter - def invalid_params(self, invalid_params): + def invalid_params(self, invalid_params: List[InvalidParam]): """Sets the invalid_params of this ProblemDetails. - Description of invalid parameters, for a request rejected due to invalid parameters. # noqa: E501 + Description of invalid parameters, for a request rejected due to invalid parameters. # noqa: E501 :param invalid_params: The invalid_params of this ProblemDetails. :type invalid_params: List[InvalidParam] @@ -245,7 +242,7 @@ class ProblemDetails(Model): self._invalid_params = invalid_params @property - def supported_features(self): + def supported_features(self) -> str: """Gets the supported_features of this ProblemDetails. A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. # noqa: E501 @@ -256,7 +253,7 @@ class ProblemDetails(Model): return self._supported_features @supported_features.setter - def supported_features(self, supported_features): + def supported_features(self, supported_features: str): """Sets the supported_features of this ProblemDetails. A string used to indicate the features supported by an API that is used as defined in clause 6.6 in 3GPP TS 29.500. The string shall contain a bitmask indicating supported features in hexadecimal representation Each character in the string shall take a value of \"0\" to \"9\", \"a\" to \"f\" or \"A\" to \"F\" and shall represent the support of 4 features as described in table 5.2.2-3. The most significant character representing the highest-numbered features shall appear first in the string, and the character representing features 1 to 4 shall appear last in the string. The list of features and their numbering (starting with 1) are defined separately for each API. If the string contains a lower number of characters than there are defined features for an API, all features that would be represented by characters that are not present in the string are not supported. # noqa: E501 diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/time_range_list.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/time_range_list.py index eaacad60592ff7acf1a9c2b7b71c21dfb6fd5083..b9c472403e124b08a48938396c05f8d0f91e9674 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/time_range_list.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/models/time_range_list.py @@ -1,11 +1,8 @@ -# coding: utf-8 - -from __future__ import absolute_import from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 -from capif_acl.models.base_model_ import Model +from capif_acl.models.base_model import Model from capif_acl import util @@ -48,7 +45,7 @@ class TimeRangeList(Model): return util.deserialize_model(dikt, cls) @property - def start_time(self): + def start_time(self) -> datetime: """Gets the start_time of this TimeRangeList. string with format \"date-time\" as defined in OpenAPI. # noqa: E501 @@ -59,7 +56,7 @@ class TimeRangeList(Model): return self._start_time @start_time.setter - def start_time(self, start_time): + def start_time(self, start_time: datetime): """Sets the start_time of this TimeRangeList. string with format \"date-time\" as defined in OpenAPI. # noqa: E501 @@ -71,7 +68,7 @@ class TimeRangeList(Model): self._start_time = start_time @property - def stop_time(self): + def stop_time(self) -> datetime: """Gets the stop_time of this TimeRangeList. string with format \"date-time\" as defined in OpenAPI. # noqa: E501 @@ -82,7 +79,7 @@ class TimeRangeList(Model): return self._stop_time @stop_time.setter - def stop_time(self, stop_time): + def stop_time(self, stop_time: datetime): """Sets the stop_time of this TimeRangeList. string with format \"date-time\" as defined in OpenAPI. # noqa: E501 diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/openapi/openapi.yaml b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/openapi/openapi.yaml index 1621baa9a449be7d8bb2377e7b2b6fd590cbec5d..164693101b1be8d3fdaab38d81075cea20decf7c 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/openapi/openapi.yaml +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/openapi/openapi.yaml @@ -309,7 +309,7 @@ components: type: string title: description: "A short, human-readable summary of the problem type. It should\ - \ not change from occurrence to occurrence of the problem." + \ not change from occurrence to occurrence of the problem. \n" title: title type: string status: @@ -326,14 +326,13 @@ components: title: type type: string cause: - description: "A machine-readable application error cause specific to this\ - \ occurrence of the problem. This IE should be present and provide application-related\ - \ error information, if available." + description: | + A machine-readable application error cause specific to this occurrence of the problem. This IE should be present and provide application-related error information, if available. title: cause type: string invalidParams: - description: "Description of invalid parameters, for a request rejected\ - \ due to invalid parameters." + description: | + Description of invalid parameters, for a request rejected due to invalid parameters. items: $ref: '#/components/schemas/InvalidParam' minItems: 1 @@ -352,8 +351,8 @@ components: title: type type: string InvalidParam: - description: "Represents the description of invalid parameters, for a request\ - \ rejected due to invalid parameters." + description: | + Represents the description of invalid parameters, for a request rejected due to invalid parameters. properties: param: description: "Attribute's name encoded as a JSON Pointer, or header's name." diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/test/test_default_controller.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/test/test_default_controller.py index 44ed0bee14671018ffb842dfe7e98edf26875ec2..d2f9a54a6ba98b17f500e91dd30fcda0e4413771 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/test/test_default_controller.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/test/test_default_controller.py @@ -1,9 +1,10 @@ -# coding: utf-8 - -from __future__ import absolute_import import unittest -from test import BaseTestCase +from flask import json + +from capif_acl.models.access_control_policy_list import AccessControlPolicyList # noqa: E501 +from capif_acl.models.problem_details import ProblemDetails # noqa: E501 +from capif_acl.test import BaseTestCase class TestDefaultController(BaseTestCase): diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/typing_utils.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/typing_utils.py index 0563f81fd5345282a33705038dfa77fdcaa15872..74e3c913a7db6246bc765f147ca872996112c6bb 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/typing_utils.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/typing_utils.py @@ -1,5 +1,3 @@ -# coding: utf-8 - import sys if sys.version_info < (3, 7): diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/util.py b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/util.py index 72d18d9b7df0bfd24490b24c4b9d9bcd683ad9ef..110348b34b01994049d4781c0005e374ec71a8ad 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/util.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/capif_acl/util.py @@ -1,8 +1,7 @@ import datetime -import six -import typing_utils - +import typing +from capif_acl import typing_utils def serialize_clean_camel_case(obj): res = obj.to_dict() @@ -53,6 +52,7 @@ def dict_to_camel_case(my_dict): return result + def _deserialize(data, klass): """Deserializes dict, list, str into an object. @@ -64,7 +64,7 @@ def _deserialize(data, klass): if data is None: return None - if klass in six.integer_types or klass in (float, str, bool, bytearray): + if klass in (int, float, str, bool, bytearray): return _deserialize_primitive(data, klass) elif klass == object: return _deserialize_object(data) @@ -93,7 +93,7 @@ def _deserialize_primitive(data, klass): try: value = klass(data) except UnicodeEncodeError: - value = six.u(data) + value = data except TypeError: value = data return value @@ -158,7 +158,7 @@ def deserialize_model(data, klass): if not instance.openapi_types: return data - for attr, attr_type in six.iteritems(instance.openapi_types): + for attr, attr_type in instance.openapi_types.items(): if data is not None \ and instance.attribute_map[attr] in data \ and isinstance(data, (list, dict)): @@ -193,4 +193,4 @@ def _deserialize_dict(data, boxed_type): :rtype: dict """ return {k: _deserialize(v, boxed_type) - for k, v in six.iteritems(data)} + for k, v in data.items() } diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/setup.py b/services/TS29222_CAPIF_Access_Control_Policy_API/setup.py index 275b7b6b91de3bcb6cb8228baf5ab704cee59c7e..78262fd2466073d6d8edb5721d96eeca932d458e 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/setup.py +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/setup.py @@ -1,9 +1,7 @@ -# coding: utf-8 - import sys from setuptools import setup, find_packages -NAME = "openapi_server" +NAME = "capif_acl" VERSION = "1.0.0" # To install the library, run the following @@ -31,7 +29,7 @@ setup( package_data={'': ['openapi/openapi.yaml']}, include_package_data=True, entry_points={ - 'console_scripts': ['openapi_server=openapi_server.__main__:main']}, + 'console_scripts': ['capif_acl=capif_acl.__main__:main']}, long_description="""\ API for access control policy. © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. """ diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/test-requirements.txt b/services/TS29222_CAPIF_Access_Control_Policy_API/test-requirements.txt index 422ece88482f451c08b57e0109939c09bead2c20..58f51d6a00272d7515a20e3618f345b73c68afa0 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/test-requirements.txt +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/test-requirements.txt @@ -1,4 +1,4 @@ pytest~=7.1.0 pytest-cov>=2.8.1 pytest-randomly>=1.2.3 -Flask-Testing == 0.8.1 +Flask-Testing==0.8.1 diff --git a/services/TS29222_CAPIF_Access_Control_Policy_API/tox.ini b/services/TS29222_CAPIF_Access_Control_Policy_API/tox.ini index f66b2d84cdaa91cec100c23e86388924a071a451..539b51bc024421711c1835fc20106a0e5a8963db 100644 --- a/services/TS29222_CAPIF_Access_Control_Policy_API/tox.ini +++ b/services/TS29222_CAPIF_Access_Control_Policy_API/tox.ini @@ -5,7 +5,7 @@ skipsdist=True [testenv] deps=-r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt - {toxinidir} + {toxinidir} commands= - pytest --cov=openapi_server + pytest --cov=capif_acl