-
Notifications
You must be signed in to change notification settings - Fork 402
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
feat(data-classes): Add S3 Object Lambda Event #353
Conversation
Changes: - Add support for get_header_value - Add docs with example - Add test coverage - Add example userName example event json
Codecov Report
@@ Coverage Diff @@
## develop #353 +/- ##
===========================================
- Coverage 99.88% 99.83% -0.06%
===========================================
Files 95 96 +1
Lines 3529 3635 +106
Branches 173 174 +1
===========================================
+ Hits 3525 3629 +104
- Misses 2 4 +2
Partials 2 2
Continue to review full report at Codecov.
|
@heitorlessa still need to add |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome and so timely - added one major ask and a nitpick
On the readability thing, I need to get my laptop to take a proper look - We can do on Monday (your morning) as part of an experimental office hours I'm all for reusing as long as UX doesn't confuse S3 Object with S3 Object Lambda (naming challenging that will confuse for sure) |
Let’s discuss some ideas on Monday ;)
…On Sat, 20 Mar 2021 at 19:43, Michael Brewer ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In aws_lambda_powertools/utilities/data_classes/s3_event.py
<#353 (comment)>
:
> + @Property
+ def arn(self) -> str:
+ """The ARN of the principal that made the call.
+ The last section of the ARN contains the user or role that made the call."""
+ return self["arn"]
+
+ @Property
+ def session_context(self) -> Optional[Dict[str, Any]]:
+ """ If the request was made with temporary security credentials,
+ this element provides information about the session that was created for those credentials."""
+ return self.get("sessionContext")
+
+
+class S3ObjectEvent(DictWrapper):
+ """S3 object event notification
+
@heitorlessa <https://github.com/heitorlessa> I do have it in the
data_classes.md but I can see how to do it in general for data-classes
package?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#353 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZPQBCHC4F3UY34HBDDMOTTETUFLANCNFSM4ZQRRXMA>
.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is correlation path S3_OBJECT or supposed to be S3_OBJECT_LAMBDA?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
two suggestions to make this feature and docs even more awesome ;)
Co-authored-by: Heitor Lessa <[email protected]>
Co-authored-by: Heitor Lessa <[email protected]>
@heitorlessa quick question why |
The name was to match SDK params
…On Mon, 22 Mar 2021 at 18:07, Michael Brewer ***@***.***> wrote:
@michaelbrewer <https://github.com/michaelbrewer> requested your review
on: #353
<#353>
feat(data-classes): Add S3 Object Lambda Event.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#353 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZPQBDGQ7SMZOEJ6YT5T23TE52L7ANCNFSM4ZQRRXMA>
.
|
That's to match writer get object response params - RequestRoute & RequestToken. When you're writing now you'll instinctively look up the event to find these, and they'll find them now effortlessly to comply with the SDK ;-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the super timely addition ;-)
Will release it this week
Issue #, if available:
Description of changes:
Add data class for Amazon S3 Object Lambda
Example usage based on the AWS Blog Post on S3 Object Lambda
Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.