Skip to content

mysql/awsmysql: allow refresh the IAM token when its expired#3625

Merged
vangent merged 1 commit intogoogle:masterfrom
giautm:g/iam-token
Oct 26, 2025
Merged

mysql/awsmysql: allow refresh the IAM token when its expired#3625
vangent merged 1 commit intogoogle:masterfrom
giautm:g/iam-token

Conversation

@giautm
Copy link
Contributor

@giautm giautm commented Oct 24, 2025

No description provided.

@giautm
Copy link
Contributor Author

giautm commented Oct 24, 2025

cc @vangent for review.

if c.iam != nil {
var err error
// AuthToken is expired after 15 minutes,
// so we need to refresh it for each new connection.
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't strictly true is it? If someone does 1000 connections at startup, you'll refresh IAM 1000 times, but only needed to do it once.

Are you copying this pattern of refresh-in-background from somewhere else, or ...?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

BuildAuthToken call is local-ops, without network invoke. So I think its okay to have 1000 tokens there. The cert provider already has its cache to use when assume the token via RoleARN.

And ofcourse, not AI thing there.

@giautm
Copy link
Contributor Author

giautm commented Oct 25, 2025

@vangent review again please,

@vangent
Copy link
Contributor

vangent commented Oct 26, 2025

I really wish we had better testing for this, but it looks OK to me.

@vangent vangent merged commit 4f54cd4 into google:master Oct 26, 2025
6 of 7 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.

2 participants