Skip to content

Retrieve username from secret in the hotswap driver function#159

Merged
JashLal merged 3 commits intomainfrom
jash/rotation_add_username
Jul 24, 2025
Merged

Retrieve username from secret in the hotswap driver function#159
JashLal merged 3 commits intomainfrom
jash/rotation_add_username

Conversation

@JashLal
Copy link
Collaborator

@JashLal JashLal commented Jul 23, 2025

Update to the hotswap credentials function. Changes the logic for the password-secret authentication mode. Retrieves a username key in addition to password and if found sets the mysql config.

@JashLal JashLal changed the title Also retrieve username from secret in the hotswap driver function Retrieve username from secret in the hotswap driver function Jul 23, 2025
aws/secret.go Outdated
return username.(string), nil
}

func (s Secret) Password(v map[string]interface{}) (string, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think these 2 new method are needed; they're extremely shallow (see book Philosophy of Software Design). They can be put inline in the callback func (return func(ctx context.Context) (Credentials, error) {) so the reader doesn't have make a mental context switch. E.g. when I fist saw these 2 methods, I figured they served some kind of other purpose/did something else. It took me a moment to realize they're just fetching a value from a map that's passed into them--there's no additional logic or handling or anything else.

@JashLal JashLal merged commit 152001b into main Jul 24, 2025
4 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