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

CloudHSMv2 Integration #8532

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

Singha22
Copy link
Contributor

@Singha22 Singha22 commented Jan 28, 2025

Resolves #8571

@Singha22 Singha22 changed the title CloudHSM list_tags CloudHSM Integration Feb 6, 2025
@Singha22 Singha22 changed the title CloudHSM Integration CloudHSMv2 Integration Feb 7, 2025
@Singha22 Singha22 marked this pull request as ready for review February 10, 2025 15:10
Copy link
Collaborator

@bblommers bblommers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @Singha22.

It looks like the ServerMode tests are currently failing - let me know if you need any help looking into them

if not max_results:
return tags, None

if next_token:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reasoning behind manipulating the next_token?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The token has to be converted into base64 so without it, we get something like eyJwYXJhbWV0ZXJDaGVja3N1bSI6IDQyMzg4OTQxMTIsICJ1bmlxdWVBdHRyaWJ1dGVzIjogIlByb2plY3QifQ instead of eyJwYXJhbWV0ZXJDaGVja3N1bSI6IDQyMzg4OTQxMTIsICJ1bmlxdWVBdHRyaWJ1dGVzIjogIlByb2plY3QifQ==. Is this not the right approach?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That explains what it does - I wanted to know why 🙂

The nextToken that AWS returns is usually a random string, and the user should not care about the exact format of it. So my question was more: why do we need to manipulate the token, and can we not use the token that the Paginator returns?

If we don't have to manipulate the token, then we can rip this all out and replace it with the @paginate decorator instead, which would be much nicer (IMHO).

If there is a good reason we must manipulate the token, then that's fine as well - I would just want to know why.


clusters = sorted(clusters, key=lambda x: x.create_timestamp)

if not max_results:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look right - even if we don't have max_results specified, we may have a next_token that we should honor.

Can we use the @paginate-decorator here instead?

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

Successfully merging this pull request may close these issues.

CloudHSM Integration
2 participants