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

fix s3 backend #13

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion awsfindingsmanagerlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"""
from ._version import __version__
from .awsfindingsmanagerlib import FindingsManager, Rule, Finding
from .backends import Http
from .backends import Http, S3

__author__ = '''Marwin Baumann <[email protected]>, Costas Tyfoxylos <[email protected]>'''
__docformat__ = '''google'''
Expand All @@ -46,3 +46,4 @@
assert Finding

assert Http
assert S3
2 changes: 1 addition & 1 deletion awsfindingsmanagerlib/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def __init__(self, bucket_name, file_name):
@staticmethod
def _get_file_contents(bucket_name, file_name):
s3 = boto3.resource('s3')
return s3.Object(s3.Bucket(bucket_name), file_name).get()['Body'].read()
return s3.Object(bucket_name, file_name).get()['Body'].read()

def _get_rules(self):
data = yaml.safe_load(self._file_contents)
Expand Down
Loading