UNPKG

strapi-plugin-firebase-authentication

Version:

Allows easy integration between clients utilizing Firebase for authentication and Strapi

74 lines (73 loc) 3.1 kB
declare const _default: ({ strapi }: { strapi: any; }) => { init(): Promise<void>; /** * Retrieves and decrypts the Firebase configuration including Web API key and password reset settings * * @returns Firebase configuration object or null if not configured * * @throws ApplicationError - When there's an error retrieving or decrypting the configuration * * @remarks * Returns an object containing: * - `firebaseConfigJson`: Decrypted Firebase service account JSON string * - `firebaseWebApiKey`: Firebase Web API key for Identity Toolkit API calls * - `passwordRequirementsRegex`: Regex pattern for password validation * - `passwordRequirementsMessage`: Error message for invalid passwords * - `passwordResetUrl`: URL for password reset page * - `passwordResetEmailSubject`: Subject line for reset emails */ getFirebaseConfigJson(): Promise<{ firebaseConfigJson: any; firebaseWebApiKey: any; passwordRequirementsRegex: any; passwordRequirementsMessage: any; passwordResetUrl: any; passwordResetEmailSubject: any; enableMagicLink: any; magicLinkUrl: any; magicLinkEmailSubject: any; magicLinkExpiryHours: any; emailVerificationUrl: any; emailVerificationEmailSubject: any; includeCredentialsInPasswordResetLink: any; includeCredentialsInVerificationLink: any; }>; /** * Stores and encrypts Firebase configuration including Web API key and password reset settings * * @param ctx - Koa context object containing the configuration in request body * @returns The saved configuration object with decrypted values * * @throws ValidationError - When required data is missing * @throws ApplicationError - When there's an error saving the configuration * * @remarks * Expects request body to contain: * - `firebaseConfigJson`: Firebase service account JSON as string * - `firebaseWebApiKey`: Firebase Web API key for REST API calls * - `passwordRequirementsRegex`: Regex pattern for password validation * - `passwordRequirementsMessage`: Error message for invalid passwords * - `passwordResetUrl`: URL for password reset page * - `passwordResetEmailSubject`: Subject line for reset emails * * The service account JSON is encrypted using AES before storage, * while the Web API key and password settings are stored in plain text. */ setFirebaseConfigJson(requestBody: any): Promise<any>; delFirebaseConfigJson: () => Promise<any>; /** * Updates only the magic link settings without affecting other configuration */ updateMagicLinkSettings(settings: any): Promise<{ enableMagicLink: any; magicLinkUrl: any; magicLinkEmailSubject: any; magicLinkExpiryHours: any; }>; encryptJson(key: string, json: string): Promise<any>; decryptJson(key: string, hash: string): Promise<any>; restart(): Promise<void>; }; export default _default;