🌟 Data migration tool from nextcloud (#299)
- created server configuration - implemented downloading files from nextcloud to a local directory - build of the docker image added to the GutHub workflow - Twake client added - Creating user in Twake Drive from ldap - Ldap client with ldapsearch(TODO make it work with ldapjs) - Jest debug tests
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import {describe, expect, test} from '@jest/globals';
|
||||
import { LdapUser } from '../src/shell_ldap_user';
|
||||
import { LdapConfiguration } from '../src/ldap_user';
|
||||
|
||||
//integration debug test
|
||||
describe.skip('ldap module', () => {
|
||||
|
||||
test('ldap returns user info', async () => {
|
||||
const ldap = new LdapUser({
|
||||
url: "ldap://auth.poc-mail-avocat.fr:389",
|
||||
baseDn: "ou=users,dc=example,dc=com",
|
||||
} as LdapConfiguration);
|
||||
const user = await ldap.find("999248");
|
||||
expect(user.firstName).toBe("Xavier");
|
||||
expect(user.lastName).toBe("GUIMARD");
|
||||
expect(user.email).toBe("xguimard@avocat.fr");
|
||||
expect(user.uid).toBe("999248");
|
||||
});
|
||||
|
||||
test('ldap returns nothing', async () => {
|
||||
const ldap = new LdapUser({
|
||||
url: "ldap://auth.poc-mail-avocat.fr:389",
|
||||
baseDn: "ou=users,dc=example,dc=com",
|
||||
} as LdapConfiguration);
|
||||
const user = await ldap.find("NOTHING_HERE");
|
||||
expect(user.email).toBeUndefined();
|
||||
});
|
||||
|
||||
});
|
||||
@@ -0,0 +1,23 @@
|
||||
import { expect, test } from '@jest/globals';
|
||||
import { TwakeDriveClient } from '../src/twake_client';
|
||||
|
||||
//integration debug test
|
||||
describe.skip('twake client module', () => {
|
||||
|
||||
test('twake creates new user', async () => {
|
||||
//given
|
||||
const subj = new TwakeDriveClient({
|
||||
url: "https://tdrive.qa.lin-saas.com/",
|
||||
credentials: {
|
||||
appId: "tdrive_onlyoffice",
|
||||
secret: "QWERTY"
|
||||
}
|
||||
})
|
||||
|
||||
//when
|
||||
const response = await subj.createUser({firstName: "Test", lastName: "User", email: "test@example.com", uid: "test"});
|
||||
expect(response).toBeDefined();
|
||||
console.log(response);
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user