Closed ismailyenigul closed 4 months ago
do older versions of aws-vault support AWS_CREDENTIAL_EXPIRATION
as well, or does this change break the AWS prompt integration unless everyone has updated?
No it is not supported in older versions. It is breaking changes in v7.0
Gotcha. If that's the case it probably makes the most sense if bobthefish falls back to the old variable if the new one isn't available.
let me try to add conditions to support AWS_CREDENTIAL_EXPIRATION as well
what do you think about the following changes
[ -n "$AWS_VAULT" -a -n "$AWS_CREDENTIAL_EXPIRATION" -o "$AWS_SESSION_EXPIRATION" ]
or return
set -l profile $AWS_VAULT
set -l now (gdate --utc +%s)
if [ -n "$AWS_CREDENTIAL_EXPIRATION" ]
set aws_vault_expiry (gdate -d "$AWS_CREDENTIAL_EXPIRATION" +%s)
else
set aws_vault_expiry (gdate -d "$AWS_SESSION_EXPIRATION" +%s)
end
#set -l expiry (gdate -d "$AWS_CREDENTIAL_EXPIRATION" +%s)
set -l diff_mins (math "floor(( $aws_vault_expiry - $now ) / 60)")
@ismailyenigul thanks for this! i merged the fix in #351 because I missed that this one came first 😬
aws-vault 7.X removed AWS_SESSION_EXPIRATION env and replaced with AWS_CREDENTIAL_EXPIRATION To make this theme works for aws-vault 7.X, we must replace this env.
see: https://github.com/99designs/aws-vault/pull/1143