Improve authentication handling (#908)
This commit is contained in:
committed by
delvedor
parent
a55856c60b
commit
708f9abe3e
16
lib/ConnectionPool.d.ts
vendored
16
lib/ConnectionPool.d.ts
vendored
@ -26,6 +26,7 @@ import { nodeFilterFn, nodeSelectorFn } from './Transport';
|
||||
interface ConnectionPoolOptions {
|
||||
ssl?: SecureContextOptions;
|
||||
agent?: AgentOptions;
|
||||
auth: BasicAuth | ApiKeyAuth;
|
||||
pingTimeout?: number;
|
||||
Connection: typeof Connection;
|
||||
resurrectStrategy?: string;
|
||||
@ -36,6 +37,20 @@ export interface getConnectionOptions {
|
||||
selector?: nodeSelectorFn;
|
||||
}
|
||||
|
||||
export interface ApiKeyAuth {
|
||||
apiKey:
|
||||
| string
|
||||
| {
|
||||
id: string;
|
||||
api_key: string;
|
||||
}
|
||||
}
|
||||
|
||||
export interface BasicAuth {
|
||||
username: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
export interface resurrectOptions {
|
||||
now?: number;
|
||||
requestId: string;
|
||||
@ -66,6 +81,7 @@ export default class ConnectionPool {
|
||||
resurrectTimeout: number;
|
||||
resurrectTimeoutCutoff: number;
|
||||
pingTimeout: number;
|
||||
auth: BasicAuth | ApiKeyAuth;
|
||||
Connection: typeof Connection;
|
||||
resurrectStrategy: number;
|
||||
constructor(opts?: ConnectionPoolOptions);
|
||||
|
||||
Reference in New Issue
Block a user