From eafbb76441f0ed7f478bb3cbc20f153f5f178e9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Thu, 9 Sep 2021 12:05:52 +0200 Subject: [PATCH] chg: Update tutorial for custom objects --- docs/tutorial/FullOverview.ipynb | 8 +++++++- poetry.lock | 17 ++++++++--------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/docs/tutorial/FullOverview.ipynb b/docs/tutorial/FullOverview.ipynb index ad3323f..08027ad 100644 --- a/docs/tutorial/FullOverview.ipynb +++ b/docs/tutorial/FullOverview.ipynb @@ -622,6 +622,7 @@ "outputs": [], "source": [ "from pymisp.tools import GenericObjectGenerator\n", + "from uuid import uuid4\n", "\n", "attributeAsDict = [{'MyCoolAttribute': {'value': 'critical thing', 'type': 'text'}}, \n", " {'MyCoolerAttribute': {'value': 'even worse', 'type': 'text'}}]\n", @@ -629,6 +630,11 @@ "\n", "misp_object = GenericObjectGenerator('my-cool-template')\n", "misp_object.generate_attributes(attributeAsDict)\n", + "# The parameters below are required if no template is provided.\n", + "misp_object.template_uuid = uuid4()\n", + "misp_object.templade_id = 1\n", + "misp_object.description = \"foo\"\n", + "setattr(misp_object, 'meta-category', 'bar')\n", "\n", "print(misp_object.to_json())" ] @@ -1495,7 +1501,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.2" + "version": "3.9.5" } }, "nbformat": 4, diff --git a/poetry.lock b/poetry.lock index 30f2ca8..01ed389 100644 --- a/poetry.lock +++ b/poetry.lock @@ -87,14 +87,14 @@ tzdata = ["tzdata"] [[package]] name = "beautifulsoup4" -version = "4.9.3" +version = "4.10.0" description = "Screen-scraping library" category = "main" optional = true -python-versions = "*" +python-versions = ">3.0.0" [package.dependencies] -soupsieve = {version = ">1.2", markers = "python_version >= \"3.0\""} +soupsieve = ">1.2" [package.extras] html5lib = ["html5lib"] @@ -1283,7 +1283,7 @@ test = ["pytest"] [[package]] name = "terminado" -version = "0.12.0" +version = "0.12.1" description = "Tornado websocket backend for the Xterm.js Javascript terminal emulator library." category = "dev" optional = false @@ -1598,9 +1598,8 @@ backcall = [ {file = "backports.zoneinfo-0.2.1.tar.gz", hash = "sha256:fadbfe37f74051d024037f223b8e001611eac868b5c5b06144ef4d8b799862f2"}, ] beautifulsoup4 = [ - {file = "beautifulsoup4-4.9.3-py2-none-any.whl", hash = "sha256:4c98143716ef1cb40bf7f39a8e3eec8f8b009509e74904ba3a7b315431577e35"}, - {file = "beautifulsoup4-4.9.3-py3-none-any.whl", hash = "sha256:fff47e031e34ec82bf17e00da8f592fe7de69aeea38be00523c04623c04fb666"}, - {file = "beautifulsoup4-4.9.3.tar.gz", hash = "sha256:84729e322ad1d5b4d25f805bfa05b902dd96450f43842c4e99067d5e1369eb25"}, + {file = "beautifulsoup4-4.10.0-py3-none-any.whl", hash = "sha256:9a315ce70049920ea4572a4055bc4bd700c940521d36fc858205ad4fcde149bf"}, + {file = "beautifulsoup4-4.10.0.tar.gz", hash = "sha256:c23ad23c521d818955a4151a67d81580319d4bf548d3d49f4223ae041ff98891"}, ] bleach = [ {file = "bleach-4.1.0-py2.py3-none-any.whl", hash = "sha256:4d2651ab93271d1129ac9cbc679f524565cc8a1b791909c4a51eac4446a15994"}, @@ -2316,8 +2315,8 @@ sphinxcontrib-serializinghtml = [ {file = "sphinxcontrib_serializinghtml-1.1.5-py2.py3-none-any.whl", hash = "sha256:352a9a00ae864471d3a7ead8d7d79f5fc0b57e8b3f95e9867eb9eb28999b92fd"}, ] terminado = [ - {file = "terminado-0.12.0-py3-none-any.whl", hash = "sha256:bd8c2ecfa0516a2a80b7836421d0be61af6a2e84e1e75eee95eb019e138eb639"}, - {file = "terminado-0.12.0.tar.gz", hash = "sha256:00927a0bc2e1e5d5728580910d82191ad7315fef0006a8b74ff940b34a916e16"}, + {file = "terminado-0.12.1-py3-none-any.whl", hash = "sha256:09fdde344324a1c9c6e610ee4ca165c4bb7f5bbf982fceeeb38998a988ef8452"}, + {file = "terminado-0.12.1.tar.gz", hash = "sha256:b20fd93cc57c1678c799799d117874367cc07a3d2d55be95205b1a88fa08393f"}, ] testpath = [ {file = "testpath-0.5.0-py3-none-any.whl", hash = "sha256:8044f9a0bab6567fc644a3593164e872543bb44225b0e24846e2c89237937589"},