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

Missing RequestId & HostId From mocked cognitoidp service API response #7162

Closed
filol opened this issue Dec 27, 2023 · 5 comments
Closed

Missing RequestId & HostId From mocked cognitoidp service API response #7162

filol opened this issue Dec 27, 2023 · 5 comments

Comments

@filol
Copy link

filol commented Dec 27, 2023

This was using botocore at 1.34.7 and moto at 4.2.9

What Actually Happened

When I use moto to mock cognitoidp, I expected to see RequestId & HostId in the ResponseMetadata it's not the case actually.

@bblommers
Copy link
Collaborator

Hi @filol, marking it as an enhancement to add these fields.

Do you have any documentation on the HostId-field? I couldn't find any info on the meaning/value of it.

@filol
Copy link
Author

filol commented Dec 28, 2023

Hi @bblommers, thanks !

Didn't find any information inside the boto3 documentation. Only a mention here : https://boto3.amazonaws.com/v1/documentation/api/latest/guide/error-handling.html#parsing-error-responses-and-catching-exceptions-from-aws-services

But i find this in the JAVA SDK documentation for S3 : "Amazon S3 also includes a host ID that can be provided to Amazon Web Services support when debugging an issue with Amazon S3."
https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/s3/S3ResponseMetadata.html

@bblommers
Copy link
Collaborator

@filol
I just tested a range of CognitoIDP operations against AWS (admin_create_user, list_users, list_resource_servers, and a few others), and they all contain the RequestId-header. I'll probably refactor Moto a bit to return this field everywhere, not just for CognitoIDP, as I believe it is returned for all services.

However: none of these operations returned the HostId-header. Was there a specific operation where you saw that returned?

@bblommers
Copy link
Collaborator

The RequestId will be part of every request from Moto v5.

We've released an alpha version yesterday if you want to try it out: moto==5.0.0alpha2

See the release announcement here to see the breaking changes:
#7198

@bblommers
Copy link
Collaborator

Moto v5 is now released: https://pypi.org/project/moto/5.0.0/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants