Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Use optional dependencies for different MISP integrations #99

Merged
merged 6 commits into from
Feb 23, 2021

Conversation

0snap
Copy link
Contributor

@0snap 0snap commented Feb 22, 2021

📔 Description

Attributes can either be exported from MISP via ZeroMQ or via Kafka. The MISP plugin supports both, but also used to force the user to have both dependencies installed.

This PR eliminates the need to install both dependencies by using extra dependencies (PEP 508). This breaks how the plugin is installed:

pip install threatbus-misp[zmq]
pip install threatbus-misp[kafka]

A plain pip install threatbus-misp without specifying the extras option works, but the plugin will throw a critical error during config validation and terminate right after.

📝 Checklist

  • All user-facing changes have changelog entries.
  • The changes are reflected on docs.tenzir.com/threatbus, if necessary.
  • The PR description contains instructions for the reviewer, if necessary.

🎯 Review Instructions

Commit-by-commit.

@0snap 0snap added the feature New functionality label Feb 22, 2021
@0snap 0snap marked this pull request as ready for review February 22, 2021 16:58
@0snap
Copy link
Contributor Author

0snap commented Feb 22, 2021

@satta fyi 😉 that should simplify the dependency management!

@satta
Copy link
Contributor

satta commented Feb 22, 2021

That sounds great! 👍

@0snap 0snap requested review from satta and removed request for mavam and tobim February 23, 2021 08:25
@0snap 0snap mentioned this pull request Feb 23, 2021
3 tasks
Copy link
Member

@lava lava left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a lot of context to be able to comment on the contents, but the code looks reasonable.

plugins/apps/threatbus_misp/README.md Outdated Show resolved Hide resolved
@0snap 0snap merged commit c79fafa into master Feb 23, 2021
@0snap 0snap deleted the story/ch23083 branch February 23, 2021 11:08
@satta
Copy link
Contributor

satta commented Feb 23, 2021

Looks good, will test once we upgrade to the latest version everywhere. Not sure how I would test this [] syntax without it being on PyPi.

@0snap
Copy link
Contributor Author

0snap commented Feb 23, 2021

@satta you can simply do pip install .[zmq]
or from git root: pip install plugins/apps/threatbus_misp[zmq]

@satta
Copy link
Contributor

satta commented Feb 24, 2021

Ah thanks! I tried pip install git+https://... but wasn't sure how to pass the feature options there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants