Skip to content

Obey the expireCredentialsAfter in CachedCredentialsProvider #718

@lauzadis

Description

@lauzadis

Describe the issue

CachedCredentialsProvider has a field called expireCredentialsAfter which allows the user to specify a maximum amount of time to wait before refreshing credentials. It defaults to 15 minutes.

Currently, we do not use this field when we receive credentials with a non-null expiration time. So, if the default expireCredentialsAfter are used and we receive credentials with an expiration 30 minutes from now, we will only refresh them after those 30 minutes, but they should be refreshed after only 15 minutes.

Steps to Reproduce

  • Create a CachedCredentialsProvider with expireCredentialsAfter time of 0 seconds
  • Mock receiving some credentials with an expiration time sometime in the near future (i.e 5 mins, 10 mins, 30 mins)
  • Try to getCredentials again. They will not be refreshed, you will be served the cached value

Current behavior

N/A

AWS Kotlin SDK version used

N/A

Platform (JVM/JS/Native)

N/A

Operating System and version

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    guidanceQuestion that needs advice or information.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions