db-migrate / node-db-migrate

Database migration framework for node
Other
2.32k stars 360 forks source link

using token as password #764

Open tamirhad opened 2 years ago

tamirhad commented 2 years ago

I'm submitting a...

Current behavior

current behavior is the password is being used from DBURL or from database.json file. when trying to set the password as token and ssl to 'Amazon RDS'(in my case) im getting: Error: Server requests authentication using unknown plugin mysql_clear_password. See TODO: add plugins doco here on how to configure or author authentication plugins. which is coming from mysql2 i guess. then tried to pass the token via "authPlugins" as someone suggested here but then I got the following message: TypeError: authPlugin is not a function

Expected behavior

pass a function to authPlugin option under mysql driver. for exmaple: authPlugins: { mysql_clear_password: () => () => { return Buffer.from(password + '\0') } }

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

im my case the motivation is to connect to my RDS database using token.

Environment


db-migrate version: 0.11.13
plugins with versions: X.Y.Z
db-migrate driver with versions: 

Additional information:
- Node version: v14.18.2  
- Platform:  alpine-docker 

Others: