Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

object-store: aws_profile fails to load static credentials #3765

Closed
helmus opened this issue Feb 26, 2023 · 1 comment · Fixed by #3766
Closed

object-store: aws_profile fails to load static credentials #3765

helmus opened this issue Feb 26, 2023 · 1 comment · Fixed by #3766
Labels
bug object-store Object Store Interface

Comments

@helmus
Copy link
Contributor

helmus commented Feb 26, 2023

Describe the bug

Loading credentials trough an aws_profile is currently not working because the expiration value of the credential is evaluated incorrectly.

The following call to c.expiry() will always return None, resulting in an Invalid expiry error.

let expiry = match c.expiry().and_then(|e| e.duration_since(t_now).ok()) {
Some(ttl) => Instant::now() + ttl,
None => {
return Err(crate::Error::Generic {
store: "S3",
source: "Invalid expiry".into(),
})
}
};

The expiry() method returns the expires_after field, which is not loaded from the aws_profile, but instead is made optionally available to the caller as a caching ttl field. ( reference for that here , there is an expiry_mut() method as well, allowing the caller to modify the expiration. ).

As such this value will always be None. A value of None means the credential does not expire at all.
Currently the referenced code evaluates an expiry of None as an invalid expiry.

To Reproduce
attempt to load a file from s3 trough an aws_profile, Invalid expiry will be shown.

Expected behavior

The query should execute correctly.

Additional context

@tustvold
Copy link
Contributor

Does your profile contain static credentials? I'm wondering if the issue here is that the aws-profile logic is not currently handling this, which we should fix, but interpreting the expiry is still correct for ephemeral credentials such as those obtained from sso?

@tustvold tustvold changed the title object-store: fix aws_profile loading object-store: aws_profile fails to load static credentials Feb 27, 2023
@tustvold tustvold added the object-store Object Store Interface label Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug object-store Object Store Interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants