mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
d8ff186303
Client and server now have their own tsconfig so that the transpilation is only done on the part that is being modified. It also allows faster transpilation since tests are now excluded from tsconfig. They are compiled by ts-node during unit tests execution.
46 lines
1.3 KiB
TypeScript
46 lines
1.3 KiB
TypeScript
|
|
import BluebirdPromise = require("bluebird");
|
|
import { IClient, GroupsAndEmails } from "../../../src/lib/ldap/IClient";
|
|
import Sinon = require("sinon");
|
|
|
|
export class ClientStub implements IClient {
|
|
openStub: Sinon.SinonStub;
|
|
closeStub: Sinon.SinonStub;
|
|
searchUserDnStub: Sinon.SinonStub;
|
|
searchEmailsStub: Sinon.SinonStub;
|
|
searchEmailsAndGroupsStub: Sinon.SinonStub;
|
|
modifyPasswordStub: Sinon.SinonStub;
|
|
|
|
constructor() {
|
|
this.openStub = Sinon.stub();
|
|
this.closeStub = Sinon.stub();
|
|
this.searchUserDnStub = Sinon.stub();
|
|
this.searchEmailsStub = Sinon.stub();
|
|
this.searchEmailsAndGroupsStub = Sinon.stub();
|
|
this.modifyPasswordStub = Sinon.stub();
|
|
}
|
|
|
|
open(): BluebirdPromise<void> {
|
|
return this.openStub();
|
|
}
|
|
|
|
close(): BluebirdPromise<void> {
|
|
return this.closeStub();
|
|
}
|
|
|
|
searchUserDn(username: string): BluebirdPromise<string> {
|
|
return this.searchUserDnStub(username);
|
|
}
|
|
|
|
searchEmails(username: string): BluebirdPromise<string[]> {
|
|
return this.searchEmailsStub(username);
|
|
}
|
|
|
|
searchEmailsAndGroups(username: string): BluebirdPromise<GroupsAndEmails> {
|
|
return this.searchEmailsAndGroupsStub(username);
|
|
}
|
|
|
|
modifyPassword(username: string, newPassword: string): BluebirdPromise<void> {
|
|
return this.modifyPasswordStub(username, newPassword);
|
|
}
|
|
} |