question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support pluggable auth plugin mechanism

See original GitHub issue

@sidorares , I raise this issue to talk about the pluggable auth plugin mechanism design. Your mysql2 have a design

const conn = mysql.createClient({
  authPlugins: {
    some_custom_plugin: (data, cb) => { /* ... * /},
    // mysql_native_plugin and sha256_password_plugin automaticlly merged to here unless you do something like
    // mysql_native_plugin: null
    // 'mysql_clear_password' not enabled by default:
    mysql_clear_password: mysql.authPlugins.mysql_clear_password
  },
  connectAuthPluginName: 'mysql_native_password' // this would be default, but if you need to start with sha256_password_plugin for example you need to put this option
})

Which describe in documented here: https://github.com/sidorares/node-mysql2/blob/master/documentation/Authentication-Switch.md

I also want to add the pluggable auth plugin mechanism, and want to let the API is same. What’s your decision on mysql2? If you like, could we talk about the auth plugin mechanism design here?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
dougwilsoncommented, Aug 10, 2017

I think just copying the public API of mysql2 is good enough. There are other ways it could be done, but no real reason to implement it differently, I suppose.

The only other way I could think of is to add methods on the main export to register plugins, which should be OK to register globally, but the down side is that it removes the flexibility to disable at a per-instance unless a different thing is done, haha.

0reactions
sidorarescommented, Aug 10, 2017

for docs it’s “name of auth plugin current packet talking about” for api discussed it’s “name of auth plugin to be used during initial handshake”

Read more comments on GitHub >

github_iconTop Results From Across the Web

Extension:PluggableAuth - MediaWiki
The PluggableAuth extension provides a framework for creating authentication and authorization extensions. Authentication is the process of ...
Read more >
Authorization Plug-ins | Apple Developer Documentation
Supporting Types and Constants. AuthorizationValue. A structure used to pass data between the authorization engine and the plug-in mechanism.
Read more >
Pluggable Authorization - Axway Documentation Portal
To support any authorization operation, a plug-in must implement CustomAuthorizer interface. Create a class that implements the CustomAuthorizer ...
Read more >
Netbackup and Pluggable Authentication Mechanism Module ...
A PAM plugin to the VERITAS Authentication service (VxAT) enables customers to make use of their existing PAM authentication modules to ...
Read more >
An introduction to Pluggable Authentication Modules (PAM) in ...
Learn how Pluggable Authentication Modules are used to help applications make proper use of user accounts in Linux.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found