mirror of
https://github.com/chenasraf/DefinitelyTyped.git
synced 2026-05-18 01:49:01 +00:00
🤖 Merge PR #61193 feat: adds ldap-authentication by @simonecorsi
This commit is contained in:
32
types/ldap-authentication/index.d.ts
vendored
Normal file
32
types/ldap-authentication/index.d.ts
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
// Type definitions for ldap-authentication 2.2
|
||||
// Project: https://github.com/shaozi/ldap-authentication#readme
|
||||
// Definitions by: Simone Corsi <https://github.com/simonecorsi>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import { ClientOptions } from 'ldapjs';
|
||||
|
||||
export interface AuthenticationOptions {
|
||||
ldapOpts: ClientOptions;
|
||||
userDn?: string;
|
||||
adminDn?: string;
|
||||
adminPassword?: string;
|
||||
userSearchBase?: string;
|
||||
usernameAttribute?: string;
|
||||
username?: string;
|
||||
verifyUserExists?: boolean;
|
||||
starttls?: boolean;
|
||||
groupsSearchBase?: string;
|
||||
groupClass?: string;
|
||||
groupMemberAttribute?: string;
|
||||
groupMemberUserAttribute?: string;
|
||||
userPassword?: string;
|
||||
}
|
||||
|
||||
export function authenticate(options: AuthenticationOptions): Promise<any>;
|
||||
|
||||
export class LdapAuthenticationError extends Error {
|
||||
constructor(message: any);
|
||||
name: string;
|
||||
}
|
||||
|
||||
export as namespace LdapAuthentication;
|
||||
14
types/ldap-authentication/ldap-authentication-tests.ts
Normal file
14
types/ldap-authentication/ldap-authentication-tests.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
/* tslint:disable:no-namespace */
|
||||
'use strict';
|
||||
|
||||
import { authenticate, AuthenticationOptions } from 'ldap-authentication';
|
||||
|
||||
namespace Module {
|
||||
declare const options: AuthenticationOptions;
|
||||
|
||||
// $ExpectType Promise<any>
|
||||
authenticate(options);
|
||||
|
||||
// @ts-expect-error
|
||||
authenticate();
|
||||
}
|
||||
23
types/ldap-authentication/tsconfig.json
Normal file
23
types/ldap-authentication/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"ldap-authentication-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/ldap-authentication/tslint.json
Normal file
1
types/ldap-authentication/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "@definitelytyped/dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user