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

feat: add support for CreateSigningKey, RevokeSigningKey, and ListSigningKeys APIs #81

Merged
merged 2 commits into from
Apr 26, 2022

Conversation

tylerburdsall
Copy link
Contributor

Adds support for new APIs

wandaitzuchen
wandaitzuchen previously approved these changes Apr 20, 2022
Copy link

@wandaitzuchen wandaitzuchen left a comment

Choose a reason for hiding this comment

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

🚢

@@ -70,5 +80,58 @@ async def list_caches(self, next_token: Optional[str] = None) -> ListCachesRespo
except Exception as e:
raise _cache_service_errors_converter.convert(e)

async def create_signing_key(
self, ttl_minutes: int, endpoint: str
Copy link
Contributor

Choose a reason for hiding this comment

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

I find it a little awkward to pass the endpoint as an arg here just to be re-packaged into CreateSigningKeyResponse and returned.

If you assign self._endpoint = endpoint in the ctor you can use that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the data plane endpoint, not the control plane endpoint. That's why I'm passing it differently here

Copy link
Contributor

Choose a reason for hiding this comment

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

oh right!

self, ttl_minutes: int, endpoint: str
) -> CreateSigningKeyResponse:
_validate_ttl_minutes(ttl_minutes)
try:
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: You could make this code read a little nicer with a decorator so you're not copypasting try:except->converter.convert all over the place.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Totally agree, happy to pick this up in a separate PR. Tracking this in #83 so we don't forget

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.

4 participants