RocketChat/Rocket.Chat

View on GitHub
apps/meteor/server/services/ldap/service.ts

Summary

Maintainability
A
0 mins
Test Coverage
import type { ILDAPService } from '@rocket.chat/core-services';
import { ServiceClassInternal } from '@rocket.chat/core-services';
import type { LDAPLoginResult } from '@rocket.chat/core-typings';

import { LDAPManager } from '../../lib/ldap/Manager';

export class LDAPService extends ServiceClassInternal implements ILDAPService {
    protected name = 'ldap';

    async loginRequest(username: string, password: string): Promise<LDAPLoginResult> {
        return LDAPManager.login(username, password);
    }

    async loginAuthenticatedUserRequest(username: string): Promise<LDAPLoginResult> {
        return LDAPManager.loginAuthenticatedUser(username);
    }

    async testConnection(): Promise<void> {
        return LDAPManager.testConnection();
    }

    async testSearch(username: string): Promise<void> {
        return LDAPManager.testSearch(username);
    }
}