dictature 0.10.0__tar.gz → 0.10.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. {dictature-0.10.0/src/dictature.egg-info → dictature-0.10.1}/PKG-INFO +1 -1
  2. {dictature-0.10.0 → dictature-0.10.1}/pyproject.toml +1 -1
  3. {dictature-0.10.0 → dictature-0.10.1}/src/dictature/backend/misp.py +10 -1
  4. {dictature-0.10.0 → dictature-0.10.1}/src/dictature/backend/mock.py +1 -1
  5. {dictature-0.10.0 → dictature-0.10.1/src/dictature.egg-info}/PKG-INFO +1 -1
  6. {dictature-0.10.0 → dictature-0.10.1}/LICENSE +0 -0
  7. {dictature-0.10.0 → dictature-0.10.1}/README.md +0 -0
  8. {dictature-0.10.0 → dictature-0.10.1}/setup.cfg +0 -0
  9. {dictature-0.10.0 → dictature-0.10.1}/src/dictature/__init__.py +0 -0
  10. {dictature-0.10.0 → dictature-0.10.1}/src/dictature/backend/__init__.py +0 -0
  11. {dictature-0.10.0 → dictature-0.10.1}/src/dictature/backend/directory.py +0 -0
  12. {dictature-0.10.0 → dictature-0.10.1}/src/dictature/backend/sqlite.py +0 -0
  13. {dictature-0.10.0 → dictature-0.10.1}/src/dictature/backend/webdav.py +0 -0
  14. {dictature-0.10.0 → dictature-0.10.1}/src/dictature/dictature.py +0 -0
  15. {dictature-0.10.0 → dictature-0.10.1}/src/dictature/transformer/__init__.py +0 -0
  16. {dictature-0.10.0 → dictature-0.10.1}/src/dictature/transformer/aes.py +0 -0
  17. {dictature-0.10.0 → dictature-0.10.1}/src/dictature/transformer/gzip.py +0 -0
  18. {dictature-0.10.0 → dictature-0.10.1}/src/dictature/transformer/hmac.py +0 -0
  19. {dictature-0.10.0 → dictature-0.10.1}/src/dictature/transformer/mock.py +0 -0
  20. {dictature-0.10.0 → dictature-0.10.1}/src/dictature/transformer/passthrough.py +0 -0
  21. {dictature-0.10.0 → dictature-0.10.1}/src/dictature/transformer/pipeline.py +0 -0
  22. {dictature-0.10.0 → dictature-0.10.1}/src/dictature.egg-info/SOURCES.txt +0 -0
  23. {dictature-0.10.0 → dictature-0.10.1}/src/dictature.egg-info/dependency_links.txt +0 -0
  24. {dictature-0.10.0 → dictature-0.10.1}/src/dictature.egg-info/top_level.txt +0 -0
  25. {dictature-0.10.0 → dictature-0.10.1}/tests/test_operations.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dictature
3
- Version: 0.10.0
3
+ Version: 0.10.1
4
4
  Summary: dictature -- A generic wrapper around dict-like interface with mulitple backends
5
5
  Author-email: Adam Hlavacek <git@adamhlavacek.com>
6
6
  Project-URL: Homepage, https://github.com/esoadamo/dictature
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "dictature"
7
- version = "0.10.0"
7
+ version = "0.10.1"
8
8
  description = "dictature -- A generic wrapper around dict-like interface with mulitple backends"
9
9
  authors = [
10
10
  { name = "Adam Hlavacek", email = "git@adamhlavacek.com" }
@@ -3,7 +3,7 @@ from typing import Iterable, Optional
3
3
  from .mock import DictatureTableMock, DictatureBackendMock, Value, ValueMode, ValueSerializer, ValueSerializerMode
4
4
 
5
5
  try:
6
- from pymisp import PyMISP, MISPEvent, MISPAttribute
6
+ from pymisp import PyMISP, MISPEvent, MISPAttribute, MISPTag
7
7
  except ImportError as e:
8
8
  raise ImportError("Please install the 'pymisp' package to use the 'DictatureBackendMISP' backend.") from e
9
9
 
@@ -92,6 +92,15 @@ class DictatureTableMISP(DictatureTableMock):
92
92
  self.__event = event
93
93
  break
94
94
  else:
95
+ # Check if tag exists, create if not
96
+ existing_tags = self.__misp.search_tags(self.__tag, strict_tagname=True, pythonify=True)
97
+ if not type(existing_tags) is list or not existing_tags:
98
+ tag = MISPTag()
99
+ tag.name = self.__tag
100
+ tag.colour = '#000000'
101
+ tag.exportable = True
102
+ self.__misp.add_tag(tag)
103
+
95
104
  event = MISPEvent()
96
105
  event.info = self.__event_description
97
106
  event.distribution = 0
@@ -74,7 +74,7 @@ class ValueSerializer:
74
74
  if self.__mode == ValueSerializerMode.hex_only:
75
75
  allowed_chars = hexdigits
76
76
  elif self.__mode == ValueSerializerMode.filename_only:
77
- allowed_chars = ascii_letters + digits + '_.'
77
+ allowed_chars = ascii_letters + digits + '-_.'
78
78
  elif self.__mode in (ValueSerializerMode.any_string, ValueSerializerMode.ascii_only):
79
79
  allowed_chars = None
80
80
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dictature
3
- Version: 0.10.0
3
+ Version: 0.10.1
4
4
  Summary: dictature -- A generic wrapper around dict-like interface with mulitple backends
5
5
  Author-email: Adam Hlavacek <git@adamhlavacek.com>
6
6
  Project-URL: Homepage, https://github.com/esoadamo/dictature
File without changes
File without changes
File without changes