sidorares / sidorares/node-mysql2
allow to use arbitrary plugin as first auth method
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 4.4k
- Forks
- 680
- Avg merge
- 9h 7m
- Merged PRs (30d)
- 59
Description
currently only allowed connect method initially is mysql_native_password. Some servers can potentially prefer to start with custom auth immediately, instead of rejecting mysql_native_password and doing AUTH_SWITH_HANDLER sequence afterwards. Also some servers can be configured to allow 'plugin based auth' but not 'auth switch request' - those are two different capabilities flags
- respect handshake packet plugin name
- deprecate
authSwitchHandlerand rename it to beauthPluginHandler - provide default handler for
mysql_native_password
also need to think of something to make it easy to chain handlers:
const mysqlIamAuth = require('mysql-iam-auth'); // imaginary, does not exist
const mysqMyCustomAuth = require('@internal/customauth');
const pool = mysql2.createPool({
authPluginHandler: combineAuthHandlers(mysqlIamAuth, mysqMyCustomAuth)
})
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the connection handshake and existing authSwitchHandler flow described in the issue, including how the server's plugin name is read. Compare the requested initial plugin handling with the current mysql_native_password default and consider the handler naming and chaining requirements. Done means custom plugins can be selected from the handshake while mysql_native_password remains supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, node.js, typescript
- Domain
- backend, database
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100