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

stream.delete_all_rules() is broken. #21

Open
wraithsec opened this issue Jan 18, 2022 · 2 comments
Open

stream.delete_all_rules() is broken. #21

wraithsec opened this issue Jan 18, 2022 · 2 comments

Comments

@wraithsec
Copy link
Contributor

Found the issue to be in this line of delete_all_rules():

    def delete_all_rules(self) -> json:
        """Deletes all your rules automatically"""
        try:
--->            rules = self.get_rules().json()
            ids = list(map(lambda rule: rule["id"], rules["data"]))
            return self.delete_rule({"delete": {"ids": ids}})
        except Exception as e:
            pass

No need for .json() as self.get_rules() already returns it as such.

@saadmanrafat
Copy link
Member

Thanks for pointing this out! If you create a pull, create I'll happily test and merge it.

The module needs updating -- some of these have been written when v2 was in its early stages. We are closer to releasing this CLI Tool. I hopefully will announce soon.

@wraithsec
Copy link
Contributor Author

Sure. I'll make PR with this change as well as the one I discussed/highlighted earlier about not being able to add filters to FilteredStream as well (FilteredStream was missing _has_params = True.

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

No branches or pull requests

2 participants