Skip to content

[BB-314] add last login#65

Merged
aldevv merged 4 commits intomainfrom
add_last_login
Apr 10, 2025
Merged

[BB-314] add last login#65
aldevv merged 4 commits intomainfrom
add_last_login

Conversation

@aldevv
Copy link
Contributor

@aldevv aldevv commented Apr 7, 2025

No description provided.

@aldevv aldevv changed the title add last login [BB-314] add last login Apr 7, 2025
}

accessKeyLastUsedDates := make([]time.Time, 0, len(accessKeyIDs))
for _, accessKeyId := range accessKeyIDs {
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like it'd slow down syncing quite a bit for accounts with lots of users (or lots of access keys).

If it becomes a problem, we can add a config option to skip this. But until then I don't think it's worth adding yet another config option.

AccessKeyId: awsSdk.String(accessKeyId),
})
if err != nil {
logger.Error("Error getting access key last used", zap.String("access_key_id", accessKeyId), zap.Error(err))
Copy link
Contributor

Choose a reason for hiding this comment

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

If there's an error, maybe we should continue or break so we can fall back to the password last used time?

I guess optimal behavior is: If it's a permission error, break. If it's a rate limit error, retry. If it's any other error, continue.


res, err := client.ListAccessKeys(ctx, &iam.ListAccessKeysInput{UserName: user.UserName})
if err != nil {
logger.Error("Error listing access keys", zap.Error(err))
Copy link
Contributor

Choose a reason for hiding this comment

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

If there's an error listing access keys, should we fall back to using the password last used time instead of returning nil?

@aldevv aldevv enabled auto-merge (squash) April 10, 2025 17:23
@aldevv aldevv merged commit 49620e6 into main Apr 10, 2025
3 checks passed
@aldevv aldevv deleted the add_last_login branch April 10, 2025 17:25
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.

3 participants