import {Ice} from 'ice'; import {Glacier2} from '../Glacier2/SSLInfo'; declare module './Glacier2.ns' { namespace Glacier2 { /** * This exception is raised if a client is denied the ability to create * a session with the router. */ class PermissionDeniedException extends Ice.UserException { constructor(reason?: string); /** * The reason why permission was denied. */ reason: string; } /** * The Glacier2 permissions verifier. This is called through the * process of establishing a session. * * @see Router */ abstract class PermissionsVerifier extends Ice.Object { /** * Check whether a user has permission to access the router. * * @param userId The user id for which to check permission. * * @param password The user's password. * * @param reason The reason why access was denied. * * @return True if access is granted, or false otherwise. * * @throws PermissionDeniedException Raised if the user access is * denied. This can be raised in place of returning false with a * reason set in the reason out parameter. */ abstract checkPermissions( userId: string, password: string, current: Ice.Current, ): Ice.OperationResult<[boolean, string]>; } /** * The Glacier2 permissions verifier. This is called through the * process of establishing a session. * * @see Router */ class PermissionsVerifierPrx extends Ice.ObjectPrx { /** * Check whether a user has permission to access the router. * * @param userId The user id for which to check permission. * * @param password The user's password. * * @param reason The reason why access was denied. * * @return True if access is granted, or false otherwise. * * @throws PermissionDeniedException Raised if the user access is * denied. This can be raised in place of returning false with a * reason set in the reason out parameter. */ checkPermissions( userId: string, password: string, ctx?: Ice.Context, ): Ice.AsyncResult<[boolean, string]>; } /** * The SSL Glacier2 permissions verifier. This is called through the * process of establishing a session. * * @see Router */ abstract class SSLPermissionsVerifier extends Ice.Object { /** * Check whether a user has permission to access the router. * * @param info The SSL information. * * @param reason The reason why access was denied. * * @return True if access is granted, or false otherwise. * * @throws PermissionDeniedException Raised if the user access is * denied. This can be raised in place of returning false with a * reason set in the reason out parameter. * * @see SSLInfo */ abstract authorize( info: SSLInfo, current: Ice.Current, ): Ice.OperationResult<[boolean, string]>; } /** * The SSL Glacier2 permissions verifier. This is called through the * process of establishing a session. * * @see Router */ class SSLPermissionsVerifierPrx extends Ice.ObjectPrx { /** * Check whether a user has permission to access the router. * * @param info The SSL information. * * @param reason The reason why access was denied. * * @return True if access is granted, or false otherwise. * * @throws PermissionDeniedException Raised if the user access is * denied. This can be raised in place of returning false with a * reason set in the reason out parameter. * * @see SSLInfo */ authorize( info: SSLInfo, ctx?: Ice.Context, ): Ice.AsyncResult<[boolean, string]>; } } } export {Glacier2} from './Glacier2.ns';