import { Logger } from '../shared/Logger';
import { Server } from "../Server";
import { IService } from "../Service";
import { IAuthProvider } from "../auth";
import { User } from "../realms";
export interface AuthServiceConfiguration {
    enableRuntimeConfiguration?: boolean;
    refreshTokenTtl?: number;
    userTokenTtl?: number;
    accessTokenTtl?: number;
}
export interface IAuthProviderConfig {
    type: string;
    name?: string;
    config?: any;
    forceCodeConfig?: boolean;
}
export declare class AuthService implements IService {
    logger: Logger;
    server: Server;
    private privateKey;
    private publicKey;
    private adminToken;
    private refreshTokenTtl;
    private userTokenTtl;
    private accessTokenTtl;
    private cleanupInterval;
    private adminRealm;
    private tokenRevocationRealm;
    private configurationRealm;
    private providers;
    private defaultProviders;
    private runtimeConfigurationEnabled;
    constructor(config?: AuthServiceConfiguration);
    addProvider(provider: IAuthProvider): void;
    setDefaultProviders(providers: IAuthProviderConfig[]): void;
    getUserByProviderId(provider: string, providerId: string): User;
    createOrUpdateUser(providerId: string, provider: string, isAdmin: boolean, metadata?: {
        [key: string]: string;
    }, userId?: string): Promise<User>;
    updateUserMetadata(user: User | string, metadata?: {
        [key: string]: string;
    }): void;
    private start(server);
    private stopping();
    private stop();
    private authenticate(body);
    private userToken(token, app_id);
    private accessToken(path, token, data, app_id?);
    private revokeToken(tokenData, req);
    private getUserById(userId, req);
    private getUserByProviderIdApi(provider, providerId, req);
    private createOrUpdateUserApi(req, providerId, provider, isAdmin, metadata?, userId?);
    private getProviders(req);
    private addOrUpdateProviderApi(req, type, config?, name?);
    private removeProviderApi(req, name);
    private updateProviderData(providerName, userId, data, req);
    private updateProviderAccount(providerName, data, req, providerId?);
    private deleteUser(userId, req);
    private createProvider(config);
    private startProvider(provider);
    private stopProvider(provider);
    private pruneRevocationTokens();
    private readonly providerQueue;
    private hasPendingProviderOperations;
    private enqueueProviderOperation(operation);
    private stopProviderQueue();
    private generateUniqueId();
    private requireAdminOrUserId(req, userId?);
    private requireRuntimeConfiguration();
    private deleteUserWithUserId(userId);
    private static ensureRealmOfType(requiredType, actualType);
}
