Skip to content
Snippets Groups Projects
Commit 2ebe25eb authored by torrespel's avatar torrespel
Browse files

Auditing API realease V18.6.0

parent 22eee7e3
No related branches found
No related tags found
2 merge requests!123Ocf141 review and implement changes from 3gpp specs v18 4 0 to v18 7 0 latest rel18,!122Ocf141 review and implement changes from 3gpp specs v18 4 0 to v18 7 0 latest rel18
Pipeline #13004 passed
Showing
with 187 additions and 37 deletions
......@@ -19,6 +19,7 @@ logs/models/invocation_log.py
logs/models/invocation_logs.py
logs/models/invocation_logs_retrieve_res.py
logs/models/log.py
logs/models/o_auth_grant_type.py
logs/models/operation.py
logs/models/problem_details.py
logs/models/protocol.py
......
7.5.0
7.11.0
......@@ -15,7 +15,7 @@ To run the server, please execute the following from the root directory:
```
pip3 install -r requirements.txt
python3 -m openapi_server
python3 -m logs
```
and open your browser to here:
......
......@@ -46,7 +46,6 @@ def api_invocation_logs_get(aef_id=None, api_invoker_id=None, time_range_start=N
:rtype: Union[InvocationLogsRetrieveRes, Tuple[InvocationLogsRetrieveRes, int], Tuple[InvocationLogsRetrieveRes, int, Dict[str, str]]
"""
current_app.logger.info("Audit logs")
if aef_id is None or api_invoker_id is None:
......
......@@ -16,4 +16,4 @@ class CustomJSONEncoder(JSONEncoder):
attr = o.attribute_map[attr]
dikt[attr] = value
return dikt
return JSONEncoder.default(self, o)
return JSONEncoder.default(self, o)
\ No newline at end of file
# flake8: noqa
# import models into model package
from logs.models.interface_description import InterfaceDescription
from logs.models.invalid_param import InvalidParam
from logs.models.invocation_log import InvocationLog
from logs.models.invocation_logs import InvocationLogs
from logs.models.invocation_logs_retrieve_res import InvocationLogsRetrieveRes
from logs.models.log import Log
from logs.models.o_auth_grant_type import OAuthGrantType
from logs.models.operation import Operation
from logs.models.problem_details import ProblemDetails
from logs.models.protocol import Protocol
from logs.models.security_method import SecurityMethod
import pprint
import typing
from logs import util
......
import re # noqa: E501
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from logs import util
from logs.models.base_model import Model
from logs.models.security_method import SecurityMethod # noqa: E501
from logs.models.o_auth_grant_type import OAuthGrantType
from logs.models.security_method import SecurityMethod
import re
from logs import util
from logs.models.o_auth_grant_type import OAuthGrantType # noqa: E501
from logs.models.security_method import SecurityMethod # noqa: E501
import re # noqa: E501
class InterfaceDescription(Model):
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
......@@ -13,7 +18,7 @@ class InterfaceDescription(Model):
Do not edit the class manually.
"""
def __init__(self, ipv4_addr=None, ipv6_addr=None, fqdn=None, port=None, api_prefix=None, security_methods=None): # noqa: E501
def __init__(self, ipv4_addr=None, ipv6_addr=None, fqdn=None, port=None, api_prefix=None, security_methods=None, grant_types=None): # noqa: E501
"""InterfaceDescription - a model defined in OpenAPI
:param ipv4_addr: The ipv4_addr of this InterfaceDescription. # noqa: E501
......@@ -28,6 +33,8 @@ class InterfaceDescription(Model):
:type api_prefix: str
:param security_methods: The security_methods of this InterfaceDescription. # noqa: E501
:type security_methods: List[SecurityMethod]
:param grant_types: The grant_types of this InterfaceDescription. # noqa: E501
:type grant_types: List[OAuthGrantType]
"""
self.openapi_types = {
'ipv4_addr': str,
......@@ -35,7 +42,8 @@ class InterfaceDescription(Model):
'fqdn': str,
'port': int,
'api_prefix': str,
'security_methods': List[SecurityMethod]
'security_methods': List[SecurityMethod],
'grant_types': List[OAuthGrantType]
}
self.attribute_map = {
......@@ -44,7 +52,8 @@ class InterfaceDescription(Model):
'fqdn': 'fqdn',
'port': 'port',
'api_prefix': 'apiPrefix',
'security_methods': 'securityMethods'
'security_methods': 'securityMethods',
'grant_types': 'grantTypes'
}
self._ipv4_addr = ipv4_addr
......@@ -53,6 +62,7 @@ class InterfaceDescription(Model):
self._port = port
self._api_prefix = api_prefix
self._security_methods = security_methods
self._grant_types = grant_types
@classmethod
def from_dict(cls, dikt) -> 'InterfaceDescription':
......@@ -136,7 +146,7 @@ class InterfaceDescription(Model):
if fqdn is not None and len(fqdn) < 4:
raise ValueError("Invalid value for `fqdn`, length must be greater than or equal to `4`") # noqa: E501
if fqdn is not None and not re.search(r'^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$', fqdn): # noqa: E501
raise ValueError("Invalid value for `fqdn`, must be a follow pattern or equal to `/^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$/`") # noqa: E501
raise ValueError(r"Invalid value for `fqdn`, must be a follow pattern or equal to `/^([0-9A-Za-z]([-0-9A-Za-z]{0,61}[0-9A-Za-z])?\.)+[A-Za-z]{2,63}\.?$/`") # noqa: E501
self._fqdn = fqdn
......@@ -214,3 +224,26 @@ class InterfaceDescription(Model):
raise ValueError("Invalid value for `security_methods`, number of items must be greater than or equal to `1`") # noqa: E501
self._security_methods = security_methods
@property
def grant_types(self) -> List[OAuthGrantType]:
"""Gets the grant_types of this InterfaceDescription.
:return: The grant_types of this InterfaceDescription.
:rtype: List[OAuthGrantType]
"""
return self._grant_types
@grant_types.setter
def grant_types(self, grant_types: List[OAuthGrantType]):
"""Sets the grant_types of this InterfaceDescription.
:param grant_types: The grant_types of this InterfaceDescription.
:type grant_types: List[OAuthGrantType]
"""
if grant_types is not None and len(grant_types) < 1:
raise ValueError("Invalid value for `grant_types`, number of items must be greater than or equal to `1`") # noqa: E501
self._grant_types = grant_types
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from logs import util
from logs.models.base_model import Model
from logs import util
class InvalidParam(Model):
......
import re # noqa: E501
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from logs import util
from logs.models.base_model import Model
from logs.models.log import Log # noqa: E501
from logs.models.log import Log
import re
from logs import util
from logs.models.log import Log # noqa: E501
import re # noqa: E501
class InvocationLog(Model):
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
......@@ -153,6 +156,6 @@ class InvocationLog(Model):
:type supported_features: str
"""
if supported_features is not None and not re.search(r'^[A-Fa-f0-9]*$', supported_features): # noqa: E501
raise ValueError("Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501
raise ValueError(r"Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501
self._supported_features = supported_features
import re # noqa: E501
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from logs import util
from logs.models.base_model import Model
from logs.models.invocation_log import InvocationLog # noqa: E501
from logs.models.invocation_log import InvocationLog
import re
from logs import util
from logs.models.invocation_log import InvocationLog # noqa: E501
import re # noqa: E501
class InvocationLogs(Model):
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
......@@ -91,6 +94,6 @@ class InvocationLogs(Model):
:type supported_features: str
"""
if supported_features is not None and not re.search(r'^[A-Fa-f0-9]*$', supported_features): # noqa: E501
raise ValueError("Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501
raise ValueError(r"Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501
self._supported_features = supported_features
import re # noqa: E501
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from logs import util
from logs.models.base_model import Model
from logs.models.invocation_log import InvocationLog
from logs.models.invocation_logs import InvocationLogs
from logs.models.log import Log
import re
from logs import util
from logs.models.invocation_log import InvocationLog # noqa: E501
from logs.models.invocation_logs import InvocationLogs # noqa: E501
from logs.models.log import Log # noqa: E501
import re # noqa: E501
class InvocationLogsRetrieveRes(Model):
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
......@@ -159,7 +165,7 @@ class InvocationLogsRetrieveRes(Model):
:type supported_features: str
"""
if supported_features is not None and not re.search(r'^[A-Fa-f0-9]*$', supported_features): # noqa: E501
raise ValueError("Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501
raise ValueError(r"Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501
self._supported_features = supported_features
......
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from logs import util
from logs.models.base_model import Model
from logs.models.interface_description import InterfaceDescription
from logs.models.operation import Operation
from logs.models.protocol import Protocol
from logs import util
from logs.models.interface_description import InterfaceDescription # noqa: E501
from logs.models.operation import Operation # noqa: E501
from logs.models.protocol import Protocol # noqa: E501
class Log(Model):
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
......
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from logs.models.base_model import Model
from logs import util
class OAuthGrantType(Model):
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Do not edit the class manually.
"""
def __init__(self): # noqa: E501
"""OAuthGrantType - a model defined in OpenAPI
"""
self.openapi_types = {
}
self.attribute_map = {
}
@classmethod
def from_dict(cls, dikt) -> 'OAuthGrantType':
"""Returns the dict as a model
:param dikt: A dict.
:type: dict
:return: The OAuthGrantType of this OAuthGrantType. # noqa: E501
:rtype: OAuthGrantType
"""
return util.deserialize_model(dikt, cls)
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from logs import util
from logs.models.base_model import Model
from logs import util
class Operation(Model):
......
import re # noqa: E501
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from logs import util
from logs.models.base_model import Model
from logs.models.invalid_param import InvalidParam # noqa: E501
from logs.models.invalid_param import InvalidParam
import re
from logs import util
from logs.models.invalid_param import InvalidParam # noqa: E501
import re # noqa: E501
class ProblemDetails(Model):
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
......@@ -259,6 +262,6 @@ class ProblemDetails(Model):
:type supported_features: str
"""
if supported_features is not None and not re.search(r'^[A-Fa-f0-9]*$', supported_features): # noqa: E501
raise ValueError("Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501
raise ValueError(r"Invalid value for `supported_features`, must be a follow pattern or equal to `/^[A-Fa-f0-9]*$/`") # noqa: E501
self._supported_features = supported_features
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from logs import util
from logs.models.base_model import Model
from logs import util
class Protocol(Model):
......
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from logs import util
from logs.models.base_model import Model
from logs import util
class SecurityMethod(Model):
......
openapi: 3.0.0
info:
description: "API for auditing. \n© 2023, 3GPP Organizational Partners (ARIB, ATIS,\
description: "API for auditing. \n© 2024, 3GPP Organizational Partners (ARIB, ATIS,\
\ CCSA, ETSI, TSDSI, TTA, TTC). \nAll rights reserved.\n"
title: CAPIF_Auditing_API
version: 1.3.0-alpha.2
version: 1.3.0
externalDocs:
description: 3GPP TS 29.222 V18.1.0 Common API Framework for 3GPP Northbound APIs
description: 3GPP TS 29.222 V18.6.0 Common API Framework for 3GPP Northbound APIs
url: https://www.3gpp.org/ftp/Specs/archive/29_series/29.222/
servers:
- url: "{apiRoot}/logs/v1"
......@@ -359,6 +359,9 @@ components:
description: Represents the description of an API's interface.
example:
ipv6Addr: ipv6Addr
grantTypes:
- CLIENT_CREDENTIALS
- CLIENT_CREDENTIALS
securityMethods:
- PSK
- PSK
......@@ -367,7 +370,10 @@ components:
apiPrefix: apiPrefix
ipv4Addr: ipv4Addr
nullable: true
oneOf: []
oneOf:
- required: ["fqdn"]
- required: ["ipv4Addr"]
- required: ["ipv6Addr"]
properties:
ipv4Addr:
description: |
......@@ -406,6 +412,12 @@ components:
minItems: 1
title: securityMethods
type: array
grantTypes:
items:
$ref: '#/components/schemas/OAuthGrantType'
minItems: 1
title: grantTypes
type: array
title: InterfaceDescription
type: object
SecurityMethod:
......@@ -508,6 +520,9 @@ components:
invocationTime: 2000-01-23T04:56:07.000+00:00
srcInterface:
ipv6Addr: ipv6Addr
grantTypes:
- CLIENT_CREDENTIALS
- CLIENT_CREDENTIALS
securityMethods:
- PSK
- PSK
......@@ -525,6 +540,9 @@ components:
apiVersion: apiVersion
destInterface:
ipv6Addr: ipv6Addr
grantTypes:
- CLIENT_CREDENTIALS
- CLIENT_CREDENTIALS
securityMethods:
- PSK
- PSK
......@@ -539,6 +557,9 @@ components:
invocationTime: 2000-01-23T04:56:07.000+00:00
srcInterface:
ipv6Addr: ipv6Addr
grantTypes:
- CLIENT_CREDENTIALS
- CLIENT_CREDENTIALS
securityMethods:
- PSK
- PSK
......@@ -556,6 +577,9 @@ components:
apiVersion: apiVersion
destInterface:
ipv6Addr: ipv6Addr
grantTypes:
- CLIENT_CREDENTIALS
- CLIENT_CREDENTIALS
securityMethods:
- PSK
- PSK
......@@ -602,6 +626,9 @@ components:
invocationTime: 2000-01-23T04:56:07.000+00:00
srcInterface:
ipv6Addr: ipv6Addr
grantTypes:
- CLIENT_CREDENTIALS
- CLIENT_CREDENTIALS
securityMethods:
- PSK
- PSK
......@@ -619,6 +646,9 @@ components:
apiVersion: apiVersion
destInterface:
ipv6Addr: ipv6Addr
grantTypes:
- CLIENT_CREDENTIALS
- CLIENT_CREDENTIALS
securityMethods:
- PSK
- PSK
......@@ -724,3 +754,20 @@ components:
minimum: 0
title: Port
type: integer
OAuthGrantType:
anyOf:
- enum:
- CLIENT_CREDENTIALS
- AUTHORIZATION_CODE
- AUTHORIZATION_CODE_WITH_PKCE
type: string
- description: |
This string provides forward-compatibility with future extensions to the enumeration and is not used to encode content defined in the present version of this API.
type: string
description: "Indicates the supported authorization flow (e.g. client credentials\
\ flow, authorization code flow, etc.) to the API invoker. \nPossible\
\ values are:\n- CLIENT_CREDENTIALS: Indicate that the grant type is is client\
\ credentials flow.\n- AUTHORIZATION_CODE: Indicate that the grant type is\
\ authorization code.\n- AUTHORIZATION_CODE_WITH_PKCE: Indicate that the grant\
\ type is authorization code with PKCE.\n"
title: OAuthGrantType
......@@ -2,6 +2,7 @@ import logging
import connexion
from flask_testing import TestCase
from logs.encoder import JSONEncoder
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment