Skip to content

Commit b304afc

Browse files
committed
Bump version to 3.0.8 and add py313 and py314 builds
1 parent a77a40d commit b304afc

6 files changed

Lines changed: 4066 additions & 3575 deletions

File tree

.github/workflows/release-package.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
steps:
1414

1515
- name: Checkout repository
16-
uses: actions/checkout@v4
16+
uses: actions/checkout@v6
1717
with:
1818
fetch-depth: 0
1919

@@ -48,15 +48,15 @@ jobs:
4848
steps:
4949

5050
- name: Checkout repository
51-
uses: actions/checkout@v4
51+
uses: actions/checkout@v6
5252

5353
- name: Install packages
54-
run: sudo apt-get install libgl1 libpoppler-cpp-dev libpoppler-cpp0v5 libzbar0 tesseract-ocr
54+
run: sudo apt-get install libgl1 libfuzzy-dev libpoppler-cpp-dev libpoppler-cpp0v5 libzbar0 tesseract-ocr libjpeg-dev
5555

56-
- name: Set up Python 3.12
57-
uses: actions/setup-python@v5
56+
- name: Set up Python 3.14
57+
uses: actions/setup-python@v6
5858
with:
59-
python-version: 3.12
59+
python-version: 3.14
6060

6161
- name: Install poetry
6262
run: python -m pip install poetry
@@ -93,15 +93,15 @@ jobs:
9393
runs-on: ubuntu-24.04
9494
steps:
9595
- name: Checkout repository
96-
uses: actions/checkout@v4
96+
uses: actions/checkout@v6
9797

9898
- name: Install packages
99-
run: sudo apt-get install libgl1 libpoppler-cpp-dev libpoppler-cpp0v5 libzbar0 tesseract-ocr
99+
run: sudo apt-get install libgl1 libfuzzy-dev libpoppler-cpp-dev libpoppler-cpp0v5 libzbar0 tesseract-ocr libjpeg-dev
100100

101-
- name: Set up Python 3.12
102-
uses: actions/setup-python@v5
101+
- name: Set up Python 3.14
102+
uses: actions/setup-python@v6
103103
with:
104-
python-version: 3.12
104+
python-version: 3.14
105105

106106
- name: Install poetry
107107
run: python -m pip install poetry
@@ -113,7 +113,7 @@ jobs:
113113
run: poetry build
114114

115115
- name: Upload package artifact
116-
uses: actions/upload-artifact@v4
116+
uses: actions/upload-artifact@v7
117117
with:
118118
name: python-package-distributions
119119
path: dist/
@@ -127,7 +127,7 @@ jobs:
127127

128128
steps:
129129
- name: Download dist files
130-
uses: actions/download-artifact@v4
130+
uses: actions/download-artifact@v8
131131
with:
132132
name: python-package-distributions
133133
path: dist/

.github/workflows/test-package.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ jobs:
1515
steps:
1616

1717
- name: Checkout repository
18-
uses: actions/checkout@v4
18+
uses: actions/checkout@v6
1919

2020
- name: Install packages
21-
run: sudo apt-get install libgl1 libpoppler-cpp-dev libpoppler-cpp0v5 libzbar0 tesseract-ocr
21+
run: sudo apt-get install libgl1 libfuzzy-dev libpoppler-cpp-dev libpoppler-cpp0v5 libzbar0 tesseract-ocr libjpeg-dev
2222

23-
- name: Set up Python 3.12
24-
uses: actions/setup-python@v5
23+
- name: Set up Python 3.14
24+
uses: actions/setup-python@v6
2525
with:
26-
python-version: 3.12
26+
python-version: 3.14
2727

2828
- name: Install poetry
2929
run: python -m pip install poetry
@@ -37,18 +37,18 @@ jobs:
3737
strategy:
3838
fail-fast: false
3939
matrix:
40-
python-version: ["3.10", "3.11", "3.12"]
40+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
4141

4242
steps:
4343

4444
- name: Checkout repository
45-
uses: actions/checkout@v4
45+
uses: actions/checkout@v6
4646

4747
- name: Install packages
48-
run: sudo apt-get install libgl1 libpoppler-cpp-dev libpoppler-cpp0v5 libzbar0 tesseract-ocr
48+
run: sudo apt-get install libgl1 libfuzzy-dev libpoppler-cpp-dev libpoppler-cpp0v5 libzbar0 tesseract-ocr libjpeg-dev
4949

5050
- name: Set up Python ${{ matrix.python-version }}
51-
uses: actions/setup-python@v5
51+
uses: actions/setup-python@v6
5252
with:
5353
python-version: ${{ matrix.python-version }}
5454

@@ -81,9 +81,9 @@ jobs:
8181
if: always()
8282
run: cat error.log
8383

84-
- name: Upload package artifcat
85-
if: ${{ matrix.python-version == '3.12' }}
86-
uses: actions/upload-artifact@v4
84+
- name: Upload package artifact
85+
if: ${{ matrix.python-version == '3.14' }}
86+
uses: actions/upload-artifact@v7
8787
with:
8888
name: python-package-distributions
8989
path: dist/
@@ -97,7 +97,7 @@ jobs:
9797

9898
steps:
9999
- name: Download dist files
100-
uses: actions/download-artifact@v4
100+
uses: actions/download-artifact@v8
101101
with:
102102
name: python-package-distributions
103103
path: dist/

misp_modules/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ def main():
355355
ioloop.IOLoop.instance().start()
356356
finally:
357357
ioloop.IOLoop.instance().stop()
358-
return 0
358+
return 0
359359

360360

361361
if __name__ == "__main__":

misp_modules/modules/import_mod/taxii21.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,15 @@
1111
import requests
1212
import taxii2client
1313
import taxii2client.exceptions
14-
from misp_stix_converter import ExternalSTIX2toMISPParser, InternalSTIX2toMISPParser, _is_stix2_from_misp
14+
from misp_stix_converter import ExternalSTIX2toMISPParser, InternalSTIX2toMISPParser
1515
from stix2.v20 import Bundle as Bundle_v20
1616
from stix2.v21 import Bundle as Bundle_v21
1717

1818

19+
_MISP_STIX_tags = ('misp:tool="MISP-STIX-Converter"', 'misp:tool="misp2stix2"')
20+
_STIX2_event_types = ('grouping', 'report')
21+
22+
1923
class ConfigError(Exception):
2024
"""
2125
Represents an error in the config settings for one invocation of this
@@ -25,6 +29,16 @@ class ConfigError(Exception):
2529
pass
2630

2731

32+
def _is_stix2_from_misp(stix_objects: list):
33+
for stix_object in stix_objects:
34+
labels = stix_object.get('labels', [])
35+
if stix_object['type'] not in _STIX2_event_types or not labels:
36+
continue
37+
if any(tag in labels for tag in _MISP_STIX_tags):
38+
return True
39+
return False
40+
41+
2842
misperrors = {"error": "Error"}
2943

3044
moduleinfo = {

0 commit comments

Comments
 (0)