tcex 4.0.11.dev6__tar.gz → 5.0.0__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.
- {tcex-4.0.11.dev6/tcex.egg-info → tcex-5.0.0}/PKG-INFO +4 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/README.md +1 -1
- {tcex-4.0.11.dev6 → tcex-5.0.0}/pyproject.toml +59 -18
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/__init__.py +1 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/__metadata__.py +1 -1
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/api.py +1 -6
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/tc.py +9 -13
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/ti_transform/__init__.py +1 -6
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/ti_transform/model/__init__.py +0 -2
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/ti_transform/model/transform_model.py +59 -81
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/ti_transform/ti_predefined_functions.py +14 -20
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/ti_transform/ti_transform.py +1 -2
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/ti_transform/transform_abc.py +29 -26
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/ti_transform/transform_builder/__init__.py +5 -7
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/ti_transform/transform_builder/v2/errors.py +11 -17
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/ti_transform/transform_builder/v2/load_transform.py +26 -8
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/util/threat_intel_util.py +1 -4
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/__init__.py +0 -1
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/batch/__init__.py +0 -1
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/batch/association.py +0 -1
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/batch/attribute.py +0 -2
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/batch/batch.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/batch/batch_cleaner.py +0 -2
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/batch/batch_submit.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/batch/batch_writer.py +2 -35
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/batch/group.py +0 -2
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/batch/indicator.py +0 -2
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/batch/security_label.py +0 -1
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/batch/tag.py +0 -1
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/datastore/cache.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/datastore/datastore.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/metric/metric.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/notification/notification.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/group/group.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/group/group_type/adversary.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/group/group_type/attack_pattern.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/group/group_type/campaign.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/group/group_type/course_of_action.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/group/group_type/document.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/group/group_type/email.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/group/group_type/event.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/group/group_type/incident.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/group/group_type/intrusion_set.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/group/group_type/malware.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/group/group_type/report.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/group/group_type/signature.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/group/group_type/tactic.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/group/group_type/threat.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/group/group_type/tool.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/group/group_type/vulnerability.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/indicator/indicator.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/indicator/indicator_type/address.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/indicator/indicator_type/email_address.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/indicator/indicator_type/file.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/indicator/indicator_type/host.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/indicator/indicator_type/url.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/mapping.py +0 -4
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/owner.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/security_label.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/tag.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/tags.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/task.py +0 -2
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/victim.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/tcex_ti_tc_request.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/threat_intelligence.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/v2.py +0 -2
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/_gen/_gen.py +12 -8
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/_gen/_gen_abc.py +19 -8
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/_gen/_gen_args_abc.py +5 -6
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/_gen/_gen_filter_abc.py +92 -38
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/_gen/_gen_model_abc.py +131 -124
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/_gen/_gen_object_abc.py +17 -29
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/_gen/_options_abc.py +2 -3
- tcex-5.0.0/tcex/api/tc/v3/_gen/_options_data.py +394 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/_gen/_options_data_filter.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/_gen/_options_data_object.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/_gen/model/__init__.py +0 -1
- tcex-5.0.0/tcex/api/tc/v3/_gen/model/_extra_model.py +31 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/_gen/model/_filter_model.py +12 -15
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/_gen/model/_property_model.py +35 -52
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/api_endpoints.py +5 -6
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/artifact_types/artifact_type.py +0 -2
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/artifact_types/artifact_type_filter.py +0 -2
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/artifact_types/artifact_type_model.py +33 -34
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/artifacts/artifact.py +1 -27
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/artifacts/artifact_filter.py +5 -8
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/artifacts/artifact_model.py +105 -110
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/attribute_types/attribute_type.py +1 -13
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/attribute_types/attribute_type_filter.py +0 -2
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/attribute_types/attribute_type_model.py +36 -37
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/attributes/attribute_model.py +25 -23
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/case_attributes/case_attribute.py +1 -18
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/case_attributes/case_attribute_filter.py +1 -4
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/case_attributes/case_attribute_model.py +56 -59
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/case_management/case_management.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/cases/case.py +1 -41
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/cases/case_filter.py +7 -10
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/cases/case_model.py +161 -170
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/file_actions/file_action_model.py +19 -14
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/file_occurrences/file_occurrence_model.py +10 -13
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/filter_abc.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/group_attributes/group_attribute.py +1 -18
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/group_attributes/group_attribute_filter.py +2 -5
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/group_attributes/group_attribute_model.py +57 -65
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/groups/group.py +4 -66
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/groups/group_filter.py +10 -13
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/groups/group_model.py +244 -261
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/indicator_attributes/indicator_attribute.py +1 -18
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/indicator_attributes/indicator_attribute_filter.py +2 -5
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/indicator_attributes/indicator_attribute_model.py +57 -65
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/indicators/indicator.py +1 -68
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/indicators/indicator_filter.py +10 -13
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/indicators/indicator_model.py +255 -260
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/intel_requirement/ir.py +0 -2
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/intel_requirements/categories/category.py +1 -8
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/intel_requirements/categories/category_filter.py +0 -2
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/intel_requirements/categories/category_model.py +23 -24
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/intel_requirements/intel_req_type_model.py +6 -9
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/intel_requirements/intel_requirement.py +3 -35
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/intel_requirements/intel_requirement_filter.py +7 -10
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/intel_requirements/intel_requirement_model.py +108 -111
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/intel_requirements/keyword_sections/keyword_section_model.py +7 -12
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/intel_requirements/results/result.py +1 -9
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/intel_requirements/results/result_filter.py +1 -4
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/intel_requirements/results/result_model.py +66 -68
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/intel_requirements/subtypes/subtype.py +1 -8
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/intel_requirements/subtypes/subtype_filter.py +0 -2
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/intel_requirements/subtypes/subtype_model.py +23 -24
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/notes/note.py +1 -13
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/notes/note_filter.py +3 -6
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/notes/note_model.py +70 -80
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/object_abc.py +3 -5
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/object_collection_abc.py +3 -3
- tcex-5.0.0/tcex/api/tc/v3/security/assignee_model.py +66 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/security/assignee_user_group_model.py +2 -5
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/security/assignee_user_model.py +4 -5
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/security/exclusion_lists/exclusion_list.py +1 -13
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/security/exclusion_lists/exclusion_list_filter.py +0 -2
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/security/exclusion_lists/exclusion_list_model.py +43 -44
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/security/owner_roles/owner_role.py +0 -2
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/security/owner_roles/owner_role_filter.py +0 -2
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/security/owner_roles/owner_role_model.py +44 -45
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/security/owners/owner.py +0 -2
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/security/owners/owner_filter.py +0 -2
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/security/owners/owner_model.py +95 -96
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/security/security.py +8 -10
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/security/system_roles/system_role.py +0 -2
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/security/system_roles/system_role_filter.py +0 -2
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/security/system_roles/system_role_model.py +32 -33
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/security/task_assignee_model.py +19 -18
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/security/user_groups/user_group.py +0 -2
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/security/user_groups/user_group_filter.py +0 -2
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/security/user_groups/user_group_model.py +28 -30
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/security/users/user.py +0 -2
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/security/users/user_filter.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/security/users/user_model.py +20 -21
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/security_labels/security_label.py +1 -10
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/security_labels/security_label_filter.py +3 -6
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/security_labels/security_label_model.py +32 -34
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/tags/mitre_tags.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/tags/naics_tags.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/tags/tag.py +1 -13
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/tags/tag_filter.py +4 -7
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/tags/tag_model.py +67 -75
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/tasks/task.py +1 -25
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/tasks/task_filter.py +3 -6
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/tasks/task_model.py +88 -98
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/threat_intelligence/threat_intelligence.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/tql/tql.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/tql/tql_operator.py +0 -1
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/tql/tql_type.py +0 -1
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/v3.py +0 -1
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/v3_model_abc.py +14 -17
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/v3_types.py +0 -2
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/victim_assets/victim_asset.py +1 -19
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/victim_assets/victim_asset_filter.py +3 -5
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/victim_assets/victim_asset_model.py +72 -68
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/victim_attributes/victim_attribute.py +1 -18
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/victim_attributes/victim_attribute_filter.py +2 -5
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/victim_attributes/victim_attribute_model.py +56 -59
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/victims/victim.py +1 -25
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/victims/victim_filter.py +7 -9
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/victims/victim_model.py +66 -74
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/workflow_events/workflow_event.py +1 -15
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/workflow_events/workflow_event_filter.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/workflow_events/workflow_event_model.py +60 -70
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/workflow_templates/workflow_template.py +1 -10
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/workflow_templates/workflow_template_filter.py +0 -2
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/workflow_templates/workflow_template_model.py +54 -61
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/app.py +0 -6
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/config/app_spec_yml.py +25 -8
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/config/install_json.py +36 -4
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/config/install_json_update.py +0 -2
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/config/install_json_validate.py +0 -1
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/config/job_json.py +0 -1
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/config/layout_json.py +20 -7
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/config/model/app_spec_yml_model.py +51 -79
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/config/model/install_json_model.py +75 -106
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/config/model/job_json_model.py +19 -37
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/config/model/layout_json_model.py +15 -38
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/config/model/tcex_json_model.py +9 -22
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/config/permutation.py +2 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/config/tcex_json.py +17 -2
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/config/tcex_json_update.py +1 -2
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/decorator/__init__.py +0 -1
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/decorator/benchmark.py +6 -7
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/decorator/debug.py +1 -5
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/decorator/fail_on_output.py +1 -5
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/decorator/on_exception.py +1 -5
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/decorator/on_success.py +1 -4
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/decorator/output.py +1 -4
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/playbook/advanced_request.py +4 -1
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/playbook/playbook_create.py +4 -5
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/service/__init__.py +0 -1
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/service/api_service.py +1 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/service/common_service.py +54 -18
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/service/common_service_trigger.py +4 -6
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/service/mqtt_message_broker.py +12 -11
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/service/webhook_trigger_service.py +3 -6
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/token/token.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/exit/__init__.py +0 -1
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/exit/error_code.py +0 -2
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/exit/exit.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/field_type/__init__.py +0 -1
- tcex-5.0.0/tcex/input/field_type/binary.py +84 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/field_type/case_management_entity.py +10 -11
- tcex-5.0.0/tcex/input/field_type/choice.py +78 -0
- tcex-5.0.0/tcex/input/field_type/datetime.py +34 -0
- tcex-5.0.0/tcex/input/field_type/edit_choice.py +417 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/field_type/exception.py +2 -2
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/field_type/group_entity.py +10 -11
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/field_type/indicator_entity.py +10 -11
- tcex-5.0.0/tcex/input/field_type/integer.py +69 -0
- tcex-5.0.0/tcex/input/field_type/ip_address.py +75 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/field_type/key_value.py +12 -30
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/field_type/sensitive.py +59 -65
- tcex-5.0.0/tcex/input/field_type/string.py +92 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/field_type/tc_entity.py +8 -14
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/field_type/validator.py +42 -37
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/input.py +10 -22
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/model/advanced_request_model.py +35 -22
- tcex-5.0.0/tcex/input/model/api_model.py +104 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/model/app_api_service_model.py +0 -1
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/model/app_external_model.py +0 -1
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/model/app_feed_api_service_model.py +0 -1
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/model/app_organization_model.py +0 -1
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/model/app_playbook_model.py +0 -1
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/model/app_system_model.py +0 -1
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/model/app_trigger_service_model.py +0 -1
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/model/app_webhook_trigger_service_model.py +0 -1
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/model/batch_model.py +29 -18
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/model/cal_setting_model.py +13 -6
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/model/cert_model.py +10 -11
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/model/common_advanced_model.py +0 -1
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/model/common_model.py +0 -1
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/model/create_config_model.py +4 -10
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/model/logging_model.py +18 -13
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/model/model_map.py +0 -1
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/model/module_app_model.py +2 -7
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/model/module_requests_session_model.py +2 -7
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/model/organization_model.py +2 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/model/path_model.py +9 -11
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/model/playbook_common_model.py +15 -12
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/model/playbook_model.py +7 -8
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/model/proxy_model.py +12 -9
- tcex-5.0.0/tcex/input/model/service_model.py +71 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/model/smtp_setting_model.py +16 -13
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/logger/api_handler.py +1 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/logger/cache_handler.py +0 -1
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/logger/logger.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/logger/rotating_file_handler_custom.py +0 -1
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/logger/sensitive_filter.py +0 -1
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/logger/trace_logger.py +0 -1
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/registry.py +5 -4
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/requests_external/__init__.py +0 -1
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/requests_external/external_session.py +4 -10
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/requests_external/rate_limit_handler.py +0 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/requests_external/requests_external.py +0 -2
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/tcex.py +0 -2
- {tcex-4.0.11.dev6 → tcex-5.0.0/tcex.egg-info}/PKG-INFO +4 -3
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex.egg-info/SOURCES.txt +2 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex.egg-info/requires.txt +2 -1
- tcex-4.0.11.dev6/tcex/api/tc/v3/security/assignee_model.py +0 -53
- tcex-4.0.11.dev6/tcex/input/field_type/binary.py +0 -85
- tcex-4.0.11.dev6/tcex/input/field_type/choice.py +0 -48
- tcex-4.0.11.dev6/tcex/input/field_type/datetime.py +0 -30
- tcex-4.0.11.dev6/tcex/input/field_type/edit_choice.py +0 -112
- tcex-4.0.11.dev6/tcex/input/field_type/integer.py +0 -92
- tcex-4.0.11.dev6/tcex/input/field_type/ip_address.py +0 -60
- tcex-4.0.11.dev6/tcex/input/field_type/string.py +0 -103
- tcex-4.0.11.dev6/tcex/input/model/api_model.py +0 -92
- tcex-4.0.11.dev6/tcex/input/model/service_model.py +0 -71
- {tcex-4.0.11.dev6 → tcex-5.0.0}/LICENSE +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/setup.cfg +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/ti_transform/transform_builder/v2/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/util/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/datastore/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/metric/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/notification/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/filters.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/group/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/group/group_type/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/indicator/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v2/threat_intelligence/mapping/indicator/indicator_type/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/_gen/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/adversary_assets/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/artifact_types/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/artifacts/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/attribute_types/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/attributes/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/case_attributes/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/case_management/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/cases/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/file_actions/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/file_occurrences/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/group_attributes/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/groups/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/indicator_attributes/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/indicators/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/intel_requirement/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/intel_requirements/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/intel_requirements/categories/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/intel_requirements/keyword_sections/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/intel_requirements/results/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/intel_requirements/subtypes/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/notes/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/security/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/security/exclusion_lists/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/security/owner_roles/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/security/owners/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/security/system_roles/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/security/user_groups/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/security/users/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/security_labels/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/tags/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/tags/default_naics_tags.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/tasks/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/threat_intelligence/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/tql/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/victim_assets/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/victim_attributes/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/victims/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/workflow_events/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/api/tc/v3/workflow_templates/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/config/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/config/model/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/key_value_store/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/key_value_store/key_value_abc.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/key_value_store/key_value_api.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/key_value_store/key_value_mock.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/key_value_store/key_value_redis.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/key_value_store/key_value_store.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/key_value_store/redis_client.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/key_value_store/redis_client_ssl.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/playbook/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/playbook/playbook.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/playbook/playbook_delete.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/playbook/playbook_output.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/playbook/playbook_read.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/app/token/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/input/model/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/logger/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/pleb/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/pleb/cached_property.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/pleb/cached_property_filesystem.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/pleb/event.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/pleb/exception_thread.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/pleb/jmespath_custom.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/pleb/jmespath_functions_array_mixin.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/pleb/jmespath_functions_base.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/pleb/jmespath_functions_control_mixin.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/pleb/jmespath_functions_crypto_mixin.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/pleb/jmespath_functions_datetime_mixin.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/pleb/jmespath_functions_math_mixin.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/pleb/jmespath_functions_object_mixin.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/pleb/jmespath_functions_string_mixin.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/pleb/none_model.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/pleb/proxies.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/pleb/scoped_property.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/pleb/singleton.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/requests_tc/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/requests_tc/auth/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/requests_tc/auth/hmac_auth.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/requests_tc/auth/tc_auth.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/requests_tc/auth/token_auth.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/requests_tc/requests_tc.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/requests_tc/tc_session.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/util/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/util/aes_operation.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/util/code_operation.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/util/datetime_operation.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/util/file_operation.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/util/model/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/util/model/playbook_variable_model.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/util/render/__init__.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/util/render/render.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/util/render/render_panel.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/util/render/render_prompt.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/util/render/render_table.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/util/requests_to_curl.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/util/string_operation.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/util/util.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex/util/variable.py +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex.egg-info/dependency_links.txt +0 -0
- {tcex-4.0.11.dev6 → tcex-5.0.0}/tcex.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tcex
|
|
3
|
-
Version:
|
|
3
|
+
Version: 5.0.0
|
|
4
4
|
Summary: ThreatConnect Exchange App Framework
|
|
5
5
|
Author-email: ThreatConnect <support@threatconnect.com>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -27,7 +27,8 @@ Requires-Dist: isort~=8.0.1
|
|
|
27
27
|
Requires-Dist: jmespath~=1.1.0
|
|
28
28
|
Requires-Dist: paho-mqtt~=2.1.0
|
|
29
29
|
Requires-Dist: pyaes~=1.6.1
|
|
30
|
-
Requires-Dist: pydantic
|
|
30
|
+
Requires-Dist: pydantic-core<3.0.0,>=2.10.0
|
|
31
|
+
Requires-Dist: pydantic<3.0.0,>=2.10.0
|
|
31
32
|
Requires-Dist: python-dateutil~=2.9.0.post0
|
|
32
33
|
Requires-Dist: pyyaml~=6.0.3
|
|
33
34
|
Requires-Dist: redis~=8.0.0
|
|
@@ -63,9 +64,9 @@ The ThreatConnect™ TcEx App Framework provides functionality for writing T
|
|
|
63
64
|
|
|
64
65
|
* bandit (https://pypi.org/project/bandit/)
|
|
65
66
|
* pre-commit (https://pypi.org/project/pre-commit/)
|
|
66
|
-
* pyright (https://pypi.org/project/pyright/)
|
|
67
67
|
* pyupgrade (https://pypi.org/project/pyupgrade/)
|
|
68
68
|
* ruff (https://pypi.org/project/ruff/)
|
|
69
|
+
* ty (https://pypi.org/project/ty/)
|
|
69
70
|
* typer (https://pypi.python.org/pypi/typer/)
|
|
70
71
|
|
|
71
72
|
### Test Requirements
|
|
@@ -24,9 +24,9 @@ The ThreatConnect™ TcEx App Framework provides functionality for writing T
|
|
|
24
24
|
|
|
25
25
|
* bandit (https://pypi.org/project/bandit/)
|
|
26
26
|
* pre-commit (https://pypi.org/project/pre-commit/)
|
|
27
|
-
* pyright (https://pypi.org/project/pyright/)
|
|
28
27
|
* pyupgrade (https://pypi.org/project/pyupgrade/)
|
|
29
28
|
* ruff (https://pypi.org/project/ruff/)
|
|
29
|
+
* ty (https://pypi.org/project/ty/)
|
|
30
30
|
* typer (https://pypi.python.org/pypi/typer/)
|
|
31
31
|
|
|
32
32
|
### Test Requirements
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Specify the build backend for PEP 517 builds
|
|
2
2
|
[build-system]
|
|
3
3
|
build-backend = "setuptools.build_meta"
|
|
4
|
-
requires = ["setuptools>=61"]
|
|
4
|
+
requires = ["requests", "setuptools>=61"]
|
|
5
5
|
|
|
6
6
|
# Project metadata and configuration
|
|
7
7
|
[project]
|
|
@@ -31,7 +31,8 @@ dependencies = [
|
|
|
31
31
|
"jmespath~=1.1.0",
|
|
32
32
|
"paho-mqtt~=2.1.0",
|
|
33
33
|
"pyaes~=1.6.1",
|
|
34
|
-
"pydantic
|
|
34
|
+
"pydantic-core>=2.10.0,<3.0.0",
|
|
35
|
+
"pydantic>=2.10.0,<3.0.0",
|
|
35
36
|
"python-dateutil~=2.9.0.post0",
|
|
36
37
|
"pyyaml~=6.0.3",
|
|
37
38
|
"redis~=8.0.0",
|
|
@@ -73,9 +74,10 @@ dev = [
|
|
|
73
74
|
"pre-commit>=4.6.0",
|
|
74
75
|
"pyupgrade>=3.21.2",
|
|
75
76
|
"ruff>=0.15.16",
|
|
76
|
-
"ty
|
|
77
|
+
"ty==0.0.51",
|
|
77
78
|
"typer>=0.26.7",
|
|
78
79
|
]
|
|
80
|
+
|
|
79
81
|
test = [
|
|
80
82
|
"deepdiff>=9.1.0",
|
|
81
83
|
"fakeredis>=2.36.0",
|
|
@@ -84,6 +86,7 @@ test = [
|
|
|
84
86
|
"pytest-html>=4.2.0",
|
|
85
87
|
"pytest-ordering>=0.6",
|
|
86
88
|
"pytest-xdist>=3.8.0",
|
|
89
|
+
"python-dotenv>=1.2.1",
|
|
87
90
|
]
|
|
88
91
|
|
|
89
92
|
# Dynamic configuration for setuptools
|
|
@@ -99,6 +102,24 @@ exclude = ["tests*", "local-*"]
|
|
|
99
102
|
# Tool configurations
|
|
100
103
|
#
|
|
101
104
|
|
|
105
|
+
[tool.uv.extra-build-dependencies]
|
|
106
|
+
tcex = [
|
|
107
|
+
"arrow>=1.3.0",
|
|
108
|
+
"black>=25.1.0",
|
|
109
|
+
"inflection>=0.5.1",
|
|
110
|
+
"jmespath>=1.0.1",
|
|
111
|
+
"paho-mqtt<2.0.0",
|
|
112
|
+
"pyaes>=1.6.1",
|
|
113
|
+
"pydantic>2.0.0",
|
|
114
|
+
"python-dateutil>=2.9.0.post0",
|
|
115
|
+
"pyyaml>=6.0.2",
|
|
116
|
+
"redis<5.0.0",
|
|
117
|
+
"requests>=2.32.3",
|
|
118
|
+
"rich>=13.9.4",
|
|
119
|
+
"semantic-version>=2.10.0",
|
|
120
|
+
"wrapt>=1.17.2",
|
|
121
|
+
]
|
|
122
|
+
|
|
102
123
|
# Configuration for bumpversion tool
|
|
103
124
|
[tool.bumpversion]
|
|
104
125
|
# Allow version bumping even if there are uncommitted changes
|
|
@@ -108,7 +129,7 @@ commit = false
|
|
|
108
129
|
# Additional arguments to pass to the git commit command
|
|
109
130
|
commit_args = "--no-verify"
|
|
110
131
|
# The current version of the project
|
|
111
|
-
current_version = "
|
|
132
|
+
current_version = "5.0.0"
|
|
112
133
|
# The commit message template used when committing version bumps
|
|
113
134
|
message = "Version updated from {current_version} to {new_version}"
|
|
114
135
|
# Regular expression for parsing version strings
|
|
@@ -149,19 +170,6 @@ filename = "tcex/__metadata__.py"
|
|
|
149
170
|
ignore-words-list = "ore"
|
|
150
171
|
skip = "*.cspell*,*.history,*local,uv.lock,*enforce_us_spelling.sh"
|
|
151
172
|
|
|
152
|
-
# Configuration for isort import sorter
|
|
153
|
-
[tool.isort]
|
|
154
|
-
dedup_headings = false
|
|
155
|
-
import_heading_firstparty = "first-party"
|
|
156
|
-
import_heading_stdlib = "standard library"
|
|
157
|
-
import_heading_thirdparty = "third-party"
|
|
158
|
-
include_trailing_comma = true
|
|
159
|
-
known_first_party = ""
|
|
160
|
-
known_local_folder = "."
|
|
161
|
-
known_third_party = ""
|
|
162
|
-
line_length = 100
|
|
163
|
-
profile = "black"
|
|
164
|
-
|
|
165
173
|
# Configuration for ty type checker
|
|
166
174
|
# https://docs.astral.sh/ty/reference/configuration/
|
|
167
175
|
[tool.ty.environment]
|
|
@@ -185,6 +193,8 @@ junit_family = "xunit2"
|
|
|
185
193
|
testpaths = [
|
|
186
194
|
"tests",
|
|
187
195
|
]
|
|
196
|
+
# Enable multiprocessing support for pytest
|
|
197
|
+
# addopts = "--numprocesses=auto --dist=loadgroup"
|
|
188
198
|
|
|
189
199
|
# Configuration for ruff linter and formatter
|
|
190
200
|
[tool.ruff]
|
|
@@ -197,6 +207,8 @@ exclude = [
|
|
|
197
207
|
line-length = 100
|
|
198
208
|
# set the python target
|
|
199
209
|
target-version = "py311"
|
|
210
|
+
# define a default section for any imports that don't fit into the specified section-order.
|
|
211
|
+
src = ["tcex"]
|
|
200
212
|
|
|
201
213
|
# Configuration for ruff formatter
|
|
202
214
|
[tool.ruff.format]
|
|
@@ -240,7 +252,7 @@ ignore = [
|
|
|
240
252
|
"PLR0915", # Too many statements
|
|
241
253
|
"PT006", # Wrong name(s) type in ..., expected ...
|
|
242
254
|
"TC001", # Move application import ... into a type-checking block
|
|
243
|
-
"TC003", #
|
|
255
|
+
"TC003", # Move standard library import ... into a type-checking block
|
|
244
256
|
"TC006", # Checks for unquoted type expressions in typing.cast() calls.
|
|
245
257
|
"TID252", # Prefer absolute imports over relative imports from parent modules
|
|
246
258
|
]
|
|
@@ -306,8 +318,37 @@ select = [
|
|
|
306
318
|
[tool.ruff.lint.extend-per-file-ignores]
|
|
307
319
|
"__init__.py" = ["F401"]
|
|
308
320
|
|
|
321
|
+
[tool.ruff.lint.isort]
|
|
322
|
+
# Define a default section for any imports that don't fit into the specified section-order.
|
|
323
|
+
default-section = "first-party"
|
|
324
|
+
|
|
325
|
+
# Map known_local_folder to known-local-folder
|
|
326
|
+
known-local-folder = ["tcex"]
|
|
327
|
+
|
|
328
|
+
# Override in which order the sections should be output. Can be used to move custom sections.
|
|
329
|
+
section-order = ["future", "standard-library", "third-party", "first-party", "local-folder"]
|
|
330
|
+
|
|
331
|
+
# Equivalent to include_trailing_comma = true
|
|
332
|
+
split-on-trailing-comma = true
|
|
333
|
+
|
|
309
334
|
# Pydocstyle configuration for ruff linter
|
|
310
335
|
[tool.ruff.lint.pydocstyle]
|
|
311
336
|
# https://docs.astral.sh/ruff/linter/
|
|
312
337
|
|
|
313
338
|
convention = "google"
|
|
339
|
+
|
|
340
|
+
# [tool.cibuildwheel]
|
|
341
|
+
# # You can also put cibuildwheel config here instead of env vars
|
|
342
|
+
# build = "cp38-* cp39-* cp310-* cp311-* cp312-*"
|
|
343
|
+
# skip = "*-win32 *-manylinux_i686 *-musllinux_i686 pp*"
|
|
344
|
+
#
|
|
345
|
+
# [tool.cibuildwheel.linux]
|
|
346
|
+
# before-build = "pip install -U pip setuptools wheel"
|
|
347
|
+
# repair-wheel-command = "auditwheel repair -w {dest_dir} {wheel}"
|
|
348
|
+
#
|
|
349
|
+
# [tool.cibuildwheel.macos]
|
|
350
|
+
# before-build = "pip install -U pip setuptools wheel"
|
|
351
|
+
# repair-wheel-command = "delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}"
|
|
352
|
+
#
|
|
353
|
+
# [tool.cibuildwheel.windows]
|
|
354
|
+
# before-build = "pip install -U pip setuptools wheel"
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"""TcEx Framework Module"""
|
|
2
2
|
|
|
3
|
-
# standard library
|
|
4
3
|
import contextlib
|
|
5
4
|
import logging
|
|
6
5
|
|
|
7
|
-
# first-party
|
|
8
6
|
from tcex.__metadata__ import __license__, __version__
|
|
9
7
|
from tcex.logger.cache_handler import CacheHandler
|
|
10
8
|
from tcex.logger.trace_logger import TraceLogger
|
|
@@ -33,6 +31,6 @@ def initialize_logger():
|
|
|
33
31
|
# init logger before instantiating tcex
|
|
34
32
|
initialize_logger()
|
|
35
33
|
|
|
34
|
+
|
|
36
35
|
with contextlib.suppress(ImportError):
|
|
37
|
-
# first-party
|
|
38
36
|
from tcex.tcex import TcEx
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"""TcEx Framework Module"""
|
|
2
2
|
|
|
3
|
-
# third-party
|
|
4
3
|
from requests import Session # TYPE-CHECKING
|
|
5
4
|
|
|
6
|
-
# first-party
|
|
7
5
|
from tcex.api.tc.tc import TC
|
|
8
6
|
from tcex.input.input import Input # TYPE-CHECKING
|
|
9
7
|
from tcex.pleb.cached_property import cached_property
|
|
@@ -24,8 +22,5 @@ class API:
|
|
|
24
22
|
|
|
25
23
|
@cached_property
|
|
26
24
|
def tc(self) -> TC:
|
|
27
|
-
"""Return a
|
|
28
|
-
|
|
29
|
-
TC is a top-level class for accessing the ThreatConnect API.
|
|
30
|
-
"""
|
|
25
|
+
"""Return a case management instance."""
|
|
31
26
|
return TC(self.inputs, self.session_tc)
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
"""TcEx Framework Module"""
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
from requests import Session # TYPE-CHECKING
|
|
3
|
+
from requests import Session
|
|
5
4
|
|
|
6
|
-
# first-party
|
|
7
5
|
from tcex.api.tc.ti_transform import TiTransform, TiTransforms
|
|
8
|
-
from tcex.api.tc.ti_transform.model import
|
|
9
|
-
|
|
10
|
-
GroupTransformModel,
|
|
11
|
-
IndicatorTransformModel,
|
|
12
|
-
)
|
|
6
|
+
from tcex.api.tc.ti_transform.model import GroupTransformModel, IndicatorTransformModel
|
|
7
|
+
from tcex.api.tc.ti_transform.model.transform_model import AssociationTransformModel
|
|
13
8
|
from tcex.api.tc.util.threat_intel_util import ThreatIntelUtil
|
|
14
9
|
from tcex.api.tc.v2.v2 import V2
|
|
15
10
|
from tcex.api.tc.v3.v3 import V3
|
|
@@ -30,6 +25,11 @@ class TC:
|
|
|
30
25
|
self.inputs = inputs
|
|
31
26
|
self.session_tc = session_tc
|
|
32
27
|
|
|
28
|
+
@staticmethod
|
|
29
|
+
def association_transform(transform: dict) -> AssociationTransformModel:
|
|
30
|
+
"""Return a association transform model."""
|
|
31
|
+
return AssociationTransformModel(**transform)
|
|
32
|
+
|
|
33
33
|
@staticmethod
|
|
34
34
|
def group_transform(transform: dict) -> GroupTransformModel:
|
|
35
35
|
"""Return a group transform model."""
|
|
@@ -52,13 +52,9 @@ class TC:
|
|
|
52
52
|
def ti_transforms(
|
|
53
53
|
ti_dict: list[dict],
|
|
54
54
|
transforms: list[AssociationTransformModel | GroupTransformModel | IndicatorTransformModel],
|
|
55
|
-
*,
|
|
56
|
-
separate_batch_associations: bool = False,
|
|
57
55
|
) -> TiTransforms:
|
|
58
56
|
"""Return an instance of TI Transforms class."""
|
|
59
|
-
return TiTransforms(
|
|
60
|
-
ti_dict, transforms, separate_batch_associations=separate_batch_associations
|
|
61
|
-
)
|
|
57
|
+
return TiTransforms(ti_dict, transforms)
|
|
62
58
|
|
|
63
59
|
@cached_property
|
|
64
60
|
def utils(self) -> ThreatIntelUtil:
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
"""TcEx Framework Module"""
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
from tcex.api.tc.ti_transform.ti_predefined_functions import (
|
|
5
|
-
ProcessingFunctions,
|
|
6
|
-
transform_builder_to_model,
|
|
7
|
-
)
|
|
3
|
+
from tcex.api.tc.ti_transform.ti_predefined_functions import ProcessingFunctions
|
|
8
4
|
from tcex.api.tc.ti_transform.ti_transform import TiTransform, TiTransforms
|
|
9
5
|
from tcex.api.tc.ti_transform.transform_abc import TransformException
|
|
10
6
|
|
|
@@ -13,5 +9,4 @@ __all__ = [
|
|
|
13
9
|
'TiTransform',
|
|
14
10
|
'TiTransforms',
|
|
15
11
|
'TransformException',
|
|
16
|
-
'transform_builder_to_model',
|
|
17
12
|
]
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"""Model Definition"""
|
|
2
2
|
|
|
3
|
-
# standard library
|
|
4
3
|
from collections.abc import Callable
|
|
4
|
+
from typing import Annotated, Any, TypeAlias
|
|
5
5
|
|
|
6
|
-
# third-party
|
|
7
6
|
from jmespath import compile as jmespath_compile
|
|
8
|
-
from pydantic import BaseModel,
|
|
7
|
+
from pydantic import BaseModel, Discriminator, Field, Tag, field_validator, model_validator
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
# reusable validator
|
|
@@ -16,14 +15,14 @@ def _always_array(value: list | str) -> list[str]:
|
|
|
16
15
|
return value
|
|
17
16
|
|
|
18
17
|
|
|
19
|
-
class PredefinedFunctionModel(BaseModel, extra=
|
|
18
|
+
class PredefinedFunctionModel(BaseModel, extra='forbid'):
|
|
20
19
|
"""Model Definitions"""
|
|
21
20
|
|
|
22
21
|
name: str = Field(..., description='The name of the static method.')
|
|
23
22
|
params: dict | None = Field({}, description='The parameters for the static method.')
|
|
24
23
|
|
|
25
24
|
|
|
26
|
-
class TransformModel(BaseModel, extra=
|
|
25
|
+
class TransformModel(BaseModel, extra='forbid'):
|
|
27
26
|
"""Model Definition"""
|
|
28
27
|
|
|
29
28
|
filter_map: dict | None = Field(None, description='')
|
|
@@ -32,7 +31,7 @@ class TransformModel(BaseModel, extra=Extra.forbid):
|
|
|
32
31
|
for_each: Callable | PredefinedFunctionModel | None = Field(None, description='')
|
|
33
32
|
static_map: dict | None = Field(None, description='')
|
|
34
33
|
|
|
35
|
-
@
|
|
34
|
+
@field_validator('filter_map', 'static_map', mode='before')
|
|
36
35
|
@classmethod
|
|
37
36
|
def _lower_map_keys(cls, v):
|
|
38
37
|
"""Validate static_map."""
|
|
@@ -41,7 +40,7 @@ class TransformModel(BaseModel, extra=Extra.forbid):
|
|
|
41
40
|
return v
|
|
42
41
|
|
|
43
42
|
# root validator that ensure at least one indicator value/summary is set
|
|
44
|
-
@
|
|
43
|
+
@model_validator(mode='before')
|
|
45
44
|
@classmethod
|
|
46
45
|
def _required_transform(cls, v: dict):
|
|
47
46
|
"""Validate either static_map or method is defined."""
|
|
@@ -58,13 +57,13 @@ class TransformModel(BaseModel, extra=Extra.forbid):
|
|
|
58
57
|
return v
|
|
59
58
|
|
|
60
59
|
|
|
61
|
-
class PathTransformModel(BaseModel, extra=
|
|
60
|
+
class PathTransformModel(BaseModel, extra='forbid'):
|
|
62
61
|
"""."""
|
|
63
62
|
|
|
64
|
-
default: str | None = Field(None, description='')
|
|
63
|
+
default: int | str | None = Field(None, description='')
|
|
65
64
|
path: str | None = Field(None, description='')
|
|
66
65
|
|
|
67
|
-
@
|
|
66
|
+
@field_validator('path')
|
|
68
67
|
@classmethod
|
|
69
68
|
def _validate_path(cls, v):
|
|
70
69
|
"""Validate path."""
|
|
@@ -77,7 +76,7 @@ class PathTransformModel(BaseModel, extra=Extra.forbid):
|
|
|
77
76
|
return v
|
|
78
77
|
|
|
79
78
|
# root validator that ensure at least one indicator value/summary is set
|
|
80
|
-
@
|
|
79
|
+
@model_validator(mode='before')
|
|
81
80
|
@classmethod
|
|
82
81
|
def _default_or_path(cls, values):
|
|
83
82
|
"""Validate either default or path is defined."""
|
|
@@ -87,22 +86,22 @@ class PathTransformModel(BaseModel, extra=Extra.forbid):
|
|
|
87
86
|
return values
|
|
88
87
|
|
|
89
88
|
|
|
90
|
-
class MetadataTransformModel(PathTransformModel, extra=
|
|
89
|
+
class MetadataTransformModel(PathTransformModel, extra='forbid'):
|
|
91
90
|
"""."""
|
|
92
91
|
|
|
93
92
|
transform: list[TransformModel] | None = Field(None, description='')
|
|
94
93
|
|
|
95
94
|
# validators
|
|
96
|
-
_transform_array =
|
|
95
|
+
_transform_array = field_validator('transform', mode='before')(_always_array)
|
|
97
96
|
|
|
98
97
|
|
|
99
|
-
class ValueTransformModel(BaseModel, extra=
|
|
98
|
+
class ValueTransformModel(BaseModel, extra='forbid'):
|
|
100
99
|
"""."""
|
|
101
100
|
|
|
102
101
|
value: str | MetadataTransformModel
|
|
103
102
|
|
|
104
103
|
|
|
105
|
-
class FileOccurrenceTransformModel(BaseModel, extra=
|
|
104
|
+
class FileOccurrenceTransformModel(BaseModel, extra='forbid'):
|
|
106
105
|
"""."""
|
|
107
106
|
|
|
108
107
|
file_name: str | MetadataTransformModel | None = Field(None, description='')
|
|
@@ -110,22 +109,22 @@ class FileOccurrenceTransformModel(BaseModel, extra=Extra.forbid):
|
|
|
110
109
|
date: str | MetadataTransformModel | None = Field(None, description='')
|
|
111
110
|
|
|
112
111
|
|
|
113
|
-
class DatetimeTransformModel(PathTransformModel, extra=
|
|
112
|
+
class DatetimeTransformModel(PathTransformModel, extra='forbid'):
|
|
114
113
|
"""."""
|
|
115
114
|
|
|
116
115
|
|
|
117
|
-
class AssociatedGroupTransform(ValueTransformModel, extra=
|
|
116
|
+
class AssociatedGroupTransform(ValueTransformModel, extra='forbid'):
|
|
118
117
|
"""."""
|
|
119
118
|
|
|
120
119
|
|
|
121
|
-
class AssociatedIndicatorFromGroupTransform(BaseModel, extra=
|
|
120
|
+
class AssociatedIndicatorFromGroupTransform(BaseModel, extra='forbid'):
|
|
122
121
|
"""."""
|
|
123
122
|
|
|
124
123
|
summary: str | MetadataTransformModel = Field(..., description='')
|
|
125
124
|
indicator_type: str | MetadataTransformModel = Field(..., description='')
|
|
126
125
|
|
|
127
126
|
|
|
128
|
-
class AssociatedIndicatorFromIndicatorTransform(BaseModel, extra=
|
|
127
|
+
class AssociatedIndicatorFromIndicatorTransform(BaseModel, extra='forbid'):
|
|
129
128
|
"""."""
|
|
130
129
|
|
|
131
130
|
summary: str | MetadataTransformModel = Field(..., description='')
|
|
@@ -133,7 +132,7 @@ class AssociatedIndicatorFromIndicatorTransform(BaseModel, extra=Extra.forbid):
|
|
|
133
132
|
association_type: str | MetadataTransformModel = Field(..., description='')
|
|
134
133
|
|
|
135
134
|
|
|
136
|
-
class AttributeTransformModel(ValueTransformModel, extra=
|
|
135
|
+
class AttributeTransformModel(ValueTransformModel, extra='forbid'):
|
|
137
136
|
"""."""
|
|
138
137
|
|
|
139
138
|
displayed: bool | MetadataTransformModel = Field(default=False, description='')
|
|
@@ -142,18 +141,18 @@ class AttributeTransformModel(ValueTransformModel, extra=Extra.forbid):
|
|
|
142
141
|
pinned: bool | MetadataTransformModel = Field(default=False, description='')
|
|
143
142
|
|
|
144
143
|
|
|
145
|
-
class SecurityLabelTransformModel(ValueTransformModel, extra=
|
|
144
|
+
class SecurityLabelTransformModel(ValueTransformModel, extra='forbid'):
|
|
146
145
|
"""."""
|
|
147
146
|
|
|
148
147
|
color: MetadataTransformModel | None = Field(None, description='')
|
|
149
148
|
description: MetadataTransformModel | None = Field(None, description='')
|
|
150
149
|
|
|
151
150
|
|
|
152
|
-
class TagTransformModel(ValueTransformModel, extra=
|
|
151
|
+
class TagTransformModel(ValueTransformModel, extra='forbid'):
|
|
153
152
|
"""."""
|
|
154
153
|
|
|
155
154
|
|
|
156
|
-
class TiTransformModel(BaseModel, extra=
|
|
155
|
+
class TiTransformModel(BaseModel, extra='forbid'):
|
|
157
156
|
"""."""
|
|
158
157
|
|
|
159
158
|
applies: Callable | None = Field(None, description='')
|
|
@@ -172,7 +171,7 @@ class TiTransformModel(BaseModel, extra=Extra.forbid):
|
|
|
172
171
|
xid: MetadataTransformModel | None = Field(None, description='')
|
|
173
172
|
|
|
174
173
|
|
|
175
|
-
class GroupTransformModel(TiTransformModel, extra=
|
|
174
|
+
class GroupTransformModel(TiTransformModel, extra='forbid'):
|
|
176
175
|
"""."""
|
|
177
176
|
|
|
178
177
|
associated_indicators: list[AssociatedIndicatorFromGroupTransform] = Field([], description='')
|
|
@@ -202,7 +201,7 @@ class GroupTransformModel(TiTransformModel, extra=Extra.forbid):
|
|
|
202
201
|
severity: MetadataTransformModel | None = Field(None, description='')
|
|
203
202
|
|
|
204
203
|
|
|
205
|
-
class IndicatorTransformModel(TiTransformModel, extra=
|
|
204
|
+
class IndicatorTransformModel(TiTransformModel, extra='forbid'):
|
|
206
205
|
"""."""
|
|
207
206
|
|
|
208
207
|
associated_indicators: list[AssociatedIndicatorFromIndicatorTransform] = Field(
|
|
@@ -223,10 +222,10 @@ class IndicatorTransformModel(TiTransformModel, extra=Extra.forbid):
|
|
|
223
222
|
active: MetadataTransformModel | None = Field(None, description='')
|
|
224
223
|
|
|
225
224
|
# root validator that ensure at least one indicator value/summary is set
|
|
226
|
-
@
|
|
225
|
+
@model_validator(mode='before')
|
|
227
226
|
@classmethod
|
|
228
227
|
def _one_indicator_value(cls, values):
|
|
229
|
-
"""Validate that one
|
|
228
|
+
"""Validate that at least one indicator value is provided."""
|
|
230
229
|
|
|
231
230
|
if not any(
|
|
232
231
|
[
|
|
@@ -240,14 +239,14 @@ class IndicatorTransformModel(TiTransformModel, extra=Extra.forbid):
|
|
|
240
239
|
return values
|
|
241
240
|
|
|
242
241
|
|
|
243
|
-
class GroupToGroupAssociation(BaseModel, extra=
|
|
242
|
+
class GroupToGroupAssociation(BaseModel, extra='forbid'):
|
|
244
243
|
"""."""
|
|
245
244
|
|
|
246
245
|
xid_1: MetadataTransformModel = Field(..., description='')
|
|
247
246
|
xid_2: MetadataTransformModel = Field(..., description='')
|
|
248
247
|
|
|
249
248
|
|
|
250
|
-
class GroupToIndicatorAssociation(BaseModel, extra=
|
|
249
|
+
class GroupToIndicatorAssociation(BaseModel, extra='forbid'):
|
|
251
250
|
"""."""
|
|
252
251
|
|
|
253
252
|
xid: MetadataTransformModel = Field(..., description='')
|
|
@@ -255,7 +254,7 @@ class GroupToIndicatorAssociation(BaseModel, extra=Extra.forbid):
|
|
|
255
254
|
indicator_type: MetadataTransformModel = Field(..., description='')
|
|
256
255
|
|
|
257
256
|
|
|
258
|
-
class IndicatorToIndicatorAssociation(BaseModel, extra=
|
|
257
|
+
class IndicatorToIndicatorAssociation(BaseModel, extra='forbid'):
|
|
259
258
|
"""."""
|
|
260
259
|
|
|
261
260
|
indicator_value_1: MetadataTransformModel = Field(..., description='')
|
|
@@ -265,58 +264,37 @@ class IndicatorToIndicatorAssociation(BaseModel, extra=Extra.forbid):
|
|
|
265
264
|
custom_association_type: MetadataTransformModel = Field(..., description='')
|
|
266
265
|
|
|
267
266
|
|
|
267
|
+
def get_association_discriminator(v: Any) -> str:
|
|
268
|
+
"""Return the association type discriminator value."""
|
|
269
|
+
if isinstance(v, BaseModel):
|
|
270
|
+
return v.__class__.__name__
|
|
271
|
+
|
|
272
|
+
if 'xid_1' in v and 'xid_2' in v:
|
|
273
|
+
return GroupToGroupAssociation.__name__
|
|
274
|
+
if 'xid' in v and 'indicator_value' in v and 'indicator_type' in v:
|
|
275
|
+
return GroupToIndicatorAssociation.__name__
|
|
276
|
+
if (
|
|
277
|
+
'indicator_value_1' in v
|
|
278
|
+
and 'indicator_type_1' in v
|
|
279
|
+
and 'indicator_value_2' in v
|
|
280
|
+
and 'indicator_type_2' in v
|
|
281
|
+
and 'custom_association_type' in v
|
|
282
|
+
):
|
|
283
|
+
return IndicatorToIndicatorAssociation.__name__
|
|
284
|
+
msg = f'Could not determine association type for {v}.'
|
|
285
|
+
raise ValueError(msg)
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
AssociationTypes: TypeAlias = Annotated[
|
|
289
|
+
Annotated[GroupToGroupAssociation, Tag(GroupToGroupAssociation.__name__)]
|
|
290
|
+
| Annotated[GroupToIndicatorAssociation, Tag(GroupToIndicatorAssociation.__name__)]
|
|
291
|
+
| Annotated[IndicatorToIndicatorAssociation, Tag(IndicatorToIndicatorAssociation.__name__)],
|
|
292
|
+
Discriminator(get_association_discriminator),
|
|
293
|
+
]
|
|
294
|
+
|
|
295
|
+
|
|
268
296
|
class AssociationTransformModel(BaseModel, extra='forbid'):
|
|
269
297
|
"""."""
|
|
270
298
|
|
|
271
299
|
applies: Callable | None = Field(None, description='')
|
|
272
|
-
associations: list[
|
|
273
|
-
GroupToGroupAssociation | GroupToIndicatorAssociation | IndicatorToIndicatorAssociation
|
|
274
|
-
] = Field(default_factory=list, description='')
|
|
275
|
-
|
|
276
|
-
# root validator to handle union of types in associations list
|
|
277
|
-
@root_validator(pre=True)
|
|
278
|
-
@classmethod
|
|
279
|
-
def _one_indicator_value(cls, values):
|
|
280
|
-
"""Validate that one set of credentials is provided for the TC API."""
|
|
281
|
-
association_types = {
|
|
282
|
-
GroupToGroupAssociation,
|
|
283
|
-
GroupToIndicatorAssociation,
|
|
284
|
-
IndicatorToIndicatorAssociation,
|
|
285
|
-
}
|
|
286
|
-
if associations := values.get('associations'):
|
|
287
|
-
validated_associations = []
|
|
288
|
-
for association in associations:
|
|
289
|
-
match association:
|
|
290
|
-
case (
|
|
291
|
-
GroupToGroupAssociation()
|
|
292
|
-
| GroupToIndicatorAssociation()
|
|
293
|
-
| IndicatorToIndicatorAssociation()
|
|
294
|
-
):
|
|
295
|
-
validated_associations.append(association)
|
|
296
|
-
case dict():
|
|
297
|
-
for association_type in association_types:
|
|
298
|
-
try:
|
|
299
|
-
validated_association = association_type(**association)
|
|
300
|
-
validated_associations.append(validated_association)
|
|
301
|
-
break
|
|
302
|
-
except Exception:
|
|
303
|
-
continue # nosec
|
|
304
|
-
else:
|
|
305
|
-
ex_msg = (
|
|
306
|
-
'Association must be one of the following types: '
|
|
307
|
-
f'{association_types}.'
|
|
308
|
-
)
|
|
309
|
-
raise ValueError(ex_msg)
|
|
310
|
-
|
|
311
|
-
case _:
|
|
312
|
-
ex_msg = (
|
|
313
|
-
f'Association must be one of the following types: {association_types}.'
|
|
314
|
-
)
|
|
315
|
-
raise ValueError(ex_msg)
|
|
316
|
-
|
|
317
|
-
values['associations'] = validated_associations
|
|
318
|
-
|
|
319
|
-
else:
|
|
320
|
-
ex_msg = 'At least one association must be defined.'
|
|
321
|
-
raise ValueError(ex_msg)
|
|
322
|
-
return values
|
|
300
|
+
associations: list[AssociationTypes] = Field(default_factory=list, description='')
|