/** * @file Authentication related API methods */ import { ConsentRequest } from '@globalid/consent-types'; import * as IdentityNamespaceTypes from '@globalid/identity-namespace-service-types'; import { ApproveConsentRequestParams, DataAccessor, EncryptedIdentityStateObject } from '../../interfaces'; import { AuthenticationParameters, AuthenticationStatus, KeyChainResponse, PostConsentResponse } from '../api_interfaces'; interface Approve2FaRequest { request_uuid: string; access_token: string; data_accessors?: DataAccessor[]; attestations?: string[]; private_signing_key: string; } /** * approve2FaRequest */ export declare function approve2FaRequest(params: Approve2FaRequest): Promise; /** * reject2FaRequest */ export declare function reject2FaRequest(request_uuid: string, access_token: string, private_signing_key: string): Promise; export interface RejectionSignature { accepted: boolean; command: ConsentRequest.ConsentCommand; consent_uuid?: string; message?: string; nonce?: string; } export interface AcceptanceSignature extends RejectionSignature { command_response: { attestations?: string[]; }; } /** * confirmIdentity * * Confirms the identity with some attestation details */ export declare function confirmIdentity(uuid: string, args: IdentityNamespaceTypes.API.V1.Identities._gid_uuid.Confirm.PUT.RequestBody): Promise; /** * Signup method calls the signup API endpoint with the arguments supplied * * @export * @async * @method signup * @param args details of the user wishing to signup * @returns a promise which returns void or an IdentityNamespaceTypes.API.V2.Identities.POST.Response */ export declare function signup(args: IdentityNamespaceTypes.API.V2.Identities.POST.RequestBody): Promise; /** * getSignupToken * * gets the signup token during signup, expects a signed jwt * * @export */ export declare function getSignupToken(jwtHeader: string): Promise; /** * Method to get the localID Public Key * * @export * @async * @method getLocalidPublicKey * @returns a promise which returns void or the publicKey as a string */ export declare function getLocalidPublicKey(): Promise; /** * Initiate the password reset request * * If a matching gid_name and contact_method are provided, a reset code will be sent to * the provided contact method */ export declare function initiatePasswordResetRequest(args: IdentityNamespaceTypes.API.V1.Identities.Password.Reset.Request.POST.RequestBody): Promise; /** * Api method for finalizing the password reset flow */ export declare function sendPasswordResetCode(args: IdentityNamespaceTypes.API.V1.Identities.Password.Reset.Code.POST.RequestBody): Promise; /** * Api method for password change flow */ export declare function changePassword(args: IdentityNamespaceTypes.API.V1.Identities.ChangePassword.POST.RequestBody, access_token: string): Promise; /** * Method to get the localID Keychain * * @export * @async * @method getKeyChain * @returns a promise which returns void or the keychain as an KeyChainResponse */ export declare function getKeyChain(access_token: string): Promise; /** * API call to retrieve the identity status of * the given access token * * @export * @async * @method getIdentityState * @param access_token the access token gathered from signup / login * @returns a promise which returns the identity state * or throws an error if failed */ export declare function getIdentityState(access_token: string): Promise; /** * Create an authentication request and return the request uuid */ export declare function createAuthenticationRequest(params: AuthenticationParameters): Promise; /** * Get the authentication request status */ export declare function getAuthenticationRequestStatus(request_uuid: string): Promise; /** * Approve the consent request, * user grants approval for the authentication request bound to this consent request */ export declare function approveConsentRequest(params: ApproveConsentRequestParams): Promise; /** * Rejects the consent request */ export declare function rejectConsentRequest(access_token: string, request_uuid: string): Promise; /** * Create a consent request bound to a specific authentication request uuid */ export declare function createConsentRequest(request_id: string, access_token: string): Promise; export {};