🤖 Merge PR #61193 feat: adds ldap-authentication by @simonecorsi

This commit is contained in:
Simone Corsi
2022-07-13 09:04:53 +02:00
committed by GitHub
parent 7c9e5d0950
commit 433c001873
4 changed files with 70 additions and 0 deletions

32
types/ldap-authentication/index.d.ts vendored Normal file
View 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;

View 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();
}

View 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"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "@definitelytyped/dtslint/dt.json" }