ldap-authentication 4.0.3 → 4.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.d.ts +17 -0
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -20,7 +20,24 @@ declare module 'ldap-authentication' {
20
20
  explicitBufferAttributes?: string[]
21
21
  }
22
22
 
23
+ export const AUTH_RESULT_FAILURE = 0
24
+ export const AUTH_RESULT_SUCCESS = 1
25
+ export const AUTH_RESULT_FAILURE_IDENTITY_NOT_FOUND = -1
26
+ export const AUTH_RESULT_FAILURE_IDENTITY_AMBIGUOUS = -2
27
+ export const AUTH_RESULT_FAILURE_CREDENTIAL_INVALID = -3
28
+ export const AUTH_RESULT_FAILURE_UNCATEGORIZED = -4
29
+
30
+ export class AuthenticationResult {
31
+ constructor(authCode: number, identity: string, user: any, messages: string[], client: any)
32
+ readonly code: number
33
+ readonly identity: string
34
+ readonly user: any
35
+ readonly messages: string[]
36
+ readonly client: any
37
+ }
38
+
23
39
  export function authenticate(options: AuthenticationOptions): Promise<any>
40
+ export function authenticateResult(options: AuthenticationOptions): Promise<AuthenticationResult>
24
41
 
25
42
  export class LdapAuthenticationError extends Error {
26
43
  constructor(message: any)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ldap-authentication",
3
- "version": "4.0.3",
3
+ "version": "4.0.4",
4
4
  "description": "A simple async nodejs library for LDAP user authentication",
5
5
  "main": "index.js",
6
6
  "types": "./index.d.ts",