Skip to content

Commit

Permalink
remove unnecessary validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Akira Noda committed Jan 29, 2024
1 parent e9c7855 commit 15c81f9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
5 changes: 0 additions & 5 deletions moto/s3/notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ def _get_s3_event(
event_name: str, bucket: Any, key: Any, notification_id: str
) -> Dict[str, List[Dict[str, Any]]]:
etag = key.etag.replace('"', "")
if not S3NotificationEvent.is_event_valid(event_name):
raise exceptions.InvalidNotificationEvent(event_name)
# s3:ObjectCreated:Put --> ObjectCreated:Put
event_name = event_name[3:]
event_time = datetime.now().strftime(_EVENT_TIME_FORMAT)
Expand Down Expand Up @@ -103,9 +101,6 @@ def send_event(
if bucket.notification_configuration is None:
return

if not S3NotificationEvent.is_event_valid(event_name):
exceptions.InvalidNotificationEvent(event_name)

for notification in bucket.notification_configuration.cloud_function:
if notification.matches(event_name, key.name):
event_body = _get_s3_event(event_name, bucket, key, notification.id)
Expand Down
5 changes: 0 additions & 5 deletions moto/s3/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
get_canned_acl,
s3_backends,
)
from .notifications import S3NotificationEvent
from .select_object_content import serialize_select
from .utils import (
ARCHIVE_STORAGE_CLASSES,
Expand Down Expand Up @@ -2139,10 +2138,6 @@ def _notification_config_from_body(self) -> Dict[str, Any]:
if not isinstance(n["Event"], list):
n["Event"] = [n["Event"]]

for event in n["Event"]:
if not S3NotificationEvent.is_event_valid(event):
raise InvalidNotificationEvent(event)

# Parse out the filters:
if n.get("Filter"):
# Error if S3Key is blank:
Expand Down

0 comments on commit 15c81f9

Please sign in to comment.