feat: add identity client passthrough and tests#429
feat: add identity client passthrough and tests#429nborges-aws wants to merge 3 commits intomainfrom
Conversation
|
| # Provider may take a moment to delete | ||
| import time | ||
|
|
||
| time.sleep(5) |
There was a problem hiding this comment.
I'll change this to use wait_until_deleted utility
| name=name, allowedResourceOauth2ReturnUrls=allowed_resource_oauth_2_return_urls or [] | ||
| ) | ||
|
|
||
| def update_workload_identity(self, name: str, allowed_resource_oauth_2_return_urls: list[str]) -> Dict: |
There was a problem hiding this comment.
now that we are proxying it through boto core, does the signature change at all? Would this be a breaking change for customers that already rely on this signature?
Same question for the other ones where we switched to passthrough.
There was a problem hiding this comment.
The signature and args do not change at all, but the methods go from accepting positional or keyword arguments to only keyword arguments. This is not a breaking change for any customer calling method(keyword="value"), but will break for those using method("value"). Boto3 does throw a clear error message when this happens:
TypeError: get_workload_identity() only accepts keyword arguments.
If we want to preserve full backwards compatibility, we would have to remove these methods from allowlist and add back explicit methods.
@jariy17 thoughts?
| f"'bedrock-agentcore' and 'bedrock-agentcore-control' services." | ||
| ) | ||
|
|
||
| def get_workload_access_token( |
There was a problem hiding this comment.
this is defined as an explicit method and a passthrough. I think the passthrough takes precedence? If so, should we delete the old one?
There was a problem hiding this comment.
I think it's the other way around. Explicit methods are resolved first, and then it goes to passthrough.
But regardless, if I'm right the passthrough method is unreachable given we have an explicit method. Keeping it in the allowlist is pointless, and could confuse users. Will remove.
Description of changes:
__getattr__passthrough withaccept_snake_case_kwargsto IdentityClientcreate_oauth2_credential_provider,create_api_key_credential_provider,update_workload_identity,get_workload_identityget_workload_access_token,create_workload_identity,complete_resource_token_auth,get_token,get_api_keyNote:
create_oauth2_credential_provider_and_waitanddelete_oauth2_credential_provider_and_waitwere originally part of this change, but were removed. Though the service model defines a status field on theGetOauth2CredentialProviderresponse, integ tests revealed that the API was not returning any status field. The provider became available synchronously after creation. Polling methods were timing out waiting for a status that never appears, even when provider was created successfully. Thus the*_and_waitmethods were dead code.Test plan:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.