Skip to content

feat: check credential validity against signature expiration - #772

Merged
Xuanwo merged 1 commit into
apache:mainfrom
colinmarc:main
Jul 4, 2026
Merged

feat: check credential validity against signature expiration#772
Xuanwo merged 1 commit into
apache:mainfrom
colinmarc:main

Conversation

@colinmarc

@colinmarc colinmarc commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

When signing requests, we currently only check that the credential is currently valid, but on some backends (for example AWS), the signature lifetime is capped to the credential lifetime. In those situations, we need to refresh credentials instead of using the cached ones.

This is still best-effort; if the minimum expiry of the credential is less than the desired expiry of the signature, there's nothing we can do. We could change the signature of is_valid_at to return a potential error if the requested expiry is impossible to fulfill, up to you.

Fixes #771.

@colinmarc

Copy link
Copy Markdown
Contributor Author

Note I only changed the AWS backend because I don't know the behavior of the other backends very well.

When signing requests, we currently only check that the credential is
*currently* valid, but on some backends (for example AWS), the signature
lifetime is capped to the credential lifetime. In those situations, we
need to refresh credentials instead of using the cached ones.

This is still best-effort; if the minimum expiry of the credential is
less than the desired expiry of the signature, there's nothing we can
do.

This introduces a new method to `SigningCredential`, `is_valid_at`,
with a default impl so the change is non-breaking.
@Xuanwo

Xuanwo commented Jul 4, 2026

Copy link
Copy Markdown
Member

Thank you for this change!

@Xuanwo
Xuanwo merged commit b1e572a into apache:main Jul 4, 2026
48 checks passed
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.

AWS credential expiry can be shorter than signature expiry

2 participants