Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Github Workflows #28

Merged
merged 7 commits into from
Jan 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/pythonx-boot-check.yaml
Original file line number Diff line number Diff line change
@@ -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
30 changes: 30 additions & 0 deletions .github/workflows/sonatype-jack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 'Sonatype Jake'

on: [ push ]

jobs:
security:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.6.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: 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
25 changes: 16 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +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)](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)](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.

__1.4.2__: Fixed python3.6 incomptibility

## 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:

Expand Down Expand Up @@ -169,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):

Expand All @@ -182,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'
Expand Down Expand Up @@ -224,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
Expand Down