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

Added MongoDB StorageInterface implementation #27

Merged
merged 10 commits into from
Mar 29, 2024

Conversation

fgibertoni
Copy link
Contributor

Added implementation of MongoDB storage interface and its tests.
The new interface is not used by default but has an optional dependency that can be installed with pip install cscapi[mongodb].

The get_signals method has been hard to implement with MongoDB, so if you see any improvements that can be done I will gladly accept them :)

@fgibertoni fgibertoni changed the title MongoDB storage Added MongoDB StorageInterface implementation Mar 26, 2024
Copy link
Collaborator

@julienloizelet julienloizelet left a comment

Choose a reason for hiding this comment

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

Thanks for this PR.

def __init__(self, connection_string="mongodb://127.0.0.1:27017/cscapi"):
try:
connect(
host="mongodb://127.0.0.1:27017/cscapi",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here, I will modify with host=connection_string.

Copy link
Collaborator

@julienloizelet julienloizelet left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for this !

After merge, I will just try to add some github action tests for this mongo implementation and probably will modify slightly unit test to use some env connection_string.

Then, I will publish a new release.

@julienloizelet julienloizelet merged commit dcf2219 into crowdsecurity:main Mar 29, 2024
12 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants