-
-
Notifications
You must be signed in to change notification settings - Fork 623
/
Auth.d.ts
30 lines (27 loc) · 930 Bytes
/
Auth.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { RsaPublicKey, RsaPrivateKey, KeyLike } from 'crypto';
import { Connection } from './Connection.js';
export type AuthPlugin = (pluginMetadata: {
connection: Connection;
command: string;
}) => (
pluginData: Buffer,
) => Promise<string> | string | Buffer | Promise<Buffer> | null;
type AuthPluginDefinition<T> = (pluginOptions?: T) => AuthPlugin;
export const authPlugins: {
caching_sha2_password: AuthPluginDefinition<{
overrideIsSecure?: boolean;
serverPublicKey?: RsaPublicKey | RsaPrivateKey | KeyLike;
jonServerPublicKey?: (data: Buffer) => void;
}>;
mysql_clear_password: AuthPluginDefinition<{
password?: string;
}>;
mysql_native_password: AuthPluginDefinition<{
password?: string;
passwordSha1?: string;
}>;
sha256_password: AuthPluginDefinition<{
serverPublicKey?: RsaPublicKey | RsaPrivateKey | KeyLike;
joinServerPublicKey?: (data: Buffer) => void;
}>;
};