import { BaseController } from "./Base"; import { Role } from "../core/security/Role"; import { RoleSearchResult } from "../core/searchResult/Role"; import { Profile } from "../core/security/Profile"; import { ProfileSearchResult } from "../core/searchResult/Profile"; import { User } from "../core/security/User"; import { UserSearchResult } from "../core/searchResult/User"; import { ArgsDefault } from "../types"; export declare class SecurityController extends BaseController { /** * @param {Kuzzle} kuzzle */ constructor(kuzzle: any); /** * Creates a new API key for a user. * * @param {String} userId - User kuid * @param {String} description - API key description * @param {Object} [options] - { _id, expiresIn, refresh } * * @returns {Promise.} ApiKey { _id, _source } */ createApiKey(userId: any, description: any, options?: ArgsSecurityControllerCreateApiKey): Promise; /** * Checks if an API action can be executed by a user * * @param {String} kuid - User kuid * @param {Object} requestPayload - Request to check */ checkRights(kuid: any, requestPayload: any, options?: ArgsSecurityControllerCheckRights): Promise; /** * Deletes an user API key. * * @param {String} userId - User kuid * @param {String} id - API key ID * @param {Object} [options] - { refresh } * * @returns {Promise} */ deleteApiKey(userId: any, id: any, options?: ArgsSecurityControllerDeleteApiKey): Promise; /** * Searches for a user API key. * * @param {String} userId - User kuid * @param {Object} [query] - Search query * @param {Object} [options] - { from, size } * * @returns {Promise.} - { hits, total } */ searchApiKeys(userId: any, query?: {}, options?: ArgsSecurityControllerSearchApiKeys): Promise; createCredentials(strategy: any, _id: any, body: any, options?: ArgsSecurityControllerCreateCredentials): Promise; createFirstAdmin(_id: any, body: any, options?: ArgsSecurityControllerCreateFirstAdmin): Promise; createOrReplaceProfile(_id: any, body: any, options?: ArgsSecurityControllerCreateOrReplaceProfile): Promise; createOrReplaceRole(_id: any, body: any, options?: ArgsSecurityControllerCreateOrReplaceRole): Promise; createProfile(_id: any, body: any, options?: ArgsSecurityControllerCreateProfile): Promise; createRestrictedUser(body: any, _id?: any, options?: ArgsSecurityControllerCreateRestrictedUser): Promise; createRole(_id: any, body: any, options?: ArgsSecurityControllerCreateRole): Promise; createUser(_id: any, body: any, options?: ArgsSecurityControllerCreateUser): Promise; deleteCredentials(strategy: any, _id: any, options?: ArgsSecurityControllerDeleteCredentials): Promise; deleteProfile(_id: any, options?: ArgsSecurityControllerDeleteProfile): Promise; deleteRole(_id: any, options?: ArgsSecurityControllerDeleteRole): Promise; deleteUser(_id: any, options?: ArgsSecurityControllerDeleteUser): Promise; getAllCredentialFields(options?: ArgsSecurityControllerGetAllCredentialFields): Promise; getCredentialFields(strategy: any, options?: ArgsSecurityControllerGetCredentialFields): Promise; getCredentials(strategy: any, _id: any, options?: ArgsSecurityControllerGetCredentials): Promise; getCredentialsById(strategy: any, _id: any, options?: ArgsSecurityControllerGetCredentialsById): Promise; getProfile(_id: any, options?: ArgsSecurityControllerGetProfile): Promise; getProfileMapping(options?: ArgsSecurityControllerGetProfileMapping): Promise; getProfileRights(_id: any, options?: ArgsSecurityControllerGetProfileRights): Promise; getRole(_id: any, options?: ArgsSecurityControllerGetRole): Promise; getRoleMapping(options?: ArgsSecurityControllerGetRoleMapping): Promise; getUser(_id: any, options?: ArgsSecurityControllerGetUser): Promise; getUserMapping(options?: ArgsSecurityControllerGetUserMapping): Promise; getUserRights(_id: any, options?: ArgsSecurityControllerGetUserRights): Promise; getUserStrategies(_id: any, options?: ArgsSecurityControllerGetUserStrategies): Promise; hasCredentials(strategy: any, _id: any, options?: ArgsSecurityControllerHasCredentials): Promise; mDeleteProfiles(ids: any, options?: ArgsSecurityControllerMDeleteProfiles): Promise; mDeleteRoles(ids: any, options?: ArgsSecurityControllerMDeleteRoles): Promise; mDeleteUsers(ids: any, options?: ArgsSecurityControllerMDeleteUsers): Promise; mGetProfiles(ids: any, options?: ArgsSecurityControllerMGetProfiles): Promise; mGetUsers(ids: any, options?: ArgsSecurityControllerMGetUsers): Promise; mGetRoles(ids: any, options?: ArgsSecurityControllerMGetRoles): Promise; refresh(collection: any, options?: ArgsSecurityControllerRefresh): Promise; replaceUser(_id: any, body: any, options?: ArgsSecurityControllerReplaceUser): Promise; searchProfiles(body: any, options?: ArgsSecurityControllerSearchProfiles): Promise; searchRoles(body: any, options?: ArgsSecurityControllerSearchRoles): Promise; searchUsers(body: any, options?: ArgsSecurityControllerSearchUsers): Promise; updateCredentials(strategy: any, _id: any, body: any, options?: ArgsSecurityControllerUpdateCredentials): Promise; updateProfile(_id: any, body: any, options?: ArgsSecurityControllerUpdateProfile): Promise; updateProfileMapping(body: any, options?: ArgsSecurityControllerUpdateProfileMapping): Promise; updateRole(_id: any, body: any, options?: ArgsSecurityControllerUpdateRole): Promise; updateRoleMapping(body: any, options?: ArgsSecurityControllerUpdateRoleMapping): Promise; updateUser(_id: any, body: any, options?: ArgsSecurityControllerUpdateUser): Promise; updateUserMapping(body: any, options?: ArgsSecurityControllerUpdateUserMapping): Promise; validateCredentials(strategy: any, _id: any, body: any, options?: ArgsSecurityControllerValidateCredentials): Promise; } export interface ArgsSecurityControllerCreateApiKey extends ArgsDefault { expiresIn?: string | number; _id?: string; refresh?: "wait_for" | "false"; } export type ArgsSecurityControllerCheckRights = ArgsDefault; export interface ArgsSecurityControllerDeleteApiKey extends ArgsDefault { refresh?: "wait_for" | "false"; } export interface ArgsSecurityControllerSearchApiKeys extends ArgsDefault { from?: number; size?: number; lang?: string; } export type ArgsSecurityControllerCreateCredentials = ArgsDefault; export interface ArgsSecurityControllerCreateFirstAdmin extends ArgsDefault { reset?: boolean; } export type ArgsSecurityControllerCreateOrReplaceProfile = ArgsDefault; export interface ArgsSecurityControllerCreateOrReplaceRole extends ArgsDefault { force?: boolean; } export type ArgsSecurityControllerCreateProfile = ArgsDefault; export type ArgsSecurityControllerCreateRestrictedUser = ArgsDefault; export interface ArgsSecurityControllerCreateRole extends ArgsDefault { force?: boolean; } export type ArgsSecurityControllerCreateUser = ArgsDefault; export type ArgsSecurityControllerDeleteCredentials = ArgsDefault; export type ArgsSecurityControllerDeleteProfile = ArgsDefault; export type ArgsSecurityControllerDeleteRole = ArgsDefault; export type ArgsSecurityControllerDeleteUser = ArgsDefault; export type ArgsSecurityControllerGetAllCredentialFields = ArgsDefault; export type ArgsSecurityControllerGetCredentialFields = ArgsDefault; export type ArgsSecurityControllerGetCredentials = ArgsDefault; export type ArgsSecurityControllerGetCredentialsById = ArgsDefault; export type ArgsSecurityControllerGetProfile = ArgsDefault; export type ArgsSecurityControllerGetProfileMapping = ArgsDefault; export type ArgsSecurityControllerGetProfileRights = ArgsDefault; export type ArgsSecurityControllerGetRole = ArgsDefault; export type ArgsSecurityControllerGetRoleMapping = ArgsDefault; export type ArgsSecurityControllerGetUser = ArgsDefault; export type ArgsSecurityControllerGetUserMapping = ArgsDefault; export type ArgsSecurityControllerGetUserRights = ArgsDefault; export type ArgsSecurityControllerGetUserStrategies = ArgsDefault; export type ArgsSecurityControllerHasCredentials = ArgsDefault; export type ArgsSecurityControllerMDeleteProfiles = ArgsDefault; export type ArgsSecurityControllerMDeleteRoles = ArgsDefault; export type ArgsSecurityControllerMDeleteUsers = ArgsDefault; export type ArgsSecurityControllerMGetProfiles = ArgsDefault; export type ArgsSecurityControllerMGetUsers = ArgsDefault; export type ArgsSecurityControllerMGetRoles = ArgsDefault; export type ArgsSecurityControllerReplaceUser = ArgsDefault; export type ArgsSecurityControllerSearchProfiles = ArgsDefault; export type ArgsSecurityControllerSearchRoles = ArgsDefault; export type ArgsSecurityControllerSearchUsers = ArgsDefault; export type ArgsSecurityControllerUpdateCredentials = ArgsDefault; export type ArgsSecurityControllerUpdateProfile = ArgsDefault; export type ArgsSecurityControllerUpdateProfileMapping = ArgsDefault; export interface ArgsSecurityControllerUpdateRole extends ArgsDefault { force?: boolean; } export type ArgsSecurityControllerUpdateRoleMapping = ArgsDefault; export type ArgsSecurityControllerUpdateUser = ArgsDefault; export type ArgsSecurityControllerUpdateUserMapping = ArgsDefault; export type ArgsSecurityControllerValidateCredentials = ArgsDefault; export type ArgsSecurityControllerRefresh = ArgsDefault;