You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've observed that when using identity center, the access key for a given session is new each time - meaning we have a unique hash key each time I run my script.
I broke out the client into my project to inject the access key into my logs to verify this.
INFO:botocore.tokens:Loading cached SSO token for my-sso-session
INFO:cache_client:API Call Logger: Access Key - ASIA.............3HS, Region - eu-west-1, Service - sso-admin, Action - DescribeInstance, API Params - {'InstanceArn': 'arn:aws:sso:::instance/ssoins-abc123'}
INFO:botocore.tokens:Loading cached SSO token for my-sso-session
INFO:cache_client:API Call Logger: Access Key - ASIA.............OF7, Region - eu-west-1, Service - sso-admin, Action - DescribeInstance, API Params - {'InstanceArn': 'arn:aws:sso:::instance/ssoins-abc123'}
I can also confirm that constructing the cache key using the following makes caching work in this scenario too:
cache_key="{service}_{action}_{region}_{api_params}".format(
# Service for identifying which service is being queriedservice=self._service_model.service_name,
# Action of the serviceaction=operation_name,
# Region where the call is being maderegion=self.meta.region_name,
# Api Parameters. This takes care of pagination token, marker and other params.# The API Params dictionary is sorted before hashingapi_params=str(OrderedDict(sorted(api_params.items()))),
)
I'm going to take a look and see if there's something more suitable to use - at least if we can detect that we're running under an SSO session.
The text was updated successfully, but these errors were encountered:
I havent tested this case with botocache so this is new to me.
In my opinion instead of botocache changing it's behaviour based on the type of credentials being used by it, it will be better if the cache key generation can be provided as an optional feature for the user to customise. This way botocache can be agnostic of the underlying mechanism.
I've observed that when using identity center, the access key for a given session is new each time - meaning we have a unique hash key each time I run my script.
I broke out the client into my project to inject the access key into my logs to verify this.
I can also confirm that constructing the cache key using the following makes caching work in this scenario too:
I'm going to take a look and see if there's something more suitable to use - at least if we can detect that we're running under an SSO session.
The text was updated successfully, but these errors were encountered: