From f0d30752aeb54aac370204acaea443a76704a0e0 Mon Sep 17 00:00:00 2001 From: Kali <136826+cmlh@users.noreply.github.com> Date: Sun, 10 Oct 2021 17:05:51 -0400 Subject: [PATCH 1/5] Create @github Actions of @sonatype-nexus-community jake --- .github/workflows/sonatype-jack.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/sonatype-jack.yml diff --git a/.github/workflows/sonatype-jack.yml b/.github/workflows/sonatype-jack.yml new file mode 100644 index 0000000..e59b74b --- /dev/null +++ b/.github/workflows/sonatype-jack.yml @@ -0,0 +1,24 @@ +name: 'Sonatype Jake' + +on: [push] + +jobs: + security: + + # runs-on: ubuntu-latest + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7.11 + - name: Run jake from Sonatype + run: | + python -m pip install --upgrade pip + pip3 install -r requirements.txt + pip3 freeze > requirements.txt + pip3 install jake + jake ddt -r requirements.txt + From 3b27ccc634c7e376df45e2566b3163134fff6b05 Mon Sep 17 00:00:00 2001 From: Felix Hertrampf Date: Wed, 15 Dec 2021 12:15:39 +0100 Subject: [PATCH 2/5] feat: adding workflows to check if trx boots on python3.6 - 3.10 --- .github/workflows/pythonx-boot-check.yaml | 29 +++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/pythonx-boot-check.yaml diff --git a/.github/workflows/pythonx-boot-check.yaml b/.github/workflows/pythonx-boot-check.yaml new file mode 100644 index 0000000..8cd2197 --- /dev/null +++ b/.github/workflows/pythonx-boot-check.yaml @@ -0,0 +1,29 @@ +name: 'Runs with Python3.6 - Python3.10' + +on: [ push ] + +jobs: + boots: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [ '3.6.x', '3.7.x', '3.8.x', '3.9.x', '3.10.x' ] + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install maltego-trx:1.4.2 + run: | + python -m pip install --upgrade pip + pip3 install maltego-trx==1.4.2 + + - name: Create starter Project + run: | + maltego-trx start test + cd test + python3 project.py list \ No newline at end of file From e27581921ac51078d22afa3a9c888d11654ed4c6 Mon Sep 17 00:00:00 2001 From: Felix Hertrampf Date: Wed, 15 Dec 2021 12:43:55 +0100 Subject: [PATCH 3/5] fix(workflows/sonatype-jack): fix command and set matrix for 3.6 and 3.10, --- .github/workflows/sonatype-jack.yml | 38 +++++++++++++++++------------ 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/.github/workflows/sonatype-jack.yml b/.github/workflows/sonatype-jack.yml index e59b74b..65b1995 100644 --- a/.github/workflows/sonatype-jack.yml +++ b/.github/workflows/sonatype-jack.yml @@ -1,24 +1,30 @@ name: 'Sonatype Jake' -on: [push] +on: [ push ] jobs: security: - - # runs-on: ubuntu-latest - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [ '3.6.x', '3.10.x' ] steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.7 - uses: actions/setup-python@v2 - with: - python-version: 3.7.11 - - name: Run jake from Sonatype - run: | - python -m pip install --upgrade pip - pip3 install -r requirements.txt - pip3 freeze > requirements.txt - pip3 install jake - jake ddt -r requirements.txt + - uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Run jake from Sonatype + run: | + # needed for Python3.6 + export PYTHONIOENCODING=utf-8 + + python -m pip install --upgrade pip + pip3 install -r requirements.txt + pip3 freeze > frozen.requirements.txt + + pip3 install jake + jake ddt \ No newline at end of file From b1197cfc3ed5be40565eb0c7d086ee778478476a Mon Sep 17 00:00:00 2001 From: Felix Hertrampf Date: Wed, 15 Dec 2021 12:47:37 +0100 Subject: [PATCH 4/5] feat(README): add badges for workflows --- README.md | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index c4b4c70..beaef68 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,18 @@ # Maltego TRX Python Library +[![Runs with Python3.6 - Python3.10](https://github.com/paterva/maltego-trx/actions/workflows/pythonx-boot-check.yaml/badge.svg?branch=feat%2Fworkflows)](https://github.com/paterva/maltego-trx/actions/workflows/pythonx-boot-check.yaml) + +[![Sonatype Jake](https://github.com/paterva/maltego-trx/actions/workflows/sonatype-jack.yml/badge.svg?branch=feat%2Fworkflows)](https://github.com/paterva/maltego-trx/actions/workflows/sonatype-jack.yml) + ## Release Notes -__1.4.0 + 1.4.1:__ Both versions are incompatible with python3.7 and lower. The issue is already fixed and will be published in 1.4.2. + +__1.4.0 + 1.4.1:__ Both versions are incompatible with python3.7 and lower. The issue is already fixed and will be +published in 1.4.2. ## Getting Started -_Note: Support for Python 2 has been officially discontinued as of July 2021. Please use Python 3.6 or higher to use up-to-date versions of Maltego TRX._ +_Note: Support for Python 2 has been officially discontinued as of July 2021. Please use Python 3.6 or higher to use +up-to-date versions of Maltego TRX._ To install the trx library run the following command: @@ -167,11 +174,11 @@ from extensions import registry @registry.register_transform( - display_name='Greet Person', - input_entity='maltego.Phrase', - description='Returns a phrase greeting a person on the graph.', - output_entities=['maltego.Phrase'], - disclaimer='This disclaimer is optional and has to be accepted before this transform is run' + display_name='Greet Person', + input_entity='maltego.Phrase', + description='Returns a phrase greeting a person on the graph.', + output_entities=['maltego.Phrase'], + disclaimer='This disclaimer is optional and has to be accepted before this transform is run' ) class GreetPerson(DiscoverableTransform): @@ -180,8 +187,8 @@ class GreetPerson(DiscoverableTransform): ... ``` -**Pro Tip:** If the `display_name` is either `None` or `""`, the registry will try to create a display name from the class -name: +**Pro Tip:** If the `display_name` is either `None` or `""`, the registry will try to create a display name from the +class name: - `DNSToIP` 'DNS To IP' - `GreetPerson` 'Greet Person' @@ -222,7 +229,9 @@ registry.global_settings = [api_key_setting] #### Configuring Settings per Transform -Settings that aren't required for every transform have to be added to the `register_transform` decorator explicitly. To access the setting on the request, use the `id` property, which will have the global prefix if it's a global setting. The `name` property won't work on global settings. +Settings that aren't required for every transform have to be added to the `register_transform` decorator explicitly. To +access the setting on the request, use the `id` property, which will have the global prefix if it's a global setting. +The `name` property won't work on global settings. ```python # settings.py From 5a8f6c98957f715058678d11c0f151da456be450 Mon Sep 17 00:00:00 2001 From: Felix Hertrampf Date: Thu, 16 Dec 2021 13:42:41 +0100 Subject: [PATCH 5/5] fix(README): remove branch from badges --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 92bc2d9..08d1723 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Maltego TRX Python Library -[![Runs with Python3.6 - Python3.10](https://github.com/paterva/maltego-trx/actions/workflows/pythonx-boot-check.yaml/badge.svg?branch=feat%2Fworkflows)](https://github.com/paterva/maltego-trx/actions/workflows/pythonx-boot-check.yaml) +[![Runs with Python3.6 - Python3.10](https://github.com/paterva/maltego-trx/actions/workflows/pythonx-boot-check.yaml/badge.svg)](https://github.com/paterva/maltego-trx/actions/workflows/pythonx-boot-check.yaml) -[![Sonatype Jake](https://github.com/paterva/maltego-trx/actions/workflows/sonatype-jack.yml/badge.svg?branch=feat%2Fworkflows)](https://github.com/paterva/maltego-trx/actions/workflows/sonatype-jack.yml) +[![Sonatype Jake](https://github.com/paterva/maltego-trx/actions/workflows/sonatype-jack.yml/badge.svg)](https://github.com/paterva/maltego-trx/actions/workflows/sonatype-jack.yml) ## Release Notes __1.4.0 + 1.4.1:__ Both versions are incompatible with python3.7 and lower.