aws / chalice

Python Serverless Microframework for AWS
Apache License 2.0
10.6k stars 1.01k forks source link

Add ability to test client cert configuration in the TestHttpClient #1614

Open marklester opened 3 years ago

marklester commented 3 years ago

I would like to test some endpoints using client certifications. It looks like api gateway supports it

https://aws.amazon.com/blogs/compute/introducing-mutual-tls-authentication-for-amazon-api-gateway/

maybe do it the way requests does it: https://stackoverflow.com/a/17604076 where you you can pass in a cert tuple to https://github.com/aws/chalice/blob/master/chalice/test.py#L109

and then the info gets added to the lamba event?

jamesls commented 3 years ago

Seems reasonable, sounds like we just need to add those two things you mentioned. Out of curiosity how would you use the info in the lambda event?

marklester commented 3 years ago

The project I am working uses the client identity to look up user attributes from a user store. We use that info to see what groups the user is in and to return records that user is allowed to see.