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

Add the time when it will expire to debug log #746

Merged
merged 4 commits into from
Nov 21, 2023

Conversation

mikutas
Copy link
Contributor

@mikutas mikutas commented Nov 25, 2021

Do we want to know when to expire even if credentials are not expired for now ?

@mikutas mikutas marked this pull request as ready for review November 25, 2021 10:21
@mikutas mikutas force-pushed the when_will_it_expire branch from aba4cb6 to 1eb5eed Compare December 20, 2021 08:30
@@ -113,13 +113,13 @@ func (p *CredentialsProvider) Load() (*AWSCredentials, error) {
}

// Expired checks if the current credentials are expired
func (p *CredentialsProvider) Expired() bool {
func (p *CredentialsProvider) Expired() (bool, *time.Time) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function name doesn't really do what it says now.
Why not create a new method ExpiresAt to return the *time.Time instead?

@mikutas mikutas force-pushed the when_will_it_expire branch from f25bb11 to 7b9add7 Compare January 20, 2022 01:16
Copy link
Contributor

@sledigabel sledigabel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice 👍 just a small comment on using value semantic

@@ -122,6 +122,15 @@ func (p *CredentialsProvider) Expired() bool {
return time.Now().After(creds.Expires)
}

func (p *CredentialsProvider) ExpiredAt() *time.Time {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend passing it as value, since a time.Time is a measure of Time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noticed 👀, can we perhaps use previousCreds.Expires instead of adding ExpiredAt?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mikutas that is indeed a lot simpler :-)

@sledigabel
Copy link
Contributor

FWIW, LGTM! 🚀

@mikutas mikutas force-pushed the when_will_it_expire branch from 8d48e13 to 08656cf Compare March 18, 2022 01:59
@gliptak
Copy link
Contributor

gliptak commented Nov 20, 2023

@mapkon please rebase

@mapkon
Copy link
Contributor

mapkon commented Nov 20, 2023

@mapkon please rebase

Do you want me to merge this?

@gliptak
Copy link
Contributor

gliptak commented Nov 21, 2023

yes please consider merging. @mikutas found this useful for debugging

@mapkon mapkon merged commit e751213 into Versent:master Nov 21, 2023
8 checks passed
@mikutas mikutas deleted the when_will_it_expire branch November 22, 2023 00:53
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.

4 participants