acm-sdk-python
acm-sdk-python copied to clipboard
Bug in AcmClient with ram_role_name as auth
When I'm trying to do following:
import acm
ENDPOINT = ''
NAMESPACE = ''
RAM_ROLE = ''
DATA_ID = ''
GROUP = ''
c = acm.ACMClient(ENDPOINT, NAMESPACE, AK, SK)
c.set_options(kms_enabled=True, region_id="cn-beijing")
print(c.get(DATA_ID, GROUP))
I get following error:
print(c.get(DATA_ID, GROUP))
File "/usr/local/lib/python3.8/dist-packages/acm/client.py", line 397, in get
return self.decrypt(content)
File "/usr/local/lib/python3.8/dist-packages/acm/client.py", line 897, in decrypt
resp = json.loads(self.kms_client.do_action_with_exception(req).decode("utf8"))
File "/usr/local/lib/python3.8/dist-packages/aliyunsdkcore/client.py", line 473, in do_action_with_exception
status, headers, body, exception = self._implementation_of_do_action(acs_request)
File "/usr/local/lib/python3.8/dist-packages/aliyunsdkcore/client.py", line 308, in _implementation_of_do_action
return self._handle_retry_and_timeout(endpoint, request, signer)
File "/usr/local/lib/python3.8/dist-packages/aliyunsdkcore/client.py", line 376, in _handle_retry_and_timeout
status, headers, body, exception = self._handle_single_request(endpoint,
File "/usr/local/lib/python3.8/dist-packages/aliyunsdkcore/client.py", line 398, in _handle_single_request
http_response = self._make_http_response(endpoint, request, read_timeout, connect_timeout,
File "/usr/local/lib/python3.8/dist-packages/aliyunsdkcore/client.py", line 264, in _make_http_response
header, url = signer.sign(self._region_id, request)
File "/usr/local/lib/python3.8/dist-packages/aliyunsdkcore/auth/signers/ecs_ram_role_signer.py", line 42, in sign
self._check_session_credential()
File "/usr/local/lib/python3.8/dist-packages/acm/client.py", line 74, in _check_session_credential_patch
expiration = self._expiration if isinstance(self._expiration, (float, int)) \
AttributeError: 'EcsRamRoleSigner' object has no attribute '_expiration'