getmoto / moto

A library that allows you to easily mock out tests based on AWS infrastructure.
http://docs.getmoto.org/en/latest/
Apache License 2.0
7.59k stars 2.02k forks source link

Mocking Cloudfront key pair for signing? #8121

Open chrisspen opened 1 week ago

chrisspen commented 1 week ago

I think this might be more of a feature request, but is there any way to mock a Cloudfront key pair, so we can simulate signing URLs for restricted Cloudfront paths? I can't find anything in the documentation.

I've written a unittest that uses moto to successfully mock S3, Dynamo, Cloudfront, and Cognito, but I'm stuck on trying to generate signed cookies to a Cloudfront path.

bblommers commented 1 week ago

Hi @chrisspen, that is not possible at the moment. As a workaround, it is always possible to patch botocore to mock these methods: https://docs.getmoto.org/en/latest/docs/services/patching_other_services.html

I'll mark it as an enhancement to add support for these in Moto though. Which methods specifically would you like to see mocked? Based on your description, it sounds like at least:

Any others?