From 225bdeaa0b64929744908a22bbbd8979efdba04b Mon Sep 17 00:00:00 2001 From: mark Date: Tue, 14 Feb 2023 11:54:10 +0000 Subject: [PATCH 1/6] Adding TrafficPolicy generic object --- 103221-1/TS_103_221_01_TrafficPolicy.xsd | 25 +++++++++++ .../examples/CreateTrafficPolicy_example.xml | 44 +++++++++++++++++++ testing/xsd_compile_targets.json | 7 ++- 3 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 103221-1/TS_103_221_01_TrafficPolicy.xsd create mode 100644 103221-1/examples/CreateTrafficPolicy_example.xml diff --git a/103221-1/TS_103_221_01_TrafficPolicy.xsd b/103221-1/TS_103_221_01_TrafficPolicy.xsd new file mode 100644 index 0000000..0af4bbd --- /dev/null +++ b/103221-1/TS_103_221_01_TrafficPolicy.xsd @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/103221-1/examples/CreateTrafficPolicy_example.xml b/103221-1/examples/CreateTrafficPolicy_example.xml new file mode 100644 index 0000000..6b34233 --- /dev/null +++ b/103221-1/examples/CreateTrafficPolicy_example.xml @@ -0,0 +1,44 @@ + + + + admfID + neID + 2023-02-14T18:46:21.247432Z + v1.13.1 + 2654a277-bafb-4240-9143-806ee41a3751 + + 6c67de93-926a-488b-9435-b0a30c20f676 + + + + + 203.0.113.0/24 + + + + + + ETSI + PolicyAction + PDSR + + + + + admfID + neID + 2023-02-14T18:46:21.247432Z + v1.13.1 + 2654a277-bafb-4240-9143-806ee41a3751 + + b04057af-362f-4e8d-9337-416f43bfd7ec + Template Rule 1 + + + 1 + 6c67de93-926a-488b-9435-b0a30c20f676 + + + + + diff --git a/testing/xsd_compile_targets.json b/testing/xsd_compile_targets.json index a1bde12..6110fd8 100644 --- a/testing/xsd_compile_targets.json +++ b/testing/xsd_compile_targets.json @@ -15,8 +15,13 @@ "103221-1/TS_103_221_01.xsd", "103221-1/TS_103_221_01_HashedID.xsd", "103221-1/TS_103_221_01_DestinationSet.xsd", + "103221-1/TS_103_221_01_TrafficPolicy.xsd", "103280/TS_103_280.xsd", - "103221-1/examples/ExampleGenericObjects.xsd" + "103221-1/examples/ExampleGenericObjects.xsd", + "103120/schema/ts_103120_Common.xsd", + "103120/schema/ts_103120_Core.xsd", + "103120/schema/ts_103120_TrafficPolicy.xsd", + "testing/deps/xmldsig/xmldsig-core-schema.xsd" ], "exampleFiles" : [ "103221-1/examples" -- GitLab From 8eaee4b02f39c1a7cb74ab466fa3e81b64f539c6 Mon Sep 17 00:00:00 2001 From: mark Date: Thu, 16 Feb 2023 11:36:00 +0000 Subject: [PATCH 2/6] Changing namespace prefix --- 103221-1/TS_103_221_01_TrafficPolicy.xsd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/103221-1/TS_103_221_01_TrafficPolicy.xsd b/103221-1/TS_103_221_01_TrafficPolicy.xsd index 0af4bbd..eda3273 100644 --- a/103221-1/TS_103_221_01_TrafficPolicy.xsd +++ b/103221-1/TS_103_221_01_TrafficPolicy.xsd @@ -1,5 +1,5 @@ - + @@ -8,7 +8,7 @@ - + @@ -17,7 +17,7 @@ - + -- GitLab From 98644f0899bb392aabeafbc966499671776cc76c Mon Sep 17 00:00:00 2001 From: mark Date: Thu, 16 Feb 2023 11:45:02 +0000 Subject: [PATCH 3/6] Adding traffic policy references to TaskDetails and MediationsDetails, and updating example --- 103221-1/TS_103_221_01.xsd | 10 ++++++++++ .../examples/CreateTrafficPolicy_example.xml | 20 +++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/103221-1/TS_103_221_01.xsd b/103221-1/TS_103_221_01.xsd index c3ca89a..894785a 100644 --- a/103221-1/TS_103_221_01.xsd +++ b/103221-1/TS_103_221_01.xsd @@ -156,6 +156,7 @@ + @@ -251,6 +252,7 @@ + @@ -319,6 +321,14 @@ + + + + + + + + diff --git a/103221-1/examples/CreateTrafficPolicy_example.xml b/103221-1/examples/CreateTrafficPolicy_example.xml index 6b34233..1150aa0 100644 --- a/103221-1/examples/CreateTrafficPolicy_example.xml +++ b/103221-1/examples/CreateTrafficPolicy_example.xml @@ -41,4 +41,24 @@ + + admfID + neID + 2023-02-14T18:46:21.247432Z + v1.13.1 + 211900a7-afb5-4187-b036-c85a92ab94aa + + 2f5faff3-077d-4ec3-b66a-226e3a921eec + + + 447700900000 + + + X2andX3 + + + b04057af-362f-4e8d-9337-416f43bfd7ec + + + -- GitLab From 20b0e43034ae3b6ad4299ad30095a6dcdaccfac0 Mon Sep 17 00:00:00 2001 From: mark Date: Thu, 16 Feb 2023 10:12:35 +0000 Subject: [PATCH 4/6] Adding code to generate attachments post-meeting --- create_attachments.py | 60 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 create_attachments.py diff --git a/create_attachments.py b/create_attachments.py new file mode 100644 index 0000000..9f5f026 --- /dev/null +++ b/create_attachments.py @@ -0,0 +1,60 @@ +from io import BytesIO +from pathlib import Path +import logging +import zipfile + +# For ETSI portal attachments, a single zip archive is created which +# contains: +# - All files in the top-level spec directory +# - A zipfile for each subdirectory, which contains all the files in that subdirectory +# This second step is recursive, so each zip file contains only files and other zipfiles, never subdirectories +# For an explanation as to *why* this is the case, speak to your ETSI technical officer. +# +# Example: Assuming the files for the portal attachment are of the following form: +# +# (contents of directory) +# - top_level_file.ext +# - subdirectory_1 +# - subdirectory_1_file.ext +# - subdirectory_2 +# - subdirectory_2_file.ext +# - TS 102 232-1 +# +# ...then the correct form for ETSI portal attachments is as follows +# +# ts_xxxxxx_vxxyyzzp0.zip +# which contains: +# - top_level_file.ext +# - subdirectory_1.zip +# (which contains) +# - subdirectory_1_file.ext +# - subdirectory_2.zip +# (which contains) +# - subdirectory_2_file.ext + + +def recursively_zip_directory(directory: Path, zipname: str, recursion=0): + logging.info( + f"{'':{recursion * 4}}Packaging contents of {directory} into {zipname}" + ) + buffer = BytesIO() + zip = zipfile.ZipFile(buffer, "a") + for f in directory.iterdir(): + if f.is_file(): + logging.info(f"{'':{recursion * 4}}Adding file: {f}") + zip.write(f, f.name) + elif f.is_dir(): + zipname = f.with_suffix(".zip").name + logging.info(f"{'':{recursion * 4}}Adding archive: {f}") + recurse_buffer = recursively_zip_directory(f, zipname, recursion + 1) + zip.writestr(zipname, recurse_buffer.getvalue()) + return buffer + + +if __name__ == "__main__": + logging.info("Creating attachments...") + for directory in Path(".").glob("1*"): + zip_name = f"ts_{directory.name}vXXYYZZp0.zip" + zip_buffer = recursively_zip_directory(directory, zip_name) + with open(zip_name, "wb") as f: + f.write(zip_buffer.getvalue()) -- GitLab From 2cbc6a2ad9a65e6fba1a51565cca6dade57ffed5 Mon Sep 17 00:00:00 2001 From: mark Date: Wed, 21 Jun 2023 11:08:56 +0100 Subject: [PATCH 5/6] Changing prefixes in examples --- .../examples/CreateTrafficPolicy_example.xml | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/103221-1/examples/CreateTrafficPolicy_example.xml b/103221-1/examples/CreateTrafficPolicy_example.xml index 1150aa0..2edc798 100644 --- a/103221-1/examples/CreateTrafficPolicy_example.xml +++ b/103221-1/examples/CreateTrafficPolicy_example.xml @@ -1,5 +1,5 @@ - + admfID neID @@ -8,20 +8,20 @@ 2654a277-bafb-4240-9143-806ee41a3751 6c67de93-926a-488b-9435-b0a30c20f676 - - - - + + + + 203.0.113.0/24 - - - - - - ETSI - PolicyAction - PDSR - + + + + + + ETSI + PolicyAction + PDSR + @@ -32,13 +32,13 @@ 2654a277-bafb-4240-9143-806ee41a3751 b04057af-362f-4e8d-9337-416f43bfd7ec - Template Rule 1 - - - 1 - 6c67de93-926a-488b-9435-b0a30c20f676 - - + Template Rule 1 + + + 1 + 6c67de93-926a-488b-9435-b0a30c20f676 + + -- GitLab From 22014002cb4244a10972c2337a4cc4966f072b4a Mon Sep 17 00:00:00 2001 From: mark Date: Wed, 21 Jun 2023 11:13:32 +0100 Subject: [PATCH 6/6] Changing prefix in TP schema --- 103221-1/TS_103_221_01_TrafficPolicy.xsd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/103221-1/TS_103_221_01_TrafficPolicy.xsd b/103221-1/TS_103_221_01_TrafficPolicy.xsd index eda3273..2e59aa9 100644 --- a/103221-1/TS_103_221_01_TrafficPolicy.xsd +++ b/103221-1/TS_103_221_01_TrafficPolicy.xsd @@ -1,5 +1,5 @@ - + @@ -8,7 +8,7 @@ - + @@ -17,7 +17,7 @@ - + -- GitLab