index
int64
0
0
repo_id
stringlengths
16
181
file_path
stringlengths
28
270
content
stringlengths
1
11.6M
__index_level_0__
int64
0
10k
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/extension
petrpan-code/ProtonMail/WebClients/packages/pass/lib/extension/message/message-broker.ts
import type { Runtime } from 'webextension-polyfill'; import { assertMessageVersion, backgroundMessage } from '@proton/pass/lib/extension/message'; import browser from '@proton/pass/lib/globals/browser'; import type { Maybe, MessageFailure, MessageSuccess, WorkerMessage, WorkerMessageResponse, WorkerMessageWithSender, WorkerResponse, } from '@proton/pass/types'; import { WorkerMessageType } from '@proton/pass/types'; import { pipe, tap } from '@proton/pass/utils/fp/pipe'; import { notIn } from '@proton/pass/utils/fp/predicates'; import { logger } from '@proton/pass/utils/logger'; export const successMessage = <T extends {}>(message?: T) => ({ type: 'success', ...(message ?? {}) }) as MessageSuccess<T>; export const errorMessage = (error?: string): MessageFailure => ({ type: 'error', error: error ?? 'unknown error', payload: error /* needed for Proton Account auth-ext page */, }); export type MessageHandlerCallback< T extends WorkerMessageType = WorkerMessageType, M extends WorkerMessageWithSender = Extract<WorkerMessageWithSender, { type: T }>, > = (message: M, sender: Runtime.MessageSender) => WorkerMessageResponse<T> | Promise<WorkerMessageResponse<T>>; export type ExtensionMessageBroker = ReturnType<typeof createMessageBroker>; export const createMessageBroker = (options: { allowExternal: WorkerMessageType[]; strictOriginCheck: WorkerMessageType[]; onDisconnect?: (portName: string) => void; }) => { const handlers: Map<WorkerMessageType, MessageHandlerCallback> = new Map(); const ports: Map<string, Runtime.Port> = new Map(); const buffer: Set<WorkerMessageWithSender> = new Set(); const extensionOrigin = new URL(browser.runtime.getURL('/')).origin; const broadcast = <M extends WorkerMessage>(message: M, matchPort?: string | ((name: string) => boolean)) => { ports.forEach( (port) => (matchPort === undefined || (typeof matchPort === 'string' && port.name === matchPort) || (typeof matchPort === 'function' && matchPort(port.name))) && port.postMessage(backgroundMessage(message)) ); }; const query = (match: (key: string) => boolean) => Array.from(ports) .filter(([key]) => match(key)) .map(([, port]) => port); const registerMessage = <T extends WorkerMessageType>(message: T, handler: MessageHandlerCallback<T>) => { if (handlers.has(message)) { throw new Error(`Message handler for "${message}" already registered`); } handlers.set(message, handler as MessageHandlerCallback<any>); }; const onMessage = async ( message: WorkerMessageWithSender, sender: Runtime.MessageSender ): Promise<WorkerResponse<WorkerMessageWithSender> | void> => { /** * During development, while using the webpack dev-server * with hot module replacement - we sometimes end up in a * "corrupted" state where the service-worker is sending out * messages to itself while it is updating or going stale. */ if (process.env.NODE_ENV === 'development') { if (message.sender === 'background') { browser.runtime.reload(); return errorMessage(); } } const handler = message.type !== undefined ? handlers.get(message.type) : undefined; if (handler) { try { const isExternal = sender.id !== browser.runtime.id; const isInternal = !isExternal; if (isExternal && notIn(options.allowExternal)(message.type)) { logger.warn('[MessageBroker::Message] unauthorized external message'); return errorMessage('unauthorized'); } if (isInternal) assertMessageVersion(message); if (isInternal && options.strictOriginCheck.includes(message.type)) { const origin = new URL((sender as any).origin ?? sender.url).origin; if (origin !== extensionOrigin) { logger.warn('[MessageBroker::Message] unauthorized message origin'); return errorMessage('unauthorized'); } } const res = await handler(message, sender); if (typeof res === 'boolean' || res === undefined) { if (res === false) throw new Error(`Error when processing "${message.type}"`); return successMessage({}); } return successMessage(res); } catch (error: any) { logger.debug(`[MessageBroker::Message] error`, error); return error instanceof Error ? errorMessage(error?.message) : { ...error, type: 'error' }; } } }; const onConnect = (port: Runtime.Port) => { ports.set(port.name, port); /* If a port forwarding message references a port we have * no reference of - reply with a `PORT_UNAUTHORIZED` message * on the source port. This can be used in injected frames to * detect they're not controlled by a content-script */ port.onMessage.addListener(async (message: Maybe<WorkerMessageWithSender>, source) => { if (message) assertMessageVersion(message); if (message && message.type === WorkerMessageType.PORT_FORWARDING_MESSAGE) { if (ports.has(message.forwardTo)) { ports.get(message.forwardTo)!.postMessage({ ...message.payload, forwarded: true }); } else { source.postMessage(backgroundMessage({ type: WorkerMessageType.PORT_UNAUTHORIZED })); } } }); port.onDisconnect.addListener(({ name }) => { ports.delete(name); options.onDisconnect?.(name); }); }; const disconnect = () => ports.forEach((port) => port.disconnect()); return { registerMessage, onMessage, buffer: { push: (message: WorkerMessageWithSender) => buffer.add(message), flush: pipe( () => Array.from(buffer.values()), tap(() => buffer.clear()) ), }, ports: { broadcast, onConnect, disconnect, query, }, }; };
7,800
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/extension
petrpan-code/ProtonMail/WebClients/packages/pass/lib/extension/message/send-message.ts
import browser from '@proton/pass/lib/globals/browser'; import type { ClientEndpoint, MessageFailure, PortFrameForwardingMessage, WorkerMessage, WorkerMessageWithSender, WorkerResponse, } from '@proton/pass/types'; import { WorkerMessageType } from '@proton/pass/types'; import { safeCall } from '@proton/pass/utils/fp/safe-call'; /** * This function is essential for maintaining consistent communication between * extension components, ensuring they all use the correct app version. It * prevents potential discrepancies that can occur during an extension update, * where components like the service worker, popup, and content scripts may differ * due to the unique way service workers are updated in MV3. */ export const assertMessageVersion = (message: WorkerMessageWithSender) => { if (message.version !== VERSION) safeCall(() => browser.runtime.reload())(); }; /** * Wraps the untyped browser.runtime.sendMessage * with our message/response types to avoid manually * casting the response types every time we use extension * messaging */ export const sendMessage = async <T extends WorkerMessageWithSender>( message: T ): Promise<WorkerResponse<typeof message> | MessageFailure> => { try { return (await browser.runtime.sendMessage(browser.runtime.id, message)) as WorkerResponse<typeof message>; } catch (error: any) { return { type: 'error', error }; } }; /** * Allows mapping over the response type via * an onReponse callback instead of manually * awaiting the sendMessage response and handling * it imperatively */ sendMessage.on = async <R, T extends WorkerMessageWithSender>( message: T, onResponse: (res: WorkerResponse<typeof message> | MessageFailure) => R ): Promise<R> => onResponse(await sendMessage(message)); /** * Allows triggering an effect only if the * worker response is of type "success" */ sendMessage.onSuccess = async <T extends WorkerMessageWithSender>( message: T, onSuccess: (res: Exclude<WorkerResponse<typeof message>, MessageFailure>) => void ): Promise<void> => sendMessage.on(message, (response) => { if (response.type === 'success') { onSuccess(response as Exclude<WorkerResponse<typeof message>, MessageFailure>); } }); export type MessageWithSenderFactory = <T extends WorkerMessage>(message: T) => WorkerMessageWithSender<T>; const messageCreator = (sender: ClientEndpoint): MessageWithSenderFactory => (message) => ({ ...message, sender, version: VERSION, }); export const backgroundMessage = messageCreator('background'); export const popupMessage = messageCreator('popup'); export const pageMessage = messageCreator('page'); export const contentScriptMessage = messageCreator('contentscript'); export const portForwardingMessage = <T extends { sender: ClientEndpoint }>( forwardTo: string, payload: T ): WorkerMessageWithSender<PortFrameForwardingMessage> => ({ forwardTo, payload, sender: payload.sender, type: WorkerMessageType.PORT_FORWARDING_MESSAGE, version: VERSION, }); export const resolveMessageFactory = messageCreator;
7,801
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/extension
petrpan-code/ProtonMail/WebClients/packages/pass/lib/extension/storage/index.ts
import { default as localStorage } from './local'; import { default as sessionStorage } from './session'; export const browserSessionStorage = sessionStorage; export const browserLocalStorage = localStorage;
7,802
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/extension
petrpan-code/ProtonMail/WebClients/packages/pass/lib/extension/storage/local.ts
import browser from '@proton/pass/lib/globals/browser'; import type { GetItem, GetItems, RemoveItem, RemoveItems, SetItem, SetItems, StorageInterface } from './types'; const getItems: GetItems = (keys) => browser.storage.local.get(keys); const getItem: GetItem = async (key) => (await getItems([key]))?.[key] ?? null; const setItems: SetItems = (items) => browser.storage.local.set(items); const setItem: SetItem = (key, value) => setItems({ [key]: value }); const removeItems: RemoveItems = (keys) => browser.storage.local.remove(keys); const removeItem: RemoveItem = (key) => removeItems([key]); const clear = (): Promise<void> => browser.storage.local.clear(); const browserLocalStorage: StorageInterface = { getItems, getItem, setItems, setItem, removeItems, removeItem, clear, }; export default browserLocalStorage;
7,803
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/extension
petrpan-code/ProtonMail/WebClients/packages/pass/lib/extension/storage/memory.ts
/* As we do not have access to the session storage API * in Firefox add-ons : we'll use a memory storage "mock" * relying on a global "store" initialized in the background * page. This memory storage will behave differently based on * the extension context. In the background page : it will * mimic the storage API by directly accessing a "storage" context * variable while maintaining the same method signatures (get/ * set/remove/clear). In any other context (popup, content-scripts * etc..) we will rely on the runtime's bi-directional messaging * capabilities in order to access or mutate the "storage" context * which only lives in the background page context. * This gives us the benefit of not having to modify existing code * to handle Firefox specifics when dealing with the session API */ import browser from '@proton/pass/lib/globals/browser'; import noop from '@proton/utils/noop'; import type { GetItem, GetItems, RemoveItem, RemoveItems, SetItem, SetItems, Storage, StorageInterface } from './types'; const MEMORY_STORAGE_EVENT = 'MEMORY_STORAGE_EVENT'; type StorageAction = | { action: 'get' } | { action: 'set'; items: Partial<Storage> } | { action: 'remove'; keys: string[] } | { action: 'clear' }; type StorageMessage = { type: typeof MEMORY_STORAGE_EVENT } & StorageAction; const isStorageMessage = (message: any): message is StorageMessage => message.type === MEMORY_STORAGE_EVENT; const isBackground = async (): Promise<boolean> => { try { return (await browser.runtime.getBackgroundPage()) === window; } catch (_) { return false; } }; export const createMemoryStorage = (): StorageInterface => { const context: { store: Storage } = { store: {} }; const applyStorageAction = <Action extends StorageAction['action']>( action: Extract<StorageAction, { action: Action }> ): Promise<Action extends 'get' ? Storage : void> => browser.runtime.sendMessage(browser.runtime.id, { type: MEMORY_STORAGE_EVENT, ...action }); const resolveStorage = async (): Promise<Storage> => (await isBackground()) ? context.store : applyStorageAction<'get'>({ action: 'get' }); const getItems: GetItems = async (keys) => { const store = await resolveStorage(); return keys.reduce( (result, key) => ({ ...result, ...(store?.[key] !== undefined ? { [key]: store?.[key] } : {}), }), {} ); }; const getItem: GetItem = async (key) => { const store = await resolveStorage(); return store?.[key] ?? null; }; const setItems: SetItems = async (items) => { if (!(await isBackground())) return applyStorageAction<'set'>({ action: 'set', items }); context.store = { ...context.store, ...items }; }; const setItem: SetItem = async (key, value) => setItems({ [key]: value }); const removeItems: RemoveItems = async (keys) => { if (!(await isBackground())) return applyStorageAction<'remove'>({ action: 'remove', keys }); keys.forEach((key) => delete context.store[key]); }; const removeItem: RemoveItem = (key) => removeItems([key]); const clear = async (): Promise<void> => { if (!(await isBackground())) return applyStorageAction({ action: 'clear' }); context.store = {}; }; /* setup context forwarding via * extension messaging if in background */ isBackground() .then((inBackgroundPage) => { if (inBackgroundPage) { browser.runtime.onMessage.addListener((message) => { if (isStorageMessage(message)) { switch (message.action) { case 'get': return Promise.resolve(context.store); case 'set': return setItems(message.items); case 'remove': return removeItems(message.keys); case 'clear': return clear(); } } }); } }) .catch(noop); return { getItems, getItem, setItems, setItem, removeItems, removeItem, clear, }; };
7,804
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/extension
petrpan-code/ProtonMail/WebClients/packages/pass/lib/extension/storage/session.ts
/* ⚠️ ⚠️ ⚠️ * This is the only part of the extension codebase * still referencing the chrome.runtime API and that * is not yet "runtime agnostic" : * The storage.session API is only available in * chromium - still not supported for Firefox/Safari * extensions. Once FF has full MV3 support we can * safely port it to webextension-polyfill * ⚠️ ⚠️ ⚠️ */ import { chromeAPI } from '@proton/pass/lib/globals/browser'; import { createMemoryStorage } from './memory'; import type { GetItem, GetItems, RemoveItem, RemoveItems, SetItem, SetItems, StorageInterface } from './types'; const getItems: GetItems = (keys) => new Promise((resolve, reject) => { chromeAPI.storage.session.get(keys, (items) => { const err = chromeAPI.runtime.lastError; return err ? reject(err) : resolve(items); }); }); export const getItem: GetItem = async (key) => (await getItems([key]))?.[key] ?? null; const setItems: SetItems = (items) => new Promise((resolve, reject) => { chromeAPI.storage.session.set(items, () => { const err = chromeAPI.runtime.lastError; return err ? reject(err) : resolve(); }); }); export const setItem: SetItem = (key, value) => setItems({ [key]: value }); export const removeItems: RemoveItems = (keys) => new Promise((resolve, reject) => { chromeAPI.storage.session.remove(keys, () => { const err = chromeAPI.runtime.lastError; return err ? reject(err) : resolve(); }); }); const removeItem: RemoveItem = (key) => removeItems([key]); const clear = (): Promise<void> => chromeAPI.storage.session.clear(); const chromeSessionStorage: StorageInterface = { getItems, getItem, setItems, setItem, removeItems, removeItem, clear, }; export default BUILD_TARGET === 'firefox' ? createMemoryStorage() : chromeSessionStorage;
7,805
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/extension
petrpan-code/ProtonMail/WebClients/packages/pass/lib/extension/storage/types.ts
import type { MaybeNull } from '@proton/pass/types'; export type Storage = Record<string, any>; export type StorageKeys<T> = Extract<keyof T, string>; export type StorageQuery<T, K extends StorageKeys<T>[]> = Partial<Pick<T, K[number]>>; export type GetItem<T = any, K extends StorageKeys<T> = StorageKeys<T>> = (key: K) => Promise<MaybeNull<T[K]>>; export type GetItems<T = any, K extends StorageKeys<T>[] = StorageKeys<T>[]> = (keys: K) => Promise<StorageQuery<T, K>>; export type SetItem<T = any, K extends StorageKeys<T> = StorageKeys<T>> = (key: K, value: T[K]) => Promise<void>; export type SetItems<T = any> = (items: Partial<T>) => Promise<void>; export type RemoveItem<T = any, K extends StorageKeys<T> = StorageKeys<T>> = (key: K) => Promise<void>; export type RemoveItems<T = any, K extends StorageKeys<T>[] = StorageKeys<T>[]> = (keys: K) => Promise<void>; export interface StorageInterface<T = any> { getItem: GetItem<T>; getItems: GetItems<T>; setItem: SetItem<T>; setItems: SetItems<T>; removeItem: RemoveItem<T>; removeItems: RemoveItems<T>; clear: () => Promise<void>; }
7,806
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/extension
petrpan-code/ProtonMail/WebClients/packages/pass/lib/extension/utils/browser.ts
import type { Browser } from '@proton/pass/types/browser'; /* * Based on https://github.com/mozilla/webextension-polyfill Chrome check */ export const detectBrowser = (): Browser => { const global = globalThis as any; return typeof global.browser === 'undefined' || Object.getPrototypeOf(global.browser) !== Object.prototype ? 'chrome' : 'firefox'; }; export const getWebStoreUrl = (browser: Browser): string => { return { chrome: 'https://chrome.google.com/webstore/detail/proton-pass/ghmbeldphafepmbegfdlkpapadhbakde', firefox: 'https://addons.mozilla.org/en-US/firefox/addon/proton-pass/', }[browser]; };
7,807
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/extension
petrpan-code/ProtonMail/WebClients/packages/pass/lib/extension/utils/tabs.ts
import type { Tabs } from 'webextension-polyfill'; import { contentScriptMessage, sendMessage } from '@proton/pass/lib/extension/message'; import browser from '@proton/pass/lib/globals/browser'; import type { Maybe, TabId } from '@proton/pass/types'; import { WorkerMessageType } from '@proton/pass/types'; import { first } from '@proton/pass/utils/array/first'; import { truthy } from '@proton/pass/utils/fp/predicates'; /* We do not have access to the tabs API in a content-script context */ export const getCurrentTab = async (): Promise<Maybe<Tabs.Tab>> => { try { return browser.tabs !== undefined ? first(await browser.tabs.query({ active: true, currentWindow: true })) : await new Promise((resolve) => sendMessage.onSuccess(contentScriptMessage({ type: WorkerMessageType.RESOLVE_TAB }), ({ tab }) => resolve(tab) ) ); } catch (_) {} }; export const filterDeletedTabIds = async (tabIds: TabId[]): Promise<TabId[]> => ( await Promise.all( tabIds.map(async (tabId) => { try { const tab = await browser.tabs.get(tabId); if (!tab) return tabId; } catch (_) { return tabId; } }) ) ).filter(truthy);
7,808
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib
petrpan-code/ProtonMail/WebClients/packages/pass/lib/globals/browser.ts
/* We create a proxy around the `chrome` or `browser` global object to hide them * from the devtools of our extension. This is done to prevent developers from * accidentally or intentionally modifying the extension's messaging system, which * could cause unexpected behavior or security issues. By hiding these globals, * we ensure that the extension's messaging system is only accessed through the * provided APIs, and not directly through the devtools console or other means */ import browser from 'webextension-polyfill'; import { logger } from '@proton/pass/utils/logger'; const self = globalThis as any; const context = { allowProxy: true, globals: { chrome: self.chrome, browser: self.browser, }, }; export const disableBrowserProxyTrap = () => (context.allowProxy = false); /* To ensure that Sentry's internal checks involving the browser * APIs don't interfere with the initialization of our apps, we * wrap the proxy initialization in a setTimeout function, which * delays the initialization until the next tick after our apps load. * ⚠️ Make sure Sentry is always initialized on app boot. */ export default (() => { const polyfill = browser; setTimeout( () => context.allowProxy && Object.entries(context.globals) .filter(([, value]) => value) .forEach(([key, value]) => { self[key] = new Proxy(value, { get(target, prop, receiver) { if (process.env.NODE_ENV !== 'development') { return logger.error(`[Extension::Error] extension API is protected`); } return Reflect.get(target, prop, receiver); }, set() { logger.error(`[Extension::Error] extension API is read-only`); return false; }, }); }), 0 ); return polyfill; })(); export const chromeAPI = context.globals.chrome as typeof chrome;
7,809
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/reader.ts
import { c } from 'ttag'; import { PASS_APP_NAME } from '@proton/shared/lib/constants'; import { read1Password1PifData } from './providers/1password.reader.1pif'; import { read1Password1PuxData } from './providers/1password.reader.1pux'; import { readBitwardenData } from './providers/bitwarden.reader'; import { readChromiumData } from './providers/chromium.reader'; import { readDashlaneData } from './providers/dashlane.reader'; import { readEnpassData } from './providers/enpass.reader'; import { readFirefoxData } from './providers/firefox.reader'; import { readKeePassData } from './providers/keepass.reader'; import { readKeeperData } from './providers/keeper.reader'; import { readLastPassData } from './providers/lastpass.reader'; import { readNordPassData } from './providers/nordpass.reader'; import { readProtonPassData } from './providers/protonpass.reader'; import { readRoboformData } from './providers/roboform.reader'; import { readSafariData } from './providers/safari.reader'; import { type ImportPayload, ImportProvider, type ImportReaderPayload } from './types'; export const extractFileExtension = (fileName: string): string => { const parts = fileName.split('.'); return parts[parts.length - 1]; }; export const fileReader = async (payload: ImportReaderPayload): Promise<ImportPayload> => { const fileExtension = extractFileExtension(payload.file.name); switch (payload.provider) { case ImportProvider.BITWARDEN: { return readBitwardenData(await payload.file.text()); } case ImportProvider.BRAVE: case ImportProvider.CHROME: case ImportProvider.EDGE: { return readChromiumData(await payload.file.text()); } case ImportProvider.FIREFOX: { return readFirefoxData(await payload.file.text()); } case ImportProvider.KEEPASS: { return readKeePassData(await payload.file.text()); } case ImportProvider.LASTPASS: { return readLastPassData(await payload.file.text()); } case ImportProvider.ONEPASSWORD: { switch (fileExtension) { case '1pif': return read1Password1PifData(await payload.file.text()); case '1pux': return read1Password1PuxData(await payload.file.arrayBuffer()); default: throw new Error(c('Error').t`Unsupported 1Password file format`); } } case ImportProvider.PROTONPASS: { switch (fileExtension) { case 'zip': return readProtonPassData({ data: await payload.file.arrayBuffer(), encrypted: false, userId: payload.userId, }); case 'pgp': return readProtonPassData({ data: await payload.file.text(), encrypted: true, userId: payload.userId, passphrase: payload.passphrase ?? '', }); default: throw new Error(c('Error').t`Unsupported ${PASS_APP_NAME} file format`); } } case ImportProvider.DASHLANE: { return readDashlaneData(await payload.file.arrayBuffer()); } case ImportProvider.SAFARI: { return readSafariData(await payload.file.text()); } case ImportProvider.KEEPER: { return readKeeperData(await payload.file.text()); } case ImportProvider.ROBOFORM: { return readRoboformData(await payload.file.text()); } case ImportProvider.NORDPASS: { return readNordPassData(await payload.file.text()); } case ImportProvider.ENPASS: { return readEnpassData(await payload.file.text()); } default: throw new Error(c('Error').t`Invalid password manager`); } };
7,810
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/types.ts
import type { ItemImportIntent, MaybeNull } from '@proton/pass/types'; import { PASS_APP_NAME } from '@proton/shared/lib/constants'; export enum ImportProvider { BITWARDEN = 'bitwarden', BRAVE = 'brave', CHROME = 'chrome', EDGE = 'edge', FIREFOX = 'firefox', KEEPASS = 'keepass', LASTPASS = 'lastpass', ONEPASSWORD = '1password', PROTONPASS = 'protonpass', DASHLANE = 'dashlane', SAFARI = 'safari', KEEPER = 'keeper', ROBOFORM = 'roboform', NORDPASS = 'nordpass', ENPASS = 'enpass', } export const PROVIDER_INFO_MAP: Record<ImportProvider, { title: string; fileExtension: string; tutorialUrl: string }> = { [ImportProvider.BITWARDEN]: { title: 'Bitwarden', fileExtension: 'json', tutorialUrl: 'https://proton.me/support/pass-import-bitwarden', }, [ImportProvider.BRAVE]: { title: 'Brave', fileExtension: 'csv', tutorialUrl: 'https://proton.me/support/pass-import-brave', }, [ImportProvider.CHROME]: { title: 'Chrome', fileExtension: 'csv', tutorialUrl: 'https://proton.me/support/pass-import-chrome', }, [ImportProvider.EDGE]: { title: 'Edge', fileExtension: 'csv', tutorialUrl: 'https://proton.me/support/pass-import-edge', }, [ImportProvider.FIREFOX]: { title: 'Firefox', fileExtension: 'csv', tutorialUrl: 'https://proton.me/support/pass-import-firefox', }, [ImportProvider.KEEPASS]: { title: 'KeePass', fileExtension: 'xml', tutorialUrl: 'https://proton.me/support/pass-import-keepass', }, [ImportProvider.LASTPASS]: { title: 'LastPass', fileExtension: 'csv', tutorialUrl: 'https://proton.me/support/pass-import-lastpass', }, [ImportProvider.ONEPASSWORD]: { title: '1Password', fileExtension: '1pux, 1pif', tutorialUrl: 'https://proton.me/support/pass-import-1password', }, [ImportProvider.DASHLANE]: { title: 'Dashlane', fileExtension: 'zip, csv', tutorialUrl: 'https://proton.me/support/pass-import-dashlane', }, [ImportProvider.PROTONPASS]: { title: PASS_APP_NAME, fileExtension: 'zip, pgp', tutorialUrl: '', }, [ImportProvider.SAFARI]: { title: 'Safari', fileExtension: 'csv', tutorialUrl: 'https://proton.me/support/pass-import-safari', }, [ImportProvider.KEEPER]: { title: 'Keeper', fileExtension: 'csv', tutorialUrl: 'https://proton.me/support/pass-import-keeper', }, [ImportProvider.ROBOFORM]: { title: 'Roboform', fileExtension: 'csv', tutorialUrl: '', }, [ImportProvider.NORDPASS]: { title: 'NordPass', fileExtension: 'csv', tutorialUrl: '', }, [ImportProvider.ENPASS]: { title: 'Enpass', fileExtension: 'json', tutorialUrl: '', }, }; export const ImportProviderValues = Object.values(ImportProvider).sort((a, b) => a.localeCompare(b)); export type ImportReaderPayload = { file: File; provider: ImportProvider; userId?: string; passphrase?: string; }; export type ImportVault = { shareId: MaybeNull<string> /* `shareId: null` => new vault */; name: string; items: ItemImportIntent[]; }; export type ImportPayload = { vaults: ImportVault[]; ignored: string[]; warnings: string[] };
7,811
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/helpers/csv.reader.spec.ts
import { readCSV } from './csv.reader'; import { ImportReaderError } from './error'; type CSVItem = { id: string; name: string }; describe('readCSV', () => { it('should read CSV data with expected headers', async () => { const csvContent = 'id,name\n1,John Doe\n2,Jane Doe\n3,Bob Smith\n'; const result = await readCSV<CSVItem>({ data: csvContent, headers: ['id', 'name'] }); expect(result.items).toEqual([ { id: '1', name: 'John Doe' }, { id: '2', name: 'Jane Doe' }, { id: '3', name: 'Bob Smith' }, ]); expect(result.ignored).toEqual([]); }); it('should read CSV data with extra headers not in expected headers', async () => { const csvContent = 'id,name,age\n1,John Doe,20\n2,Jane Doe,21\n3,Bob Smith,22\n'; const result = await readCSV<CSVItem>({ data: csvContent, headers: ['id', 'name'] }); expect(result.items).toEqual([ { id: '1', name: 'John Doe', age: '20' }, { id: '2', name: 'Jane Doe', age: '21' }, { id: '3', name: 'Bob Smith', age: '22' }, ]); expect(result.ignored).toEqual([]); }); it('should throw error if CSV is empty', async () => { await expect(readCSV<CSVItem>({ data: '', headers: [] })).rejects.toThrow( new ImportReaderError('Empty CSV file') ); await expect(readCSV<CSVItem>({ data: 'id,name', headers: [] })).rejects.toThrow( new ImportReaderError('Empty CSV file') ); }); it('should throw error if CSV file has missing headers', async () => { const csvContent = 'id\n1\n2\n3\n'; await expect(readCSV<CSVItem>({ data: csvContent, headers: ['id', 'name'] })).rejects.toThrow( new ImportReaderError('CSV file is missing expected headers: name') ); }); it('should hydrate ignored array if some entries are invalid', async () => { const csvContent = 'id,name\n1,John Doe\n2\n3,Bob Smith\n'; const result = await readCSV<CSVItem>({ data: csvContent, headers: ['id', 'name'] }); expect(result.items).toEqual([ { id: '1', name: 'John Doe' }, { id: '3', name: 'Bob Smith' }, ]); expect(result.ignored).toEqual([{ id: '2' }]); }); });
7,812
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/helpers/csv.reader.ts
import Papa from 'papaparse'; import { c, msgid } from 'ttag'; import { logger } from '@proton/pass/utils/logger'; import { ImportReaderError } from './error'; export type CSVReaderResult<T extends Record<string, any>> = { items: T[]; ignored: Partial<T>[] }; export const readCSV = async <T extends Record<string, any>>(options: { data: string; headers?: (keyof T)[]; onError?: (error: string) => void; throwOnEmpty?: boolean; }): Promise<CSVReaderResult<T>> => { const throwOnEmpty = options?.throwOnEmpty ?? true; try { return await new Promise<CSVReaderResult<T>>((resolve, reject) => { Papa.parse<T>(options.data, { header: Boolean(options.headers), transformHeader: (h) => h.trim(), skipEmptyLines: true, delimiter: ',', newline: '\n', transform: (value) => value.replaceAll('\r', ''), complete: ({ data, errors }) => { if (errors.length > 0) { const errorDetails = errors.map((err) => err.message).join(', '); logger.debug('[Importer::ReadCSV]', errorDetails); options?.onError?.( // translator: ${errors.length} is a number `[Error] ${c('Error').ngettext( msgid`Detected ${errors.length} corrupted csv row`, `Detected ${errors.length} corrupted csv rows`, errors.length )}` ); } if (throwOnEmpty && data.length === 0) return reject(c('Error').t`Empty CSV file`); const { items, ignored, missed } = data.reduce<{ items: T[]; ignored: Partial<T>[]; missed: Set<string>; }>( (acc, entry) => { const missedHeaders = ((options.headers ?? []) as string[]).filter( (header) => !Object.keys(entry).includes(header) ); missedHeaders.forEach((header) => acc.missed.add(header)); acc[missedHeaders.length > 0 ? 'ignored' : 'items'].push(entry); return acc; }, { items: [], ignored: [], missed: new Set() } ); if (items.length === 0 && missed.size > 0) { const missingHeaders = Array.from(missed.values()).join(', '); return reject(c('Error').t`CSV file is missing expected headers: ${missingHeaders}`); } return resolve({ items, ignored }); }, error: (err: Error) => reject(err.message), }); }); } catch (err: any) { throw new ImportReaderError(err); } };
7,813
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/helpers/error.ts
import { c } from 'ttag'; export class ImportReaderError extends Error {} export class ImportProviderError extends Error { constructor(provider: string, err: unknown) { const errorDetail = err instanceof ImportReaderError ? `(${err.message})` : ''; super(c('Error').t`${provider} file could not be parsed. ${errorDetail}`); } }
7,814
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/helpers/transformers.ts
import { c } from 'ttag'; import { obfuscateItem } from '@proton/pass/lib/items/item.obfuscation'; import { parseOTPValue } from '@proton/pass/lib/otp/otp'; import type { Item, ItemImportIntent, Maybe, MaybeNull, UnsafeItemExtraField } from '@proton/pass/types'; import { CardType } from '@proton/pass/types/protobuf/item-v1'; import { prop } from '@proton/pass/utils/fp/lens'; import { truthy } from '@proton/pass/utils/fp/predicates'; import { obfuscate } from '@proton/pass/utils/obfuscate/xor'; import { uniqueId } from '@proton/pass/utils/string/unique-id'; import { getFormattedDayFromTimestamp } from '@proton/pass/utils/time/format'; import { getEpoch } from '@proton/pass/utils/time/get-epoch'; import { isValidURL } from '@proton/pass/utils/url/is-valid-url'; export const getImportedVaultName = (vaultName?: string) => { if (!vaultName) { const date = getFormattedDayFromTimestamp(getEpoch()); // translator: Import - 16/05/2014 return c('Title').t`Import - ${date}`; } return vaultName; }; export const importLoginItem = (options: { name?: MaybeNull<string>; note?: MaybeNull<string>; username?: MaybeNull<string>; password?: MaybeNull<string>; urls?: Maybe<string>[]; totp?: MaybeNull<string>; extraFields?: UnsafeItemExtraField[]; trashed?: boolean; createTime?: number; modifyTime?: number; appIds?: string[]; }): ItemImportIntent<'login'> => { const urls = [...new Set((options.urls ?? []).filter(truthy))] .map((uri) => { const { valid, url } = isValidURL(uri); return valid ? new URL(url) : undefined; }) .filter(truthy); const name = options.name || urls[0]?.hostname || c('Label').t`Unnamed item`; const getTOTPvalue = (totp?: MaybeNull<string>) => { return totp ? parseOTPValue(totp, { label: options.name || urls[0]?.hostname }) : ''; }; return { ...(obfuscateItem({ type: 'login', metadata: { name, note: options.note || '', itemUuid: uniqueId() }, content: { username: options.username || '', password: options.password || '', urls: urls.filter((url) => url.origin !== 'null').map(prop('href')), totpUri: getTOTPvalue(options.totp), }, extraFields: options.extraFields?.map((field) => field.type === 'totp' ? { ...field, data: { totpUri: getTOTPvalue(field.data.totpUri) } } : field ) ?? [], platformSpecific: options.appIds ? { android: { allowedApps: options.appIds.map((appId) => ({ packageName: appId, appName: appId, hashes: [appId], })), }, } : undefined, }) as Item<'login'>), trashed: options.trashed ?? false, createTime: options.createTime, modifyTime: options.modifyTime, }; }; export const importNoteItem = (options: { name?: MaybeNull<string>; note?: MaybeNull<string>; trashed?: boolean; createTime?: number; modifyTime?: number; }): ItemImportIntent<'note'> => { return { type: 'note', metadata: { name: options.name || c('Label').t`Unnamed note`, note: obfuscate(options.note || ''), itemUuid: uniqueId(), }, content: {}, extraFields: [], trashed: options.trashed ?? false, createTime: options.createTime, modifyTime: options.modifyTime, }; }; export const importCreditCardItem = (options: { name?: MaybeNull<string>; note?: MaybeNull<string>; cardholderName?: MaybeNull<string>; number?: MaybeNull<string>; verificationNumber?: MaybeNull<string>; expirationDate?: MaybeNull<string>; pin?: MaybeNull<string>; trashed?: boolean; createTime?: number; modifyTime?: number; }): ItemImportIntent<'creditCard'> => { return { ...(obfuscateItem({ type: 'creditCard', metadata: { name: options.name || c('Label').t`Unnamed Credit Card`, note: options.note || '', itemUuid: uniqueId(), }, content: { cardType: CardType.Unspecified, cardholderName: options.cardholderName || '', number: options.number || '', verificationNumber: options.verificationNumber || '', expirationDate: options.expirationDate || '', pin: options.pin || '', }, extraFields: [], }) as Item<'creditCard'>), extraData: [], trashed: options.trashed ?? false, createTime: options.createTime, modifyTime: options.modifyTime, }; };
7,815
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/1password.1pif.types.ts
import type { OnePassFieldType, OnePassLoginDesignation } from './1password.1pux.types'; export enum OnePassLegacyItemType { CREDIT_CARD = 'wallet.financial.CreditCard', LOGIN = 'webforms.WebForm', NOTE = 'securenotes.SecureNote', PASSWORD = 'passwords.Password', } export enum OnePassLegacySectionFieldKey { CONCEALED = 'concealed', STRING = 'string', URL = 'URL', } export type OnePassLegacyField = { value: string; type: OnePassFieldType; designation?: OnePassLoginDesignation; }; export type OnePassLegacySectionField = { k: OnePassLegacySectionFieldKey; n: string; v?: string; t: string; }; export type OnePassLegacySection = { title?: string; name: string; fields?: OnePassLegacySectionField[]; }; export type OnePassLegacyURL = { label?: string; url: string; }; export type OnePassLegacyItem = { uuid: string; typeName: OnePassLegacyItemType | string; createdAt: number; updatedAt: number; location?: string; title: string; secureContents: { cardholder?: string; ccnum?: string; cvv?: string; expiry_mm?: string; expiry_yy?: string; password?: string; notesPlain?: string; sections?: OnePassLegacySection[]; fields?: OnePassLegacyField[]; URLs?: OnePassLegacyURL[]; pin?: string; }; };
7,816
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/1password.1pux.spec.ts
import fs from 'fs'; import { deobfuscateExtraFields } from '@proton/pass/lib/items/item.obfuscation'; import type { ItemImportIntent } from '@proton/pass/types'; import { CardType } from '@proton/pass/types/protobuf/item-v1'; import { deobfuscate } from '@proton/pass/utils/obfuscate/xor'; import type { ImportPayload } from '../types'; import { read1Password1PuxData } from './1password.reader.1pux'; describe('Import 1password 1pux', () => { let sourceData: ArrayBuffer; let payload: ImportPayload; beforeAll(async () => { sourceData = await fs.promises.readFile(__dirname + '/mocks/1password.1pux'); payload = await read1Password1PuxData(sourceData); }); test('should throw on invalid file content', async () => { await expect(read1Password1PuxData(new ArrayBuffer(1))).rejects.toThrow(); }); test('result should contain the correct number of vaults', () => { const [main, secondary, shared] = payload.vaults; expect(payload.vaults.length).toEqual(3); expect(main.name).toEqual('Private'); expect(secondary.name).toEqual('SecondaryVault'); expect(shared.name).toEqual('Shared'); }); test('should parse `private` vault items correctly', () => { const [main] = payload.vaults; expect(main.items.length).toEqual(11); /* Note item */ const noteItemName = 'Note item'; const noteItem = main.items.find((item) => item.metadata.name === noteItemName) as ItemImportIntent<'note'>; expect(noteItem.type).toEqual('note'); expect(noteItem.createTime).toEqual(1619085236); expect(noteItem.modifyTime).toEqual(1688982876); expect(noteItem.metadata.itemUuid).not.toBeUndefined(); expect(deobfuscate(noteItem.metadata.note)).toEqual( 'Follow these steps to get started.\n\n1️⃣ Get the apps\nhttps://1password.com/downloads\nInstall 1Password everywhere you need your passwords.\n\n2️⃣ Get 1Password in your browser\nhttps://1password.com/downloads/#browsers\nInstall 1Password in your browser to save and fill passwords.\n\n3️⃣ Save your first password\n1. Sign in to your favorite website.\n2. 1Password will ask to save your username and password.\n3. Click Save Login.\n\n4️⃣ Fill passwords and more\nhttps://support.1password.com/explore/extension/\nSave and fill passwords, credit cards, and addresses.\n\n📚 Learn 1Password\nCheck out our videos and articles:\nWatch videos\nhttps://youtube.com/1PasswordVideos\nGet support\nhttps://support.1password.com/\nRead the blog\nhttps://blog.1password.com/\nContact us\nhttps://support.1password.com/contact-us/' ); expect(noteItem.content).toEqual({}); expect(noteItem.trashed).toEqual(false); expect(noteItem.extraFields).toEqual([]); /* Login item with multiple TOTP and text extra fields */ const loginItemMultiTOTPName = 'Login item with two TOTP and one text extra fields'; const loginItemMultiTOTP = main.items.find( (item) => item.metadata.name === loginItemMultiTOTPName ) as ItemImportIntent<'login'>; expect(loginItemMultiTOTP.type).toEqual('login'); expect(loginItemMultiTOTP.createTime).toEqual(1671029303); expect(loginItemMultiTOTP.modifyTime).toEqual(1688987066); expect(loginItemMultiTOTP.metadata.itemUuid).not.toBeUndefined(); expect(deobfuscate(loginItemMultiTOTP.metadata.note)).toEqual(''); expect(deobfuscate(loginItemMultiTOTP.content.username)).toEqual('john@wick.com'); expect(deobfuscate(loginItemMultiTOTP.content.password)).toEqual('password'); expect(deobfuscate(loginItemMultiTOTP.content.totpUri)).toEqual( 'otpauth://totp/Login%20item%20with%20two%20TOTP%20and%20one%20text%20extra%20fields?secret=BASE32SECRET3232&algorithm=SHA1&digits=6&period=30' ); expect(loginItemMultiTOTP.content.urls).toEqual(['http://localhost:7777/dashboard/']); expect(loginItemMultiTOTP.trashed).toEqual(false); expect(deobfuscateExtraFields(loginItemMultiTOTP.extraFields)).toEqual([ { fieldName: 'one-time password', type: 'totp', data: { totpUri: 'otpauth://totp/generator?secret=BASE32SECRET3232&algorithm=SHA1&digits=6&period=30', }, }, { fieldName: 'text extra field label', type: 'text', data: { content: 'text extra field content', }, }, ]); /* Login item with empty credentials */ const emptyLoginItemName = 'Login item with empty credentials'; const emptyLoginItem = main.items.find( (item) => item.metadata.name === emptyLoginItemName ) as ItemImportIntent<'login'>; expect(emptyLoginItem.type).toEqual('login'); expect(emptyLoginItem.createTime).toEqual(1677234145); expect(emptyLoginItem.modifyTime).toEqual(1688983124); expect(emptyLoginItem.metadata.itemUuid).not.toBeUndefined(); expect(emptyLoginItem.trashed).toEqual(false); expect(deobfuscate(emptyLoginItem.metadata.note)).toEqual(''); expect(deobfuscate(emptyLoginItem.content.username)).toEqual(''); expect(deobfuscate(emptyLoginItem.content.password)).toEqual(''); expect(deobfuscate(emptyLoginItem.content.totpUri)).toEqual(''); expect(emptyLoginItem.extraFields).toEqual([]); /* Login item with single TOTP extra field */ const loginItemSingleTOTPName = 'Login item with a note and single TOTP extra field'; const loginItemSingleTOTP = main.items.find( (item) => item.metadata.name === loginItemSingleTOTPName ) as ItemImportIntent<'login'>; expect(loginItemSingleTOTP.type).toEqual('login'); expect(loginItemSingleTOTP.createTime).toEqual(1675849436); expect(loginItemSingleTOTP.modifyTime).toEqual(1688983719); expect(loginItemSingleTOTP.metadata.itemUuid).not.toBeUndefined(); expect(deobfuscate(loginItemSingleTOTP.metadata.note)).toEqual('this is a login item note'); expect(deobfuscate(loginItemSingleTOTP.content.username)).toEqual(''); expect(deobfuscate(loginItemSingleTOTP.content.password)).toEqual(''); expect(deobfuscate(loginItemSingleTOTP.content.totpUri)).toEqual( 'otpauth://totp/az?secret=QQ&algorithm=SHA1&digits=6&period=30' ); expect(loginItemSingleTOTP.content.urls).toEqual([]); expect(loginItemSingleTOTP.trashed).toEqual(false); expect(loginItemSingleTOTP.extraFields).toEqual([]); /* Login item with special chars in password */ const specialCharItemName = 'Login item with " in password'; const specialCharItem = main.items.find( (item) => item.metadata.name === specialCharItemName ) as ItemImportIntent<'login'>; expect(specialCharItem.type).toEqual('login'); expect(specialCharItem.createTime).toEqual(1619085696); expect(specialCharItem.modifyTime).toEqual(1688987656); expect(specialCharItem.metadata.itemUuid).not.toBeUndefined(); expect(specialCharItem.trashed).toEqual(false); expect(specialCharItem.extraFields).toEqual([]); expect(deobfuscate(specialCharItem.metadata.note)).toEqual('Item notes'); expect(deobfuscate(specialCharItem.content.username)).toEqual('somewhere'); expect(deobfuscate(specialCharItem.content.password)).toEqual('somepassword with " in it'); expect(deobfuscate(specialCharItem.content.totpUri)).toEqual(''); expect(specialCharItem.content.urls).toEqual(['https://slashdot.org/']); /* login item with broken url */ const brokenUrlItemName = 'Login item with broken URL'; const brokenUrlItem = main.items.find( (item) => item.metadata.name === brokenUrlItemName ) as ItemImportIntent<'login'>; expect(brokenUrlItem.type).toEqual('login'); expect(brokenUrlItem.createTime).toEqual(1688987490); expect(brokenUrlItem.modifyTime).toEqual(1688987490); expect(brokenUrlItem.metadata.itemUuid).not.toBeUndefined(); expect(deobfuscate(brokenUrlItem.metadata.note)).toEqual(''); expect(brokenUrlItem.trashed).toEqual(false); expect(brokenUrlItem.extraFields).toEqual([]); expect(brokenUrlItem.content.urls).toEqual([]); const passwordItemName = 'Login item with Password only'; const passwordItem = main.items.find( (item) => item.metadata.name === passwordItemName ) as ItemImportIntent<'login'>; expect(passwordItem.type).toEqual('login'); expect(passwordItem.createTime).toEqual(1655535022); expect(passwordItem.modifyTime).toEqual(1688983483); expect(passwordItem.metadata.itemUuid).not.toBeUndefined(); expect(deobfuscate(passwordItem.metadata.note)).toEqual(''); expect(deobfuscate(passwordItem.content.username)).toEqual(''); expect(deobfuscate(passwordItem.content.password)).toEqual('f@LGRHG7BEcByVy--xTV8X4U'); expect(deobfuscate(passwordItem.content.totpUri)).toEqual(''); expect(passwordItem.content.urls).toEqual([]); expect(passwordItem.trashed).toEqual(false); expect(passwordItem.extraFields).toEqual([]); /* Login item created from password item */ const autofillItemName = 'Login item Autofill Sample'; const autofillItem = main.items.find( (item) => item.metadata.name === autofillItemName ) as ItemImportIntent<'login'>; expect(autofillItem.type).toEqual('login'); expect(autofillItem.createTime).toEqual(1688035201); expect(autofillItem.modifyTime).toEqual(1688983572); expect(autofillItem.metadata.itemUuid).not.toBeUndefined(); expect(deobfuscate(autofillItem.metadata.note)).toEqual(''); expect(deobfuscate(autofillItem.content.username)).toEqual('Username test'); expect(deobfuscate(autofillItem.content.password)).toEqual('password test'); expect(deobfuscate(autofillItem.content.totpUri)).toEqual(''); expect(autofillItem.content.urls).toEqual([]); expect(autofillItem.trashed).toEqual(false); expect(autofillItem.extraFields).toEqual([]); /* Credit Card item */ const creditCardItemName = 'Credit Card item with note'; const creditCardItem = main.items.find( (item) => item.metadata.name === creditCardItemName ) as ItemImportIntent<'creditCard'>; expect(creditCardItem.type).toEqual('creditCard'); expect(deobfuscate(creditCardItem.metadata.note)).toEqual('this is credit card item note'); expect(deobfuscate(creditCardItem.content.number)).toEqual('4242333342423333'); expect(deobfuscate(creditCardItem.content.verificationNumber)).toEqual('123'); expect(deobfuscate(creditCardItem.content.pin)).toEqual('1234'); expect(creditCardItem.content.cardType).toEqual(CardType.Unspecified); expect(creditCardItem.content.cardholderName).toEqual('A B'); expect(creditCardItem.content.expirationDate).toEqual('012025'); }); test('should parse `secondary` vault items correctly', () => { const [, secondary] = payload.vaults; expect(secondary.items.length).toEqual(2); /* deleted items not included */ const archivedItemName = 'Login item archived'; const archivedItem = secondary.items.find( (item) => item.metadata.name === archivedItemName ) as ItemImportIntent<'login'>; expect(archivedItem.type).toEqual('login'); expect(archivedItem.createTime).toEqual(1683720664); expect(archivedItem.modifyTime).toEqual(1688990961); expect(archivedItem.metadata.itemUuid).not.toBeUndefined(); expect(deobfuscate(archivedItem.metadata.note)).toEqual(''); expect(deobfuscate(archivedItem.content.username)).toEqual('archived'); expect(deobfuscate(archivedItem.content.password)).toEqual('password'); expect(deobfuscate(archivedItem.content.totpUri)).toEqual(''); expect(archivedItem.content.urls).toEqual([]); expect(archivedItem.trashed).toEqual(true); expect(archivedItem.extraFields).toEqual([]); const loginItemName = 'Login item'; const loginItem = secondary.items.find( (item) => item.metadata.name === loginItemName ) as ItemImportIntent<'login'>; expect(loginItem.type).toEqual('login'); expect(loginItem.createTime).toEqual(1675777494); expect(loginItem.modifyTime).toEqual(1675777506); expect(loginItem.metadata.itemUuid).not.toBeUndefined(); expect(deobfuscate(loginItem.metadata.note)).toEqual(''); expect(deobfuscate(loginItem.content.username)).toEqual('username'); expect(deobfuscate(loginItem.content.password)).toEqual('password'); expect(deobfuscate(loginItem.content.totpUri)).toEqual(''); expect(loginItem.content.urls).toEqual([]); expect(loginItem.trashed).toEqual(false); expect(loginItem.extraFields).toEqual([]); }); test('should parse `shared` vault items correctly', () => { const [, , shared] = payload.vaults; expect(shared.items.length).toEqual(0); }); });
7,817
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/1password.1pux.types.ts
import type { Maybe } from '@proton/pass/types'; export enum OnePassState { ACTIVE = 'active', ARCHIVED = 'archived', TRASHED = 'trashed', } export enum OnePassFieldType { TEXT = 'T', EMAIL = 'E', URL = 'U', NUMBER = 'N', PASSWORD = 'P', TEXTAREA = 'A', PHONE = 'TEL', } export enum OnePassLoginDesignation { USERNAME = 'username', PASSWORD = 'password', } export enum OnePassCategory { LOGIN = '001', CREDIT_CARD = '002', NOTE = '003', PASSWORD = '005', OTHER = '006', } export enum OnePassVaultType { PRIVATE = 'P', SHARED_WITH_EVERYONE = 'E', USER_CREATED = 'U', } export enum OnePassFieldKey { CONCEALED = 'concealed', CREDIT_CARD_NUMBER = 'creditCardNumber', MONTH_YEAR = 'monthYear', STRING = 'string', TOTP = 'totp', URL = 'url', } export type OnePassFields = { [K in OnePassFieldKey]?: K extends OnePassFieldKey.MONTH_YEAR ? number : string }; export enum OnePassCreditCardFieldId { CARDHOLDER = 'cardholder', CVV = 'cvv', EXPIRY = 'expiry', NUMBER = 'ccnum', TYPE = 'type', VALID_FROM = 'validFrom', PIN = 'pin', } export type OnePassCreditCardFields = { [K in OnePassCreditCardFieldId]?: OnePassField }; export const OnePassFieldValueKeys = Object.values(OnePassFieldKey); export const OnePassCreditCardFieldIds = Object.values(OnePassCreditCardFieldId); export type OnePassField = { title: string; id: string; value: OnePassFields; }; export type ItemSection = { title: string; name: string; fields: OnePassField[]; }; export type OnePassItemDetails = { notesPlain: Maybe<string>; sections: Maybe<ItemSection[]>; }; export type OnePassPassword = OnePassItemDetails & { password: string }; export type OnePassNote = OnePassItemDetails; export type OnePassLogin = OnePassItemDetails & { loginFields: { value: string; name: Maybe<string>; type: OnePassFieldType; designation: OnePassLoginDesignation; notesPlain: Maybe<string>; sections: ItemSection[]; }[]; }; export type OnePassCreditCard = OnePassItemDetails; export type OnePassBaseItem = { uuid: string; favIndex: number; createdAt: number; updatedAt: number; state: OnePassState; categoryUuid: string; overview: { title: string; subtitle: string; url: string; urls: Maybe<{ label: string; url: string }[]>; tags: string[]; }; }; export type OnePassItem = OnePassBaseItem & ( | { categoryUuid: OnePassCategory.LOGIN; details: OnePassLogin } | { categoryUuid: OnePassCategory.NOTE; details: OnePassNote } | { categoryUuid: OnePassCategory.PASSWORD; details: OnePassPassword } | { categoryUuid: OnePassCategory.CREDIT_CARD; details: OnePassCreditCard } ); export type OnePass1PuxData = { accounts: { attrs: { accountName: string; name: string; email: string; domain: string; }; vaults: { attrs: { uuid: string; desc: string; name: string; avatar: string; type: OnePassVaultType; }; items: OnePassItem[]; }[]; }[]; }; export const OnePasswordTypeMap: Record<string, string> = { '001': 'Login', '002': 'Credit Card', '003': 'Note', '004': 'Identification', '005': 'Password', };
7,818
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/1password.reader.1pif.spec.ts
import fs from 'fs'; import { deobfuscateExtraFields } from '@proton/pass/lib/items/item.obfuscation'; import type { ItemImportIntent } from '@proton/pass/types'; import { CardType } from '@proton/pass/types/protobuf/item-v1'; import { deobfuscate } from '@proton/pass/utils/obfuscate/xor'; import type { ImportPayload } from '../types'; import { read1Password1PifData } from './1password.reader.1pif'; describe('Import 1password 1pif', () => { let sourceData: string; let payload: ImportPayload; beforeAll(async () => { sourceData = await fs.promises.readFile(__dirname + '/mocks/1password.private.1pif', 'utf8'); payload = await read1Password1PifData(sourceData); }); test('should throw on invalid file content', async () => { await expect(read1Password1PifData('not-a-1pif-file')).rejects.toThrow(); }); it('should correctly parse items', () => { const [vaultData] = payload.vaults; expect(vaultData.items.length).toEqual(8); expect(payload.vaults.length).toEqual(1); expect(vaultData.name).not.toBeUndefined(); const { items } = vaultData; /* Login */ const loginItem1 = items[1] as ItemImportIntent<'login'>; expect(loginItem1.type).toEqual('login'); expect(deobfuscate(loginItem1.metadata.note)).toEqual('Item notes'); expect(deobfuscate(loginItem1.content.username)).toEqual('somewhere'); expect(deobfuscate(loginItem1.content.password)).toEqual('somepassword with " in it'); expect(loginItem1.content.urls[0]).toEqual('https://slashdot.org/'); expect(loginItem1.content.urls.length).toEqual(1); /* Note item */ const noteItem = items[2] as ItemImportIntent<'note'>; expect(noteItem.type).toEqual('note'); expect(noteItem.createTime).toEqual(1619085236); expect(noteItem.modifyTime).toEqual(1619085236); expect(noteItem.metadata.itemUuid).not.toBeUndefined(); expect(noteItem.metadata.name).toEqual('🎉 Welcome to 1Password!'); expect(deobfuscate(noteItem.metadata.note)).toEqual( 'Follow these steps to get started.\n\n1️⃣ Get the apps\nhttps://1password.com/downloads\nInstall 1Password everywhere you need your passwords.\n\n2️⃣ Get 1Password in your browser\nhttps://1password.com/downloads/#browsers\nInstall 1Password in your browser to save and fill passwords.\n\n3️⃣ Save your first password\n1. Sign in to your favorite website.\n2. 1Password will ask to save your username and password.\n3. Click Save Login.\n\n4️⃣ Fill passwords and more\nhttps://support.1password.com/explore/extension/\nSave and fill passwords, credit cards, and addresses.\n\n📚 Learn 1Password\nCheck out our videos and articles:\nWatch videos\nhttps://youtube.com/1PasswordVideos\nGet support\nhttps://support.1password.com/\nRead the blog\nhttps://blog.1password.com/\nContact us\nhttps://support.1password.com/contact-us/' ); expect(noteItem.content).toEqual({}); expect(noteItem.trashed).toEqual(false); expect(noteItem.extraFields).toEqual([]); /* Password item */ const passwordItem = items[0] as ItemImportIntent<'login'>; expect(passwordItem.type).toEqual('login'); expect(passwordItem.createTime).toEqual(1655535022); expect(passwordItem.modifyTime).toEqual(1655535034); expect(passwordItem.metadata.itemUuid).not.toBeUndefined(); expect(passwordItem.metadata.name).toEqual('Password'); expect(deobfuscate(passwordItem.metadata.note)).toEqual(''); expect(deobfuscate(passwordItem.content.username)).toEqual(''); expect(deobfuscate(passwordItem.content.password)).toEqual('f@LGRHG7BEcByVy--xTV8X4U'); expect(deobfuscate(passwordItem.content.totpUri)).toEqual(''); expect(passwordItem.content.urls).toEqual([]); expect(passwordItem.trashed).toEqual(false); expect(passwordItem.extraFields).toEqual([]); /* Login item with TOTP extra field */ const loginItemSingleTOTP = items[6] as ItemImportIntent<'login'>; expect(loginItemSingleTOTP.type).toEqual('login'); expect(loginItemSingleTOTP.createTime).toEqual(1675849436); expect(loginItemSingleTOTP.modifyTime).toEqual(1676455597); expect(loginItemSingleTOTP.trashed).toEqual(false); expect(loginItemSingleTOTP.metadata.itemUuid).not.toBeUndefined(); expect(loginItemSingleTOTP.metadata.name).toEqual('login with 2fa'); expect(deobfuscate(loginItemSingleTOTP.metadata.note)).toEqual(''); expect(deobfuscateExtraFields(loginItemSingleTOTP.extraFields)).toEqual([ { fieldName: 'one-time password', type: 'totp', data: { totpUri: 'otpauth://totp/az?secret=QQ&algorithm=SHA1&digits=6&period=30', }, }, ]); /* Login item with multiple TOTP extra fields */ const loginItemMultiTOTP = items[5] as ItemImportIntent<'login'>; expect(loginItemMultiTOTP.type).toEqual('login'); expect(loginItemMultiTOTP.createTime).toEqual(1671029303); expect(loginItemMultiTOTP.modifyTime).toEqual(1676038895); expect(loginItemMultiTOTP.metadata.name).toEqual('Login with TOTP'); expect(loginItemMultiTOTP.metadata.itemUuid).not.toBeUndefined(); expect(deobfuscate(loginItemMultiTOTP.metadata.note)).toEqual(''); expect(deobfuscate(loginItemMultiTOTP.content.username)).toEqual('john@wick.com'); expect(deobfuscate(loginItemMultiTOTP.content.password)).toEqual('password'); expect(deobfuscate(loginItemMultiTOTP.content.totpUri)).toEqual(''); expect(loginItemMultiTOTP.content.urls).toEqual(['http://localhost:7777/dashboard/']); expect(loginItemMultiTOTP.trashed).toEqual(false); expect(deobfuscateExtraFields(loginItemMultiTOTP.extraFields)).toEqual([ { fieldName: 'one-time password', type: 'totp', data: { totpUri: 'otpauth://totp/Login%20with%20TOTP?secret=BASE32SECRET3232&algorithm=SHA1&digits=6&period=30', }, }, { fieldName: 'one-time password', type: 'totp', data: { totpUri: 'otpauth://totp/generator?secret=BASE32SECRET3232&algorithm=SHA1&digits=6&period=30', }, }, ]); /* Login item with special chars and text extra field */ const specialCharItem = items[1] as ItemImportIntent<'login'>; expect(specialCharItem.type).toEqual('login'); expect(specialCharItem.createTime).toEqual(1619085696); expect(specialCharItem.modifyTime).toEqual(1671040547); expect(specialCharItem.metadata.itemUuid).not.toBeUndefined(); expect(specialCharItem.metadata.name).toEqual('Credential with " in the name'); expect(deobfuscate(specialCharItem.metadata.note)).toEqual('Item notes'); expect(deobfuscate(specialCharItem.content.username)).toEqual('somewhere'); expect(deobfuscate(specialCharItem.content.password)).toEqual('somepassword with " in it'); expect(deobfuscate(specialCharItem.content.totpUri)).toEqual(''); expect(specialCharItem.content.urls).toEqual(['https://slashdot.org/']); expect(specialCharItem.trashed).toEqual(false); expect(deobfuscateExtraFields(specialCharItem.extraFields)).toEqual([ { fieldName: 'text section', type: 'text', data: { content: 'value of the text section', }, }, ]); /* Login item created from password item */ const autofillItem = items[3] as ItemImportIntent<'login'>; expect(autofillItem.type).toEqual('login'); expect(autofillItem.createTime).toEqual(1675771315); expect(autofillItem.modifyTime).toEqual(1675771315); expect(autofillItem.metadata.itemUuid).not.toBeUndefined(); expect(autofillItem.metadata.name).toEqual('Autofill Sample'); expect(deobfuscate(autofillItem.metadata.note)).toEqual(''); expect(deobfuscate(autofillItem.content.username)).toEqual('username test'); expect(deobfuscate(autofillItem.content.password)).toEqual('password test'); expect(deobfuscate(autofillItem.content.totpUri)).toEqual(''); expect(autofillItem.content.urls).toEqual([]); expect(autofillItem.trashed).toEqual(false); expect(autofillItem.extraFields).toEqual([]); /* Credit Card item */ const creditCardItemName = 'Credit Card item with note'; const creditCardItem = items.find( (item) => item.metadata.name === creditCardItemName ) as ItemImportIntent<'creditCard'>; expect(creditCardItem.type).toEqual('creditCard'); expect(deobfuscate(creditCardItem.metadata.note)).toEqual('this is credit card item note'); expect(deobfuscate(creditCardItem.content.number)).toEqual('4242333342423333'); expect(deobfuscate(creditCardItem.content.pin)).toEqual('1234'); expect(deobfuscate(creditCardItem.content.verificationNumber)).toEqual('123'); expect(creditCardItem.content.cardType).toEqual(CardType.Unspecified); expect(creditCardItem.content.cardholderName).toEqual('A B'); expect(creditCardItem.content.expirationDate).toEqual('012025'); }); });
7,819
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/1password.reader.1pif.ts
import { c } from 'ttag'; import type { ItemImportIntent, UnsafeItemExtraField } from '@proton/pass/types'; import { truthy } from '@proton/pass/utils/fp/predicates'; import { logger } from '@proton/pass/utils/logger'; import { ImportProviderError } from '../helpers/error'; import { getImportedVaultName, importCreditCardItem, importLoginItem, importNoteItem } from '../helpers/transformers'; import type { ImportPayload, ImportVault } from '../types'; import type { OnePassLegacyItem, OnePassLegacySectionField, OnePassLegacyURL } from './1password.1pif.types'; import { OnePassLegacyItemType, OnePassLegacySectionFieldKey } from './1password.1pif.types'; import { OnePassLoginDesignation } from './1password.1pux.types'; const ENTRY_SEPARATOR_1PIF = '***'; const isNoteSectionField = ({ k: key }: OnePassLegacySectionField) => key === OnePassLegacySectionFieldKey.STRING || key === OnePassLegacySectionFieldKey.URL; const extractFullNote = (item: OnePassLegacyItem): string => { const base = item.secureContents?.notesPlain; return (item.secureContents.sections ?? []) .reduce<string>( (fullNote, section) => { const hasNoteFields = section.fields?.some(isNoteSectionField); if (!hasNoteFields) return fullNote; if (section.title) fullNote += `${section.title}\n`; (section.fields ?? []).forEach((field, idx, fields) => { const { t: subTitle, v: value } = field; if (!isNoteSectionField(field)) return; if (subTitle) fullNote += `${subTitle}\n`; if (value) fullNote += `${value}\n${idx === fields.length - 1 ? '\n' : ''}`; }); return fullNote; }, base ? `${base}\n\n` : '' ) .trim(); }; const extractURLs = (item: OnePassLegacyItem): string[] => { if (item.secureContents?.URLs === undefined) return []; return item.secureContents.URLs.map(({ url }: OnePassLegacyURL) => url); }; const extractExtraFields = (item: OnePassLegacyItem) => { return item.secureContents.sections ?.filter(({ fields }) => Boolean(fields)) .flatMap(({ fields }) => (fields as OnePassLegacySectionField[]) .filter(({ k }) => Object.values(OnePassLegacySectionFieldKey).includes(k)) .map<UnsafeItemExtraField>(({ k, t, v, n }) => { switch (k) { case OnePassLegacySectionFieldKey.STRING: case OnePassLegacySectionFieldKey.URL: return { fieldName: t || c('Label').t`Text`, type: 'text', data: { content: v ?? '' }, }; case OnePassLegacySectionFieldKey.CONCEALED: if (n.startsWith('TOTP')) { return { fieldName: t || c('Label').t`TOTP`, type: 'totp', data: { totpUri: v ?? '' }, }; } return { // translator: label for a field that is hidden. Singular only. fieldName: t || c('Label').t`Hidden`, type: 'hidden', data: { content: v ?? '' }, }; } }) ); }; const processLoginItem = (item: OnePassLegacyItem): ItemImportIntent<'login'> => { const fields = item.secureContents.fields; return importLoginItem({ name: item.title, note: item.secureContents?.notesPlain, username: fields?.find(({ designation }) => designation === OnePassLoginDesignation.USERNAME)?.value, password: fields?.find(({ designation }) => designation === OnePassLoginDesignation.PASSWORD)?.value, urls: extractURLs(item), extraFields: extractExtraFields(item), createTime: item.createdAt, modifyTime: item.updatedAt, }); }; const processNoteItem = (item: OnePassLegacyItem): ItemImportIntent<'note'> => importNoteItem({ name: item.title, note: extractFullNote(item), createTime: item.createdAt, modifyTime: item.updatedAt, }); const processPasswordItem = (item: OnePassLegacyItem): ItemImportIntent<'login'> => importLoginItem({ name: item.title, note: item.secureContents?.notesPlain, password: item.secureContents?.password, urls: extractURLs(item), extraFields: extractExtraFields(item), createTime: item.createdAt, modifyTime: item.updatedAt, }); const processCreditCardItem = (item: OnePassLegacyItem): ItemImportIntent<'creditCard'> => { const expirationDate = item.secureContents.expiry_mm && item.secureContents.expiry_yy ? `${String(item.secureContents.expiry_mm).padStart(2, '0')}${item.secureContents.expiry_yy}` : undefined; return importCreditCardItem({ name: item.title, note: item.secureContents.notesPlain, cardholderName: item.secureContents.cardholder, number: item.secureContents.ccnum, verificationNumber: item.secureContents.cvv, expirationDate, pin: item.secureContents.pin, }); }; export const parse1PifData = (data: string): OnePassLegacyItem[] => data .split('\n') .filter((line) => !line.startsWith(ENTRY_SEPARATOR_1PIF) && Boolean(line)) .map((rawItem) => JSON.parse(rawItem)); export const read1Password1PifData = async (data: string): Promise<ImportPayload> => { try { const ignored: string[] = []; const items: ItemImportIntent[] = parse1PifData(data) .map((item) => { switch (item.typeName) { case OnePassLegacyItemType.LOGIN: return processLoginItem(item); case OnePassLegacyItemType.NOTE: return processNoteItem(item); case OnePassLegacyItemType.PASSWORD: return processPasswordItem(item); case OnePassLegacyItemType.CREDIT_CARD: return processCreditCardItem(item); default: ignored.push(`[${item.typeName}] ${item.title ?? ''}`); } }) .filter(truthy); const vaults: ImportVault[] = [ { name: getImportedVaultName(), shareId: null, items: items, }, ]; return { vaults, ignored, warnings: [] }; } catch (e) { logger.warn('[Importer::1Password]', e); throw new ImportProviderError('1Password', e); } };
7,820
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/1password.reader.1pux.ts
import jszip from 'jszip'; import { c } from 'ttag'; import type { ItemImportIntent, Maybe, UnsafeItemExtraField } from '@proton/pass/types'; import { extractFirst } from '@proton/pass/utils/array/extract-first'; import { truthy } from '@proton/pass/utils/fp/predicates'; import { logger } from '@proton/pass/utils/logger'; import lastItem from '@proton/utils/lastItem'; import { ImportProviderError } from '../helpers/error'; import { getImportedVaultName, importCreditCardItem, importLoginItem, importNoteItem } from '../helpers/transformers'; import type { ImportPayload, ImportVault } from '../types'; import type { OnePass1PuxData, OnePassBaseItem, OnePassCreditCardFieldId, OnePassCreditCardFields, OnePassField, OnePassItem, OnePassItemDetails, } from './1password.1pux.types'; import { OnePassCategory, OnePassCreditCardFieldIds, OnePassFieldKey, OnePassFieldValueKeys, OnePassLoginDesignation, OnePassState, OnePasswordTypeMap, } from './1password.1pux.types'; const formatMonthYear = (monthYear: Maybe<number>): string => { const monthYearString = String(monthYear); if (!monthYear || monthYearString.length !== 6) return ''; return `${monthYearString.slice(4, 6)}${monthYearString.slice(0, 4)}`; }; const isNoteSectionField = ({ value }: OnePassField) => 'string' in value || 'url' in value; const isSupportedField = ({ value }: OnePassField) => OnePassFieldValueKeys.some((key) => key === Object.keys(value)[0]); const isCreditCardField = (field: OnePassField): field is OnePassField & { id: OnePassCreditCardFieldId } => OnePassCreditCardFieldIds.some((id) => id === field.id); const extractFullNote = (details: OnePassItemDetails): string => { const base = details.notesPlain; return (details.sections ?? []) .reduce<string>( (fullNote, section) => { if (!section) return fullNote; const hasNoteFields = section.fields.some(isNoteSectionField); if (!hasNoteFields) return fullNote; if (section.title) fullNote += `${section.title}\n`; (section.fields ?? []).forEach((field, idx, fields) => { if (!isNoteSectionField(field)) return; const subTitle = field.title; const value = field.value.string ?? field.value.url ?? ''; if (subTitle) fullNote += `${subTitle}\n`; if (value) fullNote += `${value}\n${idx === fields.length - 1 ? '\n' : ''}`; }); return fullNote; }, base ? `${base}\n\n` : '' ) .trim(); }; const extractURLs = ({ overview }: OnePassItem): string[] => [ overview.url, ...(overview.urls ?? []).map(({ url }) => url), ]; const extractExtraFields = (item: OnePassItem): UnsafeItemExtraField[] => { const { sections = [] } = item.details; if (!sections) return []; return ( sections /* check that field value key is supported and remove any credit card fields */ .flatMap(({ fields }) => fields.filter((field) => isSupportedField(field) && !isCreditCardField(field))) .map<UnsafeItemExtraField>(({ title, value }) => { const valueKey = Object.keys(value)[0] as OnePassFieldKey; switch (valueKey) { case OnePassFieldKey.MONTH_YEAR: return { fieldName: title || c('Label').t`Text`, type: 'text', data: { content: formatMonthYear(value[valueKey]) ?? '' }, }; case OnePassFieldKey.STRING: case OnePassFieldKey.URL: return { fieldName: title || c('Label').t`Text`, type: 'text', data: { content: value[valueKey] ?? '' }, }; case OnePassFieldKey.TOTP: return { fieldName: title || c('Label').t`TOTP`, type: 'totp', data: { totpUri: value[valueKey] ?? '' }, }; case OnePassFieldKey.CONCEALED: case OnePassFieldKey.CREDIT_CARD_NUMBER: return { fieldName: title || c('Label').t`Hidden`, type: 'hidden', data: { content: value[valueKey] ?? '' }, }; } }) ); }; const processNoteItem = ( item: Extract<OnePassItem, { categoryUuid: OnePassCategory.NOTE }> ): ItemImportIntent<'note'> => importNoteItem({ name: item.overview.title, note: extractFullNote(item.details), createTime: item.createdAt, modifyTime: item.updatedAt, trashed: item.state === OnePassState.ARCHIVED, }); const extractLoginFieldFromLoginItem = ( item: Extract<OnePassItem, { categoryUuid: OnePassCategory.LOGIN }>, designation: OnePassLoginDesignation ): string => lastItem(item.details.loginFields.filter((field) => field.designation === designation))?.value ?? ''; const processLoginItem = ( item: Extract<OnePassItem, { categoryUuid: OnePassCategory.LOGIN }> ): ItemImportIntent<'login'> => { const [totp, extraFields] = extractFirst( extractExtraFields(item), (extraField): extraField is UnsafeItemExtraField<'totp'> => extraField.type === 'totp' ); return importLoginItem({ name: item.overview.title, note: item.details.notesPlain, username: extractLoginFieldFromLoginItem(item, OnePassLoginDesignation.USERNAME), password: extractLoginFieldFromLoginItem(item, OnePassLoginDesignation.PASSWORD), urls: extractURLs(item), totp: totp?.data.totpUri, extraFields, trashed: item.state === OnePassState.ARCHIVED, createTime: item.createdAt, modifyTime: item.updatedAt, }); }; const processPasswordItem = ( item: Extract<OnePassItem, { categoryUuid: OnePassCategory.PASSWORD }> ): Maybe<ItemImportIntent<'login'>> => { if (item.details.password === undefined) return undefined; return importLoginItem({ name: item.overview.title, note: item.details.notesPlain, password: item.details.password, urls: extractURLs(item), trashed: item.state === OnePassState.ARCHIVED, createTime: item.createdAt, modifyTime: item.updatedAt, }); }; const processCreditCardItem = (item: Extract<OnePassItem, { categoryUuid: OnePassCategory.CREDIT_CARD }>) => { const { cardholder, ccnum, cvv, expiry, pin } = ((): OnePassCreditCardFields => { const { sections } = item.details; if (!sections || sections.length === 0) return {}; return sections .flatMap((s) => s.fields) .reduce<OnePassCreditCardFields>((acc, field) => { if (isCreditCardField(field)) acc[field.id] = field; return acc; }, {}); })(); return importCreditCardItem({ name: item.overview.title, note: item.details.notesPlain, createTime: item.createdAt, modifyTime: item.updatedAt, trashed: item.state === OnePassState.ARCHIVED, cardholderName: cardholder?.value.string, number: ccnum?.value.creditCardNumber, verificationNumber: cvv?.value.concealed, expirationDate: formatMonthYear(expiry?.value.monthYear), pin: pin?.value.concealed, }); }; export const read1Password1PuxData = async (data: ArrayBuffer): Promise<ImportPayload> => { try { const zipFile = await jszip.loadAsync(data); const zipObject = zipFile.file('export.data'); const content = await zipObject?.async('string'); if (content === undefined) throw new Error('Unprocessable content'); const parsedData = JSON.parse(content) as OnePass1PuxData; const ignored: string[] = []; const vaults = parsedData.accounts.flatMap((account) => account.vaults.map( (vault): ImportVault => ({ name: getImportedVaultName(vault.attrs.name), shareId: null, items: vault.items .filter((item) => item.state !== OnePassState.TRASHED) .map((item): Maybe<ItemImportIntent> => { switch (item.categoryUuid) { case OnePassCategory.LOGIN: return processLoginItem(item); case OnePassCategory.NOTE: return processNoteItem(item); case OnePassCategory.CREDIT_CARD: return processCreditCardItem(item); case OnePassCategory.PASSWORD: return processPasswordItem(item); default: const { categoryUuid, overview } = item as OnePassBaseItem; ignored.push( `[${OnePasswordTypeMap[categoryUuid] ?? 'Other'}] ${ overview.title ?? overview.subtitle }` ); } }) .filter(truthy), }) ) ); return { vaults, ignored, warnings: [] }; } catch (e) { logger.warn('[Importer::1Password]', e); throw new ImportProviderError('1Password', e); } };
7,821
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/bitwarden.reader.ts
import { c } from 'ttag'; import type { ItemImportIntent, Maybe, UnsafeItemExtraField } from '@proton/pass/types'; import { truthy } from '@proton/pass/utils/fp/predicates'; import { logger } from '@proton/pass/utils/logger'; import { BITWARDEN_ANDROID_APP_FLAG, isBitwardenLinkedAndroidAppUrl } from '@proton/pass/utils/url/android'; import { ImportProviderError, ImportReaderError } from '../helpers/error'; import { getImportedVaultName, importCreditCardItem, importLoginItem, importNoteItem } from '../helpers/transformers'; import type { ImportPayload, ImportVault } from '../types'; import { type BitwardenCCItem, BitwardenCustomFieldType, type BitwardenData, type BitwardenLoginItem, BitwardenType, } from './bitwarden.types'; const BitwardenTypeMap: Record<number, string> = { 1: 'Login', 2: 'Note', 3: 'Credit Card', 4: 'Identification', }; const extractUrls = (item: BitwardenLoginItem) => (item.login.uris ?? []).reduce<{ web: string[]; android: string[] }>( (acc, { uri }) => { if (isBitwardenLinkedAndroidAppUrl(uri)) { acc.android.push(uri.replace(BITWARDEN_ANDROID_APP_FLAG, '')); return acc; } else { acc.web.push(uri); } return acc; }, { web: [], android: [] } ); const extractExtraFields = (item: BitwardenLoginItem) => { return item.fields ?.filter((field) => Object.values(BitwardenCustomFieldType).includes(field.type)) .map<UnsafeItemExtraField>(({ name, type, value }) => { switch (type) { case BitwardenCustomFieldType.TEXT: return { fieldName: name || c('Label').t`Text`, type: 'text', data: { content: value ?? '' }, }; case BitwardenCustomFieldType.HIDDEN: return { // translator: label for a field that is hidden. Singular only. fieldName: name || c('Label').t`Hidden`, type: 'hidden', data: { content: value ?? '' }, }; } }); }; const formatCCExpirationDate = (item: BitwardenCCItem) => { const { expMonth, expYear } = item.card; if (!expMonth || !expYear) return ''; return `${String(expMonth).padStart(2, '0')}${expYear}`; }; export const readBitwardenData = (data: string): ImportPayload => { try { const { items, encrypted } = JSON.parse(data) as BitwardenData; if (encrypted) throw new ImportReaderError(c('Error').t`Encrypted JSON not supported`); const ignored: string[] = []; const vaults: ImportVault[] = [ { name: getImportedVaultName(), shareId: null, items: items .map((item): Maybe<ItemImportIntent> => { switch (item.type) { case BitwardenType.LOGIN: const urls = extractUrls(item); return importLoginItem({ name: item.name, note: item.notes, username: item.login.username, password: item.login.password, urls: urls.web, totp: item.login.totp, appIds: urls.android, extraFields: extractExtraFields(item), }); case BitwardenType.NOTE: return importNoteItem({ name: item.name, note: item.notes, }); case BitwardenType.CREDIT_CARD: return importCreditCardItem({ name: item.name, note: item.notes, cardholderName: item.card.cardholderName, number: item.card.number, verificationNumber: item.card.code, expirationDate: formatCCExpirationDate(item), }); default: ignored.push( `[${BitwardenTypeMap[item.type] ?? c('Placeholder').t`Other`}] ${item.name}` ); return; } }) .filter(truthy), }, ]; return { vaults, ignored, warnings: [] }; } catch (e) { logger.warn('[Importer::Bitwarden]', e); throw new ImportProviderError('Bitwarden', e); } };
7,822
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/bitwarden.spec.ts
import fs from 'fs'; import { deobfuscateItem } from '@proton/pass/lib/items/item.obfuscation'; import type { ItemExtraField, ItemImportIntent } from '@proton/pass/types'; import type { ImportPayload } from '../types'; import { readBitwardenData } from './bitwarden.reader'; describe('Import bitwarden json', () => { let sourceData: string; let payload: ImportPayload; beforeAll(async () => { sourceData = await fs.promises.readFile(__dirname + '/mocks/bitwarden.json', 'utf8'); payload = readBitwardenData(sourceData); }); it('should throw on encrypted json payload', () => { expect(() => readBitwardenData(JSON.stringify({ encrypted: true, items: [] }))).toThrow(); }); it('should throw on corrupted files', () => { expect(() => readBitwardenData('not-a-json-body')).toThrow(); expect(() => readBitwardenData(JSON.stringify({ encrypted: false }))).toThrow(); expect(() => readBitwardenData(JSON.stringify({ encrypted: false, items: '[]' }))).toThrow(); }); it('should correctly parse items', () => { const [vaultData] = payload.vaults; expect(payload.vaults.length).toEqual(1); expect(vaultData.name).not.toBeUndefined(); const { items } = vaultData; /* Login */ const loginItem1 = deobfuscateItem(items[0] as any) as unknown as ItemImportIntent<'login'>; const allowedApp = loginItem1.platformSpecific?.android?.allowedApps[0]; expect(loginItem1.type).toBe('login'); expect(loginItem1.metadata.name).toBe('LoginItemMultipleWebsites'); expect(loginItem1.metadata.note).toBe('login note'); expect(loginItem1.content.username).toBe('username'); expect(loginItem1.content.password).toBe('password'); expect(loginItem1.content.urls[0]).toBe('https://test.url1/'); expect(loginItem1.content.urls[1]).toBe('https://test.url2/'); expect(loginItem1.content.totpUri).toBe( 'otpauth://totp/test?issuer=proton&secret=PROTON33&algorithm=SHA1&digits=6&period=30' ); const loginItem1ExtraField1 = loginItem1.extraFields[0] as ItemExtraField<'text'>; expect(loginItem1ExtraField1.fieldName).toBe('Text 1'); expect(loginItem1ExtraField1.data.content).toBe('Text 1 content'); const loginItem1ExtraField2 = loginItem1.extraFields[1] as ItemExtraField<'hidden'>; expect(loginItem1ExtraField2.fieldName).toBe('Hidden 1'); expect(loginItem1ExtraField2.data.content).toBe('Hidden 1 content'); expect(allowedApp?.packageName).toEqual('ch.protonmail.android'); expect(allowedApp?.hashes).toContain('ch.protonmail.android'); /* Note */ const noteItem = deobfuscateItem(items[1] as any) as unknown as ItemImportIntent<'note'>; expect(noteItem.type).toBe('note'); expect(noteItem.metadata.name).toBe('NoteItem'); expect(noteItem.metadata.note).toBe('note content'); expect(noteItem.content).toStrictEqual({}); /* Login empty */ const loginItem2 = deobfuscateItem(items[2] as any) as unknown as ItemImportIntent<'login'>; expect(loginItem2.type).toBe('login'); expect(loginItem2.metadata.name).toBe('LoginItemEmptyFields'); expect(loginItem2.metadata.note).toBe('login note'); expect(loginItem2.content.username).toStrictEqual(''); expect(loginItem2.content.password).toStrictEqual(''); expect(loginItem2.content.urls).toStrictEqual([]); expect(loginItem2.content.totpUri).toStrictEqual(''); /* Login broken url */ const loginItem3 = deobfuscateItem(items[3] as any) as unknown as ItemImportIntent<'login'>; expect(loginItem3.type).toBe('login'); expect(loginItem3.metadata.name).toBe('LoginItemBrokenUrl'); expect(loginItem3.metadata.note).toBe(''); expect(loginItem3.content.username).toStrictEqual(''); expect(loginItem3.content.password).toStrictEqual(''); expect(loginItem3.content.urls).toStrictEqual([]); expect(loginItem3.content.totpUri).toStrictEqual(''); /* Credit Card */ const ccItem1 = deobfuscateItem(items[4] as any) as unknown as ItemImportIntent<'creditCard'>; expect(ccItem1.type).toBe('creditCard'); expect(ccItem1.metadata.name).toBe('Credit Card Y'); expect(ccItem1.metadata.note).toBe('Credit Card Y AMEX note'); expect(ccItem1.content.cardholderName).toBe('A B'); expect(ccItem1.content.number).toBe('374242424242424'); expect(ccItem1.content.verificationNumber).toBe('123'); expect(ccItem1.content.expirationDate).toBe('012025'); }); test('correctly keeps a reference to ignored items', () => { expect(payload.ignored).not.toEqual([]); expect(payload.ignored[0]).toEqual('[Identification] IdentityItem'); }); });
7,823
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/bitwarden.types.ts
import type { MaybeNull } from '@proton/pass/types'; export enum BitwardenType { LOGIN = 1, NOTE = 2, CREDIT_CARD = 3, IDENTITY = 4, } export enum BitwardenCustomFieldType { TEXT = 0, HIDDEN = 1, } type BitwardenCustomField = { name: MaybeNull<string>; type: BitwardenCustomFieldType; value: MaybeNull<string>; }; type BitwardenBaseItem = { name: string; notes: MaybeNull<string>; fields?: BitwardenCustomField[] }; export type BitwardenLoginItem = BitwardenBaseItem & { type: BitwardenType.LOGIN; login: { username: MaybeNull<string>; password: MaybeNull<string>; uris: MaybeNull<{ uri: string }[]>; totp: MaybeNull<string>; }; }; export type BitwardenCCItem = BitwardenBaseItem & { type: BitwardenType.CREDIT_CARD; card: { cardholderName: MaybeNull<string>; brand: MaybeNull<string>; number: MaybeNull<string>; expMonth: MaybeNull<string>; expYear: MaybeNull<string>; code: MaybeNull<string>; }; }; export type BitwardenIdentityItem = BitwardenBaseItem & { type: BitwardenType.IDENTITY; }; export type BitwardenNoteItem = BitwardenBaseItem & { type: BitwardenType.NOTE }; type BitwardenItem = BitwardenLoginItem | BitwardenNoteItem | BitwardenCCItem | BitwardenIdentityItem; export type BitwardenData = { encrypted: boolean; items: BitwardenItem[]; };
7,824
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/chromium.reader.spec.ts
import fs from 'fs'; import type { ItemImportIntent } from '@proton/pass/types'; import { deobfuscate } from '@proton/pass/utils/obfuscate/xor'; import { readChromiumData } from './chromium.reader'; describe('Import Chrome CSV', () => { let chromeExport: string; let chromeExportWindows: string; beforeAll(async () => { chromeExport = await fs.promises.readFile(__dirname + '/mocks/chrome.csv', 'utf8'); chromeExportWindows = await fs.promises.readFile(__dirname + '/mocks/chrome-windows.csv', 'utf8'); }); it('should handle corrupted files', async () => { await expect(readChromiumData('not-a-csv-file')).rejects.toThrow(); }); it('should correctly parse items', async () => { const payload = await readChromiumData(chromeExport); const [vaultData] = payload.vaults; expect(payload.vaults.length).toEqual(1); expect(vaultData.name).not.toBeUndefined(); const { items } = vaultData; /* Login */ const loginItem1 = items[0] as ItemImportIntent<'login'>; expect(loginItem1.type).toEqual('login'); expect(loginItem1.metadata.name).toEqual('proton.me'); expect(deobfuscate(loginItem1.metadata.note)).toEqual(''); expect(deobfuscate(loginItem1.content.username)).toEqual('nobody@proton.me'); expect(deobfuscate(loginItem1.content.password)).toEqual('proton123'); expect(loginItem1.content.urls[0]).toEqual('https://account.proton.me/switch'); /* Login */ const loginItem2 = items[1] as ItemImportIntent<'login'>; expect(loginItem2.type).toEqual('login'); expect(loginItem2.metadata.name).toEqual('missing url'); expect(deobfuscate(loginItem2.metadata.note)).toEqual(''); expect(deobfuscate(loginItem2.content.username)).toEqual('missingurl@proton.me'); expect(deobfuscate(loginItem2.content.password)).toEqual('proton123'); expect(loginItem2.content.urls).toStrictEqual([]); /* Login */ const loginItem3 = items[2] as ItemImportIntent<'login'>; expect(loginItem3.type).toEqual('login'); expect(loginItem3.metadata.name).toEqual('missing password'); expect(deobfuscate(loginItem3.metadata.note)).toEqual(''); expect(deobfuscate(loginItem3.content.username)).toEqual('missingpw@proton.me'); expect(deobfuscate(loginItem3.content.password)).toEqual(''); expect(loginItem3.content.urls[0]).toEqual('https://account.proton.me/switch'); /* Login broken url */ const loginItem4 = items[3] as ItemImportIntent<'login'>; expect(loginItem4.type).toEqual('login'); expect(loginItem4.metadata.name).toEqual('broken url'); expect(deobfuscate(loginItem4.metadata.note)).toEqual(''); expect(deobfuscate(loginItem4.content.username)).toEqual('brokenurl@proton.me'); expect(deobfuscate(loginItem4.content.password)).toEqual(''); expect(loginItem4.content.urls).toEqual([]); }); it('correctly parse items if .csv has `notes` column', async () => { const payload = await readChromiumData(chromeExportWindows); const [vaultData] = payload.vaults; expect(payload.vaults.length).toEqual(1); expect(vaultData.name).not.toBeUndefined(); const { items } = vaultData; /* Login */ const loginItem1 = items[0] as ItemImportIntent<'login'>; expect(loginItem1.type).toEqual('login'); expect(loginItem1.metadata.name).toEqual('proton.me'); expect(deobfuscate(loginItem1.metadata.note)).toEqual(''); expect(deobfuscate(loginItem1.content.username)).toEqual('nobody@proton.me'); expect(deobfuscate(loginItem1.content.password)).toEqual('proton123'); expect(loginItem1.content.urls[0]).toEqual('https://account.proton.me/switch'); /* Login */ const loginItem2 = items[1] as ItemImportIntent<'login'>; expect(loginItem2.type).toEqual('login'); expect(loginItem2.metadata.name).toEqual('missing url'); expect(deobfuscate(loginItem2.metadata.note)).toEqual('somenote'); expect(deobfuscate(loginItem2.content.username)).toEqual('missingurl@proton.me'); expect(deobfuscate(loginItem2.content.password)).toEqual('proton123'); expect(loginItem2.content.urls).toStrictEqual([]); /* Login */ const loginItem3 = items[2] as ItemImportIntent<'login'>; expect(loginItem3.type).toEqual('login'); expect(loginItem3.metadata.name).toEqual('missing password'); expect(deobfuscate(loginItem3.metadata.note)).toEqual(''); expect(deobfuscate(loginItem3.content.username)).toEqual('missingpw@proton.me'); expect(deobfuscate(loginItem3.content.password)).toEqual(''); expect(loginItem3.content.urls[0]).toEqual('https://account.proton.me/switch'); }); });
7,825
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/chromium.reader.ts
import type { ItemImportIntent } from '@proton/pass/types'; import { logger } from '@proton/pass/utils/logger'; import { readCSV } from '../helpers/csv.reader'; import { ImportProviderError } from '../helpers/error'; import { getImportedVaultName, importLoginItem } from '../helpers/transformers'; import type { ImportPayload } from '../types'; import type { ChromiumItem } from './chromium.types'; const CHROME_EXPECTED_HEADERS: (keyof ChromiumItem)[] = ['name', 'url', 'username', 'password']; export const readChromiumData = async (data: string): Promise<ImportPayload> => { const ignored: string[] = []; const warnings: string[] = []; try { const result = await readCSV<ChromiumItem>({ data, headers: CHROME_EXPECTED_HEADERS, onError: (error) => warnings.push(error), }); return { vaults: [ { name: getImportedVaultName(), shareId: null, items: result.items.map( (item): ItemImportIntent<'login'> => importLoginItem({ name: item.name, note: item.note, username: item.username, password: item.password, urls: [item.url], }) ), }, ], ignored, warnings, }; } catch (e) { logger.warn('[Importer::Chrome]', e); throw new ImportProviderError('Chrome', e); } };
7,826
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/chromium.types.ts
import type { Maybe } from '@proton/pass/types'; export type ChromiumItem = { name: Maybe<string>; url: Maybe<string>; username: Maybe<string>; password: Maybe<string>; note: Maybe<string>; };
7,827
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/dashlane.reader.spec.ts
import fs from 'fs'; import { deobfuscateItem } from '@proton/pass/lib/items/item.obfuscation'; import type { ItemImportIntent } from '@proton/pass/types'; import type { ImportPayload } from '../types'; import { readDashlaneData } from './dashlane.reader'; describe('Import Dashlane ZIP', () => { let sourceData: ArrayBuffer; let payload: ImportPayload; beforeAll(async () => { sourceData = await fs.promises.readFile(__dirname + '/mocks/dashlane.zip'); payload = await readDashlaneData(sourceData); }); test('should throw on invalid file content', async () => { await expect(readDashlaneData(new ArrayBuffer(1))).rejects.toThrow(); }); test('should correctly parse items', () => { const [vaultData] = payload.vaults; expect(vaultData.items.length).toEqual(14); expect(payload.vaults.length).toEqual(1); expect(vaultData.name).not.toBeUndefined(); const { items } = vaultData; /* Login item with otp */ const loginItem1 = deobfuscateItem(items[0] as any) as unknown as ItemImportIntent<'login'>; expect(loginItem1.type).toEqual('login'); expect(loginItem1.metadata.itemUuid).not.toBeUndefined(); expect(loginItem1.metadata.note).toEqual(''); expect(loginItem1.metadata.name).toEqual('login with 2fa scanned from qr code'); expect(loginItem1.content.username).toEqual('john'); expect(loginItem1.content.password).toEqual('pass'); expect(loginItem1.content.urls.length).toEqual(0); expect(loginItem1.content.totpUri).toEqual( 'otpauth://totp/login%20with%202fa%20scanned%20from%20qr%20code?secret=RL3FRZ5V3EBM7T4ZMGJWGO43MQSTTMIT&algorithm=SHA1&digits=6&period=30' ); expect(loginItem1.trashed).toEqual(false); expect(loginItem1.extraFields).toEqual([ { fieldName: 'username1', type: 'text', data: { content: 'john2', }, }, ]); /* Login item with multiple lines */ const loginItem2 = deobfuscateItem(items[1] as any) as unknown as ItemImportIntent<'login'>; expect(loginItem2.type).toEqual('login'); expect(loginItem2.metadata.itemUuid).not.toBeUndefined(); expect(loginItem2.metadata.name).toEqual('login with multiple lines'); expect(loginItem2.metadata.note).toEqual('line 1\nline 2\nline 3'); expect(loginItem2.content.username).toEqual('my name'); expect(loginItem2.content.password).toEqual('pass'); expect(loginItem2.content.urls.length).toEqual(0); expect(loginItem2.content.totpUri).toEqual(''); expect(loginItem2.trashed).toEqual(false); expect(loginItem2.extraFields).toEqual([]); /* Login item with commas */ const loginItem3 = deobfuscateItem(items[2] as any) as unknown as ItemImportIntent<'login'>; expect(loginItem3.type).toEqual('login'); expect(loginItem3.metadata.itemUuid).not.toBeUndefined(); expect(loginItem3.metadata.note).toEqual('comma 1, comma 2,'); expect(loginItem3.metadata.name).toEqual('login with commas ,'); expect(loginItem3.content.username).toEqual(''); expect(loginItem3.content.password).toEqual(''); expect(loginItem3.content.urls.length).toEqual(0); expect(loginItem3.content.totpUri).toEqual(''); expect(loginItem3.trashed).toEqual(false); expect(loginItem3.extraFields).toEqual([]); /* Login item with quote in name/note */ const loginItem4 = deobfuscateItem(items[3] as any) as unknown as ItemImportIntent<'login'>; expect(loginItem4.type).toEqual('login'); expect(loginItem4.metadata.itemUuid).not.toBeUndefined(); expect(loginItem4.metadata.note).toEqual('note with "quote"'); expect(loginItem4.metadata.name).toEqual('login with quotes "'); expect(loginItem4.content.username).toEqual(''); expect(loginItem4.content.password).toEqual(''); expect(loginItem4.content.urls.length).toEqual(0); expect(loginItem4.content.totpUri).toEqual(''); expect(loginItem4.trashed).toEqual(false); expect(loginItem4.extraFields).toEqual([]); /* Login item with url */ const loginItem5 = deobfuscateItem(items[4] as any) as unknown as ItemImportIntent<'login'>; expect(loginItem5.type).toEqual('login'); expect(loginItem5.metadata.itemUuid).not.toBeUndefined(); expect(loginItem5.metadata.note).toEqual(''); expect(loginItem5.metadata.name).toEqual('login with all preferences checked'); expect(loginItem5.content.username).toEqual(''); expect(loginItem5.content.password).toEqual(''); expect(loginItem5.content.urls.length).toEqual(1); expect(loginItem5.content.urls[0]).toEqual('https://example.com/'); expect(loginItem5.content.totpUri).toEqual(''); expect(loginItem5.trashed).toEqual(false); expect(loginItem5.extraFields).toEqual([]); /* Login item with weird URL */ const loginItem6 = deobfuscateItem(items[5] as any) as unknown as ItemImportIntent<'login'>; expect(loginItem6.type).toEqual('login'); expect(loginItem6.metadata.itemUuid).not.toBeUndefined(); expect(loginItem6.metadata.note).toEqual(''); expect(loginItem6.metadata.name).toEqual('test'); expect(loginItem6.content.username).toEqual('test@example.com'); expect(loginItem6.content.password).toEqual('ndnndc'); expect(loginItem6.content.urls.length).toEqual(1); expect(loginItem6.content.urls[0]).toEqual('https://test/'); expect(loginItem6.content.totpUri).toEqual(''); expect(loginItem6.trashed).toEqual(false); expect(loginItem6.extraFields).toEqual([]); /* Login item with weird password */ const loginItem7 = deobfuscateItem(items[6] as any) as unknown as ItemImportIntent<'login'>; expect(loginItem7.type).toEqual('login'); expect(loginItem7.metadata.itemUuid).not.toBeUndefined(); expect(loginItem7.metadata.note).toEqual(''); expect(loginItem7.metadata.name).toEqual('password with comma , and quote "'); expect(loginItem7.content.username).toEqual('john'); expect(loginItem7.content.password).toEqual('password,"comma"'); expect(loginItem7.content.urls.length).toEqual(1); expect(loginItem7.content.urls[0]).toEqual('https://example.com/comma,'); expect(loginItem7.content.totpUri).toEqual(''); expect(loginItem7.trashed).toEqual(false); expect(loginItem7.extraFields).toEqual([]); /* Login item with 2FA */ const loginItem8 = deobfuscateItem(items[7] as any) as unknown as ItemImportIntent<'login'>; expect(loginItem8.type).toEqual('login'); expect(loginItem8.metadata.itemUuid).not.toBeUndefined(); expect(loginItem8.metadata.note).toEqual(''); expect(loginItem8.metadata.name).toEqual('login with 2fa manually entered'); expect(loginItem8.content.username).toEqual('john'); expect(loginItem8.content.password).toEqual('pass'); expect(loginItem8.content.urls.length).toEqual(0); expect(loginItem8.content.totpUri).toEqual( 'otpauth://totp/login%20with%202fa%20manually%20entered?secret=RL3FRZ5V3EBM7T4ZMGJWGO43MQSTTMIT&algorithm=SHA1&digits=6&period=30' ); expect(loginItem8.trashed).toEqual(false); expect(loginItem8.extraFields).toEqual([]); /* Note item with quotes */ const noteItem1 = deobfuscateItem(items[8] as any) as unknown as ItemImportIntent<'note'>; expect(noteItem1.type).toEqual('note'); expect(noteItem1.metadata.itemUuid).not.toBeUndefined(); expect(noteItem1.metadata.name).toEqual('notes with quotes "'); expect(noteItem1.metadata.note).toEqual('notes with "quotes"'); expect(noteItem1.trashed).toEqual(false); expect(noteItem1.extraFields).toEqual([]); /* Note item with commas */ const noteItem2 = deobfuscateItem(items[9] as any) as unknown as ItemImportIntent<'note'>; expect(noteItem2.type).toEqual('note'); expect(noteItem2.metadata.itemUuid).not.toBeUndefined(); expect(noteItem2.metadata.name).toEqual('notes with commas ,'); expect(noteItem2.metadata.note).toEqual('comma 1, comma 2,'); expect(noteItem2.trashed).toEqual(false); expect(noteItem2.extraFields).toEqual([]); /* Note item with commas */ const noteItem3 = deobfuscateItem(items[10] as any) as unknown as ItemImportIntent<'note'>; expect(noteItem3.type).toEqual('note'); expect(noteItem3.metadata.itemUuid).not.toBeUndefined(); expect(noteItem3.metadata.name).toEqual('notes with multiple lines'); expect(noteItem3.metadata.note).toEqual('line 1 line 2 line 3'); expect(noteItem3.trashed).toEqual(false); expect(noteItem3.extraFields).toEqual([]); /* Credit card item */ const creditCardItem1 = deobfuscateItem(items[11] as any) as unknown as ItemImportIntent<'creditCard'>; expect(creditCardItem1.type).toEqual('creditCard'); expect(creditCardItem1.metadata.itemUuid).not.toBeUndefined(); expect(creditCardItem1.metadata.name).toEqual('Unnamed Credit Card'); expect(creditCardItem1.metadata.note).toEqual(''); expect(creditCardItem1.content.cardholderName).toEqual('JOHN DOE'); expect(creditCardItem1.content.number).toEqual('11111111111111111'); expect(creditCardItem1.content.verificationNumber).toEqual('100'); expect(creditCardItem1.content.expirationDate).toEqual('032023'); expect(creditCardItem1.content.pin).toEqual(''); expect(creditCardItem1.trashed).toEqual(false); expect(creditCardItem1.extraFields).toEqual([]); /* Credit card item with all fields filled */ const creditCardItem2 = deobfuscateItem(items[12] as any) as unknown as ItemImportIntent<'creditCard'>; expect(creditCardItem2.type).toEqual('creditCard'); expect(creditCardItem2.metadata.itemUuid).not.toBeUndefined(); expect(creditCardItem2.metadata.name).toEqual('my cc'); expect(creditCardItem2.metadata.note).toEqual('line1\nline2word1, line2word2'); expect(creditCardItem2.content.cardholderName).toEqual('john'); expect(creditCardItem2.content.number).toEqual('12345678901234567'); expect(creditCardItem2.content.verificationNumber).toEqual('123'); expect(creditCardItem2.content.expirationDate).toEqual('012024'); expect(creditCardItem1.content.pin).toEqual(''); expect(creditCardItem2.trashed).toEqual(false); expect(creditCardItem2.extraFields).toEqual([]); /* Credit card item with only 2 fields filled */ const creditCardItem3 = deobfuscateItem(items[13] as any) as unknown as ItemImportIntent<'creditCard'>; expect(creditCardItem3.type).toEqual('creditCard'); expect(creditCardItem3.metadata.itemUuid).not.toBeUndefined(); expect(creditCardItem3.metadata.name).toEqual('Unnamed Credit Card'); expect(creditCardItem3.metadata.note).toEqual(''); expect(creditCardItem3.content.cardholderName).toEqual(''); expect(creditCardItem3.content.number).toEqual('1'); expect(creditCardItem3.content.verificationNumber).toEqual('1'); expect(creditCardItem3.content.expirationDate).toEqual(''); expect(creditCardItem3.content.pin).toEqual(''); expect(creditCardItem3.trashed).toEqual(false); expect(creditCardItem3.extraFields).toEqual([]); }); test('should correctly hydrate ignored and warnings arrays', () => { expect(payload.ignored.length).toEqual(1); expect(payload.ignored[0]).toEqual('[Personal Info] Unnamed'); expect(payload.warnings.length).toEqual(0); }); });
7,828
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/dashlane.reader.ts
import jszip from 'jszip'; import type { ItemImportIntent, Maybe } from '@proton/pass/types'; import { logger } from '@proton/pass/utils/logger'; import capitalize from '@proton/utils/capitalize'; import { readCSV } from '../helpers/csv.reader'; import { ImportProviderError } from '../helpers/error'; import { getImportedVaultName, importCreditCardItem, importLoginItem, importNoteItem } from '../helpers/transformers'; import type { ImportPayload, ImportVault } from '../types'; import type { DashlaneIdItem, DashlaneItem, DashlaneLoginItem, DashlaneNoteItem, DashlanePaymentItem, DashlanePersonalInfoItem, } from './dashlane.types'; const DASHLANE_LOGINS_EXPECTED_HEADERS: (keyof DashlaneLoginItem)[] = [ 'username', 'title', 'password', 'note', 'url', 'category', 'otpSecret', ]; const DASHLANE_NOTES_EXPECTED_HEADERS: (keyof DashlaneNoteItem)[] = ['title', 'note']; const DASHLANE_CREDIT_CARDS_EXPECTED_HEADERS: (keyof DashlanePaymentItem)[] = [ 'type', 'account_name', 'cc_number', 'code', 'expiration_month', 'expiration_year', ]; const processLoginItem = (item: DashlaneLoginItem): ItemImportIntent<'login'> => importLoginItem({ name: item.title, note: item.note, username: item.username, password: item.password, urls: [item.url], totp: item.otpSecret, extraFields: [item.username2, item.username3].filter(Boolean).map((username, index) => ({ fieldName: `username${index + 1}`, type: 'text', data: { content: username ?? '' }, })), }); const processNoteItem = (item: DashlaneNoteItem): ItemImportIntent<'note'> => importNoteItem({ name: item.title, note: item.note, }); const processCreditCardItem = (item: DashlanePaymentItem): ItemImportIntent<'creditCard'> => importCreditCardItem({ name: item.name, note: item.note, cardholderName: item.account_name, number: item.cc_number, verificationNumber: item.code, expirationDate: `${item.expiration_month}${item.expiration_year}`, }); const parseDashlaneCSV = async <T extends DashlaneItem>(options: { data: Maybe<string>; headers: (keyof T)[]; warnings?: string[]; }): Promise<T[]> => { return options.data ? ( await readCSV<T>({ data: options.data, headers: options.headers, throwOnEmpty: false, onError: (error) => options.warnings?.push(error), }) ).items : []; }; export const readDashlaneData = async (data: ArrayBuffer): Promise<ImportPayload> => { const ignored: string[] = []; const warnings: string[] = []; try { const zipFile = await jszip.loadAsync(data); /* logins */ const loginItems = ( await parseDashlaneCSV<DashlaneLoginItem>({ data: await zipFile.file('credentials.csv')?.async('string'), headers: DASHLANE_LOGINS_EXPECTED_HEADERS, warnings, }) ).map(processLoginItem); /* notes */ const noteItems = ( await parseDashlaneCSV<DashlaneNoteItem>({ data: await zipFile.file('securenotes.csv')?.async('string'), headers: DASHLANE_NOTES_EXPECTED_HEADERS, warnings, }) ).map(processNoteItem); /* credit cards */ const creditCards = ( await parseDashlaneCSV<DashlanePaymentItem>({ data: await zipFile.file('payments.csv')?.async('string'), headers: DASHLANE_CREDIT_CARDS_EXPECTED_HEADERS, warnings, }) ).map(processCreditCardItem); /* unsupported ids */ const ids = await parseDashlaneCSV<DashlaneIdItem>({ data: await zipFile.file('ids.csv')?.async('string'), headers: ['type', 'number'], }); /* unsupported personal info */ const personalInfos = await parseDashlaneCSV<DashlanePersonalInfoItem>({ data: await zipFile.file('personalInfo.csv')?.async('string'), headers: ['title'], }); ignored.push( ...ids.map(({ type, name }) => `[${capitalize(type ?? 'ID')}] ${name || 'Unknown ID'}`), ...personalInfos.map(({ title }) => `[${'Personal Info'}] ${title || 'Unnamed'}`) ); const vaults: ImportVault[] = [ { name: getImportedVaultName(), shareId: null, items: [...loginItems, ...noteItems, ...creditCards], }, ]; return { vaults, ignored, warnings }; } catch (e) { logger.warn('[Importer::Dashlane]', e); throw new ImportProviderError('Dashlane', e); } };
7,829
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/dashlane.types.ts
import type { Maybe } from '@proton/pass/types'; export type DashlaneLoginItem = { username: Maybe<string>; username2: Maybe<string>; username3: Maybe<string>; title: Maybe<string>; password: Maybe<string>; note: Maybe<string>; url: Maybe<string>; category: Maybe<string>; otpSecret: Maybe<string>; }; export type DashlaneNoteItem = { title: Maybe<string>; note: Maybe<string>; }; export type DashlaneIdItem = { type: Maybe<string>; number: Maybe<string>; name: Maybe<string>; issue_date: Maybe<string>; expiration_date: Maybe<string>; place_of_issue: Maybe<string>; state: Maybe<string>; }; export type DashlanePaymentItem = { type: Maybe<string>; account_name: Maybe<string>; account_holder: Maybe<string>; cc_number: Maybe<string>; code: Maybe<string>; expiration_month: Maybe<string>; expiration_year: Maybe<string>; routing_number: Maybe<string>; account_number: Maybe<string>; country: Maybe<string>; issuing_bank: Maybe<string>; note: Maybe<string>; name: Maybe<string>; }; export type DashlanePersonalInfoItem = { type: Maybe<string>; title: Maybe<string>; first_name: Maybe<string>; middle_name: Maybe<string>; last_name: Maybe<string>; login: Maybe<string>; date_of_birth: Maybe<string>; place_of_birth: Maybe<string>; email: Maybe<string>; email_type: Maybe<string>; item_name: Maybe<string>; phone_number: Maybe<string>; address: Maybe<string>; country: Maybe<string>; state: Maybe<string>; city: Maybe<string>; zip: Maybe<string>; address_recipient: Maybe<string>; address_building: Maybe<string>; address_apartment: Maybe<string>; address_floor: Maybe<string>; address_door_code: Maybe<string>; job_title: Maybe<string>; url: Maybe<string>; }; export type DashlaneItem = | DashlaneLoginItem | DashlaneNoteItem | DashlaneIdItem | DashlanePaymentItem | DashlanePersonalInfoItem;
7,830
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/enpass.reader.spec.ts
import fs from 'fs'; import { deobfuscateItem } from '@proton/pass/lib/items/item.obfuscation'; import type { ItemExtraField, ItemImportIntent } from '@proton/pass/types'; import type { ImportPayload } from '../types'; import { readEnpassData } from './enpass.reader'; describe('Import bitwarden json', () => { let sourceData: string; let payload: ImportPayload; beforeAll(async () => { sourceData = await fs.promises.readFile(__dirname + '/mocks/enpass.json', 'utf8'); payload = readEnpassData(sourceData); }); it('should throw on corrupted files', () => { expect(() => readEnpassData('not-a-json-body')).toThrow(); }); it('should correctly parse items', () => { expect(payload.vaults.length).toEqual(1); const [primary] = payload.vaults; expect(primary.name).not.toBeUndefined(); expect(primary.items.length).toEqual(8); /* Login */ const loginItem1 = deobfuscateItem(primary.items[0]) as unknown as ItemImportIntent<'login'>; expect(loginItem1.type).toEqual('login'); expect(loginItem1.metadata.name).toEqual('Twitter'); expect(loginItem1.metadata.note).toEqual(''); expect(loginItem1.content.username).toEqual('emily@enpass.io'); expect(loginItem1.content.password).toEqual('herbert nadia banal slag broken violin somber modern cdc posing'); expect(loginItem1.content.urls[0]).toEqual('https://www.twitter.com/'); expect(loginItem1.content.totpUri).toEqual( 'otpauth://totp/Twitter?secret=QG4RPWYF4T23V62G4TA3NE4374&algorithm=SHA1&digits=6&period=30' ); const loginItem1ExtraField1 = loginItem1.extraFields[0] as ItemExtraField<'text'>; expect(loginItem1ExtraField1.fieldName).toEqual('Security question'); expect(loginItem1ExtraField1.data.content).toEqual('Example extra field, predefined'); const loginItem1ExtraField2 = loginItem1.extraFields[1] as ItemExtraField<'hidden'>; expect(loginItem1ExtraField2.fieldName).toEqual('Custom field name'); expect(loginItem1ExtraField2.data.content).toEqual('Example extra field, user-defined'); expect(loginItem1ExtraField2.type).toEqual('hidden'); /* Login with a username and no email */ const loginItem2 = deobfuscateItem(primary.items[1]) as unknown as ItemImportIntent<'login'>; expect(loginItem2.type).toEqual('login'); expect(loginItem2.metadata.name).toEqual('Yahoo!'); expect(loginItem2.content.username).toEqual('customusername'); expect(loginItem2.metadata.note).toEqual('example note'); /* Trashed login */ const loginItem3 = deobfuscateItem(primary.items[2]) as unknown as ItemImportIntent<'login'>; expect(loginItem3.type).toEqual('login'); expect(loginItem3.metadata.name).toEqual('Trashed'); expect(loginItem3.trashed).toEqual(true); /* Transhed login */ const loginItem4 = deobfuscateItem(primary.items[3]) as unknown as ItemImportIntent<'login'>; expect(loginItem4.type).toEqual('login'); expect(loginItem4.metadata.name).toEqual('Archived'); expect(loginItem4.trashed).toEqual(true); /* Note */ const noteItem1 = deobfuscateItem(primary.items[4]) as unknown as ItemImportIntent<'login'>; expect(noteItem1.type).toEqual('note'); expect(noteItem1.metadata.name).toEqual('Note'); expect(noteItem1.metadata.note).toEqual('Note text'); /* Credit Card */ const creditCardItem1 = deobfuscateItem(primary.items[5]) as unknown as ItemImportIntent<'creditCard'>; expect(creditCardItem1.type).toEqual('creditCard'); expect(creditCardItem1.metadata.name).toEqual('Credit Card'); expect(creditCardItem1.metadata.note).toEqual(''); expect(creditCardItem1.content.cardholderName).toEqual('Emily Sample'); expect(creditCardItem1.content.number).toEqual('1234 123456 00000'); expect(creditCardItem1.content.expirationDate).toEqual('03/27'); expect(creditCardItem1.content.verificationNumber).toEqual('1234'); expect(creditCardItem1.content.pin).toEqual('9874'); /* Credit card - extracted login item */ const creditCardLoginItem1 = deobfuscateItem(primary.items[6]) as unknown as ItemImportIntent<'login'>; expect(creditCardLoginItem1.type).toEqual('login'); expect(creditCardLoginItem1.metadata.name).toEqual(creditCardItem1.metadata.name); expect(creditCardLoginItem1.content.username).toEqual('Emily_ENP'); expect(creditCardLoginItem1.content.password).toEqual( 'nnn tug shoot selfish bon liars convent dusty minnow uncheck' ); expect(creditCardLoginItem1.content.totpUri).toEqual(''); expect(creditCardLoginItem1.content.urls).toEqual(['http://global.americanexpress.com/']); /* Password */ const passwordItem1 = deobfuscateItem(primary.items[7]) as unknown as ItemImportIntent<'login'>; expect(passwordItem1.metadata.name).toEqual('Password'); expect(passwordItem1.content.username).toEqual('username'); expect(passwordItem1.content.password).toEqual('password'); }); test('correctly keeps a reference to ignored items', () => { expect(payload.ignored).not.toEqual([]); expect(payload.ignored.length).toEqual(6); expect(payload.ignored[0]).toEqual('[Travel] Passport Sample'); }); });
7,831
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/enpass.reader.ts
import { capitalize } from 'lodash'; import type { ItemImportIntent, Maybe, UnsafeItemExtraField } from '@proton/pass/types'; import { truthy } from '@proton/pass/utils/fp/predicates'; import { logger } from '@proton/pass/utils/logger'; import { ImportProviderError } from '../helpers/error'; import { getImportedVaultName, importCreditCardItem, importLoginItem, importNoteItem } from '../helpers/transformers'; import type { ImportPayload, ImportVault } from '../types'; import type { EnpassField, EnpassItem } from './enpass.types'; import { EnpassCategory, type EnpassData } from './enpass.types'; type RemainingField = EnpassField; const knownFieldTypes = { login: ['username', 'email', 'totp', 'password', 'url'], creditCard: ['ccName', 'ccType', 'ccNumber', 'ccCvc', 'ccPin', 'ccExpiry'], ignored: ['section'], } as const; const isTrashedItem = (item: EnpassItem<any>) => item.archived !== 0 || item.trashed !== 0; const extractFromFieldTypes = <K extends string>(keys: readonly K[]) => { const isSupportedKey = (type: any): type is K => keys.includes(type); return (fields: EnpassField[]) => fields.reduce( (acc: { extracted: { [key in K]?: string }; remaining: RemainingField[] }, field) => { if (!field.value) return acc; if (isSupportedKey(field.type) && !acc.extracted[field.type]) { acc.extracted[field.type] = field.value; return acc; } if (!(<readonly string[]>knownFieldTypes.ignored).includes(field.type)) { acc.remaining.push(field); return acc; } return acc; }, { extracted: {}, remaining: [] } ); }; const extractLoginFields = extractFromFieldTypes(knownFieldTypes.login); const extractCCFields = extractFromFieldTypes(knownFieldTypes.creditCard); const mapToExtraField = ({ value, label, sensitive }: RemainingField): UnsafeItemExtraField => ({ data: { content: value }, fieldName: label, type: sensitive ? 'hidden' : 'text', }); const processLoginItem = ( item: EnpassItem<EnpassCategory.LOGIN> | EnpassItem<EnpassCategory.PASSWORD> ): ItemImportIntent<'login'> => { const { extracted, remaining } = extractLoginFields(item.fields); return importLoginItem({ name: item.title, note: item.note, trashed: isTrashedItem(item), createTime: item.createdAt, modifyTime: item.updated_at, extraFields: remaining.map(mapToExtraField), username: extracted.username || extracted.email, password: extracted.password, totp: extracted.totp, urls: extracted.url ? [extracted.url] : [], }); }; const processNoteItem = (item: EnpassItem<EnpassCategory.NOTE>): ItemImportIntent<'note'> => importNoteItem({ name: item.title, note: item.note, trashed: item.archived !== 0 || item.trashed !== 0, createTime: item.createdAt, modifyTime: item.updated_at, }); const processCreditCardItem = (item: EnpassItem<EnpassCategory.CREDIT_CARD>): ItemImportIntent[] => { const { extracted: extractedCCData, remaining } = extractCCFields(item.fields); const ccItem = importCreditCardItem({ name: item.title, note: item.note, trashed: isTrashedItem(item), createTime: item.createdAt, modifyTime: item.updated_at, cardholderName: extractedCCData.ccName, pin: extractedCCData.ccPin, expirationDate: extractedCCData.ccExpiry, number: extractedCCData.ccNumber, verificationNumber: extractedCCData.ccCvc, }); const hasLoginFields = remaining.some(({ type }) => (<readonly string[]>knownFieldTypes.login).includes(type)); if (hasLoginFields) { const enpassLoginItem: EnpassItem<EnpassCategory.LOGIN> = { ...item, category: EnpassCategory.LOGIN, fields: remaining, }; const loginItem = processLoginItem(enpassLoginItem); return [ccItem, loginItem]; } return [ccItem]; }; export const readEnpassData = (data: string): ImportPayload => { try { const result = JSON.parse(data) as EnpassData; const items = result.items.map((i) => i); const ignored: string[] = []; const vaults: ImportVault[] = [ { name: getImportedVaultName(), shareId: null, items: items .map((item): Maybe<ItemImportIntent | ItemImportIntent[]> => { switch (item.category) { case EnpassCategory.LOGIN: case EnpassCategory.PASSWORD: return processLoginItem(item); case EnpassCategory.NOTE: return processNoteItem(item); case EnpassCategory.CREDIT_CARD: return processCreditCardItem(item); default: ignored.push(`[${capitalize(item.category) ?? 'Other'}] ${item.title}`); return; } }) .flat() .filter(truthy), }, ]; return { vaults, ignored, warnings: [] }; } catch (e) { logger.warn('[Importer::Enpass]', e); throw new ImportProviderError('Enpass', e); } };
7,832
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/enpass.types.ts
export type EnpassData = { folders: EnpassFolder[]; items: EnpassItem<EnpassCategory>[]; }; export type EnpassFolder = { icon: string; parent_uuid: string; title: string; updated_at: number; uuid: string; }; export type EnpassItem<T extends EnpassCategory> = { [K in EnpassCategory]: { category: K; archived: number; auto_submit: number; createdAt: number; favorite: number; icon: EnpassItemIcon; note: string; subtitle: string; template_type: string; title: string; trashed: number; updated_at: number; uuid: string; folders?: string[]; } & (K extends EnpassCategory.NOTE ? {} : { fields: EnpassField[] }); }[T]; export enum EnpassCategory { LOGIN = 'login', CREDIT_CARD = 'creditcard', NOTE = 'note', PASSWORD = 'password', // Unsupported IDENTITY = 'identity', FINANCE = 'finance', LICENSE = 'license', TRAVEL = 'travel', COMPUTER = 'computer', MISC = 'misc', } export type EnpassField = { deleted: number; history?: EnpassFieldHistory[]; label: string; order: number; sensitive: number; type: string; uid: number; updated_at: number; value: string; value_updated_at: number; }; export type EnpassFieldHistory = { encrypted: boolean; updated_at: number; value: string; }; export type EnpassItemIcon = { fav: string; image: { file: string; }; type: number; uuid: string; };
7,833
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/firefox.reader.spec.ts
import fs from 'fs'; import type { ItemImportIntent } from '@proton/pass/types'; import { deobfuscate } from '@proton/pass/utils/obfuscate/xor'; import type { ImportPayload } from '../types'; import { readFirefoxData } from './firefox.reader'; describe('Import Firefox CSV', () => { let payload: ImportPayload; beforeAll(async () => { const sourceData = await fs.promises.readFile(__dirname + '/mocks/firefox.csv', 'utf8'); payload = await readFirefoxData(sourceData); }); it('should handle corrupted files', async () => { await expect(readFirefoxData('not-a-csv-file')).rejects.toThrow(); }); it('should correctly parse items', async () => { const [vaultData] = payload.vaults; expect(payload.vaults.length).toEqual(1); expect(vaultData.name).not.toBeUndefined(); const { items } = vaultData; /* Login item */ const loginItem = items[0] as ItemImportIntent<'login'>; expect(loginItem.type).toEqual('login'); expect(loginItem.createTime).toEqual(1679064121); expect(loginItem.modifyTime).toEqual(1679064121); expect(loginItem.metadata.itemUuid).not.toBeUndefined(); expect(loginItem.metadata.name).toEqual('account.proton.me'); expect(deobfuscate(loginItem.metadata.note)).toEqual(''); expect(deobfuscate(loginItem.content.username)).toEqual('nobody@example.com'); expect(deobfuscate(loginItem.content.password)).toEqual('proton123'); expect(deobfuscate(loginItem.content.totpUri)).toEqual(''); expect(loginItem.content.urls).toEqual(['https://account.proton.me/']); expect(loginItem.trashed).toEqual(false); expect(loginItem.extraFields).toEqual([]); /* Login with missing url */ const loginItemMissingUrl = items[1] as ItemImportIntent<'login'>; expect(loginItemMissingUrl.type).toEqual('login'); expect(loginItemMissingUrl.createTime).toEqual(1679064140); expect(loginItemMissingUrl.modifyTime).toEqual(1679064140); expect(loginItemMissingUrl.metadata.itemUuid).not.toBeUndefined(); expect(loginItemMissingUrl.metadata.name).toEqual('Unnamed item'); expect(deobfuscate(loginItemMissingUrl.metadata.note)).toEqual(''); expect(deobfuscate(loginItemMissingUrl.content.username)).toEqual('missingurl@example.com'); expect(deobfuscate(loginItemMissingUrl.content.password)).toEqual('proton123'); expect(deobfuscate(loginItemMissingUrl.content.totpUri)).toEqual(''); expect(loginItemMissingUrl.content.urls).toEqual([]); expect(loginItemMissingUrl.trashed).toEqual(false); expect(loginItemMissingUrl.extraFields).toEqual([]); /* Login with missing password */ const loginItemMissingPassword = items[2] as ItemImportIntent<'login'>; expect(loginItemMissingPassword.type).toEqual('login'); expect(loginItemMissingPassword.createTime).toEqual(1679064121); expect(loginItemMissingPassword.modifyTime).toEqual(1679064121); expect(loginItemMissingPassword.metadata.itemUuid).not.toBeUndefined(); expect(loginItemMissingPassword.metadata.name).toEqual('account.proton.me'); expect(deobfuscate(loginItemMissingPassword.metadata.note)).toEqual(''); expect(deobfuscate(loginItemMissingPassword.content.username)).toEqual('missingpw@example.com'); expect(deobfuscate(loginItemMissingPassword.content.password)).toEqual(''); expect(deobfuscate(loginItemMissingPassword.content.totpUri)).toEqual(''); expect(loginItemMissingPassword.content.urls).toEqual(['https://account.proton.me/']); expect(loginItemMissingPassword.trashed).toEqual(false); expect(loginItemMissingPassword.extraFields).toEqual([]); /* Login with broken URL */ const loginItemBrokedUrl = items[3] as ItemImportIntent<'login'>; expect(loginItemBrokedUrl.type).toEqual('login'); expect(loginItemBrokedUrl.createTime).toEqual(1679080973); expect(loginItemBrokedUrl.modifyTime).toEqual(1679080973); expect(loginItemBrokedUrl.metadata.itemUuid).not.toBeUndefined(); expect(loginItemBrokedUrl.metadata.name).toEqual('Unnamed item'); expect(deobfuscate(loginItemBrokedUrl.metadata.note)).toEqual(''); expect(deobfuscate(loginItemBrokedUrl.content.username)).toEqual('brokenurl@example.com'); expect(deobfuscate(loginItemBrokedUrl.content.password)).toEqual(''); expect(deobfuscate(loginItemBrokedUrl.content.totpUri)).toEqual(''); expect(loginItemBrokedUrl.content.urls).toEqual([]); expect(loginItemBrokedUrl.trashed).toEqual(false); expect(loginItemBrokedUrl.extraFields).toEqual([]); /* Login with localhost url */ const loginItemLocalhost = items[4] as ItemImportIntent<'login'>; expect(loginItemLocalhost.type).toEqual('login'); expect(loginItemLocalhost.createTime).toEqual(1679406099); expect(loginItemLocalhost.modifyTime).toEqual(1679406099); expect(loginItemLocalhost.metadata.itemUuid).not.toBeUndefined(); expect(loginItemLocalhost.metadata.name).toEqual('localhost'); expect(deobfuscate(loginItemLocalhost.metadata.note)).toEqual(''); expect(deobfuscate(loginItemLocalhost.content.username)).toEqual('winston@example.com'); expect(deobfuscate(loginItemLocalhost.content.password)).toEqual('password'); expect(deobfuscate(loginItemLocalhost.content.totpUri)).toEqual(''); expect(loginItemLocalhost.content.urls).toEqual(['http://localhost:1234/']); expect(loginItemLocalhost.trashed).toEqual(false); expect(loginItemLocalhost.extraFields).toEqual([]); /* Login with comma and quote */ const loginItemCommaQuote = items[5] as ItemImportIntent<'login'>; expect(loginItemCommaQuote.type).toEqual('login'); expect(loginItemCommaQuote.createTime).toEqual(1679408193); expect(loginItemCommaQuote.modifyTime).toEqual(1684922497); expect(loginItemCommaQuote.metadata.itemUuid).not.toBeUndefined(); expect(loginItemCommaQuote.metadata.name).toEqual('account.example.com'); expect(deobfuscate(loginItemCommaQuote.metadata.note)).toEqual(''); expect(deobfuscate(loginItemCommaQuote.content.username)).toEqual('username with comma, quotes "'); expect(deobfuscate(loginItemCommaQuote.content.password)).toEqual('password with comma, quotes "'); expect(deobfuscate(loginItemCommaQuote.content.totpUri)).toEqual(''); expect(loginItemCommaQuote.content.urls).toEqual(['https://account.example.com/']); expect(loginItemCommaQuote.trashed).toEqual(false); expect(loginItemCommaQuote.extraFields).toEqual([]); /* ignored & warnings */ expect(payload.ignored.length).toEqual(0); expect(payload.warnings.length).toEqual(0); }); });
7,834
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/firefox.reader.ts
import type { ItemImportIntent } from '@proton/pass/types'; import { logger } from '@proton/pass/utils/logger'; import { msToEpoch } from '@proton/pass/utils/time/get-epoch'; import { readCSV } from '../helpers/csv.reader'; import { ImportProviderError } from '../helpers/error'; import { getImportedVaultName, importLoginItem } from '../helpers/transformers'; import type { ImportPayload } from '../types'; import type { FirefoxItem } from './firefox.types'; const FIREFOX_EXPECTED_HEADERS: (keyof FirefoxItem)[] = [ 'url', 'username', 'password', 'timeCreated', 'timePasswordChanged', ]; export const readFirefoxData = async (data: string): Promise<ImportPayload> => { const ignored: string[] = []; const warnings: string[] = []; try { const result = await readCSV<FirefoxItem>({ data, headers: FIREFOX_EXPECTED_HEADERS, onError: (error) => warnings.push(error), }); return { vaults: [ { name: getImportedVaultName(), shareId: null, items: result.items .filter((item) => item.url !== 'chrome://FirefoxAccounts') .map( (item): ItemImportIntent<'login'> => importLoginItem({ username: item.username, password: item.password, urls: [item.url], createTime: item.timeCreated ? msToEpoch(item.timeCreated) : undefined, modifyTime: item.timePasswordChanged ? msToEpoch(item.timePasswordChanged) : undefined, }) ), }, ], ignored, warnings, }; } catch (e) { logger.warn('[Importer::Firefox]', e); throw new ImportProviderError('Firefox', e); } };
7,835
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/firefox.types.ts
import type { Maybe } from '@proton/pass/types'; export type FirefoxItem = { url: Maybe<string>; username: Maybe<string>; password: Maybe<string>; httpRealm: Maybe<string>; formActionOrigin: Maybe<string>; guid: Maybe<string>; timeCreated: Maybe<number>; timeLastUsed: Maybe<number>; timePasswordChanged: Maybe<number>; };
7,836
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/keepass.reader.spec.ts
import fs from 'fs'; import { deobfuscateItem } from '@proton/pass/lib/items/item.obfuscation'; import type { ItemImportIntent } from '@proton/pass/types'; import { getEpoch } from '@proton/pass/utils/time/get-epoch'; import type { ImportPayload, ImportVault } from '../types'; import { readKeePassData } from './keepass.reader'; jest.mock('@proton/pass/utils/time/get-epoch', () => ({ getEpoch: jest.fn(() => 1682585156), })); describe('Import KeePass xml', () => { let sourceData: string; let payload: ImportPayload; beforeAll(async () => { sourceData = await fs.promises.readFile(__dirname + '/mocks/keepass.xml', 'utf8'); payload = readKeePassData(sourceData); }); afterAll(() => (getEpoch as jest.Mock).mockClear()); it('should throw on corrupted files', async () => { expect(() => readKeePassData('not-an-xml-file')).toThrow(); }); it('should extract vaults from groups', () => { expect(payload.vaults.length).toEqual(5); expect(payload.vaults[0].name).toEqual('Group A'); expect(payload.vaults[1].name).toEqual('Group B'); expect(payload.vaults[2].name).toEqual('Group C'); expect(payload.vaults[3].name).toEqual('Import - 27 Apr 2023'); expect(payload.vaults[4].name).toEqual('TOTP definitions'); }); it('should extract items from `Group A`', () => { const groupA = payload.vaults[0]; expect(groupA.items.length).toEqual(1); const loginItem = deobfuscateItem(groupA.items[0] as any) as unknown as ItemImportIntent<'login'>; expect(loginItem.type).toEqual('login'); expect(loginItem.metadata.name).toEqual('Login item with note'); expect(loginItem.metadata.note).toEqual('Login item'); expect(loginItem.metadata.itemUuid).not.toBeUndefined(); expect(loginItem.content.username).toEqual('nobodyA@proton.me'); expect(loginItem.content.password).toEqual('proton123'); expect(loginItem.content.urls).toEqual(['https://account.proton.me/']); expect(loginItem.content.totpUri).toEqual( 'otpauth://totp/Entry%20A:nobodyA%40proton.me?issuer=Entry%20A&secret=VZKDI2A4UP2NG5BB&algorithm=SHA1&digits=6&period=30' ); expect(loginItem.extraFields).toEqual([ { fieldName: 'Hidden 1', type: 'hidden', data: { content: 'Hidden 1 content', }, }, { fieldName: 'Text 1', type: 'text', data: { content: 'Text 1 content', }, }, { fieldName: 'TimeOtp-Secret-Base32', type: 'text', data: { content: 'VZKDI2A4UP2NG5BB', }, }, ]); expect(loginItem.platformSpecific).toBeUndefined(); expect(loginItem.trashed).toEqual(false); }); it('should extract items from `Group B`', () => { const groupB = payload.vaults[1]; expect(groupB.items.length).toEqual(1); const loginItem = deobfuscateItem(groupB.items[0] as any) as unknown as ItemImportIntent<'login'>; expect(loginItem.type).toEqual('login'); expect(loginItem.metadata.name).toEqual('Broken URL'); expect(loginItem.metadata.note).toEqual(''); expect(loginItem.metadata.itemUuid).not.toBeUndefined(); expect(loginItem.content.username).toEqual(''); expect(loginItem.content.password).toEqual(''); expect(loginItem.content.urls).toEqual([]); expect(loginItem.content.totpUri).toEqual(''); expect(loginItem.extraFields).toEqual([]); expect(loginItem.platformSpecific).toBeUndefined(); expect(loginItem.trashed).toEqual(false); }); it('should extract items from `Group C and not trim spaces`', () => { const groupC = payload.vaults[2]; expect(groupC.items.length).toEqual(1); const loginItem = deobfuscateItem(groupC.items[0] as any) as unknown as ItemImportIntent<'login'>; expect(loginItem.type).toEqual('login'); expect(loginItem.metadata.name).toEqual('Login item'); expect(loginItem.metadata.note).toEqual(''); expect(loginItem.metadata.itemUuid).not.toBeUndefined(); expect(loginItem.content.username).toEqual('nobody@proton.me'); expect(loginItem.content.password).toEqual('a bbbb c '); expect(loginItem.content.urls).toEqual([]); expect(loginItem.content.totpUri).toEqual(''); expect(loginItem.extraFields).toEqual([]); expect(loginItem.platformSpecific).toBeUndefined(); expect(loginItem.trashed).toEqual(false); }); it('should extract items from `Group D`', () => { const groupD = payload.vaults[3]; expect(groupD.items.length).toEqual(2); const loginItem1 = deobfuscateItem(groupD.items[0] as any) as unknown as ItemImportIntent<'login'>; expect(loginItem1.type).toEqual('login'); expect(loginItem1.metadata.name).toEqual('Login item'); expect(loginItem1.metadata.note).toEqual('some note'); expect(loginItem1.metadata.itemUuid).not.toBeUndefined(); expect(loginItem1.content.username).toEqual('nobody@proton.me'); expect(loginItem1.content.password).toEqual('proton123'); expect(loginItem1.content.urls).toEqual(['https://account.proton.me/']); expect(loginItem1.content.totpUri).toEqual(''); expect(loginItem1.extraFields).toEqual([]); expect(loginItem1.platformSpecific).toBeUndefined(); expect(loginItem1.trashed).toEqual(false); const loginItem2 = deobfuscateItem(groupD.items[1] as any) as unknown as ItemImportIntent<'login'>; expect(loginItem2.type).toEqual('login'); expect(loginItem2.metadata.name).toEqual('Broken URL'); expect(loginItem2.metadata.note).toEqual(''); expect(loginItem2.metadata.itemUuid).not.toBeUndefined(); expect(loginItem2.content.username).toEqual('nobody@proton.me'); expect(loginItem2.content.password).toEqual('proton123'); expect(loginItem2.content.urls).toEqual([]); expect(loginItem2.content.totpUri).toEqual(''); expect(loginItem2.extraFields).toEqual([ { fieldName: 'Custom', type: 'hidden', data: { content: 'ABCDEF', }, }, ]); expect(loginItem2.platformSpecific).toBeUndefined(); expect(loginItem2.trashed).toEqual(false); }); describe('TOTP definition', () => { let group: ImportVault; beforeAll(async () => { group = payload.vaults[4]; }); it('should have 2 items in group', () => { expect(group.items.length).toEqual(2); }); it('should extract modern TOTP definition', () => { const item = deobfuscateItem(group.items[0] as any) as unknown as ItemImportIntent<'login'>; expect(item.metadata.name).toEqual('Modern TOTP definition'); expect(item.content.totpUri).toEqual( 'otpauth://totp/Modern%20TOTP%20definition:none?issuer=Modern%20TOTP%20definition&secret=5KO67YMS2FHKA627&algorithm=SHA1&digits=8&period=42' ); }); it('should extract legacy TOTP definition', () => { const item = deobfuscateItem(group.items[1] as any) as unknown as ItemImportIntent<'login'>; expect(item.metadata.name).toEqual('Legacy TOTP definition'); expect(item.content.totpUri).toEqual( 'otpauth://totp/Legacy%20TOTP%20definition:none?issuer=Legacy%20TOTP%20definition&secret=AU2HMGCJYPNI2WZT&algorithm=SHA1&digits=8&period=42' ); }); }); });
7,837
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/keepass.reader.ts
import get from 'lodash/get'; import { c } from 'ttag'; import X2JS from 'x2js'; import type { ItemImportIntent, Maybe, MaybeNull } from '@proton/pass/types'; import { logger } from '@proton/pass/utils/logger'; import { ImportProviderError } from '../helpers/error'; import { getImportedVaultName, importLoginItem } from '../helpers/transformers'; import type { ImportVault } from '../types'; import { type ImportPayload } from '../types'; import type { KeePassEntry, KeePassEntryValue, KeePassFile, KeePassGroup, KeePassItem } from './keepass.types'; const getKeePassEntryValue = (Value: KeePassEntryValue): string => (typeof Value === 'string' ? Value : Value.__text); const getKeePassProtectInMemoryValue = (Value: KeePassEntryValue): string => typeof Value === 'string' ? '' : Value._ProtectInMemory; const isLegacyTotpDefinition = (item: KeePassItem) => Boolean(item.totpSeed && item.totpSettings); const formatOtpAuthUriFromLegacyTotpDefinition = (item: KeePassItem): Maybe<string> => { try { const [period, digits] = item.totpSettings!.split(';').map((value) => parseInt(value, 10)); if (isNaN(period) || isNaN(digits)) throw new Error(); return `otpauth://totp/${item.name}:none?secret=${item.totpSeed}&period=${period}&digits=${digits}`; } catch (e) { logger.warn(`[Importer::KeePass] legacy TOTP settings for item "${item.name}" are not in the expected format`); } }; const formatOtpAuthUri = (item: KeePassItem): Maybe<string> => isLegacyTotpDefinition(item) ? formatOtpAuthUriFromLegacyTotpDefinition(item) : item.otpauth; const entryToItem = (entry: KeePassEntry): ItemImportIntent<'login'> => { const entryString = Array.isArray(entry.String) ? entry.String : [entry.String]; const item = entryString.reduce<KeePassItem>( (acc, { Key, Value }) => { if (!Key || !Value) return acc; switch (Key) { case 'Title': acc.name = getKeePassEntryValue(Value); break; case 'Notes': acc.note = getKeePassEntryValue(Value); break; case 'UserName': acc.username = getKeePassEntryValue(Value); break; case 'Password': acc.password = getKeePassEntryValue(Value); break; case 'URL': acc.url = getKeePassEntryValue(Value); break; case 'otp': acc.otpauth = getKeePassEntryValue(Value); break; case 'TOTP Seed': acc.totpSeed = getKeePassEntryValue(Value); break; case 'TOTP Settings': acc.totpSettings = getKeePassEntryValue(Value); break; default: const type = getKeePassProtectInMemoryValue(Value) ? 'hidden' : 'text'; acc.customFields.push({ fieldName: Key || (type === 'hidden' ? c('Label').t`Hidden` : c('Label').t`Text`), type, data: { content: getKeePassEntryValue(Value) ?? '' }, }); } return acc; }, { customFields: [] } ); return importLoginItem({ name: item.name, note: item.note, username: item.username, password: item.password, urls: [item.url], totp: formatOtpAuthUri(item), extraFields: item.customFields, }); }; const groupToVault = (group: KeePassGroup): MaybeNull<ImportVault> => { const entry = get(group, 'Entry'); if (!entry) return null; return { name: getImportedVaultName(group.Name), shareId: null, items: Array.isArray(entry) ? entry.map(entryToItem) : [entryToItem(entry)], }; }; const extractVaults = (group: KeePassGroup, vaults: ImportVault[] = []): ImportVault[] => { const vault = groupToVault(group); if (vault) vaults.push(vault); const nestedGroup = get(group, 'Group'); if (!nestedGroup) return vaults; return Array.isArray(nestedGroup) ? nestedGroup.reduce((acc, cur) => acc.concat(extractVaults(cur, [])), vaults) : extractVaults(nestedGroup, vaults); }; export const readKeePassData = (data: string): ImportPayload => { try { const x2js = new X2JS({ stripWhitespaces: false }); const importXml: KeePassFile = x2js.xml2js(data); const vaults = extractVaults(importXml.KeePassFile.Root as KeePassGroup); return { vaults, ignored: [], warnings: [], }; } catch (e) { logger.warn('[Importer::KeePass]', e); throw new ImportProviderError('KeePass', e); } };
7,838
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/keepass.types.ts
import type { MaybeArray, UnsafeItemExtraField } from '@proton/pass/types'; export type KeePassEntryValue = { _ProtectInMemory: string; __text: string } | string; export type KeePassCustomFields = { Key: string; Value: KeePassEntryValue }[]; export type KeePassEntry = { String: | [ { Key: 'Title'; Value: KeePassEntryValue }, { Key: 'UserName'; Value: KeePassEntryValue }, { Key: 'Password'; Value: KeePassEntryValue }, { Key: 'URL'; Value: KeePassEntryValue }, { Key: 'Notes'; Value: KeePassEntryValue }, { Key: 'otp'; Value: KeePassEntryValue }, ...KeePassCustomFields, ] | { Key: string; Value: KeePassEntryValue }; }; export type KeePassGroup = { Name: string; Entry?: MaybeArray<KeePassEntry>; Group?: MaybeArray<KeePassGroup>; }; export type KeePassFile = { KeePassFile: { Root: { Group?: MaybeArray<KeePassGroup>; }; }; }; export type KeePassItem = { name?: string; url?: string; username?: string; password?: string; note?: string; otpauth?: string; totpSeed?: string; totpSettings?: string; customFields: UnsafeItemExtraField[]; };
7,839
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/keeper.reader.spec.ts
import fs from 'fs'; import { deobfuscateItem } from '@proton/pass/lib/items/item.obfuscation'; import type { ItemImportIntent } from '@proton/pass/types'; import type { ImportPayload } from '../types'; import { readKeeperData } from './keeper.reader'; jest.mock('@proton/pass/utils/time/get-epoch', () => ({ getEpoch: jest.fn(() => 1682585156), })); describe('Import Keeper CSV', () => { let payload: ImportPayload; beforeAll(async () => { const sourceData = await fs.promises.readFile(__dirname + '/mocks/keeper.csv', 'utf8'); payload = await readKeeperData(sourceData); }); it('should handle corrupted files', async () => { await expect(readKeeperData('')).rejects.toThrow(); }); it('converts Keeper folders to vaults correctly', () => { expect(payload.vaults.length).toEqual(3); expect(payload.vaults[0].name).toEqual('Import - 27 Apr 2023'); expect(payload.vaults[1].name).toEqual('folder1'); expect(payload.vaults[2].name).toEqual('subfolder1'); }); it('should correctly parse items from 1st vault', () => { const firstVault = payload.vaults[0]; expect(firstVault.items.length).toEqual(9); const { items } = firstVault; /* login with 2FA */ const loginItem2FA = deobfuscateItem(items[0] as any) as unknown as ItemImportIntent<'login'>; expect(loginItem2FA.type).toEqual('login'); expect(loginItem2FA.createTime).toBeUndefined(); expect(loginItem2FA.modifyTime).toBeUndefined(); expect(loginItem2FA.metadata.itemUuid).not.toBeUndefined(); expect(loginItem2FA.metadata.name).toEqual('login with 2fa'); expect(loginItem2FA.metadata.note).toEqual(''); expect(loginItem2FA.content).toEqual({ username: '2fa@example.com', password: 'pass', urls: ['https://example.com/'], totpUri: 'otpauth://totp/account.proton.me:2fa-manually-entered-string%40example.com?issuer=account.proton.me&secret=RL3FRZ5V3EBM7T4ZMGJWGO43MQSTTMIT&algorithm=SHA1&digits=6&period=30', }); expect(loginItem2FA.trashed).toEqual(false); expect(loginItem2FA.extraFields).toEqual([]); /* login with broken url */ const loginItemBrokenUrl = deobfuscateItem(items[1] as any) as unknown as ItemImportIntent<'login'>; expect(loginItemBrokenUrl.type).toEqual('login'); expect(loginItemBrokenUrl.createTime).toBeUndefined(); expect(loginItemBrokenUrl.modifyTime).toBeUndefined(); expect(loginItemBrokenUrl.metadata.itemUuid).not.toBeUndefined(); expect(loginItemBrokenUrl.metadata.name).toEqual('login with broken url'); expect(loginItemBrokenUrl.metadata.note).toEqual(''); expect(loginItemBrokenUrl.content).toEqual({ username: 'john', password: 'pass', urls: [], totpUri: '', }); expect(loginItemBrokenUrl.trashed).toEqual(false); expect(loginItemBrokenUrl.extraFields).toEqual([]); /* login with comma, quotes */ const loginItemCommaQuotes = deobfuscateItem(items[2] as any) as unknown as ItemImportIntent<'login'>; expect(loginItemCommaQuotes.type).toEqual('login'); expect(loginItemCommaQuotes.createTime).toBeUndefined(); expect(loginItemCommaQuotes.modifyTime).toBeUndefined(); expect(loginItemCommaQuotes.metadata.itemUuid).not.toBeUndefined(); expect(loginItemCommaQuotes.metadata.name).toEqual('login with comma, quotes "'); expect(loginItemCommaQuotes.metadata.note).toEqual('notes with commas, quotes "'); expect(loginItemCommaQuotes.content).toEqual({ username: 'username with comma, quotes "', password: 'password with comma, quotes "', urls: ['https://example.com/'], totpUri: '', }); expect(loginItemCommaQuotes.trashed).toEqual(false); expect(loginItemCommaQuotes.extraFields).toEqual([]); /* login with custom fields */ const loginItemCustomFields = deobfuscateItem(items[3] as any) as unknown as ItemImportIntent<'login'>; expect(loginItemCustomFields.type).toEqual('login'); expect(loginItemCustomFields.createTime).toBeUndefined(); expect(loginItemCustomFields.modifyTime).toBeUndefined(); expect(loginItemCustomFields.metadata.itemUuid).not.toBeUndefined(); expect(loginItemCustomFields.metadata.name).toEqual('login with custom fields'); expect(loginItemCustomFields.metadata.note).toEqual(''); expect(loginItemCustomFields.content).toEqual({ username: 'john', password: 'pass', urls: ['https://example.com/'], totpUri: '', }); expect(loginItemCustomFields.trashed).toEqual(false); expect(loginItemCustomFields.extraFields).toEqual([ { fieldName: 'Hidden Field', type: 'hidden', data: { content: 'this is custom field: hidden', }, }, { fieldName: 'Security Question & Answer', type: 'text', data: { content: 'this is custom field: security question? this is custom field: security answer', }, }, { fieldName: 'Website Address', type: 'text', data: { content: 'https://this-is-custom-field-url.example.com', }, }, { fieldName: 'Phone', type: 'text', data: { content: 'Mobile US (+1) (555) 555-5555 Ex', }, }, { fieldName: 'Hidden Field with edited label', type: 'text', data: { content: 'this is custom field: hidden with edited label', }, }, ]); /* login with multiple lines */ const loginItemMultipleLines = deobfuscateItem(items[4] as any) as unknown as ItemImportIntent<'login'>; expect(loginItemMultipleLines.type).toEqual('login'); expect(loginItemMultipleLines.createTime).toBeUndefined(); expect(loginItemMultipleLines.modifyTime).toBeUndefined(); expect(loginItemMultipleLines.metadata.itemUuid).not.toBeUndefined(); expect(loginItemMultipleLines.metadata.name).toEqual('login with multiple lines'); expect(loginItemMultipleLines.metadata.note).toEqual('notes with\nmultiple\nlines'); expect(loginItemMultipleLines.content).toEqual({ username: 'john', password: 'pass', urls: ['https://example.com/'], totpUri: '', }); expect(loginItemMultipleLines.trashed).toEqual(false); expect(loginItemMultipleLines.extraFields).toEqual([]); /* login with multiple urls */ const loginItemMultipleUrls = deobfuscateItem(items[5] as any) as unknown as ItemImportIntent<'login'>; expect(loginItemMultipleUrls.type).toEqual('login'); expect(loginItemMultipleUrls.createTime).toBeUndefined(); expect(loginItemMultipleUrls.modifyTime).toBeUndefined(); expect(loginItemMultipleUrls.metadata.itemUuid).not.toBeUndefined(); expect(loginItemMultipleUrls.metadata.name).toEqual('login with multiple urls'); expect(loginItemMultipleUrls.metadata.note).toEqual(''); expect(loginItemMultipleUrls.content).toEqual({ username: '', password: '', urls: ['https://example.com/'], totpUri: '', }); expect(loginItemMultipleUrls.trashed).toEqual(false); expect(loginItemMultipleUrls.extraFields).toEqual([ { fieldName: 'Website Address', type: 'text', data: { content: 'https://second.example.com', }, }, { fieldName: 'Website Address with edited label', type: 'text', data: { content: 'https://edited-label.example.com', }, }, ]); /* login payment card */ const loginItemPaymentCard = deobfuscateItem(items[6] as any) as unknown as ItemImportIntent<'login'>; expect(loginItemPaymentCard.type).toEqual('login'); expect(loginItemPaymentCard.createTime).toBeUndefined(); expect(loginItemPaymentCard.modifyTime).toBeUndefined(); expect(loginItemPaymentCard.metadata.itemUuid).not.toBeUndefined(); expect(loginItemPaymentCard.metadata.name).toEqual('paymentcard'); expect(loginItemPaymentCard.metadata.note).toEqual('foo'); expect(loginItemPaymentCard.content).toEqual({ username: '', password: 'b5pIs[ISaru7@)44rn,xT', urls: ['https://example.com/'], totpUri: '', }); expect(loginItemPaymentCard.trashed).toEqual(false); expect(loginItemPaymentCard.extraFields).toEqual([ { fieldName: 'Bank Account', type: 'text', data: { content: 'Checking | 980', }, }, { fieldName: 'Hidden Field', type: 'hidden', data: { content: 'this is custom field: hidden', }, }, ]); /* login secure note */ const loginItemSecureNote = deobfuscateItem(items[7] as any) as unknown as ItemImportIntent<'note'>; expect(loginItemSecureNote.type).toEqual('note'); expect(loginItemSecureNote.createTime).toBeUndefined(); expect(loginItemSecureNote.modifyTime).toBeUndefined(); expect(loginItemSecureNote.metadata.itemUuid).not.toBeUndefined(); expect(loginItemSecureNote.metadata.name).toEqual('secure note item'); expect(loginItemSecureNote.metadata.note).toEqual('foo'); expect(loginItemSecureNote.content).toEqual({}); expect(loginItemSecureNote.trashed).toEqual(false); expect(loginItemSecureNote.extraFields).toEqual([]); /* login ssh key */ const loginItemSshKey = deobfuscateItem(items[8] as any) as unknown as ItemImportIntent<'login'>; expect(loginItemSshKey.type).toEqual('login'); expect(loginItemSshKey.createTime).toBeUndefined(); expect(loginItemSshKey.modifyTime).toBeUndefined(); expect(loginItemSshKey.metadata.itemUuid).not.toBeUndefined(); expect(loginItemSshKey.metadata.name).toEqual('ssh key item'); expect(loginItemSshKey.metadata.note).toEqual('foo'); expect(loginItemSshKey.content).toEqual({ username: 'john', password: 'pass', urls: [], totpUri: '', }); expect(loginItemSshKey.trashed).toEqual(false); expect(loginItemSshKey.extraFields).toEqual([ { fieldName: 'Key Pair', type: 'text', data: { content: 'privatekey | publickey', }, }, ]); }); it('should correctly parse items from 2nd vault', () => { const secondVault = payload.vaults[1]; expect(secondVault.items.length).toEqual(1); const { items } = secondVault; const loginItemSecondVault = deobfuscateItem(items[0] as any) as unknown as ItemImportIntent<'login'>; expect(loginItemSecondVault.type).toEqual('login'); expect(loginItemSecondVault.createTime).toBeUndefined(); expect(loginItemSecondVault.modifyTime).toBeUndefined(); expect(loginItemSecondVault.metadata.itemUuid).not.toBeUndefined(); expect(loginItemSecondVault.metadata.name).toEqual('login of folder1'); expect(loginItemSecondVault.metadata.note).toEqual(''); expect(loginItemSecondVault.content).toEqual({ username: 'john', password: '', urls: [], totpUri: '', }); expect(loginItemSecondVault.trashed).toEqual(false); expect(loginItemSecondVault.extraFields).toEqual([]); }); it('should correctly parse items from 3rd vault', () => { const thirdVault = payload.vaults[2]; expect(thirdVault.items.length).toEqual(1); const { items } = thirdVault; const loginItemSecondVault = deobfuscateItem(items[0] as any) as unknown as ItemImportIntent<'login'>; expect(loginItemSecondVault.type).toEqual('login'); expect(loginItemSecondVault.createTime).toBeUndefined(); expect(loginItemSecondVault.modifyTime).toBeUndefined(); expect(loginItemSecondVault.metadata.itemUuid).not.toBeUndefined(); expect(loginItemSecondVault.metadata.name).toEqual('login of subfolder1'); expect(loginItemSecondVault.metadata.note).toEqual(''); expect(loginItemSecondVault.content).toEqual({ username: 'john', password: '', urls: [], totpUri: '', }); expect(loginItemSecondVault.trashed).toEqual(false); expect(loginItemSecondVault.extraFields).toEqual([]); }); test('should correctly hydrate ignored arrays', () => { expect(payload.ignored.length).toEqual(4); expect(payload.ignored[0]).toEqual('[Other] address item'); expect(payload.ignored[1]).toEqual('[Other] contact item'); expect(payload.ignored[2]).toEqual('[Other] file attachment item'); expect(payload.ignored[3]).toEqual('[Other] general item'); }); });
7,840
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/keeper.reader.ts
import { c } from 'ttag'; import type { ItemImportIntent, Maybe, UnsafeItemExtraField } from '@proton/pass/types'; import { groupByKey } from '@proton/pass/utils/array/group-by-key'; import { truthy } from '@proton/pass/utils/fp/predicates'; import { logger } from '@proton/pass/utils/logger'; import lastItem from '@proton/utils/lastItem'; import { readCSV } from '../helpers/csv.reader'; import { ImportProviderError } from '../helpers/error'; import { getImportedVaultName, importLoginItem, importNoteItem } from '../helpers/transformers'; import type { ImportPayload, ImportVault } from '../types'; import type { KeeperItem } from './keeper.types'; const extractTOTP = (item: KeeperItem): string => { /* the totp is the element which follows the element * 'TFC:Keeper', and Keeper doesn't allow more than 1 * totp per item */ const indexBeforeTOTP = item.findIndex((element) => element === 'TFC:Keeper'); return indexBeforeTOTP > 0 ? item[indexBeforeTOTP + 1] : ''; }; const extractExtraFields = (item: KeeperItem): UnsafeItemExtraField[] => { const customFields: UnsafeItemExtraField[] = []; if (item.length > 7) { for (let i = 7; i < item.length; i += 2) { /* skip totp field because it was already added in extractTOTP above */ if (item[i] == 'TFC:Keeper') continue; const type = item[i] === 'Hidden Field' ? 'hidden' : 'text'; customFields.push({ fieldName: item[i] || (type === 'hidden' ? c('Label').t`Hidden` : c('Label').t`Text`), type, data: { content: item[i + 1], }, }); } } return customFields; }; /* item type is not defined in the CSV, so we import * as a login item if username or password or url or note * is not empty. ie: if an SSH key item has an username it * will be imported as a login item */ const isLoginItem = (item: KeeperItem): boolean => item[2] !== '' || item[3] !== '' || item[4] !== '' || item[5] !== ''; /* all fields empty except note field at index 5 */ const isNoteItem = (item: KeeperItem): boolean => item.every((value, idx) => { if (idx < 2) return true; if (idx === 5) return value !== ''; if (idx !== 5) return !value; }); export const readKeeperData = async (data: string): Promise<ImportPayload> => { const ignored: string[] = []; const warnings: string[] = []; try { const result = await readCSV<KeeperItem>({ data, onError: (error) => warnings.push(error), }); const groupedByVault = groupByKey( result.items.map( ([folderName, ...rest]) => [lastItem(folderName?.split('\\')) ?? '', ...rest] as KeeperItem ), 0 ); const vaults: ImportVault[] = groupedByVault .filter(({ length }) => length > 0) .map((items) => { return { name: getImportedVaultName(items?.[0][0]), shareId: null, items: items .map((item): Maybe<ItemImportIntent> => { if (isNoteItem(item)) { return importNoteItem({ name: item[1], note: item[5], }); } if (isLoginItem(item)) { return importLoginItem({ name: item[1], note: item[5], username: item[2], password: item[3], urls: [item[4]], totp: extractTOTP(item), extraFields: extractExtraFields(item), }); } ignored.push(`[${c('Placeholder').t`Other`}] ${item[1]}`); return; }) .filter(truthy), }; }); return { vaults, ignored, warnings, }; } catch (e) { logger.warn('[Importer::Keeper]', e); throw new ImportProviderError('Keeper', e); } };
7,841
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/keeper.types.ts
export type KeeperItem = [ /* folder name */ string, /* title (can't be an empty string) */ string, /* username */ string, /* url */ string, /* password */ string, /* note */ string, /* shared folder name */ string, /* custom fields: * KeeperItem[7 + n]: label of a custom field * KeeperItem[7 + (n + 1)]: value of that custom field */ ...string[], ];
7,842
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/lastpass.reader.spec.ts
import fs from 'fs'; import { deobfuscateItem } from '@proton/pass/lib/items/item.obfuscation'; import type { ItemImportIntent } from '@proton/pass/types'; import { getEpoch } from '@proton/pass/utils/time/get-epoch'; import type { ImportPayload } from '../types'; import { readLastPassData } from './lastpass.reader'; jest.mock('@proton/pass/utils/time/get-epoch', () => ({ getEpoch: jest.fn(() => 1682585156), })); describe('Import LastPass csv', () => { let sourceFiles = [`${__dirname}/mocks/lastpass.csv`, `${__dirname}/mocks/lastpass.crcrlf.terminated.csv`]; let payloads: Record<string, ImportPayload> = {}; beforeAll(async () => { for (let sourceFile of sourceFiles) { const sourceData = await fs.promises.readFile(sourceFile, 'utf-8'); payloads[sourceFile] = await readLastPassData(sourceData); } }); afterAll(() => (getEpoch as jest.Mock).mockClear()); it('should throw on corrupted files', async () => { await expect(readLastPassData('not-a-csv-file')).rejects.toThrow(); }); it('converts LastPass folders to vaults correctly', () => { const [source] = sourceFiles; const [primary, secondary] = payloads[source].vaults; expect(payloads[source].vaults.length).toEqual(2); expect(primary.name).toEqual('Import - 27 Apr 2023'); expect(secondary.name).toEqual('company services'); }); it('parses primary `LastPass import` vault items correctly', () => { const [source] = sourceFiles; const [primary] = payloads[source].vaults; expect(primary.items.length).toEqual(3); /* Login */ const loginItem1 = deobfuscateItem(primary.items[0] as any) as unknown as ItemImportIntent<'login'>; expect(loginItem1.type).toEqual('login'); expect(loginItem1.metadata.name).toEqual('nobody'); expect(loginItem1.metadata.note).toEqual('Secure note'); expect(loginItem1.content.username).toEqual('nobody@proton.me'); expect(loginItem1.content.password).toEqual('proton123'); expect(loginItem1.content.urls[0]).toEqual('https://account.proton.me/'); /* Note */ const noteItem1 = deobfuscateItem(primary.items[1] as any) as unknown as ItemImportIntent<'login'>; expect(noteItem1.type).toEqual('note'); expect(noteItem1.metadata.name).toEqual('Secure note'); expect(noteItem1.metadata.note).toEqual('This is a secure note'); /* Credit Card */ const creditCardItem1 = deobfuscateItem(primary.items[2] as any) as unknown as ItemImportIntent<'creditCard'>; expect(creditCardItem1.type).toEqual('creditCard'); expect(creditCardItem1.metadata.name).toEqual('Credit Card Item with note'); expect(creditCardItem1.metadata.note).toEqual('this is a note for the credit card'); expect(creditCardItem1.content.cardholderName).toEqual('A B'); expect(creditCardItem1.content.number).toEqual('4242424242424242'); expect(creditCardItem1.content.expirationDate).toEqual('012025'); expect(creditCardItem1.content.verificationNumber).toEqual('123'); expect(creditCardItem1.content.pin).toEqual(''); }); it('parses secondary vault items correctly', async () => { const [source] = sourceFiles; const [, secondary] = payloads[source].vaults; expect(secondary.items.length).toEqual(4); /* Login */ const loginItem2 = deobfuscateItem(secondary.items[0] as any) as unknown as ItemImportIntent<'login'>; expect(loginItem2.type).toEqual('login'); expect(loginItem2.metadata.name).toEqual('Admin'); expect(loginItem2.metadata.note).toEqual(''); expect(loginItem2.content.username).toEqual('admin'); expect(loginItem2.content.password).toEqual('proton123'); expect(loginItem2.content.urls[0]).toEqual('https://proton.me/'); /* Login */ const loginItem3 = deobfuscateItem(secondary.items[1] as any) as unknown as ItemImportIntent<'login'>; expect(loginItem3.type).toEqual('login'); expect(loginItem3.metadata.name).toEqual('Twitter'); expect(loginItem3.metadata.note).toEqual('This is a twitter note'); expect(loginItem3.content.username).toEqual('@nobody'); expect(loginItem3.content.password).toEqual('proton123'); expect(loginItem3.content.urls[0]).toEqual('https://twitter.com/login'); expect(loginItem3.content.totpUri).toEqual( 'otpauth://totp/Twitter?secret=BASE32SECREQ&algorithm=SHA1&digits=6&period=30' ); /* Login */ const loginItem4 = deobfuscateItem(secondary.items[2] as any) as unknown as ItemImportIntent<'login'>; expect(loginItem4.type).toEqual('login'); expect(loginItem4.metadata.name).toEqual('fb.com'); expect(loginItem4.metadata.note).toEqual(''); expect(loginItem4.content.username).toEqual('@nobody'); expect(loginItem4.content.password).toEqual('proton123'); expect(loginItem4.content.urls[0]).toEqual('https://fb.com/login'); expect(loginItem4.content.totpUri).toEqual( 'otpauth://totp/fb.com?secret=BASE32SECREQ&algorithm=SHA1&digits=6&period=30' ); /* Login broken url */ const loginItem5 = deobfuscateItem(secondary.items[3] as any) as unknown as ItemImportIntent<'login'>; expect(loginItem5.type).toEqual('login'); expect(loginItem5.metadata.name).toEqual('Unnamed item'); expect(loginItem5.metadata.note).toEqual(''); expect(loginItem5.content.username).toEqual(''); expect(loginItem5.content.password).toEqual(''); expect(loginItem5.content.urls).toEqual([]); }); test('correctly keeps a reference to ignored items', () => { const [source] = sourceFiles; expect(payloads[source].ignored).not.toEqual([]); expect(payloads[source].ignored[0]).toEqual('[Bank Account] test'); expect(payloads[source].ignored[1]).toEqual('[Address] TestID'); }); test('correctly handles CR CR LF line endings', () => { const [, source] = sourceFiles; const payload = payloads[source]; const [primary] = payload.vaults; expect(primary.items.length).toEqual(3); expect(primary.items.filter((n) => n.type === 'note').length).toEqual(3); }); });
7,843
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/lastpass.reader.ts
import getMonth from 'date-fns/getMonth'; import getYear from 'date-fns/getYear'; import { c } from 'ttag'; import type { ItemImportIntent } from '@proton/pass/types'; import { groupByKey } from '@proton/pass/utils/array/group-by-key'; import { truthy } from '@proton/pass/utils/fp/predicates'; import { logger } from '@proton/pass/utils/logger'; import capitalize from '@proton/utils/capitalize'; import lastItem from '@proton/utils/lastItem'; import { readCSV } from '../helpers/csv.reader'; import { ImportProviderError } from '../helpers/error'; import { getImportedVaultName, importCreditCardItem, importLoginItem, importNoteItem } from '../helpers/transformers'; import type { ImportPayload, ImportVault } from '../types'; import { type LastPassItem, LastPassNoteType } from './lastpass.types'; const LASTPASS_EXPECTED_HEADERS: (keyof LastPassItem)[] = [ 'url', 'username', 'password', 'extra', 'name', 'grouping', 'fav', ]; const getFieldValue = (extra: LastPassItem['extra'], key: string) => { /* match key and get the value: 'NoteType:Credit Card' */ if (!extra) return null; const match = extra.match(new RegExp(`${key}:(.*)`)); return match && match[1]; }; const processLoginItem = (item: LastPassItem): ItemImportIntent<'login'> => importLoginItem({ name: item.name, note: item.extra, username: item.username, password: item.password, urls: [item.url], totp: item.totp, }); const processNoteItem = (item: LastPassItem): ItemImportIntent<'note'> => importNoteItem({ name: item.name, note: item.extra, }); const getCCExpirationDate = (extra: LastPassItem['extra']) => { /* lastpass exp date format: 'January, 2025' */ const unformatted = getFieldValue(extra, 'Expiration Date'); if (!unformatted) return null; const date = new Date(`${unformatted} UTC`); return `${String(getMonth(date) + 1).padStart(2, '0')}${getYear(date)}`; }; const processCreditCardItem = (item: LastPassItem): ItemImportIntent<'creditCard'> => importCreditCardItem({ name: item.name, note: getFieldValue(item.extra, 'Notes'), cardholderName: getFieldValue(item.extra, 'Name on Card'), number: getFieldValue(item.extra, 'Number'), verificationNumber: getFieldValue(item.extra, 'Security Code'), expirationDate: getCCExpirationDate(item.extra), }); export const readLastPassData = async (data: string): Promise<ImportPayload> => { const ignored: string[] = []; const warnings: string[] = []; try { const result = await readCSV<LastPassItem>({ data, headers: LASTPASS_EXPECTED_HEADERS, throwOnEmpty: true, onError: (error) => warnings.push( `[Warning] ${c('Error') .t`LastPass will export a corrupted CSV file if any of your item fields contain unexpected commas, quotes or multiple lines`}`, error ), }); const groupedByVault = groupByKey( result.items.map((item) => ({ ...item, grouping: item.grouping ? lastItem(item.grouping?.split('\\')) : '', })), 'grouping' ); const vaults: ImportVault[] = groupedByVault .filter(({ length }) => length > 0) .map((items) => { return { name: getImportedVaultName(items?.[0].grouping), shareId: null, items: items .map((item) => { const isNote = item.url === 'http://sn'; if (!isNote) return processLoginItem(item); const noteType = getFieldValue(item.extra, 'NoteType'); if (noteType === LastPassNoteType.CREDIT_CARD) { return processCreditCardItem(item); } if (!noteType) return processNoteItem(item); ignored.push(`[${capitalize(noteType)}] ${item.name}`); }) .filter(truthy), }; }); return { vaults, ignored, warnings }; } catch (e) { logger.warn('[Importer::LastPass]', e); throw new ImportProviderError('LastPass', e); } };
7,844
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/lastpass.types.ts
import type { Maybe } from '@proton/pass/types'; export enum LastPassNoteType { CREDIT_CARD = 'Credit Card', } export type LastPassItem = { url: Maybe<string>; username: Maybe<string>; password: Maybe<string>; totp: Maybe<string>; extra: Maybe<string>; name: Maybe<string>; grouping: Maybe<string>; fav: Maybe<string>; };
7,845
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/nordpass.reader.spec.ts
import fs from 'fs'; import { deobfuscateItem } from '@proton/pass/lib/items/item.obfuscation'; import type { ItemImportIntent } from '@proton/pass/types'; import { getEpoch } from '@proton/pass/utils/time/get-epoch'; import type { ImportPayload } from '../types'; import { readNordPassData } from './nordpass.reader'; jest.mock('@proton/pass/utils/time/get-epoch', () => ({ getEpoch: jest.fn(() => 1682585156), })); describe('Import NordPass csv', () => { let sourceData: string; let payload: ImportPayload; beforeAll(async () => { sourceData = await fs.promises.readFile(__dirname + '/mocks/nordpass.csv', 'utf8'); payload = await readNordPassData(sourceData); }); afterAll(() => (getEpoch as jest.Mock).mockClear()); it('should throw on corrupted files', async () => { await expect(readNordPassData('not-a-csv-file')).rejects.toThrow(); }); it('converts NordPass folders to vaults correctly', () => { const [primary, secondary] = payload.vaults; expect(payload.vaults.length).toEqual(2); expect(primary.name).toEqual('Import - 27 Apr 2023'); expect(secondary.name).toEqual('company services'); }); it('parses primary `NordPass import` vault items correctly', () => { const [primary] = payload.vaults; expect(primary.items.length).toEqual(4); /* Login */ const loginItem1 = deobfuscateItem(primary.items[0] as any) as unknown as ItemImportIntent<'login'>; expect(loginItem1.type).toEqual('login'); expect(loginItem1.metadata.name).toEqual('nobody'); expect(loginItem1.metadata.note).toEqual('Secure note'); expect(loginItem1.content.username).toEqual('nobody@proton.me'); expect(loginItem1.content.password).toEqual('proton123'); expect(loginItem1.content.urls[0]).toEqual('https://account.proton.me/'); /* Note */ const noteItem1 = deobfuscateItem(primary.items[1] as any) as unknown as ItemImportIntent<'login'>; expect(noteItem1.type).toEqual('note'); expect(noteItem1.metadata.name).toEqual('Secure note'); expect(noteItem1.metadata.note).toEqual('This is a secure note'); /* Credit Card */ const creditCardItem1 = deobfuscateItem(primary.items[3] as any) as unknown as ItemImportIntent<'creditCard'>; expect(creditCardItem1.type).toEqual('creditCard'); expect(creditCardItem1.metadata.name).toEqual('Credit Card Item with note'); expect(creditCardItem1.metadata.note).toEqual('this is a note for the credit card'); expect(creditCardItem1.content.cardholderName).toEqual('A B'); expect(creditCardItem1.content.number).toEqual('4242424242424242'); expect(creditCardItem1.content.expirationDate).toEqual('012025'); expect(creditCardItem1.content.verificationNumber).toEqual('123'); expect(creditCardItem1.content.pin).toEqual(''); }); it('parses secondary vault items correctly', async () => { const [, secondary] = payload.vaults; expect(secondary.items.length).toEqual(4); /* Login */ const loginItem2 = deobfuscateItem(secondary.items[0] as any) as unknown as ItemImportIntent<'login'>; expect(loginItem2.type).toEqual('login'); expect(loginItem2.metadata.name).toEqual('Admin'); expect(loginItem2.metadata.note).toEqual(''); expect(loginItem2.content.username).toEqual('admin'); expect(loginItem2.content.password).toEqual('proton123'); expect(loginItem2.content.urls[0]).toEqual('https://proton.me/'); /* Login */ const loginItem3 = deobfuscateItem(secondary.items[1] as any) as unknown as ItemImportIntent<'login'>; expect(loginItem3.type).toEqual('login'); expect(loginItem3.metadata.name).toEqual('Twitter'); expect(loginItem3.metadata.note).toEqual('This is a twitter note'); expect(loginItem3.content.username).toEqual('@nobody'); expect(loginItem3.content.password).toEqual('proton123'); expect(loginItem3.content.urls[0]).toEqual('https://twitter.com/login'); expect(loginItem3.content.totpUri).toEqual(''); /* Login */ const loginItem4 = deobfuscateItem(secondary.items[2] as any) as unknown as ItemImportIntent<'login'>; expect(loginItem4.type).toEqual('login'); expect(loginItem4.metadata.name).toEqual('fb.com'); expect(loginItem4.metadata.note).toEqual(''); expect(loginItem4.content.username).toEqual('@nobody'); expect(loginItem4.content.password).toEqual('proton123'); expect(loginItem4.content.urls[0]).toEqual('https://fb.com/login'); expect(loginItem4.content.totpUri).toEqual(''); /* Login broken url */ const loginItem5 = deobfuscateItem(secondary.items[3] as any) as unknown as ItemImportIntent<'login'>; expect(loginItem5.type).toEqual('login'); expect(loginItem5.metadata.name).toEqual('htts'); expect(loginItem5.metadata.note).toEqual(''); expect(loginItem5.content.username).toEqual(''); expect(loginItem5.content.password).toEqual(''); expect(loginItem5.content.urls).toEqual([]); }); test('correctly keeps a reference to ignored items', () => { expect(payload.ignored).not.toEqual([]); expect(payload.ignored[0]).toEqual('[folder] company services'); expect(payload.ignored[1]).toEqual('[identity] TestID'); }); });
7,846
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/nordpass.reader.ts
import { c } from 'ttag'; import type { ItemImportIntent } from '@proton/pass/types'; import { groupByKey } from '@proton/pass/utils/array/group-by-key'; import { truthy } from '@proton/pass/utils/fp/predicates'; import { logger } from '@proton/pass/utils/logger'; import { readCSV } from '../helpers/csv.reader'; import { ImportProviderError } from '../helpers/error'; import { getImportedVaultName, importCreditCardItem, importLoginItem, importNoteItem } from '../helpers/transformers'; import type { ImportPayload, ImportVault } from '../types'; import { type NordPassItem, NordPassType } from './nordpass.types'; const NORDPASS_EXPECTED_HEADERS: (keyof NordPassItem)[] = [ 'name', 'url', 'username', 'password', 'note', 'cardholdername', 'cardnumber', 'cvc', 'expirydate', 'zipcode', 'folder', 'full_name', 'phone_number', 'email', 'address1', 'address2', 'city', 'country', 'state', 'type', ]; const processLoginItem = (item: NordPassItem): ItemImportIntent<'login'> => importLoginItem({ name: item.name, note: item.note, username: item.username, password: item.password, urls: [item.url], }); const processNoteItem = (item: NordPassItem): ItemImportIntent<'note'> => importNoteItem({ name: item.name, note: item.note, }); const processCreditCardItem = (item: NordPassItem): ItemImportIntent<'creditCard'> => { /* NordPass expiration date format is MM/YY, we need MMYYYY */ const expirationDate = item.expirydate?.length ? `${item.expirydate.slice(0, 2)}20${item.expirydate.slice(3, 5)}` : undefined; return importCreditCardItem({ name: item.name, note: item.note, cardholderName: item.cardholdername, number: item.cardnumber, verificationNumber: item.cvc, expirationDate, }); }; export const readNordPassData = async (data: string): Promise<ImportPayload> => { const ignored: string[] = []; const warnings: string[] = []; try { const result = await readCSV<NordPassItem>({ data, headers: NORDPASS_EXPECTED_HEADERS, throwOnEmpty: true, onError: (error) => warnings.push(error), }); const groupedByVault = groupByKey(result.items, 'folder'); const vaults: ImportVault[] = groupedByVault .filter(({ length }) => length > 0) .map((items) => { return { name: getImportedVaultName(items?.[0].folder), shareId: null, items: items .map((item) => { switch (item.type) { case NordPassType.CREDIT_CARD: return processCreditCardItem(item); case NordPassType.LOGIN: return processLoginItem(item); case NordPassType.NOTE: return processNoteItem(item); default: ignored.push(`[${item.type ?? c('Placeholder').t`Other`}] ${item.name ?? ''}`); } }) .filter(truthy), }; }); return { vaults, ignored, warnings }; } catch (e) { logger.warn('[Importer::NordPass]', e); throw new ImportProviderError('NordPass', e); } };
7,847
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/nordpass.types.ts
import type { Maybe } from '@proton/pass/types'; export enum NordPassType { LOGIN = 'password', CREDIT_CARD = 'credit_card', IDENTITY = 'identity', NOTE = 'note', } export type NordPassItem = { name: Maybe<string>; url: Maybe<string>; username: Maybe<string>; password: Maybe<string>; note: Maybe<string>; cardholdername: Maybe<string>; cardnumber: Maybe<string>; cvc: Maybe<string>; expirydate: Maybe<string>; zipcode: Maybe<string>; folder: Maybe<string>; full_name: Maybe<string>; phone_number: Maybe<string>; email: Maybe<string>; address1: Maybe<string>; address2: Maybe<string>; city: Maybe<string>; country: Maybe<string>; state: Maybe<string>; type: Maybe<NordPassType>; };
7,848
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/protonpass.reader.ts
import JSZip from 'jszip'; import { c } from 'ttag'; import type { ExportPayload, ExportedItem } from '@proton/pass/lib/export/types'; import { pageMessage, sendMessage } from '@proton/pass/lib/extension/message'; import { obfuscateItem } from '@proton/pass/lib/items/item.obfuscation'; import { type ItemImportIntent, ItemState, WorkerMessageType } from '@proton/pass/types'; import { partition } from '@proton/pass/utils/array/partition'; import { prop } from '@proton/pass/utils/fp/lens'; import { logger } from '@proton/pass/utils/logger'; import { PASS_APP_NAME } from '@proton/shared/lib/constants'; import { base64StringToUint8Array } from '@proton/shared/lib/helpers/encoding'; import { ImportProviderError, ImportReaderError } from '../helpers/error'; import type { ImportPayload, ImportVault } from '../types'; type ProtonPassReaderPayload = | { data: ArrayBuffer; encrypted: false; userId?: string } | { data: string; encrypted: true; passphrase: string; userId?: string }; export const readProtonPassData = async (payload: ProtonPassReaderPayload): Promise<ImportPayload> => { const zipBuffer = payload.encrypted ? /** * CryptoProxy is only initalized in the worker execution * context. Send a pageMessage (as of now the importer is * handled in the settings page) to decrypt the payload * before reading the .zip file contents */ await (async () => sendMessage.on( pageMessage({ type: WorkerMessageType.EXPORT_DECRYPT, payload: { data: payload.data, passphrase: payload.passphrase }, }), (res) => { if (res.type === 'error') { const errorDetail = res.error.includes('Error decrypting message') ? c('Error').t`Passphrase is incorrect` : c('Error').t`File could not be parsed`; throw new ImportReaderError( c('Error').t`Decrypting your ${PASS_APP_NAME} export file failed. ${errorDetail}` ); } return base64StringToUint8Array(res.data); } ))() : payload.data; try { const zipFile = await JSZip.loadAsync(zipBuffer); const zipObject = zipFile.file(`${PASS_APP_NAME}/data.json`); const exportData = await zipObject?.async('string'); if (exportData === undefined) throw new Error(); const parsedExport = JSON.parse(exportData) as ExportPayload; const { userId } = parsedExport; /* when trying to import alias items : make sure the userId between * the exported file and the current userId match. We won't be able * to re-create the aliases if they're not user-owned */ const aliasOwnedByUser = (item: ExportedItem) => item.data.type === 'alias' ? userId === payload.userId : true; const vaults = Object.values(parsedExport.vaults).map<{ vault: ImportVault; ignored: string[] }>( ({ name, items }) => { const [itemsToImport, ignoredAliases] = partition(items, aliasOwnedByUser); return { vault: { name: name, shareId: null, items: itemsToImport.map( (item) => ({ ...obfuscateItem({ ...item.data, ...(item.data.type === 'alias' ? { extraData: { aliasEmail: item.aliasEmail! } } : {}), }), trashed: item.state === ItemState.Trashed, createTime: item.createTime, modifyTime: item.modifyTime, }) as ItemImportIntent ), }, ignored: ignoredAliases.map((item) => `[Alias] ${item.aliasEmail}`), }; } ); return { vaults: vaults.map(prop('vault')), ignored: vaults.flatMap(prop('ignored')), warnings: [], }; } catch (e) { logger.warn('[Importer::Proton]', e); throw new ImportProviderError(PASS_APP_NAME, e); } };
7,849
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/roboform.reader.spec.ts
import fs from 'fs'; import { deobfuscateItem } from '@proton/pass/lib/items/item.obfuscation'; import type { ItemImportIntent } from '@proton/pass/types'; import { getEpoch } from '@proton/pass/utils/time/get-epoch'; import type { ImportPayload } from '../types'; import { readRoboformData } from './roboform.reader'; jest.mock('@proton/pass/utils/time/get-epoch', () => ({ getEpoch: jest.fn(() => 1682585156), })); describe('Import Roboform csv', () => { let sourceData: string; let payload: ImportPayload; beforeAll(async () => { sourceData = await fs.promises.readFile(__dirname + '/mocks/roboform.csv', 'utf8'); payload = await readRoboformData(sourceData); }); afterAll(() => (getEpoch as jest.Mock).mockClear()); it('should throw on corrupted files', async () => { await expect(readRoboformData('')).rejects.toThrow(); }); it('converts Roboform folders to vaults correctly', () => { const [primary, secondary] = payload.vaults; expect(payload.vaults.length).toEqual(2); expect(primary.name).toEqual('Import - 27 Apr 2023'); expect(secondary.name).toEqual('company services'); }); it('parses primary `Roboform import` vault items correctly', () => { const [primary] = payload.vaults; expect(primary.items.length).toEqual(9); /* Login */ const loginItem1 = deobfuscateItem(primary.items[0] as any) as unknown as ItemImportIntent<'login'>; expect(loginItem1.type).toEqual('login'); expect(loginItem1.metadata.name).toEqual('Example'); expect(loginItem1.metadata.note).toEqual('cool note'); expect(loginItem1.content.username).toEqual('example'); expect(loginItem1.content.password).toEqual('some@password'); expect(loginItem1.content.urls[0]).toEqual('http://example.com/'); expect(loginItem1.content.totpUri).toEqual( 'otpauth://totp/Example:none?issuer=Example&secret=FDKJJKDS&algorithm=SHA1&digits=6&period=30' ); /* Note */ const noteItem1 = deobfuscateItem(primary.items[6] as any) as unknown as ItemImportIntent<'login'>; expect(noteItem1.type).toEqual('note'); expect(noteItem1.metadata.name).toEqual('Secure note'); expect(noteItem1.metadata.note).toEqual('This is a secure note'); }); it('parses secondary vault items correctly', async () => { const [, secondary] = payload.vaults; expect(secondary.items.length).toEqual(5); /* Login */ const loginItem2 = deobfuscateItem(secondary.items[0] as any) as unknown as ItemImportIntent<'login'>; expect(loginItem2.type).toEqual('login'); expect(loginItem2.metadata.name).toEqual('Admin'); expect(loginItem2.metadata.note).toEqual(''); expect(loginItem2.content.username).toEqual('admin'); expect(loginItem2.content.password).toEqual("'@proton123"); expect(loginItem2.content.urls[0]).toEqual('https://proton.me/'); /* Bookmark - broken url */ const loginItem3 = deobfuscateItem(secondary.items[1] as any) as unknown as ItemImportIntent<'login'>; expect(loginItem3.type).toEqual('login'); expect(loginItem3.metadata.name).toEqual('Bookmark'); expect(loginItem3.metadata.note).toEqual(''); expect(loginItem3.content.username).toEqual(''); expect(loginItem3.content.password).toEqual(''); expect(loginItem3.content.urls).toEqual([]); /* Bookmark - valid */ const loginItem4 = deobfuscateItem(secondary.items[2] as any) as unknown as ItemImportIntent<'login'>; expect(loginItem4.type).toEqual('login'); expect(loginItem4.metadata.name).toEqual('Bookmark - valid'); expect(loginItem4.metadata.note).toEqual(''); expect(loginItem4.content.username).toEqual(''); expect(loginItem4.content.password).toEqual(''); expect(loginItem4.content.urls).toEqual(['https://example.com/']); /* Login broken URL */ const loginItem5 = deobfuscateItem(secondary.items[3] as any) as unknown as ItemImportIntent<'login'>; expect(loginItem5.type).toEqual('login'); expect(loginItem5.metadata.name).toEqual('Fb'); expect(loginItem5.metadata.note).toEqual('Facebook note\n'); expect(loginItem5.content.username).toEqual('nobody'); expect(loginItem5.content.password).toEqual('@proton123'); expect(loginItem5.content.urls).toEqual(['https://fb.com/login']); }); });
7,850
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/roboform.reader.ts
import type { Maybe } from '@proton/pass/types'; import { groupByKey } from '@proton/pass/utils/array/group-by-key'; import { logger } from '@proton/pass/utils/logger'; import lastItem from '@proton/utils/lastItem'; import { readCSV } from '../helpers/csv.reader'; import { ImportProviderError } from '../helpers/error'; import { getImportedVaultName, importLoginItem, importNoteItem } from '../helpers/transformers'; import type { ImportPayload, ImportVault } from '../types'; import type { RoboformItem, RoboformVariadicItem } from './roboform.types'; /* * In Roboform exports, fields beginning with `@` or `'` have a single quote (`'`) prepended. * To account for this, occurences of `'@` and `''` are replaced with their actual values, * ie. `@` and `'` respectively. */ const unescapeFieldValue = (value: string) => value.replace(/^'(?=@|')/, ''); const formatOtpAuthUri = (item: RoboformItem): Maybe<string> => { const totpDefinition = item.RfFieldsV2?.find((e) => e.startsWith('TOTP KEY$')); if (!totpDefinition) return; const secret = lastItem(totpDefinition.split(',')); return `otpauth://totp/${item.Name}:none?secret=${secret}`; }; export const readRoboformData = async (data: string): Promise<ImportPayload> => { const ignored: string[] = []; const warnings: string[] = []; try { const result = await readCSV<RoboformVariadicItem>({ data, onError: (error) => warnings.push(error), }); /* * Skips the first row (headers) and maps results to an array of RoboformItem's. */ const items: RoboformItem[] = result.items .slice(1) .map(([Name, Url, MatchUrl, Login, Pwd, Note, Folder, ...RfFieldsV2]) => ({ Name, Url, MatchUrl, Login: unescapeFieldValue(Login), Pwd: unescapeFieldValue(Pwd), Note, Folder: lastItem(Folder.split('/')), RfFieldsV2, })); const groupedByVault = groupByKey(items, 'Folder'); const vaults: ImportVault[] = groupedByVault.map((roboformItems) => { const vaultName = roboformItems[0].Folder; const items = roboformItems.map((item) => { /* Bookmark */ if (item.Url && !item.MatchUrl && !item.Login && !item.Pwd) { return importLoginItem({ name: item.Name, urls: [item.Url], note: item.Note, }); } /* Note */ if (!item.Url && !item.MatchUrl && !item.Login && !item.Pwd) { return importNoteItem({ name: item.Name, note: item.Note, }); } /* Login */ return importLoginItem({ name: item.Name, urls: [item.MatchUrl], note: item.Note, username: item.Login, password: item.Pwd, totp: formatOtpAuthUri(item), }); }); return { shareId: null, name: getImportedVaultName(vaultName), items, }; }); return { vaults, ignored, warnings }; } catch (e) { logger.warn('[Importer::Roboform]', e); throw new ImportProviderError('Roboform', e); } };
7,851
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/roboform.types.ts
import type { Maybe } from '@proton/pass/types'; export type RoboformVariadicItem = [string, string, string, string, string, string, string, ...string[]]; export type RoboformItem = { Name: Maybe<string>; Url: Maybe<string>; MatchUrl: Maybe<string>; Login: Maybe<string>; Pwd: Maybe<string>; Note: Maybe<string>; Folder: Maybe<string>; RfFieldsV2: Maybe<string[]>; };
7,852
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/safari.reader.spec.ts
import fs from 'fs'; import type { ItemImportIntent } from '@proton/pass/types'; import { deobfuscate } from '@proton/pass/utils/obfuscate/xor'; import type { ImportPayload } from '../types'; import { readSafariData } from './safari.reader'; describe('Import Safari CSV', () => { let payload: ImportPayload; beforeAll(async () => { const sourceData = await fs.promises.readFile(__dirname + '/mocks/safari.csv', 'utf8'); payload = await readSafariData(sourceData); }); it('should handle corrupted files', async () => { await expect(readSafariData('not-a-csv-file')).rejects.toThrow(); }); it('should correctly parse items', async () => { const [vaultData] = payload.vaults; expect(payload.vaults.length).toEqual(1); expect(vaultData.name).not.toBeUndefined(); const { items } = vaultData; /* Login with broken url */ const loginItemBrokenUrl = items[0] as ItemImportIntent<'login'>; expect(loginItemBrokenUrl.type).toEqual('login'); expect(loginItemBrokenUrl.createTime).toBeUndefined(); expect(loginItemBrokenUrl.modifyTime).toBeUndefined(); expect(loginItemBrokenUrl.metadata.itemUuid).not.toBeUndefined(); expect(loginItemBrokenUrl.metadata.name).toEqual('ex:ample.com (brokenurl@example.com)'); expect(deobfuscate(loginItemBrokenUrl.metadata.note)).toEqual(''); expect(deobfuscate(loginItemBrokenUrl.content.username)).toEqual('brokenurl@example.com'); expect(deobfuscate(loginItemBrokenUrl.content.password)).toEqual('pass'); expect(deobfuscate(loginItemBrokenUrl.content.totpUri)).toEqual(''); expect(loginItemBrokenUrl.content.urls).toEqual([]); expect(loginItemBrokenUrl.trashed).toEqual(false); expect(loginItemBrokenUrl.extraFields).toEqual([]); /* Login with 2FA (scanned qr code) */ const loginItem2faScanned = items[1] as ItemImportIntent<'login'>; expect(loginItem2faScanned.type).toEqual('login'); expect(loginItem2faScanned.createTime).toBeUndefined(); expect(loginItem2faScanned.modifyTime).toBeUndefined(); expect(loginItem2faScanned.metadata.itemUuid).not.toBeUndefined(); expect(loginItem2faScanned.metadata.name).toEqual('2fa.example.com (2fa-scanned)'); expect(deobfuscate(loginItem2faScanned.metadata.note)).toEqual(''); expect(deobfuscate(loginItem2faScanned.content.username)).toEqual('2fa-scanned'); expect(deobfuscate(loginItem2faScanned.content.password)).toEqual('pass'); expect(deobfuscate(loginItem2faScanned.content.totpUri)).toEqual( 'otpauth://totp/db%40example.com?issuer=Proton&secret=OTDED5QZA64L6YRUWJLD65QQ3Z6PZ3A3&algorithm=SHA1&digits=6&period=30' ); expect(loginItem2faScanned.content.urls).toEqual(['https://2fa.example.com/']); expect(loginItem2faScanned.trashed).toEqual(false); expect(loginItem2faScanned.extraFields).toEqual([]); /* Login with comma and quote */ const loginItemCommaQuote = items[2] as ItemImportIntent<'login'>; expect(loginItemCommaQuote.type).toEqual('login'); expect(loginItemCommaQuote.createTime).toBeUndefined(); expect(loginItemCommaQuote.modifyTime).toBeUndefined(); expect(loginItemCommaQuote.metadata.itemUuid).not.toBeUndefined(); expect(loginItemCommaQuote.metadata.name).toEqual('account.example.com (username with comma, quotes ")'); expect(deobfuscate(loginItemCommaQuote.metadata.note)).toEqual('notes with commas, quotes "'); expect(deobfuscate(loginItemCommaQuote.content.username)).toEqual('username with comma, quotes "'); expect(deobfuscate(loginItemCommaQuote.content.password)).toEqual('password with comma, quotes "'); expect(deobfuscate(loginItemCommaQuote.content.totpUri)).toEqual(''); expect(loginItemCommaQuote.content.urls).toEqual(['https://account.example.com/']); expect(loginItemCommaQuote.trashed).toEqual(false); expect(loginItemCommaQuote.extraFields).toEqual([]); /* Login with multiple lines */ const loginItemMultipleLines = items[3] as ItemImportIntent<'login'>; expect(loginItemMultipleLines.type).toEqual('login'); expect(loginItemMultipleLines.createTime).toBeUndefined(); expect(loginItemMultipleLines.modifyTime).toBeUndefined(); expect(loginItemMultipleLines.metadata.itemUuid).not.toBeUndefined(); expect(loginItemMultipleLines.metadata.name).toEqual('localhost (login-with-multiple-lines)'); expect(deobfuscate(loginItemMultipleLines.metadata.note)).toEqual('notes with\nmultiple\nlines'); expect(deobfuscate(loginItemMultipleLines.content.username)).toEqual('login-with-multiple-lines'); expect(deobfuscate(loginItemMultipleLines.content.password)).toEqual('pass'); expect(deobfuscate(loginItemMultipleLines.content.totpUri)).toEqual(''); expect(loginItemMultipleLines.content.urls).toEqual(['http://localhost:7777/']); expect(loginItemMultipleLines.trashed).toEqual(false); expect(loginItemMultipleLines.extraFields).toEqual([]); /* Login with 2FA (manually entered key) */ const loginItem2faManuallyEntered = items[4] as ItemImportIntent<'login'>; expect(loginItem2faManuallyEntered.type).toEqual('login'); expect(loginItem2faManuallyEntered.createTime).toBeUndefined(); expect(loginItem2faManuallyEntered.modifyTime).toBeUndefined(); expect(loginItem2faManuallyEntered.metadata.itemUuid).not.toBeUndefined(); expect(loginItem2faManuallyEntered.metadata.name).toEqual( 'account.proton.me (2fa-manually-entered-string@example.com)' ); expect(deobfuscate(loginItem2faManuallyEntered.metadata.note)).toEqual(''); expect(deobfuscate(loginItem2faManuallyEntered.content.username)).toEqual( '2fa-manually-entered-string@example.com' ); expect(deobfuscate(loginItem2faManuallyEntered.content.password)).toEqual('proton123'); expect(deobfuscate(loginItem2faManuallyEntered.content.totpUri)).toEqual( 'otpauth://totp/account.proton.me:2fa-manually-entered-string%40example.com?issuer=account.proton.me&secret=RL3FRZ5V3EBM7T4ZMGJWGO43MQSTTMIT&algorithm=SHA1&digits=6&period=30' ); expect(loginItem2faManuallyEntered.content.urls).toEqual(['https://account.proton.me/']); expect(loginItem2faManuallyEntered.trashed).toEqual(false); expect(loginItem2faManuallyEntered.extraFields).toEqual([]); /* ignored & warnings */ expect(payload.ignored.length).toEqual(0); expect(payload.warnings.length).toEqual(0); }); });
7,853
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/safari.reader.ts
import type { ItemImportIntent } from '@proton/pass/types'; import { logger } from '@proton/pass/utils/logger'; import { readCSV } from '../helpers/csv.reader'; import { ImportProviderError } from '../helpers/error'; import { getImportedVaultName, importLoginItem } from '../helpers/transformers'; import type { ImportPayload } from '../types'; import type { SafariItem } from './safari.types'; /* Safari old version has Title,Url,Username,Password * while current version has Title,URL,Username,Password,Notes,OTPAuth * so we only expect headers in common and not all of them, to avoid readCSV throwing an error */ const SAFARI_EXPECTED_HEADERS: (keyof SafariItem)[] = ['Title', 'Username', 'Password']; export const readSafariData = async (data: string): Promise<ImportPayload> => { const ignored: string[] = []; const warnings: string[] = []; try { const result = await readCSV<SafariItem>({ data, headers: SAFARI_EXPECTED_HEADERS, onError: (error) => warnings.push(error), }); return { vaults: [ { name: getImportedVaultName(), shareId: null, items: result.items.map( (item): ItemImportIntent<'login'> => importLoginItem({ name: item.Title, note: item.Notes, username: item.Username, password: item.Password, urls: [item.URL], totp: item.OTPAuth, }) ), }, ], ignored, warnings, }; } catch (e) { logger.warn('[Importer::Safari]', e); throw new ImportProviderError('Safari', e); } };
7,854
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/safari.types.ts
import type { Maybe } from '@proton/pass/types'; export type SafariItem = { Title: Maybe<string>; URL: Maybe<string>; Username: Maybe<string>; Password: Maybe<string>; Notes: Maybe<string>; OTPAuth: Maybe<string>; };
7,855
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/mocks/1password.private.1pif
{"uuid":"fjvch3z3lfakpfgkjc5oq63h2m","updatedAt":1655535034,"securityLevel":"SL5","contentsHash":"6cc30de2","title":"Password","secureContents":{"password":"f@LGRHG7BEcByVy--xTV8X4U","sections":[{"title":"","name":"add more"},{"title":"Related Items","name":"linked items"}]},"createdAt":1655535022,"typeName":"passwords.Password"} ***5642bee8-a5ff-11dc-8314-0800200c9a66*** {"uuid":"voxsoglqnnngkfpmuuqlvir6by","updatedAt":1671040547,"locationKey":"slashdot.org","securityLevel":"SL5","openContents":{"tags":["this is a tag"]},"contentsHash":"832fb4ed","title":"Credential with \" in the name","location":"https:\/\/slashdot.org","secureContents":{"fields":[{"value":"somewhere","id":"","name":"username","type":"T","designation":"username"},{"value":"somepassword with \" in it","id":"","name":"password","type":"P","designation":"password"}],"passwordHistory":[{"value":"somepassword for some reason","time":1671029291}],"notesPlain":"Item notes","sections":[{"fields":[{"k":"string","inputTraits":{"autocorrection":"no","autocapitalization":"Sentences"},"n":"o77agfr74kydyjpbakv5ad65ne","v":"value of the text section","a":{"multiline":"yes"},"t":"text section"}],"title":"","name":"add more"}],"URLs":[{"label":"website","url":"https:\/\/slashdot.org"}]},"createdAt":1619085696,"typeName":"webforms.WebForm"} ***5642bee8-a5ff-11dc-8314-0800200c9a66*** {"uuid":"ndi5d6vocrtxz73yixx3iri7lm","updatedAt":1619085236,"securityLevel":"SL5","openContents":{"tags":["Starter Kit"]},"contentsHash":"14b7cf34","title":"🎉 Welcome to 1Password!","secureContents":{"notesPlain":"Follow these steps to get started.","sections":[{"fields":[{"k":"URL","n":"gz44u4uzf5alhu7o2pcy4i2uhq","v":"https:\/\/1password.com\/downloads","t":""},{"k":"string","n":"rmbs7vyyxcpjazvnfz5qb7skwu","v":"Install 1Password everywhere you need your passwords.","t":""}],"title":"1️⃣ Get the apps","name":"46vzn6p2jgp3tykzcgv2fl6jga"},{"fields":[{"k":"URL","n":"zwpfbyhup4mkrpyw5jp2xdbghm","v":"https:\/\/1password.com\/downloads\/#browsers","t":""},{"k":"string","n":"mrgibnuclzjk27xzkcjjolcubu","v":"Install 1Password in your browser to save and fill passwords.","t":""}],"title":"2️⃣ Get 1Password in your browser","name":"mhsmebytc42ftmcoqwsl7w5opa"},{"fields":[{"k":"string","n":"lascgq4lppo63zqt7vjwhin6wm","v":"1. Sign in to your favorite website.","t":""},{"k":"string","n":"lavyn6k6sqsz32fyvdyppn2wja","v":"2. 1Password will ask to save your username and password.","t":""},{"k":"string","n":"j3lu2gq7z4dwjxskrnkecekixm","v":"3. Click Save Login.","t":""}],"title":"3️⃣ Save your first password","name":"x2nayetyv3z7gmwceo3kjpdgty"},{"fields":[{"k":"URL","n":"xfnmvmrtrroiphohctlcyhkda4","v":"https:\/\/support.1password.com\/explore\/extension\/","t":""},{"k":"string","n":"i3qvtopfocxypll4dgq6kqpkkq","v":"Save and fill passwords, credit cards, and addresses.","t":""}],"title":"4️⃣ Fill passwords and more","name":"gdroyeze5oqr3dfnttdsntnqhi"},{"fields":[{"k":"string","n":"jbw44trcbhqdnzgubzy6rgbr6a","v":"Check out our videos and articles:","t":""},{"k":"URL","n":"pgr46pcecqfkflullcitaxdxja","v":"https:\/\/youtube.com\/1PasswordVideos","t":"Watch videos"},{"k":"URL","n":"gtqbujhyk4fv2mygi62eilb3by","v":"https:\/\/support.1password.com\/","t":"Get support"},{"k":"URL","n":"44lho4wpg7wc6g3nokvlrdtici","v":"https:\/\/blog.1password.com\/","t":"Read the blog"},{"k":"URL","n":"uxm4cv3tdjg3tlbjlzcxx37lce","v":"https:\/\/support.1password.com\/contact-us\/","t":"Contact us"}],"title":"📚 Learn 1Password","name":"wwsk4rh22gzpayprzjlvmq4ggq"}]},"createdAt":1619085236,"typeName":"securenotes.SecureNote"} ***5642bee8-a5ff-11dc-8314-0800200c9a66*** {"uuid":"c7lmhvf5tuuj2mbf43rfrxdyqa","updatedAt":1675771315,"securityLevel":"SL5","contentsHash":"a2b52a2c","title":"Autofill Sample","secureContents":{"fields":[{"value":"username test","id":"","name":"username","type":"T","designation":"username"},{"value":"password test","id":"","name":"password","type":"P","designation":"password"}]},"createdAt":1675771315,"typeName":"webforms.WebForm"} ***5642bee8-a5ff-11dc-8314-0800200c9a66*** {"uuid":"lje63s54lv6zqzob2maerhdckq","updatedAt":1677234158,"securityLevel":"SL5","contentsHash":"9335d699","title":"Inicio de sesión","secureContents":{"sections":[{"fields":[{"k":"concealed","n":"TOTP_394C7044E0A8468490C919AA16AF496F","inputTraits":{"autocorrection":"no","autocapitalization":"none"},"t":"contraseña de un solo uso"}],"title":"","name":"add more"}]},"createdAt":1677234145,"typeName":"webforms.WebForm"} ***5642bee8-a5ff-11dc-8314-0800200c9a66*** {"uuid":"quwbc4ls4a3rbejmzrj7b2vy4q","updatedAt":1676038895,"locationKey":"localhost","securityLevel":"SL5","contentsHash":"6d010aa3","title":"Login with TOTP","location":"http:\/\/localhost:7777\/dashboard\/","secureContents":{"URLs":[{"label":"website","url":"http:\/\/localhost:7777\/dashboard\/"}],"fields":[{"value":"john@wick.com","id":"","name":"username","type":"T","designation":"username"},{"value":"password","id":"","name":"password","type":"P","designation":"password"}],"sections":[{"fields":[{"k":"concealed","n":"TOTP_9C5C0CCDA73E4DFB8CFEA96515164F95","v":"base32secret3232","t":"one-time password"}],"title":"","name":"Section_gvt3f65duiuzd2kiqumvzhhp6a"},{"fields":[{"k":"concealed","n":"TOTP_7BA6F9B93A3947B4B2E30E92D4529E29","v":"otpauth:\/\/totp\/generator?secret=base32secret3232","t":"one-time password"}],"title":"","name":"Section_bom2l746m2noam5olvce7iuj34"}]},"createdAt":1671029303,"typeName":"webforms.WebForm"} ***5642bee8-a5ff-11dc-8314-0800200c9a66*** {"uuid":"j4iari3wzowqfpz247cfhmfcbm","updatedAt":1676455597,"securityLevel":"SL5","contentsHash":"6367a657","title":"login with 2fa","secureContents":{"fields":[{"value":"","id":"","name":"username","type":"T","designation":"username"},{"value":"","id":"","name":"password","type":"P","designation":"password"}],"sections":[{"fields":[{"k":"concealed","v":"otpauth:\/\/totp\/az?secret=qs","n":"TOTP_E67616E4E291459AA8A9EFE899FEF738","inputTraits":{"autocorrection":"no","autocapitalization":"none"},"t":"one-time password"}],"title":"","name":"add more"}]},"createdAt":1675849436,"typeName":"webforms.WebForm"} ***5642bee8-a5ff-11dc-8314-0800200c9a66*** {"uuid":"6gokus5nubstdy6nfbml4oform","updatedAt":1689060350,"securityLevel":"SL5","contentsHash":"626be603","title":"Credit Card item with note","secureContents":{"expiry_yy":"2025","expiry_mm":"1","sections":[{"fields":[{"k":"string","inputTraits":{"autocapitalization":"Words"},"n":"cardholder","v":"A B","a":{"guarded":"yes"},"t":"cardholder name"},{"k":"menu","v":"mc","n":"type","a":{"guarded":"yes"},"t":"type"},{"k":"string","inputTraits":{"keyboard":"NumberPad"},"n":"ccnum","v":"4242333342423333","a":{"guarded":"yes","clipboardFilter":"0123456789"},"t":"number"},{"k":"concealed","inputTraits":{"keyboard":"NumberPad"},"n":"cvv","v":"123","a":{"guarded":"yes","generate":"off"},"t":"verification number"},{"k":"monthYear","v":202501,"n":"expiry","a":{"guarded":"yes"},"t":"expiry date"},{"k":"monthYear","n":"validFrom","a":{"guarded":"yes"},"t":"valid from"}],"title":"","name":""},{"fields":[{"k":"string","n":"bank","inputTraits":{"autocapitalization":"Words"},"t":"issuing bank"},{"k":"phone","n":"phoneLocal","inputTraits":{"keyboard":"NamePhonePad"},"t":"phone (local)"},{"k":"phone","n":"phoneTollFree","inputTraits":{"keyboard":"NamePhonePad"},"t":"phone (toll free)"},{"k":"phone","n":"phoneIntl","inputTraits":{"keyboard":"NamePhonePad"},"t":"phone (intl)"},{"k":"URL","n":"website","t":"website"}],"title":"Contact Information","name":"contactInfo"},{"fields":[{"k":"concealed","inputTraits":{"keyboard":"NumberPad"},"n":"pin","a":{"generate":"off"},"v":"1234","t":"PIN"},{"k":"string","n":"creditLimit","inputTraits":{"keyboard":"NumbersAndPunctuation"},"t":"credit limit"},{"k":"string","n":"cashLimit","inputTraits":{"keyboard":"NumbersAndPunctuation"},"t":"cash withdrawal limit"},{"k":"string","n":"interest","inputTraits":{"keyboard":"NumbersAndPunctuation"},"t":"interest rate"},{"k":"string","n":"issuenumber","inputTraits":{"autocorrection":"no"},"t":"issue number"}],"title":"Additional Details","name":"details"}],"cardholder":"A B","cvv":"123","notesPlain":"this is credit card item note","type":"mc","ccnum":"4242333342423333","pin":"1234"},"createdAt":1688983815,"typeName":"wallet.financial.CreditCard"} ***5642bee8-a5ff-11dc-8314-0800200c9a66***
7,856
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/mocks/bitwarden-empty.json
{ "encrypted": false, "folders": [], "items": [] }
7,857
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/mocks/bitwarden.json
{ "encrypted": false, "folders": [], "items": [ { "id": "aa6874e0-c259-41fa-8a18-afa200cf3f3a", "organizationId": null, "folderId": null, "type": 1, "reprompt": 0, "name": "LoginItemMultipleWebsites", "notes": "login note", "favorite": false, "fields": [ { "name": "Text 1", "value": "Text 1 content", "type": 0, "linkedId": null }, { "name": "Hidden 1", "value": "Hidden 1 content", "type": 1, "linkedId": null } ], "login": { "uris": [ { "match": null, "uri": "https://test.url1/" }, { "match": null, "uri": "https://test.url2" }, { "match": null, "uri": "androidapp://ch.protonmail.android" } ], "username": "username", "password": "password", "totp": "otpauth://totp/test?secret=proton333&issuer=proton" }, "collectionIds": null }, { "id": "122b4201-6b60-495e-ae2d-afa200d0b79b", "organizationId": null, "folderId": null, "type": 4, "reprompt": 0, "name": "IdentityItem", "notes": null, "favorite": false, "identity": { "title": null, "firstName": "John", "middleName": "F", "lastName": "Kennedy", "address1": null, "address2": null, "address3": null, "city": null, "state": null, "postalCode": null, "country": null, "company": null, "email": null, "phone": null, "ssn": null, "username": null, "passportNumber": null, "licenseNumber": null }, "collectionIds": null }, { "id": "fcecd2a9-35c6-4499-8a0f-afa200d082f6", "organizationId": null, "folderId": null, "type": 2, "reprompt": 0, "name": "NoteItem", "notes": "note content", "favorite": false, "secureNote": { "type": 0 }, "collectionIds": null }, { "id": "aa6874e0-c259-41fa-8a18-afa200cf3f3a", "organizationId": null, "folderId": null, "type": 1, "reprompt": 0, "name": "LoginItemEmptyFields", "notes": "login note", "favorite": false, "login": { "uris": [], "username": null, "password": null, "totp": null }, "collectionIds": null }, { "id": "aa6874e0-c259-41fa-8a18-afa200cf3f3b", "organizationId": null, "folderId": null, "type": 1, "reprompt": 0, "name": "LoginItemBrokenUrl", "notes": "", "favorite": false, "login": { "uris": [ { "match": null, "uri": "htt:/test.url1/" } ], "username": null, "password": null, "totp": null }, "collectionIds": null }, { "id": "59a92880-bf32-4da2-83a3-b037008f99ad", "organizationId": null, "folderId": null, "type": 3, "reprompt": 0, "name": "Credit Card Y", "notes": "Credit Card Y AMEX note", "favorite": false, "card": { "cardholderName": "A B", "brand": "Amex", "number": "374242424242424", "expMonth": "1", "expYear": "2025", "code": "123" }, "collectionIds": null } ] }
7,858
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/mocks/chrome-windows.csv
name,url,username,password,note proton.me,https://account.proton.me/switch,nobody@proton.me,proton123, missing url,,missingurl@proton.me,proton123,somenote missing password,https://account.proton.me/switch,missingpw@proton.me,,
7,859
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/mocks/chrome.csv
name,url,username,password proton.me,https://account.proton.me/switch,nobody@proton.me,proton123 missing url,,missingurl@proton.me,proton123 missing password,https://account.proton.me/switch,missingpw@proton.me, broken url,htt:/proton.me/switch,brokenurl@proton.me,
7,860
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/mocks/enpass.json
{ "folders": [ { "icon": "1008", "parent_uuid": "", "title": "tag1", "updated_at": 1697729133, "uuid": "3a71050b-830a-44d7-9345-84a29da66fb5" }, { "icon": "1025", "parent_uuid": "", "title": "tag whitespace", "updated_at": 1697802838, "uuid": "da3ef579-c1cb-4e69-9bcd-f7cf946ef868" }, { "icon": "1030", "parent_uuid": "", "title": "Social", "updated_at": 1697802871, "uuid": "4b0b9809-2368-466b-a5a9-e5a415cfdf2a" } ], "items": [ { "archived": 0, "auto_submit": 1, "category": "travel", "createdAt": 1697729073, "favorite": 0, "fields": [ { "deleted": 0, "history": [ { "encrypted": false, "updated_at": 1534490729, "value": "123456789" } ], "label": "Number", "order": 1, "sensitive": 0, "type": "text", "uid": 2, "updated_at": 1697729073, "value": "ENP123456789", "value_updated_at": 1697729073 }, { "deleted": 0, "history": [ { "encrypted": false, "updated_at": 1534490729, "value": "Wendy Appleseed" }, { "encrypted": false, "updated_at": 1535521835, "value": "Emma Apple Seed" }, { "encrypted": false, "updated_at": 1535522105, "value": "Emily Seed" } ], "label": "Full name", "order": 2, "sensitive": 0, "type": "text", "uid": 0, "updated_at": 1697729073, "value": "Emily", "value_updated_at": 1697729073 }, { "deleted": 0, "history": [ { "encrypted": false, "updated_at": 1534490729, "value": "Male" } ], "label": "Gender", "order": 3, "sensitive": 0, "type": "text", "uid": 14, "updated_at": 1697729073, "value": "Female", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "Type", "order": 4, "sensitive": 0, "type": "text", "uid": 1, "updated_at": 1697729073, "value": "Regular", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "Nationality", "order": 5, "sensitive": 0, "type": "text", "uid": 15, "updated_at": 1697729073, "value": "United States of America", "value_updated_at": 1697729073 }, { "deleted": 0, "history": [ { "encrypted": false, "updated_at": 1534490729, "value": "Newyork" } ], "label": "Birth place", "order": 6, "sensitive": 0, "type": "text", "uid": 4, "updated_at": 1697729073, "value": "New York", "value_updated_at": 1697729073 }, { "deleted": 0, "history": [ { "encrypted": false, "updated_at": 1534490729, "value": "01/01/2000" }, { "encrypted": false, "updated_at": 1534490789, "value": "01/02/2000" } ], "label": "Birth date", "order": 7, "sensitive": 0, "type": "date", "uid": 5, "updated_at": 1697729073, "value": "01/01/1989", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "Issued at", "order": 8, "sensitive": 0, "type": "text", "uid": 6, "updated_at": 1697729073, "value": "", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "Issued on", "order": 9, "sensitive": 0, "type": "date", "uid": 7, "updated_at": 1697729073, "value": "", "value_updated_at": 1697729073 }, { "deleted": 0, "history": [ { "encrypted": false, "updated_at": 1534490729, "value": "01/01/2027" } ], "label": "Expiry date", "order": 10, "sensitive": 0, "type": "date", "uid": 8, "updated_at": 1697729073, "value": "10/01/2027", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "Issuing country", "order": 11, "sensitive": 0, "type": "text", "uid": 9, "updated_at": 1697729073, "value": "", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "Authority", "order": 12, "sensitive": 0, "type": "text", "uid": 10, "updated_at": 1697729073, "value": "", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "Replacements", "order": 13, "sensitive": 0, "type": "text", "uid": 12, "updated_at": 1697729073, "value": "", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "If lost, call", "order": 14, "sensitive": 0, "type": "phone", "uid": 13, "updated_at": 1697729073, "value": "", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "LOGIN DETAILS", "order": 15, "sensitive": 0, "type": "section", "uid": 187, "updated_at": 1697729073, "value": "", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "Website", "order": 16, "sensitive": 0, "type": "url", "uid": 188, "updated_at": 1697729073, "value": "", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "Username", "order": 17, "sensitive": 0, "type": "username", "uid": 189, "updated_at": 1697729073, "value": "", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "Password", "order": 18, "sensitive": 1, "type": "password", "uid": 190, "updated_at": 1697729073, "value": "", "value_updated_at": 1697729073 } ], "icon": { "fav": "", "image": { "file": "misc/passport" }, "type": 1, "uuid": "" }, "note": "", "subtitle": "ENP123456789", "template_type": "travel.passport", "title": "Passport Sample", "trashed": 0, "updated_at": 1697729073, "uuid": "6efcb7c7-5355-442b-9bd6-b5c6a7eccf58" }, { "archived": 0, "auto_submit": 1, "category": "login", "createdAt": 1697729073, "favorite": 0, "fields": [ { "deleted": 0, "label": "Username", "order": 1, "sensitive": 0, "type": "username", "uid": 10, "updated_at": 1698057141, "value": "", "value_updated_at": 1698057141 }, { "deleted": 0, "history": [ { "encrypted": false, "updated_at": 1534490049, "value": "wendyappleseed@enpass.io" }, { "encrypted": false, "updated_at": 1535521734, "value": "emmaappleseed@enpass.io" }, { "encrypted": false, "updated_at": 1535522120, "value": "emilyappleseed@enpass.io" } ], "label": "E-mail", "order": 2, "sensitive": 0, "type": "email", "uid": 12, "updated_at": 1697729073, "value": "emily@enpass.io", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "Password", "order": 3, "sensitive": 1, "type": "password", "uid": 11, "updated_at": 1697729073, "value": "herbert nadia banal slag broken violin somber modern cdc posing", "value_updated_at": 1697729073 }, { "deleted": 0, "history": [ { "encrypted": false, "updated_at": 1534489965, "value": "https://www.facebook.com/login/" } ], "label": "Website", "order": 4, "sensitive": 0, "type": "url", "uid": 13, "updated_at": 1697729073, "value": "https://www.twitter.com/", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "ADDITIONAL DETAILS", "order": 5, "sensitive": 0, "type": "section", "uid": 101, "updated_at": 1697729073, "value": "", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "Phone number", "order": 6, "sensitive": 0, "type": "phone", "uid": 14, "updated_at": 1697729073, "value": "", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "One-time code", "order": 7, "sensitive": 0, "type": "totp", "uid": 102, "updated_at": 1697729073, "value": "qg4r pwyf 4t23 v62g 4ta3 ne43 74", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "Security question", "order": 8, "sensitive": 0, "type": "text", "uid": 15, "updated_at": 1698057029, "value": "Example extra field, predefined", "value_updated_at": 1698057029 }, { "deleted": 0, "label": "Security answer", "order": 9, "sensitive": 1, "type": "text", "uid": 16, "updated_at": 1697729073, "value": "", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "Custom field name", "order": 10, "sensitive": 1, "type": "text", "uid": 8418, "updated_at": 1698057029, "value": "Example extra field, user-defined", "value_updated_at": 1698057029 } ], "folders": ["4b0b9809-2368-466b-a5a9-e5a415cfdf2a"], "icon": { "fav": "www.twitter.com", "image": { "file": "web/twitter.com" }, "type": 2, "uuid": "" }, "note": "", "subtitle": "emily@enpass.io", "template_type": "login.default", "title": "Twitter", "trashed": 0, "updated_at": 1698057141, "uuid": "0ba11053-b4c9-48d8-92e3-fbb5f2a9c2ce" }, { "archived": 0, "auto_submit": 1, "category": "login", "createdAt": 1698057167, "favorite": 0, "fields": [ { "deleted": 0, "label": "Username", "order": 1, "sensitive": 0, "type": "username", "uid": 10, "updated_at": 1698057167, "value": "customusername", "value_updated_at": 1698057167 }, { "deleted": 0, "label": "E-mail", "order": 2, "sensitive": 0, "type": "email", "uid": 12, "updated_at": 1698057167, "value": "yahoo@example.com", "value_updated_at": 1698057167 }, { "deleted": 0, "label": "Password", "order": 3, "sensitive": 1, "type": "password", "uid": 11, "updated_at": 1698057167, "value": "", "value_updated_at": 1698057167 }, { "deleted": 0, "label": "Website", "order": 4, "sensitive": 0, "type": "url", "uid": 13, "updated_at": 1698057167, "value": "https://login.yahoo.com/", "value_updated_at": 1698057167 }, { "deleted": 0, "label": "ADDITIONAL DETAILS", "order": 5, "sensitive": 0, "type": "section", "uid": 101, "updated_at": 1698057167, "value": "", "value_updated_at": 1698057167 }, { "deleted": 0, "label": "Phone number", "order": 6, "sensitive": 0, "type": "phone", "uid": 14, "updated_at": 1698057167, "value": "", "value_updated_at": 1698057167 }, { "deleted": 0, "label": "One-time code", "order": 7, "sensitive": 0, "type": "totp", "uid": 102, "updated_at": 1698057167, "value": "", "value_updated_at": 1698057167 }, { "deleted": 0, "label": "Security question", "order": 8, "sensitive": 0, "type": "text", "uid": 15, "updated_at": 1698057167, "value": "", "value_updated_at": 1698057167 }, { "deleted": 0, "label": "Security answer", "order": 9, "sensitive": 1, "type": "text", "uid": 16, "updated_at": 1698057167, "value": "", "value_updated_at": 1698057167 } ], "icon": { "fav": "login.yahoo.com", "image": { "file": "web/yahoo.com" }, "type": 1, "uuid": "" }, "note": "example note", "subtitle": "customusername", "template_type": "login.default", "title": "Yahoo!", "trashed": 0, "updated_at": 1698057203, "uuid": "17877058-90a0-4b9f-bda6-e6a0590f9211" }, { "archived": 0, "auto_submit": 1, "category": "login", "createdAt": 1697729354, "favorite": 0, "fields": [ { "deleted": 0, "label": "Username", "order": 1, "sensitive": 0, "type": "username", "uid": 10, "updated_at": 1697729354, "value": "username", "value_updated_at": 1697729354 }, { "deleted": 0, "label": "E-mail", "order": 2, "sensitive": 0, "type": "email", "uid": 12, "updated_at": 1697729354, "value": "email@example.com", "value_updated_at": 1697729354 }, { "deleted": 0, "label": "Password", "order": 3, "sensitive": 1, "type": "password", "uid": 11, "updated_at": 1697729354, "value": "password", "value_updated_at": 1697729354 }, { "deleted": 0, "label": "Website", "order": 4, "sensitive": 0, "type": "url", "uid": 13, "updated_at": 1697729354, "value": "https://example.com", "value_updated_at": 1697729354 }, { "deleted": 0, "label": "ADDITIONAL DETAILS", "order": 5, "sensitive": 0, "type": "section", "uid": 101, "updated_at": 1697729354, "value": "", "value_updated_at": 1697729354 }, { "deleted": 0, "label": "Phone number", "order": 6, "sensitive": 0, "type": "phone", "uid": 14, "updated_at": 1697729354, "value": "+19999999", "value_updated_at": 1697729354 }, { "deleted": 0, "label": "One-time code", "order": 7, "sensitive": 0, "type": "totp", "uid": 102, "updated_at": 1697729354, "value": "secretkey", "value_updated_at": 1697729354 }, { "deleted": 0, "label": "Security question", "order": 8, "sensitive": 0, "type": "text", "uid": 15, "updated_at": 1697729354, "value": "Dog's name?", "value_updated_at": 1697729354 }, { "deleted": 0, "label": "Security answer", "order": 9, "sensitive": 1, "type": "text", "uid": 16, "updated_at": 1697729354, "value": "Proton", "value_updated_at": 1697729354 } ], "icon": { "fav": "example.com", "image": { "file": "misc/login" }, "type": 1, "uuid": "" }, "note": "Custom note", "subtitle": "username", "template_type": "login.default", "title": "Trashed", "trashed": 1, "updated_at": 1697729399, "uuid": "3caf61fe-ab14-4d35-b1ad-bf09b9dff136" }, { "archived": 1, "auto_submit": 1, "category": "login", "createdAt": 1697729073, "favorite": 0, "fields": [ { "deleted": 0, "label": "Username", "order": 1, "sensitive": 0, "type": "username", "uid": 10, "updated_at": 1697729073, "value": "", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "E-mail", "order": 2, "sensitive": 0, "type": "email", "uid": 12, "updated_at": 1697729073, "value": "emily@enpass.io", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "Password", "order": 3, "sensitive": 1, "type": "password", "uid": 11, "updated_at": 1697729073, "value": "$&W:v@}4\\iRpUXVbjPdPKDGbD<xK>", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "Website", "order": 4, "sensitive": 0, "type": "url", "uid": 13, "updated_at": 1697729073, "value": "https://www.amazon.com", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "ADDITIONAL DETAILS", "order": 5, "sensitive": 0, "type": "section", "uid": 101, "updated_at": 1697729073, "value": "", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "Phone number", "order": 6, "sensitive": 0, "type": "phone", "uid": 14, "updated_at": 1697729073, "value": "", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "One-time code", "order": 7, "sensitive": 0, "type": "totp", "uid": 102, "updated_at": 1697729073, "value": "", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "Security question", "order": 8, "sensitive": 0, "type": "text", "uid": 15, "updated_at": 1697729073, "value": "", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "Security answer", "order": 9, "sensitive": 1, "type": "text", "uid": 16, "updated_at": 1697729073, "value": "", "value_updated_at": 1697729073 } ], "icon": { "fav": "www.amazon.com", "image": { "file": "web/amazon.com" }, "type": 1, "uuid": "" }, "note": "", "subtitle": "emily@enpass.io", "template_type": "login.default", "title": "Archived", "trashed": 0, "updated_at": 1697729411, "uuid": "5b7f1d87-1016-4150-a769-38cb0baf6e99" }, { "archived": 0, "auto_submit": 1, "category": "note", "createdAt": 1697729114, "favorite": 0, "folders": ["3a71050b-830a-44d7-9345-84a29da66fb5", "da3ef579-c1cb-4e69-9bcd-f7cf946ef868"], "icon": { "fav": "", "image": { "file": "web/msn.com" }, "type": 1, "uuid": "" }, "note": "Note text", "subtitle": "Note text", "template_type": "note.default", "title": "Note", "trashed": 0, "updated_at": 1697802849, "uuid": "e3279bb7-dc68-4d48-9732-d9fe933bdc84" }, { "archived": 0, "auto_submit": 1, "category": "creditcard", "createdAt": 1697729073, "favorite": 0, "fields": [ { "deleted": 0, "history": [ { "encrypted": false, "updated_at": 1534490234, "value": "Wendy Apple Seed" }, { "encrypted": false, "updated_at": 1535521811, "value": "Emma" }, { "encrypted": false, "updated_at": 1535522090, "value": "Emily" } ], "label": "Cardholder", "order": 1, "sensitive": 0, "type": "ccName", "uid": 0, "updated_at": 1697729073, "value": "Emily Sample", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "Type", "order": 2, "sensitive": 0, "type": "ccType", "uid": 17, "updated_at": 1697729073, "value": "American Express", "value_updated_at": 1697729073 }, { "deleted": 0, "history": [ { "encrypted": false, "updated_at": 1534490234, "value": "1234 1234 5678 0000" } ], "label": "Number", "order": 3, "sensitive": 0, "type": "ccNumber", "uid": 1, "updated_at": 1697729073, "value": "1234 123456 00000", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "CVC", "order": 4, "sensitive": 1, "type": "ccCvc", "uid": 2, "updated_at": 1697729073, "value": "1234", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "PIN", "order": 5, "sensitive": 1, "type": "ccPin", "uid": 3, "updated_at": 1697729073, "value": "9874", "value_updated_at": 1697729073 }, { "deleted": 0, "history": [ { "encrypted": false, "updated_at": 1697804290, "value": "03/27" }, { "encrypted": false, "updated_at": 1697804302, "value": "03/27mhjkdhjk" } ], "label": "Expiry date", "order": 6, "sensitive": 0, "type": "ccExpiry", "uid": 4, "updated_at": 1697804302, "value": "03/27", "value_updated_at": 1697804302 }, { "deleted": 0, "label": "INTERNET BANKING", "order": 7, "sensitive": 0, "type": "section", "uid": 103, "updated_at": 1697729073, "value": "", "value_updated_at": 1697729073 }, { "deleted": 0, "history": [ { "encrypted": false, "updated_at": 1534490234, "value": "WendySeed" }, { "encrypted": false, "updated_at": 1535521811, "value": "Emma1" }, { "encrypted": false, "updated_at": 1535522182, "value": "Emily1" } ], "label": "Username", "order": 8, "sensitive": 0, "type": "username", "uid": 15, "updated_at": 1697729073, "value": "Emily_ENP", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "Login password", "order": 9, "sensitive": 1, "type": "password", "uid": 16, "updated_at": 1697729073, "value": "nnn tug shoot selfish bon liars convent dusty minnow uncheck", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "Transaction password", "order": 10, "sensitive": 1, "type": "ccTxnpassword", "uid": 9, "updated_at": 1697729073, "value": "", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "Website", "order": 11, "sensitive": 0, "type": "url", "uid": 14, "updated_at": 1697729073, "value": "http://global.americanexpress.com/", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "ADDITIONAL DETAILS", "order": 12, "sensitive": 0, "type": "section", "uid": 104, "updated_at": 1697729073, "value": "", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "Issuing bank", "order": 13, "sensitive": 0, "type": "ccBankname", "uid": 6, "updated_at": 1697729073, "value": "American Express", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "Issued on", "order": 14, "sensitive": 0, "type": "date", "uid": 7, "updated_at": 1697729073, "value": "", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "Valid from", "order": 15, "sensitive": 0, "type": "ccValidfrom", "uid": 18, "updated_at": 1697729073, "value": "", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "Credit limit", "order": 16, "sensitive": 0, "type": "numeric", "uid": 10, "updated_at": 1697729073, "value": "100000", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "Withdrawal limit", "order": 17, "sensitive": 0, "type": "numeric", "uid": 11, "updated_at": 1697729073, "value": "50000", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "Interest rate", "order": 18, "sensitive": 0, "type": "numeric", "uid": 12, "updated_at": 1697729073, "value": "", "value_updated_at": 1697729073 }, { "deleted": 0, "label": "If lost, call", "order": 19, "sensitive": 0, "type": "phone", "uid": 8, "updated_at": 1697729073, "value": "", "value_updated_at": 1697729073 } ], "icon": { "fav": "global.americanexpress.com", "image": { "file": "cc/american_express" }, "type": 2, "uuid": "" }, "note": "", "subtitle": "***** 0000", "template_type": "creditcard.default", "title": "Credit Card", "trashed": 0, "updated_at": 1697729073, "uuid": "d300cb1b-3ced-4f28-98f1-4982e099306c" }, { "archived": 0, "auto_submit": 1, "category": "password", "createdAt": 1697729144, "favorite": 0, "fields": [ { "deleted": 0, "label": "Login", "order": 1, "sensitive": 0, "type": "username", "uid": 0, "updated_at": 1697729144, "value": "username", "value_updated_at": 1697729144 }, { "deleted": 0, "label": "Password", "order": 2, "sensitive": 1, "type": "password", "uid": 1, "updated_at": 1697729144, "value": "password", "value_updated_at": 1697729144 }, { "deleted": 0, "label": "Access", "order": 3, "sensitive": 0, "type": "text", "uid": 2, "updated_at": 1697729144, "value": "access", "value_updated_at": 1697729144 } ], "folders": ["3a71050b-830a-44d7-9345-84a29da66fb5"], "icon": { "fav": "", "image": { "file": "misc/password_2" }, "type": 1, "uuid": "" }, "note": "custom note", "subtitle": "username", "template_type": "password.default", "title": "Password", "trashed": 0, "updated_at": 1697729144, "uuid": "71ee36cc-08b4-4014-adfb-33cc3243343f" }, { "archived": 0, "auto_submit": 1, "category": "finance", "createdAt": 1697729162, "favorite": 0, "fields": [ { "deleted": 0, "label": "Bank name", "order": 1, "sensitive": 0, "type": "ccBankname", "uid": 4, "updated_at": 1697729162, "value": "bank name", "value_updated_at": 1697729162 }, { "deleted": 0, "label": "Account holder", "order": 2, "sensitive": 0, "type": "ccName", "uid": 0, "updated_at": 1697729162, "value": "account 1", "value_updated_at": 1697729162 }, { "deleted": 0, "label": "Account type", "order": 3, "sensitive": 0, "type": "text", "uid": 1, "updated_at": 1697729162, "value": "debit", "value_updated_at": 1697729162 }, { "deleted": 0, "label": "Account number", "order": 4, "sensitive": 0, "type": "numeric", "uid": 2, "updated_at": 1697729162, "value": "999999", "value_updated_at": 1697729162 }, { "deleted": 0, "label": "Customer ID", "order": 5, "sensitive": 0, "type": "text", "uid": 16, "updated_at": 1697729162, "value": "999998", "value_updated_at": 1697729162 }, { "deleted": 0, "label": "Phone number", "order": 6, "sensitive": 0, "type": "phone", "uid": 106, "updated_at": 1697729162, "value": "", "value_updated_at": 1697729162 }, { "deleted": 0, "label": "IFSC code", "order": 7, "sensitive": 0, "type": "text", "uid": 169, "updated_at": 1697729162, "value": "ifsc", "value_updated_at": 1697729162 }, { "deleted": 0, "label": "Routing number", "order": 8, "sensitive": 0, "type": "numeric", "uid": 5, "updated_at": 1697729162, "value": "123456789", "value_updated_at": 1697729162 }, { "deleted": 0, "label": "SWIFT", "order": 9, "sensitive": 0, "type": "text", "uid": 8, "updated_at": 1697729162, "value": "swift", "value_updated_at": 1697729162 }, { "deleted": 0, "label": "IBAN", "order": 10, "sensitive": 0, "type": "text", "uid": 9, "updated_at": 1697729162, "value": "iban", "value_updated_at": 1697729162 }, { "deleted": 0, "label": "INTERNET BANKING", "order": 11, "sensitive": 0, "type": "section", "uid": 105, "updated_at": 1697729162, "value": "", "value_updated_at": 1697729162 }, { "deleted": 0, "label": "Website", "order": 12, "sensitive": 0, "type": "url", "uid": 17, "updated_at": 1697729162, "value": "https://example.com", "value_updated_at": 1697729162 }, { "deleted": 0, "label": "Username", "order": 13, "sensitive": 0, "type": "username", "uid": 18, "updated_at": 1697729162, "value": "example", "value_updated_at": 1697729162 }, { "deleted": 0, "label": "Login password", "order": 14, "sensitive": 1, "type": "password", "uid": 19, "updated_at": 1697729162, "value": "password", "value_updated_at": 1697729162 }, { "deleted": 0, "label": "Transaction password", "order": 15, "sensitive": 1, "type": "ccTxnpassword", "uid": 20, "updated_at": 1697729162, "value": "transaction", "value_updated_at": 1697729162 }, { "deleted": 0, "label": "BRANCH DETAILS", "order": 16, "sensitive": 0, "type": "section", "uid": 107, "updated_at": 1697729162, "value": "", "value_updated_at": 1697729162 }, { "deleted": 0, "label": "Branch name", "order": 17, "sensitive": 0, "type": "text", "uid": 6, "updated_at": 1697729894, "value": "branch name", "value_updated_at": 1697729894 }, { "deleted": 0, "label": "Branch code", "order": 18, "sensitive": 0, "type": "numeric", "uid": 7, "updated_at": 1697729894, "value": "branch code", "value_updated_at": 1697729894 }, { "deleted": 0, "label": "Branch address", "order": 19, "sensitive": 0, "type": "text", "uid": 24, "updated_at": 1697729894, "value": "branch address", "value_updated_at": 1697729894 }, { "deleted": 0, "label": "Branch phone", "order": 20, "sensitive": 0, "type": "phone", "uid": 25, "updated_at": 1697729894, "value": "branch phone", "value_updated_at": 1697729894 }, { "deleted": 0, "label": "LINKED CARD", "order": 21, "sensitive": 0, "type": "section", "uid": 108, "updated_at": 1697729162, "value": "", "value_updated_at": 1697729162 }, { "deleted": 0, "label": "Debit card number", "order": 22, "sensitive": 0, "type": "ccNumber", "uid": 11, "updated_at": 1697729894, "value": "4242424242424242", "value_updated_at": 1697729894 }, { "deleted": 0, "label": " Card type", "order": 23, "sensitive": 0, "type": "ccType", "uid": 26, "updated_at": 1697729894, "value": "Visa", "value_updated_at": 1697729894 }, { "deleted": 0, "label": "PIN", "order": 24, "sensitive": 1, "type": "ccPin", "uid": 12, "updated_at": 1697729894, "value": "1234", "value_updated_at": 1697729894 }, { "deleted": 0, "label": "CVV", "order": 25, "sensitive": 1, "type": "ccCvc", "uid": 14, "updated_at": 1697729894, "value": "123", "value_updated_at": 1697729894 }, { "deleted": 0, "label": "Expiry date", "order": 26, "sensitive": 0, "type": "ccExpiry", "uid": 13, "updated_at": 1697729894, "value": "202920", "value_updated_at": 1697729894 }, { "deleted": 0, "label": "ADDITIONAL DETAILS", "order": 27, "sensitive": 0, "type": "section", "uid": 109, "updated_at": 1697729162, "value": "", "value_updated_at": 1697729162 }, { "deleted": 0, "label": "Withdrawal limit", "order": 28, "sensitive": 0, "type": "numeric", "uid": 27, "updated_at": 1697729894, "value": "100000", "value_updated_at": 1697729894 }, { "deleted": 0, "label": "Helpline", "order": 29, "sensitive": 0, "type": "phone", "uid": 22, "updated_at": 1697729894, "value": "0909999999", "value_updated_at": 1697729894 }, { "deleted": 0, "label": "T-PIN", "order": 30, "sensitive": 1, "type": "pin", "uid": 23, "updated_at": 1697729894, "value": "1234", "value_updated_at": 1697729894 } ], "icon": { "fav": "example.com", "image": { "file": "misc/bank" }, "type": 1, "uuid": "" }, "note": "my note", "subtitle": "bank name", "template_type": "finance.bankaccount", "title": "Bank account ", "trashed": 0, "updated_at": 1697729894, "uuid": "630880e6-236c-4dd6-bfc4-6280a906e3c5" }, { "archived": 0, "auto_submit": 1, "category": "license", "createdAt": 1697729423, "favorite": 0, "fields": [ { "deleted": 0, "label": "Number", "order": 1, "sensitive": 0, "type": "numeric", "uid": 1, "updated_at": 1697729423, "value": "123456789", "value_updated_at": 1697729423 }, { "deleted": 0, "label": "Name", "order": 2, "sensitive": 0, "type": "text", "uid": 0, "updated_at": 1697729423, "value": "John Doe", "value_updated_at": 1697729423 }, { "deleted": 0, "label": "Gender", "order": 3, "sensitive": 0, "type": "text", "uid": 8, "updated_at": 1697729423, "value": "Male", "value_updated_at": 1697729423 }, { "deleted": 0, "label": "Birth date", "order": 4, "sensitive": 0, "type": "date", "uid": 9, "updated_at": 1697729423, "value": "1991", "value_updated_at": 1697729423 }, { "deleted": 0, "label": "Address", "order": 5, "sensitive": 0, "type": "text", "uid": 10, "updated_at": 1697729423, "value": "Address 1", "value_updated_at": 1697729423 }, { "deleted": 0, "label": "Height", "order": 6, "sensitive": 0, "type": "text", "uid": 11, "updated_at": 1697729423, "value": "Height", "value_updated_at": 1697729423 }, { "deleted": 0, "label": "Class", "order": 7, "sensitive": 0, "type": "text", "uid": 2, "updated_at": 1697729423, "value": "Class", "value_updated_at": 1697729423 }, { "deleted": 0, "label": "Restrictions", "order": 8, "sensitive": 0, "type": "text", "uid": 13, "updated_at": 1697729423, "value": "Restrictions", "value_updated_at": 1697729423 }, { "deleted": 0, "label": "State", "order": 9, "sensitive": 0, "type": "text", "uid": 3, "updated_at": 1697729423, "value": "State", "value_updated_at": 1697729423 }, { "deleted": 0, "label": "Country", "order": 10, "sensitive": 0, "type": "text", "uid": 4, "updated_at": 1697729423, "value": "Country", "value_updated_at": 1697729423 }, { "deleted": 0, "label": "Expiry date", "order": 11, "sensitive": 0, "type": "date", "uid": 5, "updated_at": 1697729423, "value": "Expiry", "value_updated_at": 1697729423 }, { "deleted": 0, "label": "Issued on", "order": 12, "sensitive": 0, "type": "date", "uid": 6, "updated_at": 1697729423, "value": "Issued", "value_updated_at": 1697729423 }, { "deleted": 0, "label": "If lost, call", "order": 13, "sensitive": 0, "type": "phone", "uid": 7, "updated_at": 1697729423, "value": "Houston", "value_updated_at": 1697729423 } ], "icon": { "fav": "", "image": { "file": "misc/driving_license_1" }, "type": 1, "uuid": "" }, "note": "Note", "subtitle": "123456789", "template_type": "license.driving", "title": "Driving license", "trashed": 0, "updated_at": 1697729423, "uuid": "8d372daf-9e92-497b-8cad-e6718a57c073" }, { "archived": 0, "auto_submit": 1, "category": "computer", "createdAt": 1697803354, "favorite": 0, "fields": [ { "deleted": 0, "label": "Username", "order": 1, "sensitive": 0, "type": "username", "uid": 0, "updated_at": 1697803530, "value": "username4isp", "value_updated_at": 1697803530 }, { "deleted": 0, "label": "Password", "order": 2, "sensitive": 1, "type": "password", "uid": 1, "updated_at": 1697803530, "value": "pwd4isp", "value_updated_at": 1697803530 }, { "deleted": 0, "label": "Website", "order": 3, "sensitive": 0, "type": "url", "uid": 18, "updated_at": 1697803530, "value": "isp.example.com", "value_updated_at": 1697803530 }, { "deleted": 0, "label": "Dialup phone", "order": 4, "sensitive": 0, "type": "phone", "uid": 3, "updated_at": 1697803354, "value": "", "value_updated_at": 1697803354 }, { "deleted": 0, "label": "ISP/System", "order": 5, "sensitive": 0, "type": "text", "uid": 4, "updated_at": 1697803354, "value": "", "value_updated_at": 1697803354 }, { "deleted": 0, "label": "IP address", "order": 6, "sensitive": 0, "type": "numeric", "uid": 5, "updated_at": 1697803354, "value": "", "value_updated_at": 1697803354 }, { "deleted": 0, "label": "Subnet mask", "order": 7, "sensitive": 0, "type": "numeric", "uid": 6, "updated_at": 1697803354, "value": "", "value_updated_at": 1697803354 }, { "deleted": 0, "label": "Gateway", "order": 8, "sensitive": 0, "type": "numeric", "uid": 20, "updated_at": 1697803354, "value": "", "value_updated_at": 1697803354 }, { "deleted": 0, "label": "Primary DNS", "order": 9, "sensitive": 0, "type": "numeric", "uid": 7, "updated_at": 1697803354, "value": "", "value_updated_at": 1697803354 }, { "deleted": 0, "label": "Secondary DNS", "order": 10, "sensitive": 0, "type": "numeric", "uid": 8, "updated_at": 1697803354, "value": "", "value_updated_at": 1697803354 }, { "deleted": 0, "label": "WINS", "order": 11, "sensitive": 0, "type": "text", "uid": 9, "updated_at": 1697803354, "value": "", "value_updated_at": 1697803354 }, { "deleted": 0, "label": "SMTP", "order": 12, "sensitive": 0, "type": "text", "uid": 11, "updated_at": 1697803354, "value": "", "value_updated_at": 1697803354 }, { "deleted": 0, "label": "POP3", "order": 13, "sensitive": 0, "type": "text", "uid": 12, "updated_at": 1697803354, "value": "", "value_updated_at": 1697803354 }, { "deleted": 0, "label": "NNTP", "order": 14, "sensitive": 0, "type": "text", "uid": 13, "updated_at": 1697803354, "value": "", "value_updated_at": 1697803354 }, { "deleted": 0, "label": "FTP", "order": 15, "sensitive": 0, "type": "text", "uid": 14, "updated_at": 1697803354, "value": "", "value_updated_at": 1697803354 }, { "deleted": 0, "label": "Telnet", "order": 16, "sensitive": 0, "type": "text", "uid": 15, "updated_at": 1697803354, "value": "", "value_updated_at": 1697803354 }, { "deleted": 0, "label": "Helpline", "order": 17, "sensitive": 0, "type": "phone", "uid": 17, "updated_at": 1697803354, "value": "", "value_updated_at": 1697803354 }, { "deleted": 0, "label": "Billing info", "order": 18, "sensitive": 0, "type": "text", "uid": 19, "updated_at": 1697803354, "value": "", "value_updated_at": 1697803354 } ], "icon": { "fav": "isp.example.com", "image": { "file": "misc/internet_provider" }, "type": 1, "uuid": "" }, "note": "", "subtitle": "username4isp", "template_type": "computer.internetprovider", "title": "Internet provider", "trashed": 0, "updated_at": 1697803530, "uuid": "73eecd91-3f60-41a8-aa9d-7236ea87e560" }, { "archived": 0, "auto_submit": 1, "category": "misc", "createdAt": 1697803386, "favorite": 0, "fields": [ { "deleted": 0, "label": "Registration number", "order": 1, "sensitive": 0, "type": "text", "uid": 3, "updated_at": 1697803386, "value": "PP-9999", "value_updated_at": 1697803386 }, { "deleted": 0, "label": "Owner", "order": 2, "sensitive": 0, "type": "text", "uid": 11, "updated_at": 1697803386, "value": "John Doe", "value_updated_at": 1697803386 }, { "deleted": 0, "label": "Model", "order": 3, "sensitive": 0, "type": "text", "uid": 0, "updated_at": 1697803386, "value": "ACME Corp", "value_updated_at": 1697803386 }, { "deleted": 0, "label": "Vehicle type", "order": 4, "sensitive": 0, "type": "text", "uid": 12, "updated_at": 1697803386, "value": "3-Series", "value_updated_at": 1697803386 }, { "deleted": 0, "label": "Purchase date", "order": 5, "sensitive": 0, "type": "date", "uid": 13, "updated_at": 1697803386, "value": "1 January 2023", "value_updated_at": 1697803386 }, { "deleted": 0, "label": "Make", "order": 6, "sensitive": 0, "type": "text", "uid": 1, "updated_at": 1697803386, "value": "Make", "value_updated_at": 1697803386 }, { "deleted": 0, "label": "Year", "order": 7, "sensitive": 0, "type": "numeric", "uid": 2, "updated_at": 1697803386, "value": "Year", "value_updated_at": 1697803386 }, { "deleted": 0, "label": "VIN", "order": 8, "sensitive": 0, "type": "text", "uid": 4, "updated_at": 1697803386, "value": "VIN", "value_updated_at": 1697803386 }, { "deleted": 0, "label": "INSURANCE DETAILS", "order": 9, "sensitive": 0, "type": "section", "uid": 118, "updated_at": 1697803386, "value": "", "value_updated_at": 1697803386 }, { "deleted": 0, "label": "Insurance provider", "order": 10, "sensitive": 0, "type": "text", "uid": 16, "updated_at": 1697803386, "value": "Insurance Co.", "value_updated_at": 1697803386 }, { "deleted": 0, "label": "Insurance amount", "order": 11, "sensitive": 0, "type": "numeric", "uid": 7, "updated_at": 1697803386, "value": "64000 euros", "value_updated_at": 1697803386 }, { "deleted": 0, "label": "Policy number", "order": 12, "sensitive": 0, "type": "numeric", "uid": 8, "updated_at": 1697803386, "value": "999-policy-999", "value_updated_at": 1697803386 }, { "deleted": 0, "label": "Expiry date", "order": 13, "sensitive": 0, "type": "date", "uid": 10, "updated_at": 1697803386, "value": "2024", "value_updated_at": 1697803386 }, { "deleted": 0, "label": "Phone number", "order": 14, "sensitive": 0, "type": "phone", "uid": 9, "updated_at": 1697803386, "value": "999 9999", "value_updated_at": 1697803386 }, { "deleted": 0, "label": "SELLER DETAILS", "order": 15, "sensitive": 0, "type": "section", "uid": 197, "updated_at": 1697803386, "value": "", "value_updated_at": 1697803386 }, { "deleted": 0, "label": "Purchased from", "order": 16, "sensitive": 0, "type": "text", "uid": 198, "updated_at": 1697803386, "value": "Seller Name", "value_updated_at": 1697803386 }, { "deleted": 0, "label": "Phone number", "order": 17, "sensitive": 0, "type": "phone", "uid": 199, "updated_at": 1697803386, "value": "Seller Phone Number", "value_updated_at": 1697803386 }, { "deleted": 0, "label": "Address", "order": 18, "sensitive": 0, "type": "text", "uid": 200, "updated_at": 1697803386, "value": "Seller Address", "value_updated_at": 1697803386 }, { "deleted": 0, "label": "ADDITIONAL DETAILS", "order": 19, "sensitive": 0, "type": "section", "uid": 201, "updated_at": 1697803386, "value": "", "value_updated_at": 1697803386 }, { "deleted": 0, "label": "Service phone", "order": 20, "sensitive": 0, "type": "phone", "uid": 5, "updated_at": 1697803386, "value": "Service phone", "value_updated_at": 1697803386 }, { "deleted": 0, "label": "On road helpline", "order": 21, "sensitive": 0, "type": "phone", "uid": 14, "updated_at": 1697803386, "value": "On road helpline", "value_updated_at": 1697803386 } ], "icon": { "fav": "", "image": { "file": "misc/vehicle" }, "type": 1, "uuid": "" }, "note": "", "subtitle": "PP-9999", "template_type": "misc.vehicleinfo", "title": "Vehicle info", "trashed": 0, "updated_at": 1697803386, "uuid": "03c9830c-b71c-4a13-94ff-806c2affc1cb" }, { "archived": 0, "auto_submit": 1, "category": "identity", "createdAt": 1697803540, "favorite": 0, "fields": [ { "deleted": 0, "label": "Initial", "order": 1, "sensitive": 0, "type": "text", "uid": 129, "updated_at": 1697803540, "value": "JD", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "First name", "order": 2, "sensitive": 0, "type": "text", "uid": 130, "updated_at": 1697803540, "value": "John", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "Middle name", "order": 3, "sensitive": 0, "type": "text", "uid": 131, "updated_at": 1697803540, "value": "Jay", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "Last name", "order": 4, "sensitive": 0, "type": "text", "uid": 132, "updated_at": 1697803540, "value": "Doe", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "Gender", "order": 5, "sensitive": 0, "type": "text", "uid": 133, "updated_at": 1697803540, "value": "N/A", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "Birth date", "order": 6, "sensitive": 0, "type": "date", "uid": 134, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "Social Security Number", "order": 7, "sensitive": 0, "type": "text", "uid": 212, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "HOME ADDRESS", "order": 8, "sensitive": 0, "type": "section", "uid": 141, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "Street", "order": 9, "sensitive": 0, "type": "text", "uid": 143, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "City", "order": 10, "sensitive": 0, "type": "text", "uid": 144, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "State", "order": 11, "sensitive": 0, "type": "text", "uid": 145, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "Country", "order": 12, "sensitive": 0, "type": "text", "uid": 146, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "ZIP", "order": 13, "sensitive": 0, "type": "text", "uid": 147, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "CONTACT DETAILS", "order": 14, "sensitive": 0, "type": "section", "uid": 148, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "Phone number", "order": 15, "sensitive": 0, "type": "phone", "uid": 149, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "Phone home", "order": 16, "sensitive": 0, "type": "phone", "uid": 151, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "Phone work", "order": 17, "sensitive": 0, "type": "phone", "uid": 140, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "WORK DETAILS", "order": 18, "sensitive": 0, "type": "section", "uid": 135, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "Occupation", "order": 19, "sensitive": 0, "type": "text", "uid": 136, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "Company", "order": 20, "sensitive": 0, "type": "text", "uid": 137, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "Department", "order": 21, "sensitive": 0, "type": "text", "uid": 138, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "Job title", "order": 22, "sensitive": 0, "type": "text", "uid": 139, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "Organization", "order": 23, "sensitive": 0, "type": "text", "uid": 213, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "WORK ADDRESS", "order": 24, "sensitive": 0, "type": "section", "uid": 220, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "Street", "order": 25, "sensitive": 0, "type": "text", "uid": 221, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "City", "order": 26, "sensitive": 0, "type": "text", "uid": 222, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "State", "order": 27, "sensitive": 0, "type": "text", "uid": 223, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "Country", "order": 28, "sensitive": 0, "type": "text", "uid": 224, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "ZIP", "order": 29, "sensitive": 0, "type": "text", "uid": 225, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "SOCIAL", "order": 30, "sensitive": 0, "type": "section", "uid": 152, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "Twitter", "order": 31, "sensitive": 0, "type": "text", "uid": 153, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "Facebook", "order": 32, "sensitive": 0, "type": "text", "uid": 154, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "LinkedIn", "order": 33, "sensitive": 0, "type": "text", "uid": 155, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "Skype", "order": 34, "sensitive": 0, "type": "text", "uid": 156, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "Instagram", "order": 35, "sensitive": 0, "type": "text", "uid": 157, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "Yahoo", "order": 36, "sensitive": 0, "type": "text", "uid": 158, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "MSN", "order": 37, "sensitive": 0, "type": "text", "uid": 159, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "ICQ", "order": 38, "sensitive": 0, "type": "text", "uid": 160, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "AIM", "order": 39, "sensitive": 0, "type": "text", "uid": 161, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "ADDITIONAL DETAILS", "order": 40, "sensitive": 0, "type": "section", "uid": 162, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "Website", "order": 41, "sensitive": 0, "type": "url", "uid": 163, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "Username", "order": 42, "sensitive": 0, "type": "username", "uid": 164, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "E-mail", "order": 43, "sensitive": 0, "type": "email", "uid": 165, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "Password", "order": 44, "sensitive": 1, "type": "password", "uid": 169, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "Secret question", "order": 45, "sensitive": 0, "type": "text", "uid": 166, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "Secret answer", "order": 46, "sensitive": 1, "type": "text", "uid": 167, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 }, { "deleted": 0, "label": "Signature", "order": 47, "sensitive": 0, "type": "text", "uid": 168, "updated_at": 1697803540, "value": "", "value_updated_at": 1697803540 } ], "icon": { "fav": "", "image": { "file": "misc/user" }, "type": 1, "uuid": "" }, "note": "", "subtitle": "John Doe", "template_type": "identity.default", "title": "Identity", "trashed": 0, "updated_at": 1697803540, "uuid": "831b98fe-fda4-4af1-80bd-3f77dcea3a7f" } ] }
7,861
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/mocks/firefox.csv
"url","username","password","httpRealm","formActionOrigin","guid","timeCreated","timeLastUsed","timePasswordChanged" "https://account.proton.me","nobody@example.com","proton123",,"https://account.proton.me","{29b6a2f2-f678-4958-8cb7-4c330dc902ee}","1679064121003","1679064121003","1679064121003" "","missingurl@example.com","proton123",,"","{ab2d1a69-fcf8-4a14-a8af-2eb39ac51d0a}","1679064140519","1683045281725","1679064140519" "https://account.proton.me","missingpw@example.com","",,"https://account.proton.me","{29b6a2b8-f678-5060-8cb7-4c210dc902gf}","1679064121003","1679064121003","1679064121003" "htt:/proton.me","brokenurl@example.com","",,"htt:/proton.me","{1aa97449-d682-4b44-909b-f63d8gf001f5}","1679080973707","1679080973707","1679080973707" "http://localhost:1234","winston@example.com","password",,"http://localhost:1234","{ed4f85ed-8aa3-4a9d-b323-416d623d8d7f}","1679406099659","1683122809810","1679406099659" "chrome://FirefoxAccounts","abc","{""version"":1,""accountData"": 0}","Firefox Accounts credentials",,"{63539b29-87cf-4a45-8cbd-01d26f978bbb}","1682592135978","1682592135978","1682592189474" "https://account.example.com","username with comma, quotes ""","password with comma, quotes """,,"https://account.example.com","{48f8bf2d-bd36-4014-8fd3-682dc9480268}","1679408193331","1679410200681","1684922497980"
7,862
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/mocks/keepass.xml
<?xml version="1.0" encoding="UTF-8"?> <KeePassFile> <Meta> <Generator>MacPass</Generator> <DatabaseName>Database</DatabaseName> <DatabaseNameChanged>2023-05-02T08:52:56Z</DatabaseNameChanged> <DatabaseDescription/> <DatabaseDescriptionChanged>2023-05-02T08:52:56Z</DatabaseDescriptionChanged> <DefaultUserName/> <DefaultUserNameChanged>2023-05-02T08:52:56Z</DefaultUserNameChanged> <MaintenanceHistoryDays>365</MaintenanceHistoryDays> <Color/> <MasterKeyChanged>2023-05-02T08:53:20Z</MasterKeyChanged> <MasterKeyChangeRec>-1</MasterKeyChangeRec> <MasterKeyChangeForce>-1</MasterKeyChangeForce> <MemoryProtection> <ProtectTitle>False</ProtectTitle> <ProtectUserName>False</ProtectUserName> <ProtectPassword>True</ProtectPassword> <ProtectURL>False</ProtectURL> <ProtectNotes>False</ProtectNotes> </MemoryProtection> <RecycleBinEnabled>True</RecycleBinEnabled> <RecycleBinUUID>ea26zFu0TOCdqWkuPjXn9g==</RecycleBinUUID> <RecycleBinChanged>2023-05-02T08:53:04Z</RecycleBinChanged> <EntryTemplatesGroup>AAAAAAAAAAAAAAAAAAAAAA==</EntryTemplatesGroup> <EntryTemplatesGroupChanged>2023-05-02T08:52:56Z</EntryTemplatesGroupChanged> <HistoryMaxItems>10</HistoryMaxItems> <HistoryMaxSize>6291456</HistoryMaxSize> <LastSelectedGroup>0aVS7uYWSvuHHQc9kAonJQ==</LastSelectedGroup> <LastTopVisibleGroup>AAAAAAAAAAAAAAAAAAAAAA==</LastTopVisibleGroup> <Binaries/> <CustomData/> </Meta> <Root> <Group> <UUID>9gXTsuD4QxGyChZRf1NGCQ==</UUID> <Name>Group A</Name> <Notes/> <IconID>48</IconID> <Times> <LastModificationTime>2023-05-02T08:55:52Z</LastModificationTime> <CreationTime>2023-05-02T08:52:56Z</CreationTime> <LastAccessTime>2023-05-02T08:52:56Z</LastAccessTime> <ExpiryTime>4001-01-01T00:00:00Z</ExpiryTime> <Expires>False</Expires> <UsageCount>0</UsageCount> <LocationChanged>2023-05-02T08:52:56Z</LocationChanged> </Times> <IsExpanded>True</IsExpanded> <DefaultAutoTypeSequence/> <EnableAutoType>null</EnableAutoType> <EnableSearching>null</EnableSearching> <LastTopVisibleEntry>AAAAAAAAAAAAAAAAAAAAAA==</LastTopVisibleEntry> <PreviousParentGroup>iIeq7AEAAABgSUgCAGAAAA==</PreviousParentGroup> <Entry> <UUID>GX1bcmlmTtudvdYXcRv3wg==</UUID> <IconID>0</IconID> <ForegroundColor/> <BackgroundColor/> <OverrideURL/> <Tags/> <Times> <LastModificationTime>2023-05-02T13:31:16Z</LastModificationTime> <CreationTime>2023-05-02T08:55:14Z</CreationTime> <LastAccessTime>2023-05-02T08:55:14Z</LastAccessTime> <ExpiryTime>4001-01-01T00:00:00Z</ExpiryTime> <Expires>False</Expires> <UsageCount>0</UsageCount> <LocationChanged>2023-05-02T12:26:21Z</LocationChanged> </Times> <String> <Key>Hidden 1</Key> <Value ProtectInMemory="True">Hidden 1 content</Value> </String> <String> <Key>Title</Key> <Value>Login item with note</Value> </String> <String> <Key>UserName</Key> <Value>nobodyA@proton.me</Value> </String> <String> <Key>Password</Key> <Value ProtectInMemory="True">proton123</Value> </String> <String> <Key>URL</Key> <Value>https://account.proton.me</Value> </String> <String> <Key>Notes</Key> <Value>Login item</Value> </String> <String> <Key>otp</Key> <Value>otpauth://totp/Entry%20A:nobodyA@proton.me?algorithm=sha1&amp;issuer=Entry%20A&amp;period=30&amp;digits=6&amp;secret=VZKDI2A4UP2NG5BB</Value> </String> <String> <Key>Text 1</Key> <Value>Text 1 content</Value> </String> <String> <Key>TimeOtp-Secret-Base32</Key> <Value>VZKDI2A4UP2NG5BB</Value> </String> <AutoType> <Enabled>True</Enabled> <DataTransferObfuscation>0</DataTransferObfuscation> </AutoType> <History> <Entry> <UUID>GX1bcmlmTtudvdYXcRv3wg==</UUID> <IconID>0</IconID> <ForegroundColor/> <BackgroundColor/> <OverrideURL/> <Tags/> <Times> <LastModificationTime>2023-05-02T08:55:14Z</LastModificationTime> <CreationTime>2023-05-02T08:55:14Z</CreationTime> <LastAccessTime>2023-05-02T08:55:14Z</LastAccessTime> <ExpiryTime>4001-01-01T00:00:00Z</ExpiryTime> <Expires>False</Expires> <UsageCount>0</UsageCount> <LocationChanged>2023-05-02T08:55:14Z</LocationChanged> </Times> <String> <Key>Title</Key> <Value>New Entry</Value> </String> <String> <Key>UserName</Key> <Value/> </String> <String> <Key>Password</Key> <Value ProtectInMemory="True">?(B5k_qMJ#tM</Value> </String> <String> <Key>URL</Key> <Value/> </String> <String> <Key>Notes</Key> <Value/> </String> <AutoType> <Enabled>True</Enabled> <DataTransferObfuscation>0</DataTransferObfuscation> </AutoType> </Entry> <Entry> <UUID>GX1bcmlmTtudvdYXcRv3wg==</UUID> <IconID>0</IconID> <ForegroundColor/> <BackgroundColor/> <OverrideURL/> <Tags/> <Times> <LastModificationTime>2023-05-02T08:56:02Z</LastModificationTime> <CreationTime>2023-05-02T08:55:14Z</CreationTime> <LastAccessTime>2023-05-02T08:55:14Z</LastAccessTime> <ExpiryTime>4001-01-01T00:00:00Z</ExpiryTime> <Expires>False</Expires> <UsageCount>0</UsageCount> <LocationChanged>2023-05-02T08:55:14Z</LocationChanged> </Times> <String> <Key>Title</Key> <Value>Entry A</Value> </String> <String> <Key>UserName</Key> <Value/> </String> <String> <Key>Password</Key> <Value ProtectInMemory="True">?(B5k_qMJ#tM</Value> </String> <String> <Key>URL</Key> <Value/> </String> <String> <Key>Notes</Key> <Value/> </String> <AutoType> <Enabled>True</Enabled> <DataTransferObfuscation>0</DataTransferObfuscation> </AutoType> </Entry> <Entry> <UUID>GX1bcmlmTtudvdYXcRv3wg==</UUID> <IconID>0</IconID> <ForegroundColor/> <BackgroundColor/> <OverrideURL/> <Tags/> <Times> <LastModificationTime>2023-05-02T08:57:12Z</LastModificationTime> <CreationTime>2023-05-02T08:55:14Z</CreationTime> <LastAccessTime>2023-05-02T08:55:14Z</LastAccessTime> <ExpiryTime>4001-01-01T00:00:00Z</ExpiryTime> <Expires>False</Expires> <UsageCount>0</UsageCount> <LocationChanged>2023-05-02T08:55:14Z</LocationChanged> </Times> <String> <Key>Title</Key> <Value>Entry A</Value> </String> <String> <Key>UserName</Key> <Value>nobody@proton.me</Value> </String> <String> <Key>Password</Key> <Value ProtectInMemory="True">proton123</Value> </String> <String> <Key>URL</Key> <Value>https://account.proton.me</Value> </String> <String> <Key>Notes</Key> <Value>Entry A note</Value> </String> <AutoType> <Enabled>True</Enabled> <DataTransferObfuscation>0</DataTransferObfuscation> </AutoType> </Entry> <Entry> <UUID>GX1bcmlmTtudvdYXcRv3wg==</UUID> <IconID>0</IconID> <ForegroundColor/> <BackgroundColor/> <OverrideURL/> <Tags/> <Times> <LastModificationTime>2023-05-02T09:24:27Z</LastModificationTime> <CreationTime>2023-05-02T08:55:14Z</CreationTime> <LastAccessTime>2023-05-02T08:55:14Z</LastAccessTime> <ExpiryTime>4001-01-01T00:00:00Z</ExpiryTime> <Expires>False</Expires> <UsageCount>0</UsageCount> <LocationChanged>2023-05-02T08:55:14Z</LocationChanged> </Times> <String> <Key>Title</Key> <Value>Entry A</Value> </String> <String> <Key>UserName</Key> <Value>nobody@proton.me</Value> </String> <String> <Key>Password</Key> <Value ProtectInMemory="True">proton123</Value> </String> <String> <Key>URL</Key> <Value>https://account.proton.me</Value> </String> <String> <Key>Notes</Key> <Value>Entry A note</Value> </String> <String> <Key>Custom</Key> <Value ProtectInMemory="True">ABCDEF</Value> </String> <AutoType> <Enabled>True</Enabled> <DataTransferObfuscation>0</DataTransferObfuscation> </AutoType> </Entry> <Entry> <UUID>GX1bcmlmTtudvdYXcRv3wg==</UUID> <IconID>0</IconID> <ForegroundColor/> <BackgroundColor/> <OverrideURL/> <Tags/> <Times> <LastModificationTime>2023-05-02T09:25:26Z</LastModificationTime> <CreationTime>2023-05-02T08:55:14Z</CreationTime> <LastAccessTime>2023-05-02T08:55:14Z</LastAccessTime> <ExpiryTime>4001-01-01T00:00:00Z</ExpiryTime> <Expires>False</Expires> <UsageCount>0</UsageCount> <LocationChanged>2023-05-02T12:26:21Z</LocationChanged> </Times> <String> <Key>Title</Key> <Value>Entry A</Value> </String> <String> <Key>UserName</Key> <Value>nobodyA@proton.me</Value> </String> <String> <Key>Password</Key> <Value ProtectInMemory="True">proton123</Value> </String> <String> <Key>URL</Key> <Value>https://account.proton.me</Value> </String> <String> <Key>Notes</Key> <Value>Entry A note</Value> </String> <String> <Key>Custom</Key> <Value ProtectInMemory="True">ABCDEF</Value> </String> <AutoType> <Enabled>True</Enabled> <DataTransferObfuscation>0</DataTransferObfuscation> </AutoType> </Entry> <Entry> <UUID>GX1bcmlmTtudvdYXcRv3wg==</UUID> <IconID>0</IconID> <ForegroundColor/> <BackgroundColor/> <OverrideURL/> <Tags/> <Times> <LastModificationTime>2023-05-02T12:32:23Z</LastModificationTime> <CreationTime>2023-05-02T08:55:14Z</CreationTime> <LastAccessTime>2023-05-02T08:55:14Z</LastAccessTime> <ExpiryTime>4001-01-01T00:00:00Z</ExpiryTime> <Expires>False</Expires> <UsageCount>0</UsageCount> <LocationChanged>2023-05-02T12:26:21Z</LocationChanged> </Times> <String> <Key>Title</Key> <Value>Entry A</Value> </String> <String> <Key>UserName</Key> <Value>nobodyA@proton.me</Value> </String> <String> <Key>Password</Key> <Value ProtectInMemory="True">proton123</Value> </String> <String> <Key>URL</Key> <Value>https://account.proton.me</Value> </String> <String> <Key>Notes</Key> <Value>Entry A note</Value> </String> <String> <Key>otp</Key> <Value ProtectInMemory="True">otpauth://totp/Entry%20A:nobodyA@proton.me?algorithm=sha1&amp;issuer=Entry%20A&amp;period=30&amp;digits=6&amp;secret=</Value> </String> <String> <Key>TimeOtp-Secret-Base32</Key> <Value/> </String> <AutoType> <Enabled>True</Enabled> <DataTransferObfuscation>0</DataTransferObfuscation> </AutoType> </Entry> <Entry> <UUID>GX1bcmlmTtudvdYXcRv3wg==</UUID> <IconID>0</IconID> <ForegroundColor/> <BackgroundColor/> <OverrideURL/> <Tags/> <Times> <LastModificationTime>2023-05-02T12:59:29Z</LastModificationTime> <CreationTime>2023-05-02T08:55:14Z</CreationTime> <LastAccessTime>2023-05-02T08:55:14Z</LastAccessTime> <ExpiryTime>4001-01-01T00:00:00Z</ExpiryTime> <Expires>False</Expires> <UsageCount>0</UsageCount> <LocationChanged>2023-05-02T12:26:21Z</LocationChanged> </Times> <String> <Key>Title</Key> <Value>Entry A</Value> </String> <String> <Key>UserName</Key> <Value>nobodyA@proton.me</Value> </String> <String> <Key>Password</Key> <Value ProtectInMemory="True">proton123</Value> </String> <String> <Key>URL</Key> <Value>https://account.proton.me</Value> </String> <String> <Key>Notes</Key> <Value>Entry A note</Value> </String> <String> <Key>otp</Key> <Value>otpauth://totp/Entry%20A:nobodyA@proton.me?algorithm=sha1&amp;issuer=Entry%20A&amp;period=30&amp;digits=6&amp;secret=VZKDI2A4UP2NG5BB</Value> </String> <String> <Key>TimeOtp-Secret-Base32</Key> <Value>VZKDI2A4UP2NG5BB</Value> </String> <AutoType> <Enabled>True</Enabled> <DataTransferObfuscation>0</DataTransferObfuscation> </AutoType> </Entry> <Entry> <UUID>GX1bcmlmTtudvdYXcRv3wg==</UUID> <IconID>0</IconID> <ForegroundColor/> <BackgroundColor/> <OverrideURL/> <Tags/> <Times> <LastModificationTime>2023-05-02T13:04:23Z</LastModificationTime> <CreationTime>2023-05-02T08:55:14Z</CreationTime> <LastAccessTime>2023-05-02T08:55:14Z</LastAccessTime> <ExpiryTime>4001-01-01T00:00:00Z</ExpiryTime> <Expires>False</Expires> <UsageCount>0</UsageCount> <LocationChanged>2023-05-02T12:26:21Z</LocationChanged> </Times> <String> <Key>Title</Key> <Value>Entry A</Value> </String> <String> <Key>UserName</Key> <Value>nobodyA@proton.me</Value> </String> <String> <Key>Password</Key> <Value ProtectInMemory="True">proton123</Value> </String> <String> <Key>URL</Key> <Value>https://account.proton.me</Value> </String> <String> <Key>Notes</Key> <Value>Entry A note</Value> </String> <String> <Key>otp</Key> <Value>otpauth://totp/Entry%20A:nobodyA@proton.me?algorithm=sha1&amp;issuer=Entry%20A&amp;period=30&amp;digits=6&amp;secret=VZKDI2A4UP2NG5BB</Value> </String> <String> <Key>TimeOtp-Secret-Base32</Key> <Value>VZKDI2A4UP2NG5BB</Value> </String> <AutoType> <Enabled>True</Enabled> <DataTransferObfuscation>0</DataTransferObfuscation> </AutoType> </Entry> </History> </Entry> <Group> <UUID>tYs0rRprTleeiYokvLuT1g==</UUID> <Name>Group B</Name> <Notes/> <IconID>48</IconID> <Times> <LastModificationTime>2023-05-02T13:29:00Z</LastModificationTime> <CreationTime>2023-05-02T13:28:49Z</CreationTime> <LastAccessTime>2023-05-02T13:28:49Z</LastAccessTime> <ExpiryTime>4001-01-01T00:00:00Z</ExpiryTime> <Expires>False</Expires> <UsageCount>0</UsageCount> <LocationChanged>2023-05-02T13:28:51Z</LocationChanged> </Times> <IsExpanded>False</IsExpanded> <DefaultAutoTypeSequence/> <EnableAutoType>null</EnableAutoType> <EnableSearching>null</EnableSearching> <LastTopVisibleEntry>AAAAAAAAAAAAAAAAAAAAAA==</LastTopVisibleEntry> <PreviousParentGroup>9gXTsuD4QxGyChZRf1NGCQ==</PreviousParentGroup> <Entry> <UUID>e4OgQnwTQ3mH+xeUx7qU/Q==</UUID> <IconID>0</IconID> <ForegroundColor/> <BackgroundColor/> <OverrideURL/> <Tags/> <Times> <LastModificationTime>2023-05-02T13:29:57Z</LastModificationTime> <CreationTime>2023-05-02T13:29:04Z</CreationTime> <LastAccessTime>2023-05-02T13:29:04Z</LastAccessTime> <ExpiryTime>4001-01-01T00:00:00Z</ExpiryTime> <Expires>False</Expires> <UsageCount>0</UsageCount> <LocationChanged>2023-05-02T13:29:04Z</LocationChanged> </Times> <String> <Key>Title</Key> <Value>Broken URL</Value> </String> <String> <Key>UserName</Key> <Value/> </String> <String> <Key>Password</Key> <Value ProtectInMemory="True"/> </String> <String> <Key>URL</Key> <Value>ht:////broken.proton.me</Value> </String> <String> <Key>Notes</Key> <Value/> </String> <AutoType> <Enabled>True</Enabled> <DataTransferObfuscation>0</DataTransferObfuscation> </AutoType> <History> <Entry> <UUID>e4OgQnwTQ3mH+xeUx7qU/Q==</UUID> <IconID>0</IconID> <ForegroundColor/> <BackgroundColor/> <OverrideURL/> <Tags/> <Times> <LastModificationTime>2023-05-02T13:29:04Z</LastModificationTime> <CreationTime>2023-05-02T13:29:04Z</CreationTime> <LastAccessTime>2023-05-02T13:29:04Z</LastAccessTime> <ExpiryTime>4001-01-01T00:00:00Z</ExpiryTime> <Expires>False</Expires> <UsageCount>0</UsageCount> <LocationChanged>2023-05-02T13:29:04Z</LocationChanged> </Times> <String> <Key>Title</Key> <Value>New Entry</Value> </String> <String> <Key>UserName</Key> <Value/> </String> <String> <Key>Password</Key> <Value ProtectInMemory="True">?C\50r+Wxnhx</Value> </String> <String> <Key>URL</Key> <Value/> </String> <String> <Key>Notes</Key> <Value/> </String> <AutoType> <Enabled>True</Enabled> <DataTransferObfuscation>0</DataTransferObfuscation> </AutoType> </Entry> </History> </Entry> </Group> <Group> <UUID>LRGWyF2uTzKftDuafPUKRQ==</UUID> <Name>Group C</Name> <Notes/> <IconID>48</IconID> <Times> <LastModificationTime>2023-05-02T09:24:55Z</LastModificationTime> <CreationTime>2023-05-02T09:24:39Z</CreationTime> <LastAccessTime>2023-05-02T09:24:39Z</LastAccessTime> <ExpiryTime>4001-01-01T00:00:00Z</ExpiryTime> <Expires>False</Expires> <UsageCount>0</UsageCount> <LocationChanged>2023-05-02T12:26:21Z</LocationChanged> </Times> <IsExpanded>True</IsExpanded> <DefaultAutoTypeSequence/> <EnableAutoType>null</EnableAutoType> <EnableSearching>null</EnableSearching> <LastTopVisibleEntry>AAAAAAAAAAAAAAAAAAAAAA==</LastTopVisibleEntry> <PreviousParentGroup>9gXTsuD4QxGyChZRf1NGCQ==</PreviousParentGroup> <Entry> <UUID>RmDxpSufT1+j9c4OLcIL8w==</UUID> <IconID>0</IconID> <ForegroundColor/> <BackgroundColor/> <OverrideURL/> <Tags/> <Times> <LastModificationTime>2023-05-02T13:28:28Z</LastModificationTime> <CreationTime>2023-05-02T09:25:02Z</CreationTime> <LastAccessTime>2023-05-02T09:25:02Z</LastAccessTime> <ExpiryTime>4001-01-01T00:00:00Z</ExpiryTime> <Expires>False</Expires> <UsageCount>0</UsageCount> <LocationChanged>2023-05-02T12:26:21Z</LocationChanged> </Times> <String> <Key>Title</Key> <Value>Login item</Value> </String> <String> <Key>UserName</Key> <Value>nobody@proton.me</Value> </String> <String> <Key>Password</Key> <Value ProtectInMemory="True">a bbbb c </Value> </String> <String> <Key>URL</Key> <Value/> </String> <String> <Key>Notes</Key> <Value/> </String> <AutoType> <Enabled>True</Enabled> <DataTransferObfuscation>0</DataTransferObfuscation> </AutoType> <History> <Entry> <UUID>RmDxpSufT1+j9c4OLcIL8w==</UUID> <IconID>0</IconID> <ForegroundColor/> <BackgroundColor/> <OverrideURL/> <Tags/> <Times> <LastModificationTime>2023-05-02T09:25:02Z</LastModificationTime> <CreationTime>2023-05-02T09:25:02Z</CreationTime> <LastAccessTime>2023-05-02T09:25:02Z</LastAccessTime> <ExpiryTime>4001-01-01T00:00:00Z</ExpiryTime> <Expires>False</Expires> <UsageCount>0</UsageCount> <LocationChanged>2023-05-02T09:25:02Z</LocationChanged> </Times> <String> <Key>Title</Key> <Value>New Entry</Value> </String> <String> <Key>UserName</Key> <Value/> </String> <String> <Key>Password</Key> <Value ProtectInMemory="True">W2qjVFffTP*J</Value> </String> <String> <Key>URL</Key> <Value/> </String> <String> <Key>Notes</Key> <Value/> </String> <AutoType> <Enabled>True</Enabled> <DataTransferObfuscation>0</DataTransferObfuscation> </AutoType> </Entry> <Entry> <UUID>RmDxpSufT1+j9c4OLcIL8w==</UUID> <IconID>0</IconID> <ForegroundColor/> <BackgroundColor/> <OverrideURL/> <Tags/> <Times> <LastModificationTime>2023-05-02T09:25:14Z</LastModificationTime> <CreationTime>2023-05-02T09:25:02Z</CreationTime> <LastAccessTime>2023-05-02T09:25:02Z</LastAccessTime> <ExpiryTime>4001-01-01T00:00:00Z</ExpiryTime> <Expires>False</Expires> <UsageCount>0</UsageCount> <LocationChanged>2023-05-02T09:25:02Z</LocationChanged> </Times> <String> <Key>Title</Key> <Value>Entry B</Value> </String> <String> <Key>UserName</Key> <Value/> </String> <String> <Key>Password</Key> <Value ProtectInMemory="True">W2qjVFffTP*J</Value> </String> <String> <Key>URL</Key> <Value/> </String> <String> <Key>Notes</Key> <Value/> </String> <AutoType> <Enabled>True</Enabled> <DataTransferObfuscation>0</DataTransferObfuscation> </AutoType> </Entry> <Entry> <UUID>RmDxpSufT1+j9c4OLcIL8w==</UUID> <IconID>0</IconID> <ForegroundColor/> <BackgroundColor/> <OverrideURL/> <Tags/> <Times> <LastModificationTime>2023-05-02T09:25:47Z</LastModificationTime> <CreationTime>2023-05-02T09:25:02Z</CreationTime> <LastAccessTime>2023-05-02T09:25:02Z</LastAccessTime> <ExpiryTime>4001-01-01T00:00:00Z</ExpiryTime> <Expires>False</Expires> <UsageCount>0</UsageCount> <LocationChanged>2023-05-02T12:26:21Z</LocationChanged> </Times> <String> <Key>Title</Key> <Value>Entry B</Value> </String> <String> <Key>UserName</Key> <Value>nobodyB@proton.me</Value> </String> <String> <Key>Password</Key> <Value ProtectInMemory="True">proton123</Value> </String> <String> <Key>URL</Key> <Value/> </String> <String> <Key>Notes</Key> <Value/> </String> <AutoType> <Enabled>True</Enabled> <DataTransferObfuscation>0</DataTransferObfuscation> </AutoType> </Entry> </History> </Entry> <Group> <UUID>0aVS7uYWSvuHHQc9kAonJQ==</UUID> <Name></Name> <Notes/> <IconID>48</IconID> <Times> <LastModificationTime>2023-05-02T13:30:15Z</LastModificationTime> <CreationTime>2023-05-02T13:30:05Z</CreationTime> <LastAccessTime>2023-05-02T13:30:05Z</LastAccessTime> <ExpiryTime>4001-01-01T00:00:00Z</ExpiryTime> <Expires>False</Expires> <UsageCount>0</UsageCount> <LocationChanged>2023-05-02T13:30:05Z</LocationChanged> </Times> <IsExpanded>False</IsExpanded> <DefaultAutoTypeSequence/> <EnableAutoType>null</EnableAutoType> <EnableSearching>null</EnableSearching> <LastTopVisibleEntry>AAAAAAAAAAAAAAAAAAAAAA==</LastTopVisibleEntry> <PreviousParentGroup/> <Entry> <UUID>+NGH4+mcQmCsSWZOlEA3iQ==</UUID> <IconID>0</IconID> <ForegroundColor/> <BackgroundColor/> <OverrideURL/> <Tags/> <Times> <LastModificationTime>2023-05-02T13:31:08Z</LastModificationTime> <CreationTime>2023-05-02T13:30:17Z</CreationTime> <LastAccessTime>2023-05-02T13:30:17Z</LastAccessTime> <ExpiryTime>4001-01-01T00:00:00Z</ExpiryTime> <Expires>False</Expires> <UsageCount>0</UsageCount> <LocationChanged>2023-05-02T13:30:17Z</LocationChanged> </Times> <String> <Key>Title</Key> <Value>Login item</Value> </String> <String> <Key>UserName</Key> <Value>nobody@proton.me</Value> </String> <String> <Key>Password</Key> <Value ProtectInMemory="True">proton123</Value> </String> <String> <Key>URL</Key> <Value>https://account.proton.me</Value> </String> <String> <Key>Notes</Key> <Value>some note</Value> </String> <AutoType> <Enabled>True</Enabled> <DataTransferObfuscation>0</DataTransferObfuscation> </AutoType> <History> <Entry> <UUID>+NGH4+mcQmCsSWZOlEA3iQ==</UUID> <IconID>0</IconID> <ForegroundColor/> <BackgroundColor/> <OverrideURL/> <Tags/> <Times> <LastModificationTime>2023-05-02T13:30:17Z</LastModificationTime> <CreationTime>2023-05-02T13:30:17Z</CreationTime> <LastAccessTime>2023-05-02T13:30:17Z</LastAccessTime> <ExpiryTime>4001-01-01T00:00:00Z</ExpiryTime> <Expires>False</Expires> <UsageCount>0</UsageCount> <LocationChanged>2023-05-02T13:30:17Z</LocationChanged> </Times> <String> <Key>Title</Key> <Value>New Entry</Value> </String> <String> <Key>UserName</Key> <Value/> </String> <String> <Key>Password</Key> <Value ProtectInMemory="True">]J9rv+T-}P;N</Value> </String> <String> <Key>URL</Key> <Value/> </String> <String> <Key>Notes</Key> <Value/> </String> <AutoType> <Enabled>True</Enabled> <DataTransferObfuscation>0</DataTransferObfuscation> </AutoType> </Entry> <Entry> <UUID>+NGH4+mcQmCsSWZOlEA3iQ==</UUID> <IconID>0</IconID> <ForegroundColor/> <BackgroundColor/> <OverrideURL/> <Tags/> <Times> <LastModificationTime>2023-05-02T13:30:28Z</LastModificationTime> <CreationTime>2023-05-02T13:30:17Z</CreationTime> <LastAccessTime>2023-05-02T13:30:17Z</LastAccessTime> <ExpiryTime>4001-01-01T00:00:00Z</ExpiryTime> <Expires>False</Expires> <UsageCount>0</UsageCount> <LocationChanged>2023-05-02T13:30:17Z</LocationChanged> </Times> <String> <Key>Title</Key> <Value>Entry D1</Value> </String> <String> <Key>UserName</Key> <Value/> </String> <String> <Key>Password</Key> <Value ProtectInMemory="True">]J9rv+T-}P;N</Value> </String> <String> <Key>URL</Key> <Value/> </String> <String> <Key>Notes</Key> <Value/> </String> <AutoType> <Enabled>True</Enabled> <DataTransferObfuscation>0</DataTransferObfuscation> </AutoType> </Entry> <Entry> <UUID>+NGH4+mcQmCsSWZOlEA3iQ==</UUID> <IconID>0</IconID> <ForegroundColor/> <BackgroundColor/> <OverrideURL/> <Tags/> <Times> <LastModificationTime>2023-05-02T13:30:50Z</LastModificationTime> <CreationTime>2023-05-02T13:30:17Z</CreationTime> <LastAccessTime>2023-05-02T13:30:17Z</LastAccessTime> <ExpiryTime>4001-01-01T00:00:00Z</ExpiryTime> <Expires>False</Expires> <UsageCount>0</UsageCount> <LocationChanged>2023-05-02T13:30:17Z</LocationChanged> </Times> <String> <Key>Title</Key> <Value>Entry D1</Value> </String> <String> <Key>UserName</Key> <Value>nobodyD@proton.me</Value> </String> <String> <Key>Password</Key> <Value ProtectInMemory="True">proton123</Value> </String> <String> <Key>URL</Key> <Value/> </String> <String> <Key>Notes</Key> <Value/> </String> <AutoType> <Enabled>True</Enabled> <DataTransferObfuscation>0</DataTransferObfuscation> </AutoType> </Entry> </History> </Entry> <Entry> <UUID>AA1bcmlmTtudvdYXcRv3wg==</UUID> <IconID>0</IconID> <ForegroundColor/> <BackgroundColor/> <OverrideURL/> <Tags/> <Times> <LastModificationTime>2023-05-02T09:24:27Z</LastModificationTime> <CreationTime>2023-05-02T08:55:14Z</CreationTime> <LastAccessTime>2023-05-02T08:55:14Z</LastAccessTime> <ExpiryTime>4001-01-01T00:00:00Z</ExpiryTime> <Expires>False</Expires> <UsageCount>0</UsageCount> <LocationChanged>2023-05-02T08:55:14Z</LocationChanged> </Times> <String> <Key>Title</Key> <Value>Broken URL</Value> </String> <String> <Key>UserName</Key> <Value>nobody@proton.me</Value> </String> <String> <Key>Password</Key> <Value ProtectInMemory="True">proton123</Value> </String> <String> <Key>URL</Key> <Value>htp::/broken.proton.me</Value> </String> <String> <Key>Notes</Key> <Value></Value> </String> <String> <Key>Custom</Key> <Value ProtectInMemory="True">ABCDEF</Value> </String> <AutoType> <Enabled>True</Enabled> <DataTransferObfuscation>0</DataTransferObfuscation> </AutoType> </Entry> </Group> </Group> <Group> <UUID>ea26zFu0TOCdqWkuPjXn9g==</UUID> <Name>Trash</Name> <Notes/> <IconID>43</IconID> <Times> <LastModificationTime>2023-05-02T08:53:04Z</LastModificationTime> <CreationTime>2023-05-02T08:53:04Z</CreationTime> <LastAccessTime>2023-05-02T08:53:04Z</LastAccessTime> <ExpiryTime>4001-01-01T00:00:00Z</ExpiryTime> <Expires>False</Expires> <UsageCount>0</UsageCount> <LocationChanged>2023-05-02T12:26:21Z</LocationChanged> </Times> <IsExpanded>False</IsExpanded> <DefaultAutoTypeSequence/> <EnableAutoType>False</EnableAutoType> <EnableSearching>False</EnableSearching> <LastTopVisibleEntry>AAAAAAAAAAAAAAAAAAAAAA==</LastTopVisibleEntry> <PreviousParentGroup>iIeq7AEAAABARkgCAGAAAA==</PreviousParentGroup> </Group> <Group> <UUID>rbANwgLLRlSX3QoGaevZtw==</UUID> <Name>TOTP definitions</Name> <Notes/> <IconID>48</IconID> <Times> <LastModificationTime>pS1T3A4AAAA=</LastModificationTime> <CreationTime>iS1T3A4AAAA=</CreationTime> <LastAccessTime>pS1T3A4AAAA=</LastAccessTime> <ExpiryTime>iS1T3A4AAAA=</ExpiryTime> <Expires>False</Expires> <UsageCount>0</UsageCount> <LocationChanged>ni1T3A4AAAA=</LocationChanged> </Times> <IsExpanded>True</IsExpanded> <DefaultAutoTypeSequence/> <EnableAutoType>null</EnableAutoType> <EnableSearching>null</EnableSearching> <LastTopVisibleEntry>AAAAAAAAAAAAAAAAAAAAAA==</LastTopVisibleEntry> <Entry> <UUID>JH3dwjOZRnCyGO+449ZzjA==</UUID> <IconID>0</IconID> <ForegroundColor/> <BackgroundColor/> <OverrideURL/> <Tags/> <Times> <LastModificationTime>pS1T3A4AAAA=</LastModificationTime> <CreationTime>8iVT3A4AAAA=</CreationTime> <LastAccessTime>pS1T3A4AAAA=</LastAccessTime> <ExpiryTime>8iVT3A4AAAA=</ExpiryTime> <Expires>False</Expires> <UsageCount>0</UsageCount> <LocationChanged>pS1T3A4AAAA=</LocationChanged> </Times> <PreviousParentGroup>peyI7pxERxW3HudVhmU4xQ==</PreviousParentGroup> <String> <Key>Notes</Key> <Value/> </String> <String> <Key>Password</Key> <Value ProtectInMemory="True"/> </String> <String> <Key>Title</Key> <Value>Modern TOTP definition</Value> </String> <String> <Key>URL</Key> <Value/> </String> <String> <Key>UserName</Key> <Value/> </String> <String> <Key>otp</Key> <Value ProtectInMemory="True">otpauth://totp/Modern%20TOTP%20definition:none?secret=5KO67YMS2FHKA627&amp;period=42&amp;digits=8</Value> </String> <AutoType> <Enabled>True</Enabled> <DataTransferObfuscation>0</DataTransferObfuscation> <DefaultSequence/> </AutoType> <History/> </Entry> <Entry> <UUID>L4T40aLuRPe5N/+mvrAZ/Q==</UUID> <IconID>0</IconID> <ForegroundColor/> <BackgroundColor/> <OverrideURL/> <Tags/> <Times> <LastModificationTime>pS1T3A4AAAA=</LastModificationTime> <CreationTime>TSZT3A4AAAA=</CreationTime> <LastAccessTime>pS1T3A4AAAA=</LastAccessTime> <ExpiryTime>TSZT3A4AAAA=</ExpiryTime> <Expires>False</Expires> <UsageCount>0</UsageCount> <LocationChanged>pS1T3A4AAAA=</LocationChanged> </Times> <PreviousParentGroup>peyI7pxERxW3HudVhmU4xQ==</PreviousParentGroup> <String> <Key>Notes</Key> <Value/> </String> <String> <Key>Password</Key> <Value ProtectInMemory="True"/> </String> <String> <Key>TOTP Seed</Key> <Value ProtectInMemory="True">AU2HMGCJYPNI2WZT</Value> </String> <String> <Key>TOTP Settings</Key> <Value>42;8</Value> </String> <String> <Key>Title</Key> <Value>Legacy TOTP definition</Value> </String> <String> <Key>URL</Key> <Value/> </String> <String> <Key>UserName</Key> <Value/> </String> <AutoType> <Enabled>True</Enabled> <DataTransferObfuscation>0</DataTransferObfuscation> <DefaultSequence/> </AutoType> <History/> </Entry> </Group> </Group> <DeletedObjects> <DeletedObject> <UUID>aJH24VB+TvyO8ujA+DavRA==</UUID> <DeletionTime>2023-05-02T08:53:41Z</DeletionTime> </DeletedObject> <DeletedObject> <UUID>I/1IiumUTrOOLasC+OWqkA==</UUID> <DeletionTime>2023-05-02T12:26:29Z</DeletionTime> </DeletedObject> <DeletedObject> <UUID>PnEaklCcS1upckrMUMLacg==</UUID> <DeletionTime>2023-05-02T08:53:41Z</DeletionTime> </DeletedObject> <DeletedObject> <UUID>MItWlDCbSF6C9eq/D0Xihw==</UUID> <DeletionTime>2023-05-02T08:53:41Z</DeletionTime> </DeletedObject> <DeletedObject> <UUID>R9NJzo6MSW+GPGrnTiI5gw==</UUID> <DeletionTime>2023-05-02T08:53:41Z</DeletionTime> </DeletedObject> <DeletedObject> <UUID>h6NUAy6oR8qInxGfqUqbIA==</UUID> <DeletionTime>2023-05-02T08:53:41Z</DeletionTime> </DeletedObject> </DeletedObjects> </Root> </KeePassFile>
7,863
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/mocks/keeper.csv
"","address item","","","","","" "","contact item","","","","","","Name","jonny doe" "","file attachment item","","","","","" "","general item","","","","","" "folder1","login of folder1","john","","","","" "folder1\subfolder1","login of subfolder1","john","","","","" "","login with 2fa","2fa@example.com","pass","https://example.com","","","TFC:Keeper","otpauth://totp/account.proton.me:2fa-manually-entered-string@example.com?secret=RL3FRZ5V3EBM7T4ZMGJWGO43MQSTTMIT&issuer=account.proton.me&algorithm=SHA1&digits=6&period=30" "","login with broken url","john","pass","https://ex:ample.com/","","" "","login with comma, quotes ""","username with comma, quotes ""","password with comma, quotes ""","https://example.com/","notes with commas, quotes ""","" "","login with custom fields","john","pass","https://example.com","","","Hidden Field","this is custom field: hidden","Security Question & Answer","this is custom field: security question? this is custom field: security answer","Website Address","https://this-is-custom-field-url.example.com","Phone","Mobile US (+1) (555) 555-5555 Ex","Hidden Field with edited label","this is custom field: hidden with edited label" "","login with multiple lines","john","pass","https://example.com","notes with multiple lines","" "","login with multiple urls","","","https://example.com","","","Website Address","https://second.example.com","Website Address with edited label","https://edited-label.example.com" "","paymentcard","","b5pIs[ISaru7@)44rn,xT","https://example.com","foo","","Bank Account","Checking | 980","Hidden Field","this is custom field: hidden" "","secure note item","","","","foo","" "","ssh key item","john","pass","","foo","","Key Pair","privatekey | publickey"
7,864
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/mocks/lastpass.corrupted.items.csv
url,username,password,totp,extra,name,grouping,fav https://account.proton.me,nobody@proton.me,proton123,,Secure note,nobody,,0 https://proton.me,admin,proton123,,,Admin,,0 ,,,,1 line 2 line 3line 4line 5line 6line,login items with 6 lines,,0 http://sn,,,,This is a secure note,Secure note,,0
7,865
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/mocks/lastpass.corrupted.rows.csv
url,username,password,totp,extra,name,grouping,fav https://account.proton.me,nobody@proton.me,proton123,,Secure note,nobody,,0 https://proton.me,admin,proton123,,,Admin,company services,0 ,,,,first line second line,login with multi lines,,0 ,,,,test" test",login item with multilines and quotes ("),,0 https://twitter.com/login,@nobody,proton123,,This is a twitter note,Twitter,company services,0 ,,,,1 line 2 line 3line 4line 5line 6line,login items with 6 lines,,0 http://sn,,,,This is a secure note,Secure note,,0 http://sn,,,,"NoteType:Bank Account Language:en-GB Bank Name:test Account Type:test Routing Number: Account Number:333333 SWIFT Code: IBAN Number: Pin: Branch Address: Branch Phone: Notes:",test,,0 http://sn,,,,"NoteType:Credit Card Language:en-GB Name on Card:Mr Test Type:Test Number:42424242 Security Code: Start Date:, Expiration Date:, Notes:",TestCC,,0 http://sn,,,,"NoteType:Address Language:en-GB Title:mrs First Name:Test Middle Name:Joe Last Name:Test Username: Gender: Birthday:,, Company: Address 1: Address 2: Address 3: City / Town: County: State: Zip / Postal Code: Country: Timezone: Email Address: Phone: Evening Phone: Mobile Phone: Fax: Notes:",TestID,,0 http://sn,,,,"comma , and second comma ,",secure note with commas (,),,0 http://sn,,,,,secure note with file,,0 http://sn,,,,"""test ""test2",secure note with multilines & quotes ",,0
7,866
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/mocks/lastpass.crcrlf.terminated.csv
url,username,password,totp,extra,name,grouping,fav http://sn,,,,xxxx,Evernote Single-Use Codes,Personal,0 http://sn,,,,yyyy,Duck Duck Go settings pw,Personal,0 http://sn,,,,zzzz,Canon Pro-1000 Admin PW,Personal,0
7,867
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/mocks/lastpass.csv
url,username,password,totp,extra,name,grouping,fav https://account.proton.me,nobody@proton.me,proton123,,Secure note,nobody,,0 https://proton.me,admin,proton123,,,Admin,company services,0 https://twitter.com/login,@nobody,proton123,base32secret,This is a twitter note,Twitter,company services,0 https://fb.com/login,@nobody,proton123,base32secret,,,company services,0 http://sn,,,,This is a secure note,Secure note,,0 htts:/broken.url,,,,,,company services,0 http://sn,,,,"NoteType:Bank Account Language:en-GB Bank Name:test Account Type:test Routing Number: Account Number:333333 SWIFT Code: IBAN Number: Pin: Branch Address: Branch Phone: Notes:",test,,0 http://sn,,,,"NoteType:Address Language:en-GB Title:mrs First Name:Test Middle Name:Joe Last Name:Test Username: Gender: Birthday:,, Company: Address 1: Address 2: Address 3: City / Town: County: State: Zip / Postal Code: Country: Timezone: Email Address: Phone: Evening Phone: Mobile Phone: Fax: Notes:",TestID,,0 http://sn,,,,"NoteType:Credit Card Language:en-GB Name on Card:A B Type:Visa Number:4242424242424242 Security Code:123 Start Date:, Expiration Date:January,2025 Notes:this is a note for the credit card",Credit Card Item with note,,0
7,868
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/mocks/nordpass.csv
name,url,username,password,note,cardholdername,cardnumber,cvc,expirydate,zipcode,folder,full_name,phone_number,email,address1,address2,city,country,state,type company services,,,,,,,,,,,,,,,,,,,folder nobody,https://account.proton.me,nobody@proton.me,proton123,Secure note,,,,,,,,,,,,,,,password Secure note,,,,This is a secure note,,,,,,,,,,,,,,,note test,,,,"Bank Name: test Account Type: test Account Number: 333333",,,,,,,,,,,,,,,note Credit Card Item with note,,,,this is a note for the credit card,A B,4242424242424242,123,01/25,19412,,,,,,,,,,credit_card TestID,,,,Title: mrs,,,,,,,Test Joe Test,,,,,,,,identity Admin,https://proton.me,admin,proton123,,,,,,,company services,,,,,,,,,password Twitter,https://twitter.com/login,@nobody,proton123,This is a twitter note,,,,,,company services,,,,,,,,,password fb.com,https://fb.com/login,@nobody,proton123,,,,,,,company services,,,,,,,,,password htts,htts:/broken.url,,,,,,,,,company services,,,,,,,,,password
7,869
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/mocks/roboform.csv
Name,Url,MatchUrl,Login,Pwd,Note,Folder,RfFieldsV2 Example,http://example.com,http://example.com,example,some@password,cool note,,"User ID$,,,txt,example","Password$,,,pwd,some@password","TOTP KEY$,,,txt,fdkjjkdsf" Example - 1,http://emptynote.example.com,http://emptynote.example.com,empty,"'@'password""",,,"User ID$,,,txt,empty","Password$,,,pwd,""'@'password""""""" Google,https://accounts.google.com/login,https://accounts.google.com/login,specialchars@example.com,$#%298340@,,,"User ID$,,,txt,specialchars@example.com","Password$,,,pwd,$#%298340@" nobody,https://account.proton.me,https://account.proton.me,nobody@proton.me,proton123,"Secure note Imported from LastPass.",,"User ID$,,,txt,nobody@proton.me","Password$,,,pwd,proton123" Nonote,http://nonote.example.,http://nonote.example.,example1,example1,,,"User ID$,,,txt,example1","Password$,,,pwd,example1" Credit Card Item with note,,,,,"NoteType:Credit Card Language:en-GB Name on Card:A B Type:Visa Number:4242424242424242 Security Code:123 Start Date:, Expiration Date:January,2025 Notes:this is a note for the credit card Imported from LastPass.", Secure note,,,,,This is a secure note, test,,,,,"NoteType:Bank Account Language:en-GB Bank Name:test Account Type:test Routing Number: Account Number:333333 SWIFT Code: IBAN Number: Pin: Branch Address: Branch Phone: Notes: Imported from LastPass.", TestID,,,,,"NoteType:Address Language:en-GB Title:mrs First Name:Test Middle Name:Joe Last Name:Test Username: Gender: Birthday:,, Company: Address 1: Address 2: Address 3: City / Town: County: State: Zip / Postal Code: Country: Timezone: Email Address: Phone: Evening Phone: Mobile Phone: Fax: Notes: Imported from LastPass.", Admin,https://proton.me,https://proton.me,admin,''@proton123,,/company services,"User ID$,,,txt,admin","Password$,,,pwd,''@proton123" Bookmark,htts:/broken.url,,,,,/company services Bookmark - valid,https://example.com,,,,,/company services Fb,https://fb.com/login,https://fb.com/login,nobody,'@proton123,"Facebook note ",/company services,"User ID$,,,txt,nobody","Password$,,,pwd,'@proton123" Twitter,https://twitter.com/login,https://twitter.com/login,'@nobody,''password,This is a twitter note,/company services,"User ID$,,,txt,'@nobody","Password$,,,pwd,''password"
7,870
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers
petrpan-code/ProtonMail/WebClients/packages/pass/lib/import/providers/mocks/safari.csv
Title,URL,Username,Password,Notes,OTPAuth "ex:ample.com (brokenurl@example.com)","https://ex:ample.com/",brokenurl@example.com,pass,, 2fa.example.com (2fa-scanned),https://2fa.example.com/,2fa-scanned,pass,,otpauth://totp/db@example.com?secret=OTDED5QZA64L6YRUWJLD65QQ3Z6PZ3A3&issuer=Proton&algorithm=SHA1&digits=6&period=30 "account.example.com (username with comma, quotes "")",https://account.example.com/,"username with comma, quotes ""","password with comma, quotes ""","notes with commas, quotes """, localhost (login-with-multiple-lines),http://localhost:7777/,login-with-multiple-lines,pass,"notes with multiple lines", account.proton.me (2fa-manually-entered-string@example.com),https://account.proton.me/,2fa-manually-entered-string@example.com,proton123,,otpauth://totp/account.proton.me:2fa-manually-entered-string@example.com?secret=RL3FRZ5V3EBM7T4ZMGJWGO43MQSTTMIT&issuer=account.proton.me&algorithm=SHA1&digits=6&period=30
7,871
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib
petrpan-code/ProtonMail/WebClients/packages/pass/lib/invites/invite.requests.ts
import { api } from '@proton/pass/lib/api/api'; import { PassCrypto } from '@proton/pass/lib/crypto/pass-crypto'; import type { NewUserPendingInvite, PendingInvite } from '@proton/pass/types/data/invites'; import type { InviteAcceptIntent, InviteCreateIntent, InviteRejectIntent, InviteRemoveIntent, InviteResendIntent, NewUserInvitePromoteIntent, NewUserInviteRemoveIntent, } from '@proton/pass/types/data/invites.dto'; import { getPublicKeysForEmail } from '../auth/address'; export type InviteData = { invites: PendingInvite[]; newUserInvites: NewUserPendingInvite[] }; export const loadInvites = async (shareId: string): Promise<InviteData> => { const { Invites, NewUserInvites } = await api({ url: `pass/v1/share/${shareId}/invite`, method: 'get', }); return { invites: Invites.map( (invite): PendingInvite => ({ inviteId: invite.InviteID, targetId: invite.TargetID, targetType: invite.TargetType, invitedEmail: invite.InvitedEmail, inviterEmail: invite.InviterEmail, remindersSent: invite.RemindersSent, createTime: invite.CreateTime, modifyTime: invite.ModifyTime, }) ), newUserInvites: NewUserInvites.map( (invite): NewUserPendingInvite => ({ newUserInviteId: invite.NewUserInviteID!, targetId: invite.TargetID!, targetType: invite.TargetType!, invitedEmail: invite.InvitedEmail!, inviterEmail: invite.InviterEmail!, createTime: invite.CreateTime!, signature: invite.Signature!, state: invite.State!, }) ), }; }; export const createInvite = async ({ email, invitedPublicKey, role, shareId, }: InviteCreateIntent & { invitedPublicKey: string }) => api({ url: `pass/v1/share/${shareId}/invite`, method: 'post', data: await PassCrypto.createVaultInvite({ shareId, email, role, invitedPublicKey }), }); export const promoteInvite = async ({ invitedPublicKey, newUserInviteId, shareId, }: NewUserInvitePromoteIntent & { invitedPublicKey: string }) => api({ url: `pass/v1/share/${shareId}/invite/new_user/${newUserInviteId}/keys`, method: 'post', data: await PassCrypto.promoteInvite({ shareId, invitedPublicKey }), }); export const createNewUserInvite = async ({ email, role, shareId }: InviteCreateIntent) => api({ url: `pass/v1/share/${shareId}/invite/new_user`, method: 'post', data: await PassCrypto.createNewUserVaultInvite({ email, role, shareId }), }); export const resendInvite = async ({ shareId, inviteId }: InviteResendIntent) => api({ url: `pass/v1/share/${shareId}/invite/${inviteId}/reminder`, method: 'post' }); export const removeInvite = async ({ shareId, inviteId }: InviteRemoveIntent) => api({ url: `pass/v1/share/${shareId}/invite/${inviteId}`, method: 'delete' }); export const removeNewUserInvite = async ({ shareId, newUserInviteId }: NewUserInviteRemoveIntent) => api({ url: `pass/v1/share/${shareId}/invite/new_user/${newUserInviteId}`, method: 'delete' }); export const acceptInvite = async ({ inviteToken, inviterEmail, invitedAddressId, inviteKeys }: InviteAcceptIntent) => { return ( await api({ url: `pass/v1/invite/${inviteToken}`, method: 'post', data: await PassCrypto.acceptVaultInvite({ invitedAddressId, inviteKeys, inviterPublicKeys: await getPublicKeysForEmail(inviterEmail), }), }) ).Share!; }; export const rejectInvite = async ({ inviteToken }: InviteRejectIntent) => api({ url: `pass/v1/invite/${inviteToken}`, method: 'delete', });
7,872
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib
petrpan-code/ProtonMail/WebClients/packages/pass/lib/items/item-proto.transformer.spec.ts
import type { ItemType, SafeProtobufItem } from '@proton/pass/types'; import { decodeItemContent, encodeItemContent } from './item-proto.transformer'; function checkAndCast<T extends ItemType>(input: SafeProtobufItem, expectedType: T): SafeProtobufItem<T> { const { content } = input.content; const type = content.oneofKind; if (type === expectedType) { return input as SafeProtobufItem<any>; } throw new Error(`oneofKind did not match [input:${type}] [expected:${expectedType}]`); } describe('ItemContentTransformer', () => { it('should be able to encode and decode a Note', () => { const itemName = 'Item' + Math.random(); const noteContents = 'Contents' + Math.random(); const sourceItem: SafeProtobufItem = { metadata: { name: itemName, note: noteContents, itemUuid: String(Math.random()), }, content: { content: { oneofKind: 'note', note: {}, }, }, extraFields: [], }; const encoded = encodeItemContent(sourceItem); expect(encoded.length).toBeGreaterThan(0); const decoded = decodeItemContent(encoded); expect(decoded.metadata.name).toStrictEqual(itemName); const note = checkAndCast(decoded, 'note'); expect(note.metadata.note).toStrictEqual(noteContents); }); it('should be able to encode and decode a Login', () => { const itemName = 'Item' + Math.random(); const itemUsername = 'Username' + Math.random(); const itemPassword = 'Password' + Math.random(); const sourceItem: SafeProtobufItem = { metadata: { name: itemName, note: '', itemUuid: String(Math.random()), }, content: { content: { oneofKind: 'login', login: { username: itemUsername, password: itemPassword, urls: [], totpUri: '', }, }, }, extraFields: [], }; const encoded = encodeItemContent(sourceItem); expect(encoded.length).toBeGreaterThan(0); const decoded = decodeItemContent(encoded); expect(decoded.metadata.name).toStrictEqual(itemName); const login = checkAndCast(decoded, 'login'); expect(login.content.content.login.username).toStrictEqual(itemUsername); expect(login.content.content.login.password).toStrictEqual(itemPassword); }); });
7,873
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib
petrpan-code/ProtonMail/WebClients/packages/pass/lib/items/item-proto.transformer.ts
import type { Item, ItemRevision, OpenedItem, SafeProtobufExtraField, SafeProtobufItem, UnsafeItem, UnsafeItemExtraField, } from '@proton/pass/types'; import { ProtobufItem } from '@proton/pass/types'; import type { ItemCreditCard } from '@proton/pass/types/protobuf/item-v1'; import { omit } from '@proton/shared/lib/helpers/object'; import { deobfuscateItem, obfuscateItem } from './item.obfuscation'; const protobufToExtraField = ({ fieldName, ...field }: SafeProtobufExtraField): UnsafeItemExtraField => { switch (field.content.oneofKind) { case 'text': return { fieldName, type: field.content.oneofKind, data: { content: field.content.text.content }, }; case 'hidden': return { fieldName, type: field.content.oneofKind, data: { content: field.content.hidden.content }, }; case 'totp': return { fieldName, type: field.content.oneofKind, data: { totpUri: field.content.totp.totpUri }, }; default: throw new Error('Unsupported extra field type'); } }; const protobufToCreditCardContent = (creditCard: ItemCreditCard): UnsafeItem<'creditCard'>['content'] => { const [year, month] = (creditCard.expirationDate ?? '').split('-') as [string, string | undefined]; return { ...creditCard, number: creditCard.number, verificationNumber: creditCard.verificationNumber, pin: creditCard.pin, /* YYYY-MM to MMYYYY */ expirationDate: year?.length && month?.length ? `${month}${year}` : '', }; }; const protobufToItem = (item: SafeProtobufItem): UnsafeItem => { const { platformSpecific, metadata, content: itemContent } = item; const base = { metadata: { ...metadata, note: metadata.note }, extraFields: item.extraFields.map(protobufToExtraField), platformSpecific, }; const { content: data } = itemContent; switch (data.oneofKind) { case 'login': return { ...base, type: 'login', content: { ...data.login, username: data.login.username, password: data.login.password, totpUri: data.login.totpUri, }, }; case 'note': return { ...base, type: 'note', content: data.note }; case 'alias': return { ...base, type: 'alias', content: data.alias }; case 'creditCard': return { ...base, type: 'creditCard', content: protobufToCreditCardContent(data.creditCard) }; default: throw new Error('Unsupported item type'); } }; const extraFieldToProtobuf = ({ fieldName, ...extraField }: UnsafeItemExtraField): SafeProtobufExtraField => { switch (extraField.type) { case 'text': return { fieldName, content: { oneofKind: 'text', text: { ...extraField.data, content: extraField.data.content }, }, }; case 'hidden': return { fieldName, content: { oneofKind: 'hidden', hidden: { ...extraField.data, content: extraField.data.content }, }, }; case 'totp': return { fieldName, content: { oneofKind: 'totp', totp: { ...extraField.data, totpUri: extraField.data.totpUri }, }, }; default: throw new Error('Unsupported extra field type'); } }; const creditCardContentToProtobuf = (creditCard: UnsafeItem<'creditCard'>['content']): ItemCreditCard => { const expirationDate = creditCard.expirationDate?.length ? `${creditCard.expirationDate.slice(2, 6)}-${creditCard.expirationDate.slice(0, 2)}` : ''; return { ...creditCard, /* MMYYYY to YYYY-MM */ expirationDate, number: creditCard.number, verificationNumber: creditCard.verificationNumber, pin: creditCard.pin, }; }; const itemToProtobuf = (item: UnsafeItem): SafeProtobufItem => { const { platformSpecific, metadata } = item; const base = { metadata: { ...metadata, note: metadata.note, }, extraFields: item.extraFields.map(extraFieldToProtobuf), platformSpecific, }; switch (item.type) { case 'login': return { ...base, content: { content: { oneofKind: 'login', login: { ...item.content, username: item.content.username, password: item.content.password, totpUri: item.content.totpUri, }, }, }, }; case 'note': return { ...base, content: { content: { oneofKind: 'note', note: item.content } } }; case 'alias': return { ...base, content: { content: { oneofKind: 'alias', alias: item.content } } }; case 'creditCard': return { ...base, content: { content: { oneofKind: 'creditCard', creditCard: creditCardContentToProtobuf(item.content) }, }, }; default: throw new Error('Unsupported item type'); } }; export const encodeItemContent = (item: SafeProtobufItem): Uint8Array => ProtobufItem.toBinary(item); /* serialization will strip extraneous data */ export const serializeItemContent = (item: Item): Uint8Array => { const protobuf = itemToProtobuf(deobfuscateItem(item)); return encodeItemContent(protobuf); }; export const decodeItemContent = (item: Uint8Array): SafeProtobufItem => { const decoded = ProtobufItem.fromBinary(item); if (decoded.metadata === undefined) { throw new Error('Missing metadata message'); } if (decoded.content === undefined || decoded.content.content.oneofKind === undefined) { throw new Error('Missing or corrupted content message'); } return decoded as SafeProtobufItem; }; export const parseOpenedItem = (data: { openedItem: OpenedItem; shareId: string }): ItemRevision => { const content = decodeItemContent(data.openedItem.content); return { shareId: data.shareId, data: obfuscateItem(protobufToItem(content)), ...omit(data.openedItem, ['content']), }; };
7,874
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib
petrpan-code/ProtonMail/WebClients/packages/pass/lib/items/item.obfuscation.ts
import type { Item, ItemExtraField, UnsafeItem, UnsafeItemExtraField } from '@proton/pass/types'; import { deobfuscate, obfuscate } from '@proton/pass/utils/obfuscate/xor'; export const obfuscateExtraFields = (extraFields?: UnsafeItemExtraField[]): ItemExtraField[] => extraFields?.map((field) => field.type === 'totp' ? { ...field, data: { totpUri: obfuscate(field.data.totpUri) } } : { ...field, data: { content: obfuscate(field.data.content) } } ) ?? []; export const deobfuscateExtraFields = (extraFields?: ItemExtraField[]): UnsafeItemExtraField[] => extraFields?.map((extraField): UnsafeItemExtraField => { switch (extraField.type) { case 'totp': return { ...extraField, data: { totpUri: deobfuscate(extraField.data.totpUri) }, }; default: return { ...extraField, data: { content: deobfuscate(extraField.data.content) }, }; } }) ?? []; export const obfuscateItem = (item: UnsafeItem): Item => { const base = { metadata: { ...item.metadata, note: obfuscate(item.metadata.note) }, extraFields: obfuscateExtraFields(item.extraFields), }; switch (item.type) { case 'login': return { ...item, ...base, content: { ...item.content, username: obfuscate(item.content.username), password: obfuscate(item.content.password), totpUri: obfuscate(item.content.totpUri), }, }; case 'creditCard': return { ...item, ...base, content: { ...item.content, number: obfuscate(item.content.number), verificationNumber: obfuscate(item.content.verificationNumber), pin: obfuscate(item.content.pin), }, }; case 'note': return { ...item, ...base }; case 'alias': return { ...item, ...base }; } }; export const deobfuscateItem = (item: Item): UnsafeItem => { const base = { metadata: { ...item.metadata, note: deobfuscate(item.metadata.note) }, extraFields: deobfuscateExtraFields(item.extraFields), }; switch (item.type) { case 'login': return { ...item, ...base, content: { ...item.content, username: deobfuscate(item.content.username), password: deobfuscate(item.content.password), totpUri: deobfuscate(item.content.totpUri), }, }; case 'creditCard': return { ...item, ...base, content: { ...item.content, number: deobfuscate(item.content.number), verificationNumber: deobfuscate(item.content.verificationNumber), pin: deobfuscate(item.content.pin), }, }; case 'note': return { ...item, ...base }; case 'alias': return { ...item, ...base }; } };
7,875
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib
petrpan-code/ProtonMail/WebClients/packages/pass/lib/items/item.parser.ts
import { PassCrypto } from '@proton/pass/lib/crypto/pass-crypto'; import type { ItemRevision, ItemRevisionContentsResponse } from '@proton/pass/types'; import { parseOpenedItem } from './item-proto.transformer'; export const parseItemRevision = async ( shareId: string, encryptedItem: ItemRevisionContentsResponse ): Promise<ItemRevision> => { const openedItem = await PassCrypto.openItem({ shareId, encryptedItem }); return parseOpenedItem({ openedItem, shareId }); };
7,876
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib
petrpan-code/ProtonMail/WebClients/packages/pass/lib/items/item.predicates.ts
import { type Item, type ItemRevision, ItemState, type UniqueItem } from '@proton/pass/types'; export const isLoginItem = (item: Item): item is Item<'login'> => item.type === 'login'; export const isAliasItem = (item: Item): item is Item<'alias'> => item.type === 'alias'; export const isNoteItem = (item: Item): item is Item<'note'> => item.type === 'note'; export const itemEq = <T extends UniqueItem>(a: T) => (b: T): boolean => a.shareId === b.shareId && a.itemId === b.itemId; export const belongsToShare = (shareId: string) => <T extends UniqueItem>(item: T): boolean => item.shareId === shareId; export const isTrashed = ({ state }: ItemRevision) => state === ItemState.Trashed;
7,877
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib
petrpan-code/ProtonMail/WebClients/packages/pass/lib/items/item.requests.ts
import { MAX_BATCH_ITEMS_PER_REQUEST } from '@proton/pass/constants'; import { api } from '@proton/pass/lib/api/api'; import { PassCrypto } from '@proton/pass/lib/crypto/pass-crypto'; import type { AliasAndItemCreateRequest, CustomAliasCreateRequest, ImportItemBatchRequest, ImportItemRequest, ItemCreateIntent, ItemEditIntent, ItemImportIntent, ItemMoveIndividualToShareRequest, ItemMoveMultipleToShareRequest, ItemRevision, ItemRevisionContentsResponse, ItemType, Maybe, } from '@proton/pass/types'; import { groupByKey } from '@proton/pass/utils/array/group-by-key'; import { truthy } from '@proton/pass/utils/fp/predicates'; import { logger } from '@proton/pass/utils/logger'; import { getEpoch } from '@proton/pass/utils/time/get-epoch'; import chunk from '@proton/utils/chunk'; import { serializeItemContent } from './item-proto.transformer'; import { parseItemRevision } from './item.parser'; const batchRevisionsByShareId = (items: ItemRevision[]) => groupByKey(items, 'shareId').flatMap((shareTrashedItems) => { const batches = chunk(shareTrashedItems, MAX_BATCH_ITEMS_PER_REQUEST); return batches.map((batch) => ({ shareId: batch[0].shareId, Items: batch.map((item) => ({ ItemID: item.itemId, Revision: item.revision })), })); }); /* Item creation API request for all items * except for alias items */ export const createItem = async ( createIntent: ItemCreateIntent<Exclude<ItemType, 'alias'>> ): Promise<ItemRevisionContentsResponse> => { const { shareId, ...item } = createIntent; const content = serializeItemContent(item); const data = await PassCrypto.createItem({ shareId, content }); const { Item } = await api({ url: `pass/v1/share/${shareId}/item`, method: 'post', data, }); return Item!; }; /* Specific alias item API request */ export const createAlias = async (createIntent: ItemCreateIntent<'alias'>): Promise<ItemRevisionContentsResponse> => { const { shareId, ...item } = createIntent; const content = serializeItemContent(item); const encryptedItem = await PassCrypto.createItem({ shareId, content }); const data: CustomAliasCreateRequest = { Item: encryptedItem, Prefix: item.extraData.prefix, SignedSuffix: item.extraData.signedSuffix, MailboxIDs: item.extraData.mailboxes.map(({ id }) => id), }; const { Item } = await api({ url: `pass/v1/share/${shareId}/alias/custom`, method: 'post', data, }); return Item!; }; /* Specific item with alias API request: the first item * returned will be the login item, followed by the alias */ export const createItemWithAlias = async ( createIntent: ItemCreateIntent<'login'> & { extraData: { withAlias: true } } ): Promise<[ItemRevisionContentsResponse, ItemRevisionContentsResponse]> => { const { shareId, ...item } = createIntent; const loginItemContent = serializeItemContent(item); const aliasItemContent = serializeItemContent(item.extraData.alias); const encryptedLoginItem = await PassCrypto.createItem({ shareId, content: loginItemContent }); const encryptedAliasItem = await PassCrypto.createItem({ shareId, content: aliasItemContent }); const data: AliasAndItemCreateRequest = { Item: encryptedLoginItem, Alias: { Prefix: item.extraData.alias.extraData.prefix, SignedSuffix: item.extraData.alias.extraData.signedSuffix, MailboxIDs: item.extraData.alias.extraData.mailboxes.map(({ id }) => id), Item: encryptedAliasItem, }, }; const { Bundle } = await api({ url: `pass/v1/share/${shareId}/item/with_alias`, method: 'post', data, }); return [Bundle!.Item, Bundle!.Alias]; }; export const editItem = async ( editIntent: ItemEditIntent, lastRevision: number ): Promise<ItemRevisionContentsResponse> => { const { shareId, itemId, ...item } = editIntent; const content = serializeItemContent(item); const latestItemKey = ( await api({ url: `pass/v1/share/${shareId}/item/${itemId}/key/latest`, method: 'get', }) ).Key!; const data = await PassCrypto.updateItem({ shareId, content, lastRevision, latestItemKey }); const { Item } = await api({ url: `pass/v1/share/${shareId}/item/${itemId}`, method: 'put', data, }); return Item!; }; export const moveItem = async ( item: ItemRevision, shareId: string, destinationShareId: string ): Promise<ItemRevision> => { const content = serializeItemContent(item.data); const data = await PassCrypto.moveItem({ destinationShareId, content }); const encryptedItem = ( await api({ url: `pass/v1/share/${shareId}/item/${item.itemId}/share`, method: 'put', data, }) ).Item!; return parseItemRevision(destinationShareId, encryptedItem); }; export const moveItems = async (items: ItemRevision[], destinationShareId: string): Promise<ItemRevision[]> => { const groupedByShareId = groupByKey(items, 'shareId').flatMap((shareItems) => { const batches = chunk(shareItems, MAX_BATCH_ITEMS_PER_REQUEST); return batches.map((batch) => ({ shareId: batch[0].shareId, items: batch, })); }); const encryptedItems = ( await Promise.all( groupedByShareId.map(async (batch) => { const data: ItemMoveMultipleToShareRequest = { ShareID: destinationShareId, Items: await Promise.all( batch.items.map<Promise<ItemMoveIndividualToShareRequest>>(async (item) => { const content = serializeItemContent(item.data); return { ItemID: item.itemId, Item: (await PassCrypto.moveItem({ destinationShareId, content })).Item, }; }) ), }; return (await api({ url: `pass/v1/share/${batch.shareId}/item/share`, method: 'put', data })).Items!; }) ) ).flat(); const revisions = encryptedItems.map(async (encryptedItem) => parseItemRevision(destinationShareId, encryptedItem)); return Promise.all(revisions); }; export const trashItems = async (items: ItemRevision[]) => ( await Promise.all( batchRevisionsByShareId(items).map(({ shareId, Items }) => api({ url: `pass/v1/share/${shareId}/item/trash`, method: 'post', data: { Items }, }) ) ) ).flatMap(({ Items }) => Items?.Items ?? []); export const restoreItems = (items: ItemRevision[]) => Promise.all( batchRevisionsByShareId(items).map(({ shareId, Items }) => api({ url: `pass/v1/share/${shareId}/item/untrash`, method: 'post', data: { Items }, }) ) ); export const deleteItems = (items: ItemRevision[]) => Promise.all( batchRevisionsByShareId(items).map(({ shareId, Items }) => api({ url: `pass/v1/share/${shareId}/item`, method: 'delete', data: { Items }, }) ) ); export const updateItemLastUseTime = async (shareId: string, itemId: string) => ( await api({ url: `pass/v1/share/${shareId}/item/${itemId}/lastuse`, method: 'put', data: { LastUseTime: getEpoch() }, }) ).Revision!; const requestAllItemsForShareId = async ( shareId: string, onItemsLoaded?: (total: number) => void ): Promise<ItemRevisionContentsResponse[]> => { const pageIterator = async (count: number, Since?: string): Promise<ItemRevisionContentsResponse[]> => { const { Items } = await api({ url: `pass/v1/share/${shareId}/item`, method: 'get', params: Since ? { Since } : {}, }); const nextCount = count + (Items?.RevisionsData.length ?? 0); onItemsLoaded?.(nextCount); return Items?.LastToken ? Items.RevisionsData.concat(await pageIterator(nextCount, Items.LastToken)) : Items!.RevisionsData; }; return pageIterator(0); }; /* avoid throwing when decrypting items for a shareId - this avoids blocking * the user if one item is corrupted or is using a newer proto version */ export async function requestItemsForShareId( shareId: string, onItemsLoaded?: (total: number) => void ): Promise<ItemRevision[]> { const encryptedItems = await requestAllItemsForShareId(shareId, onItemsLoaded); const items = await Promise.all(encryptedItems.map((item) => parseItemRevision(shareId, item).catch(() => null))); return items.filter(truthy); } export const importItemsBatch = async (options: { shareId: string; importIntents: ItemImportIntent[]; onSkippedItem?: (skipped: ItemImportIntent) => void; }): Promise<ItemRevisionContentsResponse[]> => { const { shareId, importIntents, onSkippedItem } = options; const data: ImportItemBatchRequest = { Items: ( await Promise.all( importIntents.map(async (importIntent): Promise<Maybe<ImportItemRequest>> => { const { trashed, createTime, modifyTime, ...item } = importIntent; try { return { Item: await PassCrypto.createItem({ shareId, content: serializeItemContent(item) }), AliasEmail: item.type === 'alias' ? item.extraData.aliasEmail : null, Trashed: trashed, CreateTime: createTime ?? null, ModifyTime: modifyTime ?? null, }; } catch (e) { logger.info(`[Saga::Import] could not import "${item.metadata.name}"`); onSkippedItem?.(importIntent); return; } }) ) ).filter(truthy), }; if (data.Items.length === 0) return []; const result = await api({ url: `pass/v1/share/${shareId}/item/import/batch`, method: 'post', data, }); if (result.Revisions?.RevisionsData === undefined) { throw new Error(`Error while batch importing data`); } return result.Revisions.RevisionsData; };
7,878
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib
petrpan-code/ProtonMail/WebClients/packages/pass/lib/items/item.utils.ts
import { c } from 'ttag'; import type { ItemRevision, ItemSortFilter, ItemType, MaybeNull } from '@proton/pass/types'; import { arrayInterpolate } from '@proton/pass/utils/array/interpolate'; import { UNIX_DAY, UNIX_MONTH, UNIX_WEEK } from '@proton/pass/utils/time/constants'; import { getEpoch } from '@proton/pass/utils/time/get-epoch'; export const getItemKey = ({ shareId, itemId, revision }: ItemRevision) => `${shareId}-${itemId}-${revision}`; export const getItemActionId = ( payload: | { optimisticId: string; itemId?: string; shareId: string } | { optimisticId?: string; itemId: string; shareId: string } ) => `${payload.shareId}-${payload?.optimisticId ?? payload.itemId!}`; export const flattenItemsByShareId = (itemsByShareId: { [shareId: string]: { [itemId: string]: ItemRevision }; }): ItemRevision[] => Object.values(itemsByShareId).flatMap(Object.values); export const interpolateRecentItems = <T extends ItemRevision>(items: T[]) => (shouldInterpolate: boolean) => { type DateCluster = { label: string; boundary: number }; const now = getEpoch(); return arrayInterpolate<T, DateCluster>(items, { clusters: shouldInterpolate ? [ { // translator: label means items that have been added or edited in last 24 hours from the current moment label: c('Label').t`Today`, boundary: now - UNIX_DAY, }, { // translator: label means items that have been added or edited in last 7 days from the current moment label: c('Label').t`Last week`, boundary: now - UNIX_WEEK, }, { // translator: label means items that have been added or edited in last 14 days from the current moment label: c('Label').t`Last 2 weeks`, boundary: now - UNIX_WEEK * 2, }, { // translator: label means items that have been added or edited in last 4 weeks from the current moment label: c('Label').t`Last month`, boundary: now - UNIX_MONTH, }, ] : [], fallbackCluster: { // translator: label means items that have been added or edited more than a month ago (4 weeks) from the current moment label: c('Label').t`More than a month`, boundary: 0, }, shouldInterpolate: ({ lastUseTime, modifyTime }, { boundary }) => Math.max(lastUseTime ?? modifyTime, modifyTime) > boundary, }); }; export const filterItemsByShareId = (shareId?: MaybeNull<string>) => <T extends ItemRevision>(items: T[]) => { if (!shareId) return items; return items.filter((item) => shareId === item.shareId); }; export const filterItemsByType = (itemType?: MaybeNull<ItemType>) => <T extends ItemRevision>(items: T[]) => { if (!itemType) return items; return items.filter((item) => !itemType || itemType === item.data.type); }; export const sortItems = (sort?: MaybeNull<ItemSortFilter>) => <T extends ItemRevision>(items: T[]) => { if (!sort) return items; return items.slice().sort((a, b) => { switch (sort) { case 'createTimeASC': return a.createTime - b.createTime; case 'createTimeDESC': return b.createTime - a.createTime; case 'recent': return ( Math.max(b.lastUseTime ?? b.modifyTime, b.modifyTime) - Math.max(a.lastUseTime ?? a.modifyTime, a.modifyTime) ); case 'titleASC': return a.data.metadata.name.localeCompare(b.data.metadata.name); } }); };
7,879
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib
petrpan-code/ProtonMail/WebClients/packages/pass/lib/otp/generate.ts
import type { TOTP } from 'otpauth'; import { URI } from 'otpauth'; import type { MaybeNull, OtpCode } from '@proton/pass/types'; import { getEpoch } from '@proton/pass/utils/time/get-epoch'; export const generateTOTPCode = (totpUri?: string): MaybeNull<OtpCode> => { try { if (!totpUri) return null; const otp = URI.parse(totpUri) as TOTP; const token = otp.generate(); const timestamp = getEpoch(); const expiry = timestamp + otp.period - (timestamp % otp.period); return { token, period: otp.period, expiry }; } catch { return null; } };
7,880
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib
petrpan-code/ProtonMail/WebClients/packages/pass/lib/otp/otp.spec.ts
import { getOPTSecret, getSecretOrUri, hasDefaultOTP, parseOTPValue } from './otp'; const toOtpUri = (secret: string) => `otpauth://totp/Proton%20Pass?secret=${secret.split(' ').join('')}&algorithm=SHA1&digits=6&period=30`; describe('otp parser', () => { test('should parse raw base32 secrets', () => { [ 'NMC2NUFEYUEBIT4U', 'O45BF7XCIMXYH4WH', 'TWIG6UVT3UVHF4PW', '3AX6HCBFHX2LQKYP', '4GSMRELZ3ZUCJKTW', 'HHHLHJJZQQMNEFII', 'HEW7OP7ASXHW7YEQ', 'ETOVQFNIWOQWWV6V', ].forEach((secret) => expect(parseOTPValue(secret)).toEqual(toOtpUri(secret))); }); test('should parse base32 secrets with spaces', () => { [ 'NMC2 NUFE YUEB IT4U', 'O45B F7XC IMXY H4WH', 'TWIG 6UVT 3UVH F4PW', '3AX6 HCBF HX2L QKYP', '4GSM RELZ 3ZUC JKTW', 'HHHL HJJZ QQMN EFII', 'HEW7 OP7A SXHW 7YEQ', 'ETOV QFNI WOQW WV6V', ].forEach((secret) => expect(parseOTPValue(secret)).toEqual(toOtpUri(secret))); }); test('should fail on invalid base32 secrets', () => { [ '1MC2NUFEYUEBIT4U', '845BF7XCIMXYH4WH', '9WIG6UVT3UVHF4PW', '1AX6HCBFHX2LQKYP', '8GSMRELZ3ZUCJKTW', '9HHLHJJZQQMNEFII', '0EW7OP7ASXHW7YEQ', '1TOVQFNIWOQWWV6V', ].forEach((secret) => expect(parseOTPValue(secret)).toEqual('')); }); test('should parse OTP urls following the spec', () => { [ toOtpUri('NMC2 NUFE YUEB IT4U'), toOtpUri('O45B F7XC IMXY H4WH'), toOtpUri('TWIG 6UVT 3UVH F4PW'), toOtpUri('3AX6 HCBF HX2L QKYP'), toOtpUri('4GSM RELZ 3ZUC JKTW'), toOtpUri('HHHL HJJZ QQMN EFII'), toOtpUri('HEW7 OP7A SXHW 7YEQ'), toOtpUri('ETOV QFNI WOQW WV6V'), ].forEach((url) => expect(parseOTPValue(url)).toEqual(url)); }); test('should handle incomplete OTP urls', () => { [ [ /* missing otp auth label */ 'otpauth://totp?secret=QWERTZUIOPASDFGH&algorithm=SHA1&digits=6&period=60', 'otpauth://totp/Proton%20Pass?secret=QWERTZUIOPASDFGH&algorithm=SHA1&digits=6&period=60', ], [ /* only secret */ 'otpauth://totp?secret=QWERTZUIOPASDFGH', 'otpauth://totp/Proton%20Pass?secret=QWERTZUIOPASDFGH&algorithm=SHA1&digits=6&period=30', ], ].forEach(([uri, expected]) => expect(parseOTPValue(uri)).toEqual(expected)); }); test('should fail on invalid OTP URIs', () => { [ 'otp://totp?secret=QWERTZUIOPASDFGH&algorithm=SHA1&digits=6&period=60', 'otpauth:totp?secret=QWERTZUIOPASDFGH&algorithm=SHA1&digits=6&period=60', 'otpauth://totp?secret=QWERTZUIOPA1DFGH&algorithm=SHA1&digits=6&period=60', ].forEach((uri) => expect(parseOTPValue(uri)).toEqual('')); }); test('should hydrate label & issuer', () => { expect( parseOTPValue('otpauth://totp?secret=QWERTZUIOPASDFGH&algorithm=SHA1&digits=6&period=30', { label: 'TestLabel', issuer: 'TestIssuer', }) ).toEqual( 'otpauth://totp/TestIssuer:TestLabel?issuer=TestIssuer&secret=QWERTZUIOPASDFGH&algorithm=SHA1&digits=6&period=30' ); expect( parseOTPValue('QWERTZUIOPASDFGH', { label: 'TestLabel', issuer: 'TestIssuer', }) ).toEqual( 'otpauth://totp/TestIssuer:TestLabel?issuer=TestIssuer&secret=QWERTZUIOPASDFGH&algorithm=SHA1&digits=6&period=30' ); }); }); describe('getOPTSecret', () => { test('should return just the secret value of totpUri', () => { [ 'otpauth://totp/TestIssuer:TestLabel?issuer=TestIssuer&secret=QWERTZUIOPASDFGH&algorithm=SHA1&digits=6&period=30', 'otpauth://totp/TestIssuer:TestLabel?issuer=TestIssuer&secret=QWERTZUIOPASDFGH&algorithm=SHA1&digits=9&period=30', 'otpauth://totp/TestIssuer:TestLabel?issuer=TestIssuer&secret=QWERTZUIOPASDFGH&algorithm=SHA1&digits=6&period=45', 'otpauth://totp/TestIssuer:TestLabel?issuer=TestIssuer&secret=QWERTZUIOPASDFGH&algorithm=SHA2&digits=6&period=30', 'otpauth://totp/TestIssuer:TestLabel?issuer=TestIssuer&secret=QWERTZUIOPASDFGH', ].forEach((totpUri) => expect(getOPTSecret(totpUri)).toEqual('QWERTZUIOPASDFGH')); }); test('should return empty string when secret is missing', () => { [ 'otpauth://totp/TestIssuer:TestLabel?issuer=TestIssuer&algorithm=SHA1&digits=6&period=30', 'otpauth://totp/TestIssuer:TestLabel?issuer=TestIssuer&algorithm=SHA1&digits=9&period=30', 'otpauth://totp/TestIssuer:TestLabel?issuer=TestIssuer&algorithm=SHA1&digits=6&period=45', 'otpauth://totp/TestIssuer:TestLabel?issuer=TestIssuer&algorithm=SHA2&digits=6&period=30', 'otpauth://totp/TestIssuer:TestLabel?issuer=TestIssuer', ].forEach((totpUri) => expect(getOPTSecret(totpUri)).toEqual('')); }); }); describe('hasDefaultOTP', () => { test('should return true when 3 defaults are set', () => { ['1MC2NUFEYUEBIT4U', 'NMC2 NUFE YUEB IT4U'].forEach( (secret) => expect(hasDefaultOTP(parseOTPValue(secret))).toBeTruthy ); }); test('should return true when some of the defaults is not set at all', () => { [ 'otpauth://totp/TestIssuer:TestLabel?issuer=TestIssuer&secret=QWERTZUIOPASDFGH&algorithm=SHA1&digits=6', 'otpauth://totp/TestIssuer:TestLabel?issuer=TestIssuer&secret=QWERTZUIOPASDFGH&algorithm=SHA1&&period=30', 'otpauth://totp/TestIssuer:TestLabel?issuer=TestIssuer&secret=QWERTZUIOPASDFGH&digits=6&period=30', ].forEach((totpUri) => expect(hasDefaultOTP(totpUri)).toBeFalsy); }); test('should return false when some of the 3 defaults do not match', () => { [ 'otpauth://totp/TestIssuer:TestLabel?issuer=TestIssuer&secret=QWERTZUIOPASDFGH&algorithm=SHA2&digits=6&period=30', 'otpauth://totp/TestIssuer:TestLabel?issuer=TestIssuer&secret=QWERTZUIOPASDFGH&algorithm=SHA1&digits=9&period=30', 'otpauth://totp/TestIssuer:TestLabel?issuer=TestIssuer&secret=QWERTZUIOPASDFGH&algorithm=SHA1&digits=6&period=45', ].forEach((totpUri) => expect(hasDefaultOTP(totpUri)).toBeFalsy); }); }); describe('getSecretOrUri', () => { test('should return secret when all of the 3 defaults do match or some is not set', () => { [ 'otpauth://totp/TestIssuer:TestLabel?issuer=TestIssuer&secret=QWERTZUIOPASDFGH&algorithm=SHA1&digits=6&period=30', 'otpauth://totp/TestIssuer:TestLabel?issuer=TestIssuer&secret=QWERTZUIOPASDFGH&algorithm=SHA1&digits=6', 'otpauth://totp/TestIssuer:TestLabel?issuer=TestIssuer&secret=QWERTZUIOPASDFGH&algorithm=SHA1&period=30', 'otpauth://totp/TestIssuer:TestLabel?issuer=TestIssuer&secret=QWERTZUIOPASDFGH&digits=6&period=30', ].forEach((totpUri) => expect(getSecretOrUri(totpUri)).toEqual('QWERTZUIOPASDFGH')); }); test('should return full totpUri when some of the 3 defaults do not match', () => { [ 'otpauth://totp/TestIssuer:TestLabel?issuer=TestIssuer&secret=QWERTZUIOPASDFGH&algorithm=SHA2&digits=6&period=30', 'otpauth://totp/TestIssuer:TestLabel?issuer=TestIssuer&secret=QWERTZUIOPASDFGH&algorithm=SHA1&digits=9&period=30', 'otpauth://totp/TestIssuer:TestLabel?issuer=TestIssuer&secret=QWERTZUIOPASDFGH&algorithm=SHA1&digits=6&period=45', ].forEach((totpUri) => expect(getSecretOrUri(totpUri)).toEqual(totpUri)); }); });
7,881
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib
petrpan-code/ProtonMail/WebClients/packages/pass/lib/otp/otp.ts
import { Secret, TOTP, URI } from 'otpauth'; import type { MaybeNull } from '@proton/pass/types'; import { merge } from '@proton/pass/utils/object/merge'; import { isEmptyString } from '@proton/pass/utils/string/is-empty-string'; import { isTotpUri } from '@proton/pass/utils/url/totp'; import { getSearchParams } from '@proton/shared/lib/helpers/url'; export const OTP_DEFAULTS = { issuer: '', label: 'Proton Pass', algorithm: 'SHA1', digits: 6, period: 30, }; export const parseOTPValue = ( input: string, { label, issuer }: { label?: MaybeNull<string>; issuer?: MaybeNull<string> } = {} ): string => { if (isEmptyString(input)) return ''; try { return URI.parse(input).toString(); } catch (err) { try { if (isTotpUri(input)) { const params = getSearchParams(input.split('?')?.[1]); if (params.secret === undefined) return ''; return new TOTP( merge( OTP_DEFAULTS, { ...params, label, issuer, }, { excludeEmpty: true } ) ).toString(); } /* remove spaces, dashes and underscores */ let maybeBase32Secret = input.replace(/\s|-|_/g, ''); let secret = Secret.fromBase32(maybeBase32Secret); return new TOTP( merge( OTP_DEFAULTS, { label, issuer, secret, }, { excludeEmpty: true } ) ).toString(); } catch (err) { return ''; } } }; export const getOPTSecret = (totpUri: string): string => { const params = getSearchParams(totpUri.split('?')?.[1]); return params.secret === undefined ? '' : params.secret; }; /* we like to compare just algorithm: 'SHA1', digits: 6, period: 30, */ export const hasDefaultOTP = (totpUri: string): boolean => { const keysToCompare = ['algorithm', 'digits', 'period'] as const; const totpUriParams = getSearchParams(totpUri.split('?')?.[1]); return keysToCompare.every((key) => !(key in totpUriParams) || totpUriParams[key] === String(OTP_DEFAULTS[key])); }; /* returns just the secret when we have defaults */ export const getSecretOrUri = (totpUri: string): string => { return hasDefaultOTP(totpUri) ? getOPTSecret(totpUri) : totpUri; };
7,882
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib
petrpan-code/ProtonMail/WebClients/packages/pass/lib/password/constants.ts
/* We've removed the characters `i, o, l, I ,O ,L` to minimize * the chance of confusion. For symbols we'd like to avoid those * that prevent selecting the password when double clicking on * top of the password. */ export const uppercaseChars = 'ABCDEFGHJKMNPQRSTUVWXYZ'; export const lowercaseChars = 'abcdefghjkmnpqrstuvwxyz'; export const alphabeticChars = uppercaseChars + lowercaseChars + 'iolIOL'; export const digitChars = '0123456789'; export const specialChars = '!#$%&()*+.:;<=>?@[]^'; export const DEFAULT_PASSWORD_LENGTH = 16;
7,883
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib
petrpan-code/ProtonMail/WebClients/packages/pass/lib/password/generator.ts
import type { MemorablePasswordOptions } from './memorable'; import { generateMemorablePassword } from './memorable'; import type { RandomPasswordOptions } from './random'; import { generateRandomPassword } from './random'; export type GeneratePasswordOptions = | { type: 'random'; options: RandomPasswordOptions } | { type: 'memorable'; options: MemorablePasswordOptions }; export const generatePassword = (data: GeneratePasswordOptions) => { switch (data.type) { case 'random': return generateRandomPassword(data.options); case 'memorable': return generateMemorablePassword(data.options); } };
7,884
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib
petrpan-code/ProtonMail/WebClients/packages/pass/lib/password/memorable.spec.ts
import { digitChars, specialChars } from './constants'; import type { MemorablePasswordOptions } from './memorable'; import { SeperatorOptions, generateMemorablePassword } from './memorable'; import WORD_LIST from './wordlist.json'; const WORDS = Object.values(WORD_LIST); const wordsInList = (words: string[], options: MemorablePasswordOptions) => words.every((word) => { let originalWord = word.toLowerCase(); if (options.extraNumbers) originalWord = originalWord.slice(0, -1); return WORDS.includes(originalWord); }); const wordsMatchCapitalization = (words: string[], options: MemorablePasswordOptions) => words.every((word) => (options.capitalize ? /[A-Z]/.test(word[0]) : true)); const wordsMatchExtraNumbers = (words: string[], options: MemorablePasswordOptions) => words.every((word) => (options.extraNumbers ? /[0-9]/.test(word[word.length - 1]) : true)); describe('memorable password generator', () => { test('should throw if wordCount is 0', () => { expect(() => generateMemorablePassword({ wordCount: 0, seperator: SeperatorOptions.HYPHEN, capitalize: false, extraNumbers: false, }) ).toThrow(); }); test('generate from wordlist with basic seperators', () => { const options: MemorablePasswordOptions[] = [ { wordCount: 1, seperator: SeperatorOptions.HYPHEN, capitalize: false, extraNumbers: false }, { wordCount: 4, seperator: SeperatorOptions.HYPHEN, capitalize: false, extraNumbers: false }, { wordCount: 4, seperator: SeperatorOptions.COMMA, capitalize: true, extraNumbers: false }, { wordCount: 4, seperator: SeperatorOptions.PERIOD, capitalize: false, extraNumbers: false }, { wordCount: 4, seperator: SeperatorOptions.UNDERSCORE, capitalize: false, extraNumbers: false }, { wordCount: 4, seperator: SeperatorOptions.SPACE, capitalize: false, extraNumbers: false }, { wordCount: 5, seperator: SeperatorOptions.HYPHEN, capitalize: true, extraNumbers: false }, { wordCount: 10, seperator: SeperatorOptions.SPACE, capitalize: false, extraNumbers: false }, { wordCount: 15, seperator: SeperatorOptions.UNDERSCORE, capitalize: true, extraNumbers: false }, ]; options.forEach((options) => { const result = generateMemorablePassword(options); const words = result.split(options.seperator); expect(result).toBeDefined(); expect(words.length).toEqual(options.wordCount); expect(wordsInList(words, options)).toBe(true); expect(wordsMatchCapitalization(words, options)).toBe(true); expect(wordsMatchExtraNumbers(words, options)).toBe(true); }); }); test('generate from wordlist with random number seperator', () => { const options: MemorablePasswordOptions[] = [ { wordCount: 4, seperator: SeperatorOptions.NUMBER, capitalize: false, extraNumbers: false }, { wordCount: 5, seperator: SeperatorOptions.NUMBER, capitalize: true, extraNumbers: false }, { wordCount: 10, seperator: SeperatorOptions.NUMBER, capitalize: true, extraNumbers: false }, { wordCount: 15, seperator: SeperatorOptions.NUMBER, capitalize: false, extraNumbers: false }, ]; options.forEach((options) => { const result = generateMemorablePassword(options); const words = result.split(new RegExp(digitChars.split('').join('|'))); expect(result).toBeDefined(); expect(words.length).toEqual(options.wordCount); expect(wordsInList(words, options)).toBe(true); expect(wordsMatchCapitalization(words, options)).toBe(true); expect(wordsMatchExtraNumbers(words, options)).toBe(true); }); }); test('generate from wordlist with random number or symbol seperator', () => { const options: MemorablePasswordOptions[] = [ { wordCount: 4, seperator: SeperatorOptions.NUMBER_OR_SYMBOL, capitalize: false, extraNumbers: false }, { wordCount: 5, seperator: SeperatorOptions.NUMBER_OR_SYMBOL, capitalize: true, extraNumbers: false }, { wordCount: 10, seperator: SeperatorOptions.NUMBER_OR_SYMBOL, capitalize: true, extraNumbers: false }, { wordCount: 15, seperator: SeperatorOptions.NUMBER_OR_SYMBOL, capitalize: false, extraNumbers: false }, ]; options.forEach((options) => { const result = generateMemorablePassword(options); const words = result.split( new RegExp( digitChars .concat(specialChars) .split('') .map((char) => (specialChars.includes(char) ? `\\${char}` : char)) .join('|') ) ); expect(result).toBeDefined(); expect(words.length).toEqual(options.wordCount); expect(wordsInList(words, options)).toBe(true); expect(wordsMatchCapitalization(words, options)).toBe(true); expect(wordsMatchExtraNumbers(words, options)).toBe(true); }); }); test('should support interpolating extra numbers', () => { const options: MemorablePasswordOptions[] = [ { wordCount: 1, seperator: SeperatorOptions.HYPHEN, capitalize: false, extraNumbers: true }, { wordCount: 4, seperator: SeperatorOptions.HYPHEN, capitalize: false, extraNumbers: true }, { wordCount: 4, seperator: SeperatorOptions.COMMA, capitalize: true, extraNumbers: true }, { wordCount: 4, seperator: SeperatorOptions.PERIOD, capitalize: false, extraNumbers: true }, { wordCount: 4, seperator: SeperatorOptions.UNDERSCORE, capitalize: false, extraNumbers: true }, { wordCount: 4, seperator: SeperatorOptions.SPACE, capitalize: false, extraNumbers: true }, { wordCount: 5, seperator: SeperatorOptions.HYPHEN, capitalize: true, extraNumbers: true }, { wordCount: 10, seperator: SeperatorOptions.SPACE, capitalize: false, extraNumbers: true }, { wordCount: 15, seperator: SeperatorOptions.UNDERSCORE, capitalize: true, extraNumbers: true }, ]; options.forEach((options) => { const result = generateMemorablePassword(options); const words = result.split(options.seperator); expect(result).toBeDefined(); expect(words.length).toEqual(options.wordCount); expect(wordsInList(words, options)).toBe(true); expect(wordsMatchCapitalization(words, options)).toBe(true); expect(wordsMatchExtraNumbers(words, options)).toBe(true); }); }); });
7,885
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib
petrpan-code/ProtonMail/WebClients/packages/pass/lib/password/memorable.ts
import { c } from 'ttag'; import capitalize from '@proton/utils/capitalize'; import { digitChars, specialChars } from './constants'; import WORD_LIST from './wordlist.json'; export enum SeperatorOptions { HYPHEN = '-', SPACE = ' ', PERIOD = '.', COMMA = ',', UNDERSCORE = '_', NUMBER = 'NUMBER', NUMBER_OR_SYMBOL = 'NUMBER_OR_SYMBOL', } export const getSeperatorTranslation = (seperator: SeperatorOptions) => ({ [SeperatorOptions.HYPHEN]: c('Option').t`Hyphens`, [SeperatorOptions.SPACE]: c('Option').t`Spaces`, [SeperatorOptions.PERIOD]: c('Option').t`Periods`, [SeperatorOptions.COMMA]: c('Option').t`Commas`, [SeperatorOptions.UNDERSCORE]: c('Option').t`Underscores`, [SeperatorOptions.NUMBER]: c('Option').t`Numbers`, [SeperatorOptions.NUMBER_OR_SYMBOL]: c('Option').t`Numbers and Symbols`, })[seperator]; export type MemorablePasswordOptions = { wordCount: number; seperator: SeperatorOptions; capitalize: boolean; extraNumbers: boolean; }; const getRandomCharacter = (characters: string) => { const seed = Array.from(crypto.getRandomValues(new Uint8Array(1))); const idx = seed.map((val) => val % characters.length)[0]; return characters[idx]; }; const getSeperator = (seperator: SeperatorOptions): string => { switch (seperator) { case SeperatorOptions.HYPHEN: return '-'; case SeperatorOptions.SPACE: return ' '; case SeperatorOptions.PERIOD: return '.'; case SeperatorOptions.COMMA: return ','; case SeperatorOptions.UNDERSCORE: return '_'; case SeperatorOptions.NUMBER: return getRandomCharacter(digitChars); case SeperatorOptions.NUMBER_OR_SYMBOL: return getRandomCharacter(digitChars.concat(specialChars)); } }; export const generateMemorablePassword = (options: MemorablePasswordOptions): string => { if (options.wordCount <= 0) throw new Error('invalid options'); const getRandomWord = () => { const wordId = Array.from(crypto.getRandomValues(new Uint8Array(5))) .map((num) => (num % 6) + 1) .join('') as keyof typeof WORD_LIST; return WORD_LIST[wordId]; }; return Array.from({ length: options.wordCount }, () => { let word = getRandomWord(); if (options.capitalize) word = capitalize(word)!; if (options.extraNumbers) word = `${word}${getRandomCharacter(digitChars)}`; return word; }).reduce<string>( (password, word, idx) => (idx === 0 ? word : `${password}${getSeperator(options.seperator)}${word}`), '' ); };
7,886
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib
petrpan-code/ProtonMail/WebClients/packages/pass/lib/password/random.spec.ts
import { specialChars } from './constants'; import type { RandomPasswordOptions } from './random'; import { generateRandomPassword } from './random'; const passwordMatchesOptions = (password: string, options: RandomPasswordOptions) => { const validLength = password.length === options.length; const validUppercase = !options.useUppercase || /[A-Z]/.test(password); const validDigits = !options.useDigits || /[0-9]/.test(password); const validSpecialChars = !options.useSpecialChars || new RegExp( specialChars .split('') .map((char) => (specialChars.includes(char) ? `\\${char}` : char)) .join('|') ).test(password); return validLength && validUppercase && validDigits && validSpecialChars; }; describe('random password generator', () => { test('should throw if password length is smaller than 4', () => { expect(() => generateRandomPassword({ length: 3, useDigits: true, useSpecialChars: true, useUppercase: true, }) ).toThrow(); expect(() => generateRandomPassword({ length: 0, useDigits: true, useSpecialChars: true, useUppercase: true, }) ).toThrow(); }); test('supports lowercase mode', () => { const options: RandomPasswordOptions[] = [ { length: 4, useDigits: false, useSpecialChars: false, useUppercase: false }, { length: 5, useDigits: false, useSpecialChars: false, useUppercase: false }, { length: 10, useDigits: false, useSpecialChars: false, useUppercase: false }, { length: 15, useDigits: false, useSpecialChars: false, useUppercase: false }, { length: 20, useDigits: false, useSpecialChars: false, useUppercase: false }, ]; options.forEach((option) => expect(passwordMatchesOptions(generateRandomPassword(option), option)).toBe(true)); }); test('supports uppercase mode', () => { const options: RandomPasswordOptions[] = [ { length: 4, useDigits: false, useSpecialChars: false, useUppercase: true }, { length: 5, useDigits: false, useSpecialChars: false, useUppercase: true }, { length: 10, useDigits: false, useSpecialChars: false, useUppercase: true }, { length: 15, useDigits: false, useSpecialChars: false, useUppercase: true }, { length: 20, useDigits: false, useSpecialChars: false, useUppercase: true }, ]; options.forEach((option) => expect(passwordMatchesOptions(generateRandomPassword(option), option)).toBe(true)); }); test('supports digits mode', () => { const options: RandomPasswordOptions[] = [ { length: 4, useDigits: true, useSpecialChars: false, useUppercase: false }, { length: 5, useDigits: true, useSpecialChars: false, useUppercase: false }, { length: 10, useDigits: true, useSpecialChars: false, useUppercase: false }, { length: 15, useDigits: true, useSpecialChars: false, useUppercase: false }, { length: 20, useDigits: true, useSpecialChars: false, useUppercase: false }, ]; options.forEach((option) => expect(passwordMatchesOptions(generateRandomPassword(option), option)).toBe(true)); }); test('supports special mode', () => { const options: RandomPasswordOptions[] = [ { length: 4, useDigits: false, useSpecialChars: true, useUppercase: false }, { length: 5, useDigits: false, useSpecialChars: true, useUppercase: false }, { length: 10, useDigits: false, useSpecialChars: true, useUppercase: false }, { length: 15, useDigits: false, useSpecialChars: true, useUppercase: false }, { length: 20, useDigits: false, useSpecialChars: true, useUppercase: false }, ]; options.forEach((option) => expect(passwordMatchesOptions(generateRandomPassword(option), option)).toBe(true)); }); test('supports combinations', () => { const options: RandomPasswordOptions[] = [ { length: 4, useDigits: true, useSpecialChars: true, useUppercase: true }, { length: 5, useDigits: false, useSpecialChars: true, useUppercase: true }, { length: 10, useDigits: true, useSpecialChars: false, useUppercase: true }, { length: 15, useDigits: true, useSpecialChars: true, useUppercase: false }, { length: 20, useDigits: true, useSpecialChars: true, useUppercase: true }, ]; options.forEach((option) => expect(passwordMatchesOptions(generateRandomPassword(option), option)).toBe(true)); }); test('password validation recursion sanity check', () => { const options: RandomPasswordOptions[] = Array.from({ length: 1000 }, () => ({ length: 4, useDigits: true, useSpecialChars: true, useUppercase: true, })); options.forEach((option) => { let counter = 0; generateRandomPassword(option, () => counter++); expect(counter).toBeLessThan(100); }); }); });
7,887
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib
petrpan-code/ProtonMail/WebClients/packages/pass/lib/password/random.ts
import { digitChars, lowercaseChars, specialChars, uppercaseChars } from './constants'; export type RandomPasswordOptions = { length: number; useSpecialChars: boolean; useDigits: boolean; useUppercase: boolean; }; const resolveCharList = (options: RandomPasswordOptions): string => { let charList = lowercaseChars; if (options.useUppercase) charList = charList.concat(uppercaseChars); if (options.useDigits) charList = charList.concat(digitChars); if (options.useSpecialChars) charList = charList.concat(specialChars); return charList; }; const validatePassword = (password: string, options: RandomPasswordOptions) => { const chars = password.split(''); if (options.useUppercase && !chars.some((char) => uppercaseChars.includes(char))) return false; if (options.useDigits && !chars.some((char) => digitChars.includes(char))) return false; if (options.useSpecialChars && !chars.some((char) => specialChars.includes(char))) return false; return true; }; export const generateRandomPassword = (options: RandomPasswordOptions, counter?: () => void): string => { if (options.length < 4) throw new Error('invalid password length'); counter?.(); /* used in tests for recursion monitoring */ const charList = resolveCharList(options); const randomValues = crypto.getRandomValues(new Uint8Array(options.length)); const password = Array.from(randomValues) .map((val) => charList[val % charList.length]) .join(''); return validatePassword(password, options) ? password : generateRandomPassword(options, counter); };
7,888
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib
petrpan-code/ProtonMail/WebClients/packages/pass/lib/password/wordlist.json
{ "11111": "abacus", "11112": "abdomen", "11113": "abdominal", "11114": "abide", "11115": "abiding", "11116": "ability", "11121": "ablaze", "11122": "able", "11123": "abnormal", "11124": "abrasion", "11125": "abrasive", "11126": "abreast", "11131": "abridge", "11132": "abroad", "11133": "abruptly", "11134": "absence", "11135": "absentee", "11136": "absently", "11141": "absinthe", "11142": "absolute", "11143": "absolve", "11144": "abstain", "11145": "abstract", "11146": "absurd", "11151": "accent", "11152": "acclaim", "11153": "acclimate", "11154": "accompany", "11155": "account", "11156": "accuracy", "11161": "accurate", "11162": "accustom", "11163": "acetone", "11164": "achiness", "11165": "aching", "11166": "acid", "11211": "acorn", "11212": "acquaint", "11213": "acquire", "11214": "acre", "11215": "acrobat", "11216": "acronym", "11221": "acting", "11222": "action", "11223": "activate", "11224": "activator", "11225": "active", "11226": "activism", "11231": "activist", "11232": "activity", "11233": "actress", "11234": "acts", "11235": "acutely", "11236": "acuteness", "11241": "aeration", "11242": "aerobics", "11243": "aerosol", "11244": "aerospace", "11245": "afar", "11246": "affair", "11251": "affected", "11252": "affecting", "11253": "affection", "11254": "affidavit", "11255": "affiliate", "11256": "affirm", "11261": "affix", "11262": "afflicted", "11263": "affluent", "11264": "afford", "11265": "affront", "11266": "aflame", "11311": "afloat", "11312": "aflutter", "11313": "afoot", "11314": "afraid", "11315": "afterglow", "11316": "afterlife", "11321": "aftermath", "11322": "aftermost", "11323": "afternoon", "11324": "aged", "11325": "ageless", "11326": "agency", "11331": "agenda", "11332": "agent", "11333": "aggregate", "11334": "aghast", "11335": "agile", "11336": "agility", "11341": "aging", "11342": "agnostic", "11343": "agonize", "11344": "agonizing", "11345": "agony", "11346": "agreeable", "11351": "agreeably", "11352": "agreed", "11353": "agreeing", "11354": "agreement", "11355": "aground", "11356": "ahead", "11361": "ahoy", "11362": "aide", "11363": "aids", "11364": "aim", "11365": "ajar", "11366": "alabaster", "11411": "alarm", "11412": "albatross", "11413": "album", "11414": "alfalfa", "11415": "algebra", "11416": "algorithm", "11421": "alias", "11422": "alibi", "11423": "alienable", "11424": "alienate", "11425": "aliens", "11426": "alike", "11431": "alive", "11432": "alkaline", "11433": "alkalize", "11434": "almanac", "11435": "almighty", "11436": "almost", "11441": "aloe", "11442": "aloft", "11443": "aloha", "11444": "alone", "11445": "alongside", "11446": "aloof", "11451": "alphabet", "11452": "alright", "11453": "although", "11454": "altitude", "11455": "alto", "11456": "aluminum", "11461": "alumni", "11462": "always", "11463": "amaretto", "11464": "amaze", "11465": "amazingly", "11466": "amber", "11511": "ambiance", "11512": "ambiguity", "11513": "ambiguous", "11514": "ambition", "11515": "ambitious", "11516": "ambulance", "11521": "ambush", "11522": "amendable", "11523": "amendment", "11524": "amends", "11525": "amenity", "11526": "amiable", "11531": "amicably", "11532": "amid", "11533": "amigo", "11534": "amino", "11535": "amiss", "11536": "ammonia", "11541": "ammonium", "11542": "amnesty", "11543": "amniotic", "11544": "among", "11545": "amount", "11546": "amperage", "11551": "ample", "11552": "amplifier", "11553": "amplify", "11554": "amply", "11555": "amuck", "11556": "amulet", "11561": "amusable", "11562": "amused", "11563": "amusement", "11564": "amuser", "11565": "amusing", "11566": "anaconda", "11611": "anaerobic", "11612": "anagram", "11613": "anatomist", "11614": "anatomy", "11615": "anchor", "11616": "anchovy", "11621": "ancient", "11622": "android", "11623": "anemia", "11624": "anemic", "11625": "aneurism", "11626": "anew", "11631": "angelfish", "11632": "angelic", "11633": "anger", "11634": "angled", "11635": "angler", "11636": "angles", "11641": "angling", "11642": "angrily", "11643": "angriness", "11644": "anguished", "11645": "angular", "11646": "animal", "11651": "animate", "11652": "animating", "11653": "animation", "11654": "animator", "11655": "anime", "11656": "animosity", "11661": "ankle", "11662": "annex", "11663": "annotate", "11664": "announcer", "11665": "annoying", "11666": "annually", "12111": "annuity", "12112": "anointer", "12113": "another", "12114": "answering", "12115": "antacid", "12116": "antarctic", "12121": "anteater", "12122": "antelope", "12123": "antennae", "12124": "anthem", "12125": "anthill", "12126": "anthology", "12131": "antibody", "12132": "antics", "12133": "antidote", "12134": "antihero", "12135": "antiquely", "12136": "antiques", "12141": "antiquity", "12142": "antirust", "12143": "antitoxic", "12144": "antitrust", "12145": "antiviral", "12146": "antivirus", "12151": "antler", "12152": "antonym", "12153": "antsy", "12154": "anvil", "12155": "anybody", "12156": "anyhow", "12161": "anymore", "12162": "anyone", "12163": "anyplace", "12164": "anything", "12165": "anytime", "12166": "anyway", "12211": "anywhere", "12212": "aorta", "12213": "apache", "12214": "apostle", "12215": "appealing", "12216": "appear", "12221": "appease", "12222": "appeasing", "12223": "appendage", "12224": "appendix", "12225": "appetite", "12226": "appetizer", "12231": "applaud", "12232": "applause", "12233": "apple", "12234": "appliance", "12235": "applicant", "12236": "applied", "12241": "apply", "12242": "appointee", "12243": "appraisal", "12244": "appraiser", "12245": "apprehend", "12246": "approach", "12251": "approval", "12252": "approve", "12253": "apricot", "12254": "april", "12255": "apron", "12256": "aptitude", "12261": "aptly", "12262": "aqua", "12263": "aqueduct", "12264": "arbitrary", "12265": "arbitrate", "12266": "ardently", "12311": "area", "12312": "arena", "12313": "arguable", "12314": "arguably", "12315": "argue", "12316": "arise", "12321": "armadillo", "12322": "armband", "12323": "armchair", "12324": "armed", "12325": "armful", "12326": "armhole", "12331": "arming", "12332": "armless", "12333": "armoire", "12334": "armored", "12335": "armory", "12336": "armrest", "12341": "army", "12342": "aroma", "12343": "arose", "12344": "around", "12345": "arousal", "12346": "arrange", "12351": "array", "12352": "arrest", "12353": "arrival", "12354": "arrive", "12355": "arrogance", "12356": "arrogant", "12361": "arson", "12362": "art", "12363": "ascend", "12364": "ascension", "12365": "ascent", "12366": "ascertain", "12411": "ashamed", "12412": "ashen", "12413": "ashes", "12414": "ashy", "12415": "aside", "12416": "askew", "12421": "asleep", "12422": "asparagus", "12423": "aspect", "12424": "aspirate", "12425": "aspire", "12426": "aspirin", "12431": "astonish", "12432": "astound", "12433": "astride", "12434": "astrology", "12435": "astronaut", "12436": "astronomy", "12441": "astute", "12442": "atlantic", "12443": "atlas", "12444": "atom", "12445": "atonable", "12446": "atop", "12451": "atrium", "12452": "atrocious", "12453": "atrophy", "12454": "attach", "12455": "attain", "12456": "attempt", "12461": "attendant", "12462": "attendee", "12463": "attention", "12464": "attentive", "12465": "attest", "12466": "attic", "12511": "attire", "12512": "attitude", "12513": "attractor", "12514": "attribute", "12515": "atypical", "12516": "auction", "12521": "audacious", "12522": "audacity", "12523": "audible", "12524": "audibly", "12525": "audience", "12526": "audio", "12531": "audition", "12532": "augmented", "12533": "august", "12534": "authentic", "12535": "author", "12536": "autism", "12541": "autistic", "12542": "autograph", "12543": "automaker", "12544": "automated", "12545": "automatic", "12546": "autopilot", "12551": "available", "12552": "avalanche", "12553": "avatar", "12554": "avenge", "12555": "avenging", "12556": "avenue", "12561": "average", "12562": "aversion", "12563": "avert", "12564": "aviation", "12565": "aviator", "12566": "avid", "12611": "avoid", "12612": "await", "12613": "awaken", "12614": "award", "12615": "aware", "12616": "awhile", "12621": "awkward", "12622": "awning", "12623": "awoke", "12624": "awry", "12625": "axis", "12626": "babble", "12631": "babbling", "12632": "babied", "12633": "baboon", "12634": "backache", "12635": "backboard", "12636": "backboned", "12641": "backdrop", "12642": "backed", "12643": "backer", "12644": "backfield", "12645": "backfire", "12646": "backhand", "12651": "backing", "12652": "backlands", "12653": "backlash", "12654": "backless", "12655": "backlight", "12656": "backlit", "12661": "backlog", "12662": "backpack", "12663": "backpedal", "12664": "backrest", "12665": "backroom", "12666": "backshift", "13111": "backside", "13112": "backslid", "13113": "backspace", "13114": "backspin", "13115": "backstab", "13116": "backstage", "13121": "backtalk", "13122": "backtrack", "13123": "backup", "13124": "backward", "13125": "backwash", "13126": "backwater", "13131": "backyard", "13132": "bacon", "13133": "bacteria", "13134": "bacterium", "13135": "badass", "13136": "badge", "13141": "badland", "13142": "badly", "13143": "badness", "13144": "baffle", "13145": "baffling", "13146": "bagel", "13151": "bagful", "13152": "baggage", "13153": "bagged", "13154": "baggie", "13155": "bagginess", "13156": "bagging", "13161": "baggy", "13162": "bagpipe", "13163": "baguette", "13164": "baked", "13165": "bakery", "13166": "bakeshop", "13211": "baking", "13212": "balance", "13213": "balancing", "13214": "balcony", "13215": "balmy", "13216": "balsamic", "13221": "bamboo", "13222": "banana", "13223": "banish", "13224": "banister", "13225": "banjo", "13226": "bankable", "13231": "bankbook", "13232": "banked", "13233": "banker", "13234": "banking", "13235": "banknote", "13236": "bankroll", "13241": "banner", "13242": "bannister", "13243": "banshee", "13244": "banter", "13245": "barbecue", "13246": "barbed", "13251": "barbell", "13252": "barber", "13253": "barcode", "13254": "barge", "13255": "bargraph", "13256": "barista", "13261": "baritone", "13262": "barley", "13263": "barmaid", "13264": "barman", "13265": "barn", "13266": "barometer", "13311": "barrack", "13312": "barracuda", "13313": "barrel", "13314": "barrette", "13315": "barricade", "13316": "barrier", "13321": "barstool", "13322": "bartender", "13323": "barterer", "13324": "bash", "13325": "basically", "13326": "basics", "13331": "basil", "13332": "basin", "13333": "basis", "13334": "basket", "13335": "batboy", "13336": "batch", "13341": "bath", "13342": "baton", "13343": "bats", "13344": "battalion", "13345": "battered", "13346": "battering", "13351": "battery", "13352": "batting", "13353": "battle", "13354": "bauble", "13355": "bazooka", "13356": "blabber", "13361": "bladder", "13362": "blade", "13363": "blah", "13364": "blame", "13365": "blaming", "13366": "blanching", "13411": "blandness", "13412": "blank", "13413": "blaspheme", "13414": "blasphemy", "13415": "blast", "13416": "blatancy", "13421": "blatantly", "13422": "blazer", "13423": "blazing", "13424": "bleach", "13425": "bleak", "13426": "bleep", "13431": "blemish", "13432": "blend", "13433": "bless", "13434": "blighted", "13435": "blimp", "13436": "bling", "13441": "blinked", "13442": "blinker", "13443": "blinking", "13444": "blinks", "13445": "blip", "13446": "blissful", "13451": "blitz", "13452": "blizzard", "13453": "bloated", "13454": "bloating", "13455": "blob", "13456": "blog", "13461": "bloomers", "13462": "blooming", "13463": "blooper", "13464": "blot", "13465": "blouse", "13466": "blubber", "13511": "bluff", "13512": "bluish", "13513": "blunderer", "13514": "blunt", "13515": "blurb", "13516": "blurred", "13521": "blurry", "13522": "blurt", "13523": "blush", "13524": "blustery", "13525": "boaster", "13526": "boastful", "13531": "boasting", "13532": "boat", "13533": "bobbed", "13534": "bobbing", "13535": "bobble", "13536": "bobcat", "13541": "bobsled", "13542": "bobtail", "13543": "bodacious", "13544": "body", "13545": "bogged", "13546": "boggle", "13551": "bogus", "13552": "boil", "13553": "bok", "13554": "bolster", "13555": "bolt", "13556": "bonanza", "13561": "bonded", "13562": "bonding", "13563": "bondless", "13564": "boned", "13565": "bonehead", "13566": "boneless", "13611": "bonelike", "13612": "boney", "13613": "bonfire", "13614": "bonnet", "13615": "bonsai", "13616": "bonus", "13621": "bony", "13622": "boogeyman", "13623": "boogieman", "13624": "book", "13625": "boondocks", "13626": "booted", "13631": "booth", "13632": "bootie", "13633": "booting", "13634": "bootlace", "13635": "bootleg", "13636": "boots", "13641": "boozy", "13642": "borax", "13643": "boring", "13644": "borough", "13645": "borrower", "13646": "borrowing", "13651": "boss", "13652": "botanical", "13653": "botanist", "13654": "botany", "13655": "botch", "13656": "both", "13661": "bottle", "13662": "bottling", "13663": "bottom", "13664": "bounce", "13665": "bouncing", "13666": "bouncy", "14111": "bounding", "14112": "boundless", "14113": "bountiful", "14114": "bovine", "14115": "boxcar", "14116": "boxer", "14121": "boxing", "14122": "boxlike", "14123": "boxy", "14124": "breach", "14125": "breath", "14126": "breeches", "14131": "breeching", "14132": "breeder", "14133": "breeding", "14134": "breeze", "14135": "breezy", "14136": "brethren", "14141": "brewery", "14142": "brewing", "14143": "briar", "14144": "bribe", "14145": "brick", "14146": "bride", "14151": "bridged", "14152": "brigade", "14153": "bright", "14154": "brilliant", "14155": "brim", "14156": "bring", "14161": "brink", "14162": "brisket", "14163": "briskly", "14164": "briskness", "14165": "bristle", "14166": "brittle", "14211": "broadband", "14212": "broadcast", "14213": "broaden", "14214": "broadly", "14215": "broadness", "14216": "broadside", "14221": "broadways", "14222": "broiler", "14223": "broiling", "14224": "broken", "14225": "broker", "14226": "bronchial", "14231": "bronco", "14232": "bronze", "14233": "bronzing", "14234": "brook", "14235": "broom", "14236": "brought", "14241": "browbeat", "14242": "brownnose", "14243": "browse", "14244": "browsing", "14245": "bruising", "14246": "brunch", "14251": "brunette", "14252": "brunt", "14253": "brush", "14254": "brussels", "14255": "brute", "14256": "brutishly", "14261": "bubble", "14262": "bubbling", "14263": "bubbly", "14264": "buccaneer", "14265": "bucked", "14266": "bucket", "14311": "buckle", "14312": "buckshot", "14313": "buckskin", "14314": "bucktooth", "14315": "buckwheat", "14316": "buddhism", "14321": "buddhist", "14322": "budding", "14323": "buddy", "14324": "budget", "14325": "buffalo", "14326": "buffed", "14331": "buffer", "14332": "buffing", "14333": "buffoon", "14334": "buggy", "14335": "bulb", "14336": "bulge", "14341": "bulginess", "14342": "bulgur", "14343": "bulk", "14344": "bulldog", "14345": "bulldozer", "14346": "bullfight", "14351": "bullfrog", "14352": "bullhorn", "14353": "bullion", "14354": "bullish", "14355": "bullpen", "14356": "bullring", "14361": "bullseye", "14362": "bullwhip", "14363": "bully", "14364": "bunch", "14365": "bundle", "14366": "bungee", "14411": "bunion", "14412": "bunkbed", "14413": "bunkhouse", "14414": "bunkmate", "14415": "bunny", "14416": "bunt", "14421": "busboy", "14422": "bush", "14423": "busily", "14424": "busload", "14425": "bust", "14426": "busybody", "14431": "buzz", "14432": "cabana", "14433": "cabbage", "14434": "cabbie", "14435": "cabdriver", "14436": "cable", "14441": "caboose", "14442": "cache", "14443": "cackle", "14444": "cacti", "14445": "cactus", "14446": "caddie", "14451": "caddy", "14452": "cadet", "14453": "cadillac", "14454": "cadmium", "14455": "cage", "14456": "cahoots", "14461": "cake", "14462": "calamari", "14463": "calamity", "14464": "calcium", "14465": "calculate", "14466": "calculus", "14511": "caliber", "14512": "calibrate", "14513": "calm", "14514": "caloric", "14515": "calorie", "14516": "calzone", "14521": "camcorder", "14522": "cameo", "14523": "camera", "14524": "camisole", "14525": "camper", "14526": "campfire", "14531": "camping", "14532": "campsite", "14533": "campus", "14534": "canal", "14535": "canary", "14536": "cancel", "14541": "candied", "14542": "candle", "14543": "candy", "14544": "cane", "14545": "canine", "14546": "canister", "14551": "cannabis", "14552": "canned", "14553": "canning", "14554": "cannon", "14555": "cannot", "14556": "canola", "14561": "canon", "14562": "canopener", "14563": "canopy", "14564": "canteen", "14565": "canyon", "14566": "capable", "14611": "capably", "14612": "capacity", "14613": "cape", "14614": "capillary", "14615": "capital", "14616": "capitol", "14621": "capped", "14622": "capricorn", "14623": "capsize", "14624": "capsule", "14625": "caption", "14626": "captivate", "14631": "captive", "14632": "captivity", "14633": "capture", "14634": "caramel", "14635": "carat", "14636": "caravan", "14641": "carbon", "14642": "cardboard", "14643": "carded", "14644": "cardiac", "14645": "cardigan", "14646": "cardinal", "14651": "cardstock", "14652": "carefully", "14653": "caregiver", "14654": "careless", "14655": "caress", "14656": "caretaker", "14661": "cargo", "14662": "caring", "14663": "carless", "14664": "carload", "14665": "carmaker", "14666": "carnage", "15111": "carnation", "15112": "carnival", "15113": "carnivore", "15114": "carol", "15115": "carpenter", "15116": "carpentry", "15121": "carpool", "15122": "carport", "15123": "carried", "15124": "carrot", "15125": "carrousel", "15126": "carry", "15131": "cartel", "15132": "cartload", "15133": "carton", "15134": "cartoon", "15135": "cartridge", "15136": "cartwheel", "15141": "carve", "15142": "carving", "15143": "carwash", "15144": "cascade", "15145": "case", "15146": "cash", "15151": "casing", "15152": "casino", "15153": "casket", "15154": "cassette", "15155": "casually", "15156": "casualty", "15161": "catacomb", "15162": "catalog", "15163": "catalyst", "15164": "catalyze", "15165": "catapult", "15166": "cataract", "15211": "catatonic", "15212": "catcall", "15213": "catchable", "15214": "catcher", "15215": "catching", "15216": "catchy", "15221": "caterer", "15222": "catering", "15223": "catfight", "15224": "catfish", "15225": "cathedral", "15226": "cathouse", "15231": "catlike", "15232": "catnap", "15233": "catnip", "15234": "catsup", "15235": "cattail", "15236": "cattishly", "15241": "cattle", "15242": "catty", "15243": "catwalk", "15244": "caucasian", "15245": "caucus", "15246": "causal", "15251": "causation", "15252": "cause", "15253": "causing", "15254": "cauterize", "15255": "caution", "15256": "cautious", "15261": "cavalier", "15262": "cavalry", "15263": "caviar", "15264": "cavity", "15265": "cedar", "15266": "celery", "15311": "celestial", "15312": "celibacy", "15313": "celibate", "15314": "celtic", "15315": "cement", "15316": "census", "15321": "ceramics", "15322": "ceremony", "15323": "certainly", "15324": "certainty", "15325": "certified", "15326": "certify", "15331": "cesarean", "15332": "cesspool", "15333": "chafe", "15334": "chaffing", "15335": "chain", "15336": "chair", "15341": "chalice", "15342": "challenge", "15343": "chamber", "15344": "chamomile", "15345": "champion", "15346": "chance", "15351": "change", "15352": "channel", "15353": "chant", "15354": "chaos", "15355": "chaperone", "15356": "chaplain", "15361": "chapped", "15362": "chaps", "15363": "chapter", "15364": "character", "15365": "charbroil", "15366": "charcoal", "15411": "charger", "15412": "charging", "15413": "chariot", "15414": "charity", "15415": "charm", "15416": "charred", "15421": "charter", "15422": "charting", "15423": "chase", "15424": "chasing", "15425": "chaste", "15426": "chastise", "15431": "chastity", "15432": "chatroom", "15433": "chatter", "15434": "chatting", "15435": "chatty", "15436": "cheating", "15441": "cheddar", "15442": "cheek", "15443": "cheer", "15444": "cheese", "15445": "cheesy", "15446": "chef", "15451": "chemicals", "15452": "chemist", "15453": "chemo", "15454": "cherisher", "15455": "cherub", "15456": "chess", "15461": "chest", "15462": "chevron", "15463": "chevy", "15464": "chewable", "15465": "chewer", "15466": "chewing", "15511": "chewy", "15512": "chief", "15513": "chihuahua", "15514": "childcare", "15515": "childhood", "15516": "childish", "15521": "childless", "15522": "childlike", "15523": "chili", "15524": "chill", "15525": "chimp", "15526": "chip", "15531": "chirping", "15532": "chirpy", "15533": "chitchat", "15534": "chivalry", "15535": "chive", "15536": "chloride", "15541": "chlorine", "15542": "choice", "15543": "chokehold", "15544": "choking", "15545": "chomp", "15546": "chooser", "15551": "choosing", "15552": "choosy", "15553": "chop", "15554": "chosen", "15555": "chowder", "15556": "chowtime", "15561": "chrome", "15562": "chubby", "15563": "chuck", "15564": "chug", "15565": "chummy", "15566": "chump", "15611": "chunk", "15612": "churn", "15613": "chute", "15614": "cider", "15615": "cilantro", "15616": "cinch", "15621": "cinema", "15622": "cinnamon", "15623": "circle", "15624": "circling", "15625": "circular", "15626": "circulate", "15631": "circus", "15632": "citable", "15633": "citadel", "15634": "citation", "15635": "citizen", "15636": "citric", "15641": "citrus", "15642": "city", "15643": "civic", "15644": "civil", "15645": "clad", "15646": "claim", "15651": "clambake", "15652": "clammy", "15653": "clamor", "15654": "clamp", "15655": "clamshell", "15656": "clang", "15661": "clanking", "15662": "clapped", "15663": "clapper", "15664": "clapping", "15665": "clarify", "15666": "clarinet", "16111": "clarity", "16112": "clash", "16113": "clasp", "16114": "class", "16115": "clatter", "16116": "clause", "16121": "clavicle", "16122": "claw", "16123": "clay", "16124": "clean", "16125": "clear", "16126": "cleat", "16131": "cleaver", "16132": "cleft", "16133": "clench", "16134": "clergyman", "16135": "clerical", "16136": "clerk", "16141": "clever", "16142": "clicker", "16143": "client", "16144": "climate", "16145": "climatic", "16146": "cling", "16151": "clinic", "16152": "clinking", "16153": "clip", "16154": "clique", "16155": "cloak", "16156": "clobber", "16161": "clock", "16162": "clone", "16163": "cloning", "16164": "closable", "16165": "closure", "16166": "clothes", "16211": "clothing", "16212": "cloud", "16213": "clover", "16214": "clubbed", "16215": "clubbing", "16216": "clubhouse", "16221": "clump", "16222": "clumsily", "16223": "clumsy", "16224": "clunky", "16225": "clustered", "16226": "clutch", "16231": "clutter", "16232": "coach", "16233": "coagulant", "16234": "coastal", "16235": "coaster", "16236": "coasting", "16241": "coastland", "16242": "coastline", "16243": "coat", "16244": "coauthor", "16245": "cobalt", "16246": "cobbler", "16251": "cobweb", "16252": "cocoa", "16253": "coconut", "16254": "cod", "16255": "coeditor", "16256": "coerce", "16261": "coexist", "16262": "coffee", "16263": "cofounder", "16264": "cognition", "16265": "cognitive", "16266": "cogwheel", "16311": "coherence", "16312": "coherent", "16313": "cohesive", "16314": "coil", "16315": "coke", "16316": "cola", "16321": "cold", "16322": "coleslaw", "16323": "coliseum", "16324": "collage", "16325": "collapse", "16326": "collar", "16331": "collected", "16332": "collector", "16333": "collide", "16334": "collie", "16335": "collision", "16336": "colonial", "16341": "colonist", "16342": "colonize", "16343": "colony", "16344": "colossal", "16345": "colt", "16346": "coma", "16351": "come", "16352": "comfort", "16353": "comfy", "16354": "comic", "16355": "coming", "16356": "comma", "16361": "commence", "16362": "commend", "16363": "comment", "16364": "commerce", "16365": "commode", "16366": "commodity", "16411": "commodore", "16412": "common", "16413": "commotion", "16414": "commute", "16415": "commuting", "16416": "compacted", "16421": "compacter", "16422": "compactly", "16423": "compactor", "16424": "companion", "16425": "company", "16426": "compare", "16431": "compel", "16432": "compile", "16433": "comply", "16434": "component", "16435": "composed", "16436": "composer", "16441": "composite", "16442": "compost", "16443": "composure", "16444": "compound", "16445": "compress", "16446": "comprised", "16451": "computer", "16452": "computing", "16453": "comrade", "16454": "concave", "16455": "conceal", "16456": "conceded", "16461": "concept", "16462": "concerned", "16463": "concert", "16464": "conch", "16465": "concierge", "16466": "concise", "16511": "conclude", "16512": "concrete", "16513": "concur", "16514": "condense", "16515": "condiment", "16516": "condition", "16521": "condone", "16522": "conducive", "16523": "conductor", "16524": "conduit", "16525": "cone", "16526": "confess", "16531": "confetti", "16532": "confidant", "16533": "confident", "16534": "confider", "16535": "confiding", "16536": "configure", "16541": "confined", "16542": "confining", "16543": "confirm", "16544": "conflict", "16545": "conform", "16546": "confound", "16551": "confront", "16552": "confused", "16553": "confusing", "16554": "confusion", "16555": "congenial", "16556": "congested", "16561": "congrats", "16562": "congress", "16563": "conical", "16564": "conjoined", "16565": "conjure", "16566": "conjuror", "16611": "connected", "16612": "connector", "16613": "consensus", "16614": "consent", "16615": "console", "16616": "consoling", "16621": "consonant", "16622": "constable", "16623": "constant", "16624": "constrain", "16625": "constrict", "16626": "construct", "16631": "consult", "16632": "consumer", "16633": "consuming", "16634": "contact", "16635": "container", "16636": "contempt", "16641": "contend", "16642": "contented", "16643": "contently", "16644": "contents", "16645": "contest", "16646": "context", "16651": "contort", "16652": "contour", "16653": "contrite", "16654": "control", "16655": "contusion", "16656": "convene", "16661": "convent", "16662": "copartner", "16663": "cope", "16664": "copied", "16665": "copier", "16666": "copilot", "21111": "coping", "21112": "copious", "21113": "copper", "21114": "copy", "21115": "coral", "21116": "cork", "21121": "cornball", "21122": "cornbread", "21123": "corncob", "21124": "cornea", "21125": "corned", "21126": "corner", "21131": "cornfield", "21132": "cornflake", "21133": "cornhusk", "21134": "cornmeal", "21135": "cornstalk", "21136": "corny", "21141": "coronary", "21142": "coroner", "21143": "corporal", "21144": "corporate", "21145": "corral", "21146": "correct", "21151": "corridor", "21152": "corrode", "21153": "corroding", "21154": "corrosive", "21155": "corsage", "21156": "corset", "21161": "cortex", "21162": "cosigner", "21163": "cosmetics", "21164": "cosmic", "21165": "cosmos", "21166": "cosponsor", "21211": "cost", "21212": "cottage", "21213": "cotton", "21214": "couch", "21215": "cough", "21216": "could", "21221": "countable", "21222": "countdown", "21223": "counting", "21224": "countless", "21225": "country", "21226": "county", "21231": "courier", "21232": "covenant", "21233": "cover", "21234": "coveted", "21235": "coveting", "21236": "coyness", "21241": "cozily", "21242": "coziness", "21243": "cozy", "21244": "crabbing", "21245": "crabgrass", "21246": "crablike", "21251": "crabmeat", "21252": "cradle", "21253": "cradling", "21254": "crafter", "21255": "craftily", "21256": "craftsman", "21261": "craftwork", "21262": "crafty", "21263": "cramp", "21264": "cranberry", "21265": "crane", "21266": "cranial", "21311": "cranium", "21312": "crank", "21313": "crate", "21314": "crave", "21315": "craving", "21316": "crawfish", "21321": "crawlers", "21322": "crawling", "21323": "crayfish", "21324": "crayon", "21325": "crazed", "21326": "crazily", "21331": "craziness", "21332": "crazy", "21333": "creamed", "21334": "creamer", "21335": "creamlike", "21336": "crease", "21341": "creasing", "21342": "creatable", "21343": "create", "21344": "creation", "21345": "creative", "21346": "creature", "21351": "credible", "21352": "credibly", "21353": "credit", "21354": "creed", "21355": "creme", "21356": "creole", "21361": "crepe", "21362": "crept", "21363": "crescent", "21364": "crested", "21365": "cresting", "21366": "crestless", "21411": "crevice", "21412": "crewless", "21413": "crewman", "21414": "crewmate", "21415": "crib", "21416": "cricket", "21421": "cried", "21422": "crier", "21423": "crimp", "21424": "crimson", "21425": "cringe", "21426": "cringing", "21431": "crinkle", "21432": "crinkly", "21433": "crisped", "21434": "crisping", "21435": "crisply", "21436": "crispness", "21441": "crispy", "21442": "criteria", "21443": "critter", "21444": "croak", "21445": "crock", "21446": "crook", "21451": "croon", "21452": "crop", "21453": "cross", "21454": "crouch", "21455": "crouton", "21456": "crowbar", "21461": "crowd", "21462": "crown", "21463": "crucial", "21464": "crudely", "21465": "crudeness", "21466": "cruelly", "21511": "cruelness", "21512": "cruelty", "21513": "crumb", "21514": "crummiest", "21515": "crummy", "21516": "crumpet", "21521": "crumpled", "21522": "cruncher", "21523": "crunching", "21524": "crunchy", "21525": "crusader", "21526": "crushable", "21531": "crushed", "21532": "crusher", "21533": "crushing", "21534": "crust", "21535": "crux", "21536": "crying", "21541": "cryptic", "21542": "crystal", "21543": "cubbyhole", "21544": "cube", "21545": "cubical", "21546": "cubicle", "21551": "cucumber", "21552": "cuddle", "21553": "cuddly", "21554": "cufflink", "21555": "culinary", "21556": "culminate", "21561": "culpable", "21562": "culprit", "21563": "cultivate", "21564": "cultural", "21565": "culture", "21566": "cupbearer", "21611": "cupcake", "21612": "cupid", "21613": "cupped", "21614": "cupping", "21615": "curable", "21616": "curator", "21621": "curdle", "21622": "cure", "21623": "curfew", "21624": "curing", "21625": "curled", "21626": "curler", "21631": "curliness", "21632": "curling", "21633": "curly", "21634": "curry", "21635": "curse", "21636": "cursive", "21641": "cursor", "21642": "curtain", "21643": "curtly", "21644": "curtsy", "21645": "curvature", "21646": "curve", "21651": "curvy", "21652": "cushy", "21653": "cusp", "21654": "cussed", "21655": "custard", "21656": "custodian", "21661": "custody", "21662": "customary", "21663": "customer", "21664": "customize", "21665": "customs", "21666": "cut", "22111": "cycle", "22112": "cyclic", "22113": "cycling", "22114": "cyclist", "22115": "cylinder", "22116": "cymbal", "22121": "cytoplasm", "22122": "cytoplast", "22123": "dab", "22124": "dad", "22125": "daffodil", "22126": "dagger", "22131": "daily", "22132": "daintily", "22133": "dainty", "22134": "dairy", "22135": "daisy", "22136": "dallying", "22141": "dance", "22142": "dancing", "22143": "dandelion", "22144": "dander", "22145": "dandruff", "22146": "dandy", "22151": "danger", "22152": "dangle", "22153": "dangling", "22154": "daredevil", "22155": "dares", "22156": "daringly", "22161": "darkened", "22162": "darkening", "22163": "darkish", "22164": "darkness", "22165": "darkroom", "22166": "darling", "22211": "darn", "22212": "dart", "22213": "darwinism", "22214": "dash", "22215": "dastardly", "22216": "data", "22221": "datebook", "22222": "dating", "22223": "daughter", "22224": "daunting", "22225": "dawdler", "22226": "dawn", "22231": "daybed", "22232": "daybreak", "22233": "daycare", "22234": "daydream", "22235": "daylight", "22236": "daylong", "22241": "dayroom", "22242": "daytime", "22243": "dazzler", "22244": "dazzling", "22245": "deacon", "22246": "deafening", "22251": "deafness", "22252": "dealer", "22253": "dealing", "22254": "dealmaker", "22255": "dealt", "22256": "dean", "22261": "debatable", "22262": "debate", "22263": "debating", "22264": "debit", "22265": "debrief", "22266": "debtless", "22311": "debtor", "22312": "debug", "22313": "debunk", "22314": "decade", "22315": "decaf", "22316": "decal", "22321": "decathlon", "22322": "decay", "22323": "deceased", "22324": "deceit", "22325": "deceiver", "22326": "deceiving", "22331": "december", "22332": "decency", "22333": "decent", "22334": "deception", "22335": "deceptive", "22336": "decibel", "22341": "decidable", "22342": "decimal", "22343": "decimeter", "22344": "decipher", "22345": "deck", "22346": "declared", "22351": "decline", "22352": "decode", "22353": "decompose", "22354": "decorated", "22355": "decorator", "22356": "decoy", "22361": "decrease", "22362": "decree", "22363": "dedicate", "22364": "dedicator", "22365": "deduce", "22366": "deduct", "22411": "deed", "22412": "deem", "22413": "deepen", "22414": "deeply", "22415": "deepness", "22416": "deface", "22421": "defacing", "22422": "defame", "22423": "default", "22424": "defeat", "22425": "defection", "22426": "defective", "22431": "defendant", "22432": "defender", "22433": "defense", "22434": "defensive", "22435": "deferral", "22436": "deferred", "22441": "defiance", "22442": "defiant", "22443": "defile", "22444": "defiling", "22445": "define", "22446": "definite", "22451": "deflate", "22452": "deflation", "22453": "deflator", "22454": "deflected", "22455": "deflector", "22456": "defog", "22461": "deforest", "22462": "defraud", "22463": "defrost", "22464": "deftly", "22465": "defuse", "22466": "defy", "22511": "degraded", "22512": "degrading", "22513": "degrease", "22514": "degree", "22515": "dehydrate", "22516": "deity", "22521": "dejected", "22522": "delay", "22523": "delegate", "22524": "delegator", "22525": "delete", "22526": "deletion", "22531": "delicacy", "22532": "delicate", "22533": "delicious", "22534": "delighted", "22535": "delirious", "22536": "delirium", "22541": "deliverer", "22542": "delivery", "22543": "delouse", "22544": "delta", "22545": "deluge", "22546": "delusion", "22551": "deluxe", "22552": "demanding", "22553": "demeaning", "22554": "demeanor", "22555": "demise", "22556": "democracy", "22561": "democrat", "22562": "demote", "22563": "demotion", "22564": "demystify", "22565": "denatured", "22566": "deniable", "22611": "denial", "22612": "denim", "22613": "denote", "22614": "dense", "22615": "density", "22616": "dental", "22621": "dentist", "22622": "denture", "22623": "deny", "22624": "deodorant", "22625": "deodorize", "22626": "departed", "22631": "departure", "22632": "depict", "22633": "deplete", "22634": "depletion", "22635": "deplored", "22636": "deploy", "22641": "deport", "22642": "depose", "22643": "depraved", "22644": "depravity", "22645": "deprecate", "22646": "depress", "22651": "deprive", "22652": "depth", "22653": "deputize", "22654": "deputy", "22655": "derail", "22656": "deranged", "22661": "derby", "22662": "derived", "22663": "desecrate", "22664": "deserve", "22665": "deserving", "22666": "designate", "23111": "designed", "23112": "designer", "23113": "designing", "23114": "deskbound", "23115": "desktop", "23116": "deskwork", "23121": "desolate", "23122": "despair", "23123": "despise", "23124": "despite", "23125": "destiny", "23126": "destitute", "23131": "destruct", "23132": "detached", "23133": "detail", "23134": "detection", "23135": "detective", "23136": "detector", "23141": "detention", "23142": "detergent", "23143": "detest", "23144": "detonate", "23145": "detonator", "23146": "detoxify", "23151": "detract", "23152": "deuce", "23153": "devalue", "23154": "deviancy", "23155": "deviant", "23156": "deviate", "23161": "deviation", "23162": "deviator", "23163": "device", "23164": "devious", "23165": "devotedly", "23166": "devotee", "23211": "devotion", "23212": "devourer", "23213": "devouring", "23214": "devoutly", "23215": "dexterity", "23216": "dexterous", "23221": "diabetes", "23222": "diabetic", "23223": "diabolic", "23224": "diagnoses", "23225": "diagnosis", "23226": "diagram", "23231": "dial", "23232": "diameter", "23233": "diaper", "23234": "diaphragm", "23235": "diary", "23236": "dice", "23241": "dicing", "23242": "dictate", "23243": "dictation", "23244": "dictator", "23245": "difficult", "23246": "diffused", "23251": "diffuser", "23252": "diffusion", "23253": "diffusive", "23254": "dig", "23255": "dilation", "23256": "diligence", "23261": "diligent", "23262": "dill", "23263": "dilute", "23264": "dime", "23265": "diminish", "23266": "dimly", "23311": "dimmed", "23312": "dimmer", "23313": "dimness", "23314": "dimple", "23315": "diner", "23316": "dingbat", "23321": "dinghy", "23322": "dinginess", "23323": "dingo", "23324": "dingy", "23325": "dining", "23326": "dinner", "23331": "diocese", "23332": "dioxide", "23333": "diploma", "23334": "dipped", "23335": "dipper", "23336": "dipping", "23341": "directed", "23342": "direction", "23343": "directive", "23344": "directly", "23345": "directory", "23346": "direness", "23351": "dirtiness", "23352": "disabled", "23353": "disagree", "23354": "disallow", "23355": "disarm", "23356": "disarray", "23361": "disaster", "23362": "disband", "23363": "disbelief", "23364": "disburse", "23365": "discard", "23366": "discern", "23411": "discharge", "23412": "disclose", "23413": "discolor", "23414": "discount", "23415": "discourse", "23416": "discover", "23421": "discuss", "23422": "disdain", "23423": "disengage", "23424": "disfigure", "23425": "disgrace", "23426": "dish", "23431": "disinfect", "23432": "disjoin", "23433": "disk", "23434": "dislike", "23435": "disliking", "23436": "dislocate", "23441": "dislodge", "23442": "disloyal", "23443": "dismantle", "23444": "dismay", "23445": "dismiss", "23446": "dismount", "23451": "disobey", "23452": "disorder", "23453": "disown", "23454": "disparate", "23455": "disparity", "23456": "dispatch", "23461": "dispense", "23462": "dispersal", "23463": "dispersed", "23464": "disperser", "23465": "displace", "23466": "display", "23511": "displease", "23512": "disposal", "23513": "dispose", "23514": "disprove", "23515": "dispute", "23516": "disregard", "23521": "disrupt", "23522": "dissuade", "23523": "distance", "23524": "distant", "23525": "distaste", "23526": "distill", "23531": "distinct", "23532": "distort", "23533": "distract", "23534": "distress", "23535": "district", "23536": "distrust", "23541": "ditch", "23542": "ditto", "23543": "ditzy", "23544": "dividable", "23545": "divided", "23546": "dividend", "23551": "dividers", "23552": "dividing", "23553": "divinely", "23554": "diving", "23555": "divinity", "23556": "divisible", "23561": "divisibly", "23562": "division", "23563": "divisive", "23564": "divorcee", "23565": "dizziness", "23566": "dizzy", "23611": "doable", "23612": "docile", "23613": "dock", "23614": "doctrine", "23615": "document", "23616": "dodge", "23621": "dodgy", "23622": "doily", "23623": "doing", "23624": "dole", "23625": "dollar", "23626": "dollhouse", "23631": "dollop", "23632": "dolly", "23633": "dolphin", "23634": "domain", "23635": "domelike", "23636": "domestic", "23641": "dominion", "23642": "dominoes", "23643": "donated", "23644": "donation", "23645": "donator", "23646": "donor", "23651": "donut", "23652": "doodle", "23653": "doorbell", "23654": "doorframe", "23655": "doorknob", "23656": "doorman", "23661": "doormat", "23662": "doornail", "23663": "doorpost", "23664": "doorstep", "23665": "doorstop", "23666": "doorway", "24111": "doozy", "24112": "dork", "24113": "dormitory", "24114": "dorsal", "24115": "dosage", "24116": "dose", "24121": "dotted", "24122": "doubling", "24123": "douche", "24124": "dove", "24125": "down", "24126": "dowry", "24131": "doze", "24132": "drab", "24133": "dragging", "24134": "dragonfly", "24135": "dragonish", "24136": "dragster", "24141": "drainable", "24142": "drainage", "24143": "drained", "24144": "drainer", "24145": "drainpipe", "24146": "dramatic", "24151": "dramatize", "24152": "drank", "24153": "drapery", "24154": "drastic", "24155": "draw", "24156": "dreaded", "24161": "dreadful", "24162": "dreadlock", "24163": "dreamboat", "24164": "dreamily", "24165": "dreamland", "24166": "dreamless", "24211": "dreamlike", "24212": "dreamt", "24213": "dreamy", "24214": "drearily", "24215": "dreary", "24216": "drench", "24221": "dress", "24222": "drew", "24223": "dribble", "24224": "dried", "24225": "drier", "24226": "drift", "24231": "driller", "24232": "drilling", "24233": "drinkable", "24234": "drinking", "24235": "dripping", "24236": "drippy", "24241": "drivable", "24242": "driven", "24243": "driver", "24244": "driveway", "24245": "driving", "24246": "drizzle", "24251": "drizzly", "24252": "drone", "24253": "drool", "24254": "droop", "24255": "dropdown", "24256": "dropbox", "24261": "dropkick", "24262": "droplet", "24263": "dropout", "24264": "dropper", "24265": "drove", "24266": "drown", "24311": "drowsily", "24312": "drudge", "24313": "drum", "24314": "dry", "24315": "dubbed", "24316": "dubiously", "24321": "duchess", "24322": "duckbill", "24323": "ducking", "24324": "duckling", "24325": "ducktail", "24326": "ducky", "24331": "duct", "24332": "dude", "24333": "duffel", "24334": "dugout", "24335": "duh", "24336": "duke", "24341": "duller", "24342": "dullness", "24343": "duly", "24344": "dumping", "24345": "dumpling", "24346": "dumpster", "24351": "duo", "24352": "dupe", "24353": "duplex", "24354": "duplicate", "24355": "duplicity", "24356": "durable", "24361": "durably", "24362": "duration", "24363": "duress", "24364": "during", "24365": "dusk", "24366": "dust", "24411": "dutiful", "24412": "duty", "24413": "duvet", "24414": "dwarf", "24415": "dweeb", "24416": "dwelled", "24421": "dweller", "24422": "dwelling", "24423": "dwindle", "24424": "dwindling", "24425": "dynamic", "24426": "dynamite", "24431": "dynasty", "24432": "dyslexia", "24433": "dyslexic", "24434": "each", "24435": "eagle", "24436": "earache", "24441": "eardrum", "24442": "earflap", "24443": "earful", "24444": "earlobe", "24445": "early", "24446": "earmark", "24451": "earmuff", "24452": "earphone", "24453": "earpiece", "24454": "earplugs", "24455": "earring", "24456": "earshot", "24461": "earthen", "24462": "earthlike", "24463": "earthling", "24464": "earthly", "24465": "earthworm", "24466": "earthy", "24511": "earwig", "24512": "easeful", "24513": "easel", "24514": "easiest", "24515": "easily", "24516": "easiness", "24521": "easing", "24522": "eastbound", "24523": "eastcoast", "24524": "easter", "24525": "eastward", "24526": "eatable", "24531": "eaten", "24532": "eatery", "24533": "eating", "24534": "eats", "24535": "ebay", "24536": "ebony", "24541": "ebook", "24542": "ecard", "24543": "eccentric", "24544": "echo", "24545": "eclair", "24546": "eclipse", "24551": "ecologist", "24552": "ecology", "24553": "economic", "24554": "economist", "24555": "economy", "24556": "ecosphere", "24561": "ecosystem", "24562": "edge", "24563": "edginess", "24564": "edging", "24565": "edgy", "24566": "edition", "24611": "editor", "24612": "educated", "24613": "education", "24614": "educator", "24615": "eel", "24616": "effective", "24621": "effects", "24622": "efficient", "24623": "effort", "24624": "eggbeater", "24625": "egging", "24626": "eggnog", "24631": "eggplant", "24632": "eggshell", "24633": "egomaniac", "24634": "egotism", "24635": "egotistic", "24636": "either", "24641": "eject", "24642": "elaborate", "24643": "elastic", "24644": "elated", "24645": "elbow", "24646": "eldercare", "24651": "elderly", "24652": "eldest", "24653": "electable", "24654": "election", "24655": "elective", "24656": "elephant", "24661": "elevate", "24662": "elevating", "24663": "elevation", "24664": "elevator", "24665": "eleven", "24666": "elf", "25111": "eligible", "25112": "eligibly", "25113": "eliminate", "25114": "elite", "25115": "elitism", "25116": "elixir", "25121": "elk", "25122": "ellipse", "25123": "elliptic", "25124": "elm", "25125": "elongated", "25126": "elope", "25131": "eloquence", "25132": "eloquent", "25133": "elsewhere", "25134": "elude", "25135": "elusive", "25136": "elves", "25141": "email", "25142": "embargo", "25143": "embark", "25144": "embassy", "25145": "embattled", "25146": "embellish", "25151": "ember", "25152": "embezzle", "25153": "emblaze", "25154": "emblem", "25155": "embody", "25156": "embolism", "25161": "emboss", "25162": "embroider", "25163": "emcee", "25164": "emerald", "25165": "emergency", "25166": "emission", "25211": "emit", "25212": "emote", "25213": "emoticon", "25214": "emotion", "25215": "empathic", "25216": "empathy", "25221": "emperor", "25222": "emphases", "25223": "emphasis", "25224": "emphasize", "25225": "emphatic", "25226": "empirical", "25231": "employed", "25232": "employee", "25233": "employer", "25234": "emporium", "25235": "empower", "25236": "emptier", "25241": "emptiness", "25242": "empty", "25243": "emu", "25244": "enable", "25245": "enactment", "25246": "enamel", "25251": "enchanted", "25252": "enchilada", "25253": "encircle", "25254": "enclose", "25255": "enclosure", "25256": "encode", "25261": "encore", "25262": "encounter", "25263": "encourage", "25264": "encroach", "25265": "encrust", "25266": "encrypt", "25311": "endanger", "25312": "endeared", "25313": "endearing", "25314": "ended", "25315": "ending", "25316": "endless", "25321": "endnote", "25322": "endocrine", "25323": "endorphin", "25324": "endorse", "25325": "endowment", "25326": "endpoint", "25331": "endurable", "25332": "endurance", "25333": "enduring", "25334": "energetic", "25335": "energize", "25336": "energy", "25341": "enforced", "25342": "enforcer", "25343": "engaged", "25344": "engaging", "25345": "engine", "25346": "engorge", "25351": "engraved", "25352": "engraver", "25353": "engraving", "25354": "engross", "25355": "engulf", "25356": "enhance", "25361": "enigmatic", "25362": "enjoyable", "25363": "enjoyably", "25364": "enjoyer", "25365": "enjoying", "25366": "enjoyment", "25411": "enlarged", "25412": "enlarging", "25413": "enlighten", "25414": "enlisted", "25415": "enquirer", "25416": "enrage", "25421": "enrich", "25422": "enroll", "25423": "enslave", "25424": "ensnare", "25425": "ensure", "25426": "entail", "25431": "entangled", "25432": "entering", "25433": "entertain", "25434": "enticing", "25435": "entire", "25436": "entitle", "25441": "entity", "25442": "entomb", "25443": "entourage", "25444": "entrap", "25445": "entree", "25446": "entrench", "25451": "entrust", "25452": "entryway", "25453": "entwine", "25454": "enunciate", "25455": "envelope", "25456": "enviable", "25461": "enviably", "25462": "envious", "25463": "envision", "25464": "envoy", "25465": "envy", "25466": "enzyme", "25511": "epic", "25512": "epidemic", "25513": "epidermal", "25514": "epidermis", "25515": "epidural", "25516": "epilepsy", "25521": "epileptic", "25522": "epilogue", "25523": "epiphany", "25524": "episode", "25525": "equal", "25526": "equate", "25531": "equation", "25532": "equator", "25533": "equinox", "25534": "equipment", "25535": "equity", "25536": "equivocal", "25541": "eradicate", "25542": "erasable", "25543": "erased", "25544": "eraser", "25545": "erasure", "25546": "ergonomic", "25551": "errand", "25552": "errant", "25553": "erratic", "25554": "error", "25555": "erupt", "25556": "escalate", "25561": "escalator", "25562": "escapable", "25563": "escapade", "25564": "escapist", "25565": "escargot", "25566": "eskimo", "25611": "esophagus", "25612": "espionage", "25613": "espresso", "25614": "esquire", "25615": "essay", "25616": "essence", "25621": "essential", "25622": "establish", "25623": "estate", "25624": "esteemed", "25625": "estimate", "25626": "estimator", "25631": "estranged", "25632": "estrogen", "25633": "etching", "25634": "eternal", "25635": "eternity", "25636": "ethanol", "25641": "ether", "25642": "ethically", "25643": "ethics", "25644": "euphemism", "25645": "evacuate", "25646": "evacuee", "25651": "evade", "25652": "evaluate", "25653": "evaluator", "25654": "evaporate", "25655": "evasion", "25656": "evasive", "25661": "even", "25662": "everglade", "25663": "evergreen", "25664": "everybody", "25665": "everyday", "25666": "everyone", "26111": "evict", "26112": "evidence", "26113": "evident", "26114": "evil", "26115": "evoke", "26116": "evolution", "26121": "evolve", "26122": "exact", "26123": "exalted", "26124": "example", "26125": "excavate", "26126": "excavator", "26131": "exceeding", "26132": "exception", "26133": "excess", "26134": "exchange", "26135": "excitable", "26136": "exciting", "26141": "exclaim", "26142": "exclude", "26143": "excluding", "26144": "exclusion", "26145": "exclusive", "26146": "excretion", "26151": "excretory", "26152": "excursion", "26153": "excusable", "26154": "excusably", "26155": "excuse", "26156": "exemplary", "26161": "exemplify", "26162": "exemption", "26163": "exerciser", "26164": "exert", "26165": "exes", "26166": "exfoliate", "26211": "exhale", "26212": "exhaust", "26213": "exhume", "26214": "exile", "26215": "existing", "26216": "exit", "26221": "exodus", "26222": "exonerate", "26223": "exorcism", "26224": "exorcist", "26225": "expand", "26226": "expanse", "26231": "expansion", "26232": "expansive", "26233": "expectant", "26234": "expedited", "26235": "expediter", "26236": "expel", "26241": "expend", "26242": "expenses", "26243": "expensive", "26244": "expert", "26245": "expire", "26246": "expiring", "26251": "explain", "26252": "expletive", "26253": "explicit", "26254": "explode", "26255": "exploit", "26256": "explore", "26261": "exploring", "26262": "exponent", "26263": "exporter", "26264": "exposable", "26265": "expose", "26266": "exposure", "26311": "express", "26312": "expulsion", "26313": "exquisite", "26314": "extended", "26315": "extending", "26316": "extent", "26321": "extenuate", "26322": "exterior", "26323": "external", "26324": "extinct", "26325": "extortion", "26326": "extradite", "26331": "extras", "26332": "extrovert", "26333": "extrude", "26334": "extruding", "26335": "exuberant", "26336": "fable", "26341": "fabric", "26342": "fabulous", "26343": "facebook", "26344": "facecloth", "26345": "facedown", "26346": "faceless", "26351": "facelift", "26352": "faceplate", "26353": "faceted", "26354": "facial", "26355": "facility", "26356": "facing", "26361": "facsimile", "26362": "faction", "26363": "factoid", "26364": "factor", "26365": "factsheet", "26366": "factual", "26411": "faculty", "26412": "fade", "26413": "fading", "26414": "failing", "26415": "falcon", "26416": "fall", "26421": "false", "26422": "falsify", "26423": "fame", "26424": "familiar", "26425": "family", "26426": "famine", "26431": "famished", "26432": "fanatic", "26433": "fancied", "26434": "fanciness", "26435": "fancy", "26436": "fanfare", "26441": "fang", "26442": "fanning", "26443": "fantasize", "26444": "fantastic", "26445": "fantasy", "26446": "fascism", "26451": "fastball", "26452": "faster", "26453": "fasting", "26454": "fastness", "26455": "faucet", "26456": "favorable", "26461": "favorably", "26462": "favored", "26463": "favoring", "26464": "favorite", "26465": "fax", "26466": "feast", "26511": "federal", "26512": "fedora", "26513": "feeble", "26514": "feed", "26515": "feel", "26516": "feisty", "26521": "feline", "26522": "felttip", "26523": "feminine", "26524": "feminism", "26525": "feminist", "26526": "feminize", "26531": "femur", "26532": "fence", "26533": "fencing", "26534": "fender", "26535": "ferment", "26536": "fernlike", "26541": "ferocious", "26542": "ferocity", "26543": "ferret", "26544": "ferris", "26545": "ferry", "26546": "fervor", "26551": "fester", "26552": "festival", "26553": "festive", "26554": "festivity", "26555": "fetal", "26556": "fetch", "26561": "fever", "26562": "fiber", "26563": "fiction", "26564": "fiddle", "26565": "fiddling", "26566": "fidelity", "26611": "fidgeting", "26612": "fidgety", "26613": "fifteen", "26614": "fifth", "26615": "fiftieth", "26616": "fifty", "26621": "figment", "26622": "figure", "26623": "figurine", "26624": "filing", "26625": "filled", "26626": "filler", "26631": "filling", "26632": "film", "26633": "filter", "26634": "filth", "26635": "filtrate", "26636": "finale", "26641": "finalist", "26642": "finalize", "26643": "finally", "26644": "finance", "26645": "financial", "26646": "finch", "26651": "fineness", "26652": "finer", "26653": "finicky", "26654": "finished", "26655": "finisher", "26656": "finishing", "26661": "finite", "26662": "finless", "26663": "finlike", "26664": "fiscally", "26665": "fit", "26666": "five", "31111": "flaccid", "31112": "flagman", "31113": "flagpole", "31114": "flagship", "31115": "flagstick", "31116": "flagstone", "31121": "flail", "31122": "flakily", "31123": "flaky", "31124": "flame", "31125": "flammable", "31126": "flanked", "31131": "flanking", "31132": "flannels", "31133": "flap", "31134": "flaring", "31135": "flashback", "31136": "flashbulb", "31141": "flashcard", "31142": "flashily", "31143": "flashing", "31144": "flashy", "31145": "flask", "31146": "flatbed", "31151": "flatfoot", "31152": "flatly", "31153": "flatness", "31154": "flatten", "31155": "flattered", "31156": "flatterer", "31161": "flattery", "31162": "flattop", "31163": "flatware", "31164": "flatworm", "31165": "flavored", "31166": "flavorful", "31211": "flavoring", "31212": "flaxseed", "31213": "fled", "31214": "fleshed", "31215": "fleshy", "31216": "flick", "31221": "flier", "31222": "flight", "31223": "flinch", "31224": "fling", "31225": "flint", "31226": "flip", "31231": "flirt", "31232": "float", "31233": "flock", "31234": "flogging", "31235": "flop", "31236": "floral", "31241": "florist", "31242": "floss", "31243": "flounder", "31244": "flyable", "31245": "flyaway", "31246": "flyer", "31251": "flying", "31252": "flyover", "31253": "flypaper", "31254": "foam", "31255": "foe", "31256": "fog", "31261": "foil", "31262": "folic", "31263": "folk", "31264": "follicle", "31265": "follow", "31266": "fondling", "31311": "fondly", "31312": "fondness", "31313": "fondue", "31314": "font", "31315": "food", "31316": "fool", "31321": "footage", "31322": "football", "31323": "footbath", "31324": "footboard", "31325": "footer", "31326": "footgear", "31331": "foothill", "31332": "foothold", "31333": "footing", "31334": "footless", "31335": "footman", "31336": "footnote", "31341": "footpad", "31342": "footpath", "31343": "footprint", "31344": "footrest", "31345": "footsie", "31346": "footsore", "31351": "footwear", "31352": "footwork", "31353": "fossil", "31354": "foster", "31355": "founder", "31356": "founding", "31361": "fountain", "31362": "fox", "31363": "foyer", "31364": "fraction", "31365": "fracture", "31366": "fragile", "31411": "fragility", "31412": "fragment", "31413": "fragrance", "31414": "fragrant", "31415": "frail", "31416": "frame", "31421": "framing", "31422": "frantic", "31423": "fraternal", "31424": "frayed", "31425": "fraying", "31426": "frays", "31431": "freckled", "31432": "freckles", "31433": "freebase", "31434": "freebee", "31435": "freebie", "31436": "freedom", "31441": "freefall", "31442": "freehand", "31443": "freeing", "31444": "freeload", "31445": "freely", "31446": "freemason", "31451": "freeness", "31452": "freestyle", "31453": "freeware", "31454": "freeway", "31455": "freewill", "31456": "freezable", "31461": "freezing", "31462": "freight", "31463": "french", "31464": "frenzied", "31465": "frenzy", "31466": "frequency", "31511": "frequent", "31512": "fresh", "31513": "fretful", "31514": "fretted", "31515": "friction", "31516": "friday", "31521": "fridge", "31522": "fried", "31523": "friend", "31524": "frighten", "31525": "frightful", "31526": "frigidity", "31531": "frigidly", "31532": "frill", "31533": "fringe", "31534": "frisbee", "31535": "frisk", "31536": "fritter", "31541": "frivolous", "31542": "frolic", "31543": "from", "31544": "front", "31545": "frostbite", "31546": "frosted", "31551": "frostily", "31552": "frosting", "31553": "frostlike", "31554": "frosty", "31555": "froth", "31556": "frown", "31561": "frozen", "31562": "fructose", "31563": "frugality", "31564": "frugally", "31565": "fruit", "31566": "frustrate", "31611": "frying", "31612": "gab", "31613": "gaffe", "31614": "gag", "31615": "gainfully", "31616": "gaining", "31621": "gains", "31622": "gala", "31623": "gallantly", "31624": "galleria", "31625": "gallery", "31626": "galley", "31631": "gallon", "31632": "gallows", "31633": "gallstone", "31634": "galore", "31635": "galvanize", "31636": "gambling", "31641": "game", "31642": "gaming", "31643": "gamma", "31644": "gander", "31645": "gangly", "31646": "gangrene", "31651": "gangway", "31652": "gap", "31653": "garage", "31654": "garbage", "31655": "garden", "31656": "gargle", "31661": "garland", "31662": "garlic", "31663": "garment", "31664": "garnet", "31665": "garnish", "31666": "garter", "32111": "gas", "32112": "gatherer", "32113": "gathering", "32114": "gating", "32115": "gauging", "32116": "gauntlet", "32121": "gauze", "32122": "gave", "32123": "gawk", "32124": "gazing", "32125": "gear", "32126": "gecko", "32131": "geek", "32132": "geiger", "32133": "gem", "32134": "gender", "32135": "generic", "32136": "generous", "32141": "genetics", "32142": "genre", "32143": "gentile", "32144": "gentleman", "32145": "gently", "32146": "gents", "32151": "geography", "32152": "geologic", "32153": "geologist", "32154": "geology", "32155": "geometric", "32156": "geometry", "32161": "geranium", "32162": "gerbil", "32163": "geriatric", "32164": "germicide", "32165": "germinate", "32166": "germless", "32211": "germproof", "32212": "gestate", "32213": "gestation", "32214": "gesture", "32215": "getaway", "32216": "getting", "32221": "getup", "32222": "giant", "32223": "gibberish", "32224": "giblet", "32225": "giddily", "32226": "giddiness", "32231": "giddy", "32232": "gift", "32233": "gigabyte", "32234": "gigahertz", "32235": "gigantic", "32236": "giggle", "32241": "giggling", "32242": "giggly", "32243": "gigolo", "32244": "gilled", "32245": "gills", "32246": "gimmick", "32251": "girdle", "32252": "giveaway", "32253": "given", "32254": "giver", "32255": "giving", "32256": "gizmo", "32261": "gizzard", "32262": "glacial", "32263": "glacier", "32264": "glade", "32265": "gladiator", "32266": "gladly", "32311": "glamorous", "32312": "glamour", "32313": "glance", "32314": "glancing", "32315": "glandular", "32316": "glare", "32321": "glaring", "32322": "glass", "32323": "glaucoma", "32324": "glazing", "32325": "gleaming", "32326": "gleeful", "32331": "glider", "32332": "gliding", "32333": "glimmer", "32334": "glimpse", "32335": "glisten", "32336": "glitch", "32341": "glitter", "32342": "glitzy", "32343": "gloater", "32344": "gloating", "32345": "gloomily", "32346": "gloomy", "32351": "glorified", "32352": "glorifier", "32353": "glorify", "32354": "glorious", "32355": "glory", "32356": "gloss", "32361": "glove", "32362": "glowing", "32363": "glowworm", "32364": "glucose", "32365": "glue", "32366": "gluten", "32411": "glutinous", "32412": "glutton", "32413": "gnarly", "32414": "gnat", "32415": "goal", "32416": "goatskin", "32421": "goes", "32422": "goggles", "32423": "going", "32424": "goldfish", "32425": "goldmine", "32426": "goldsmith", "32431": "golf", "32432": "goliath", "32433": "gonad", "32434": "gondola", "32435": "gone", "32436": "gong", "32441": "good", "32442": "gooey", "32443": "goofball", "32444": "goofiness", "32445": "goofy", "32446": "google", "32451": "goon", "32452": "gopher", "32453": "gore", "32454": "gorged", "32455": "gorgeous", "32456": "gory", "32461": "gosling", "32462": "gossip", "32463": "gothic", "32464": "gotten", "32465": "gout", "32466": "gown", "32511": "grab", "32512": "graceful", "32513": "graceless", "32514": "gracious", "32515": "gradation", "32516": "graded", "32521": "grader", "32522": "gradient", "32523": "grading", "32524": "gradually", "32525": "graduate", "32526": "graffiti", "32531": "grafted", "32532": "grafting", "32533": "grain", "32534": "granddad", "32535": "grandkid", "32536": "grandly", "32541": "grandma", "32542": "grandpa", "32543": "grandson", "32544": "granite", "32545": "granny", "32546": "granola", "32551": "grant", "32552": "granular", "32553": "grape", "32554": "graph", "32555": "grapple", "32556": "grappling", "32561": "grasp", "32562": "grass", "32563": "gratified", "32564": "gratify", "32565": "grating", "32566": "gratitude", "32611": "gratuity", "32612": "gravel", "32613": "graveness", "32614": "graves", "32615": "graveyard", "32616": "gravitate", "32621": "gravity", "32622": "gravy", "32623": "gray", "32624": "grazing", "32625": "greasily", "32626": "greedily", "32631": "greedless", "32632": "greedy", "32633": "green", "32634": "greeter", "32635": "greeting", "32636": "grew", "32641": "greyhound", "32642": "grid", "32643": "grief", "32644": "grievance", "32645": "grieving", "32646": "grievous", "32651": "grill", "32652": "grimace", "32653": "grimacing", "32654": "grime", "32655": "griminess", "32656": "grimy", "32661": "grinch", "32662": "grinning", "32663": "grip", "32664": "gristle", "32665": "grit", "32666": "groggily", "33111": "groggy", "33112": "groin", "33113": "groom", "33114": "groove", "33115": "grooving", "33116": "groovy", "33121": "grope", "33122": "ground", "33123": "grouped", "33124": "grout", "33125": "grove", "33126": "grower", "33131": "growing", "33132": "growl", "33133": "grub", "33134": "grudge", "33135": "grudging", "33136": "grueling", "33141": "gruffly", "33142": "grumble", "33143": "grumbling", "33144": "grumbly", "33145": "grumpily", "33146": "grunge", "33151": "grunt", "33152": "guacamole", "33153": "guidable", "33154": "guidance", "33155": "guide", "33156": "guiding", "33161": "guileless", "33162": "guise", "33163": "gulf", "33164": "gullible", "33165": "gully", "33166": "gulp", "33211": "gumball", "33212": "gumdrop", "33213": "gumminess", "33214": "gumming", "33215": "gummy", "33216": "gurgle", "33221": "gurgling", "33222": "guru", "33223": "gush", "33224": "gusto", "33225": "gusty", "33226": "gutless", "33231": "guts", "33232": "gutter", "33233": "guy", "33234": "guzzler", "33235": "gyration", "33236": "habitable", "33241": "habitant", "33242": "habitat", "33243": "habitual", "33244": "hacked", "33245": "hacker", "33246": "hacking", "33251": "hacksaw", "33252": "had", "33253": "haggler", "33254": "haiku", "33255": "half", "33256": "halogen", "33261": "halt", "33262": "halved", "33263": "halves", "33264": "hamburger", "33265": "hamlet", "33266": "hammock", "33311": "hamper", "33312": "hamster", "33313": "hamstring", "33314": "handbag", "33315": "handball", "33316": "handbook", "33321": "handbrake", "33322": "handcart", "33323": "handclap", "33324": "handclasp", "33325": "handcraft", "33326": "handcuff", "33331": "handed", "33332": "handful", "33333": "handgrip", "33334": "handgun", "33335": "handheld", "33336": "handiness", "33341": "handiwork", "33342": "handlebar", "33343": "handled", "33344": "handler", "33345": "handling", "33346": "handmade", "33351": "handoff", "33352": "handpick", "33353": "handprint", "33354": "handrail", "33355": "handsaw", "33356": "handset", "33361": "handsfree", "33362": "handshake", "33363": "handstand", "33364": "handwash", "33365": "handwork", "33366": "handwoven", "33411": "handwrite", "33412": "handyman", "33413": "hangnail", "33414": "hangout", "33415": "hangover", "33416": "hangup", "33421": "hankering", "33422": "hankie", "33423": "hanky", "33424": "haphazard", "33425": "happening", "33426": "happier", "33431": "happiest", "33432": "happily", "33433": "happiness", "33434": "happy", "33435": "harbor", "33436": "hardcopy", "33441": "hardcore", "33442": "hardcover", "33443": "harddisk", "33444": "hardened", "33445": "hardener", "33446": "hardening", "33451": "hardhat", "33452": "hardhead", "33453": "hardiness", "33454": "hardly", "33455": "hardness", "33456": "hardship", "33461": "hardware", "33462": "hardwired", "33463": "hardwood", "33464": "hardy", "33465": "harmful", "33466": "harmless", "33511": "harmonica", "33512": "harmonics", "33513": "harmonize", "33514": "harmony", "33515": "harness", "33516": "harpist", "33521": "harsh", "33522": "harvest", "33523": "hash", "33524": "hassle", "33525": "haste", "33526": "hastily", "33531": "hastiness", "33532": "hasty", "33533": "hatbox", "33534": "hatchback", "33535": "hatchery", "33536": "hatchet", "33541": "hatching", "33542": "hatchling", "33543": "hate", "33544": "hatless", "33545": "hatred", "33546": "haunt", "33551": "haven", "33552": "hazard", "33553": "hazelnut", "33554": "hazily", "33555": "haziness", "33556": "hazing", "33561": "hazy", "33562": "headache", "33563": "headband", "33564": "headboard", "33565": "headcount", "33566": "headdress", "33611": "headed", "33612": "header", "33613": "headfirst", "33614": "headgear", "33615": "heading", "33616": "headlamp", "33621": "headless", "33622": "headlock", "33623": "headphone", "33624": "headpiece", "33625": "headrest", "33626": "headroom", "33631": "headscarf", "33632": "headset", "33633": "headsman", "33634": "headstand", "33635": "headstone", "33636": "headway", "33641": "headwear", "33642": "heap", "33643": "heat", "33644": "heave", "33645": "heavily", "33646": "heaviness", "33651": "heaving", "33652": "hedge", "33653": "hedging", "33654": "heftiness", "33655": "hefty", "33656": "helium", "33661": "helmet", "33662": "helper", "33663": "helpful", "33664": "helping", "33665": "helpless", "33666": "helpline", "34111": "hemlock", "34112": "hemstitch", "34113": "hence", "34114": "henchman", "34115": "henna", "34116": "herald", "34121": "herbal", "34122": "herbicide", "34123": "herbs", "34124": "heritage", "34125": "hermit", "34126": "heroics", "34131": "heroism", "34132": "herring", "34133": "herself", "34134": "hertz", "34135": "hesitancy", "34136": "hesitant", "34141": "hesitate", "34142": "hexagon", "34143": "hexagram", "34144": "hubcap", "34145": "huddle", "34146": "huddling", "34151": "huff", "34152": "hug", "34153": "hula", "34154": "hulk", "34155": "hull", "34156": "human", "34161": "humble", "34162": "humbling", "34163": "humbly", "34164": "humid", "34165": "humiliate", "34166": "humility", "34211": "humming", "34212": "hummus", "34213": "humongous", "34214": "humorist", "34215": "humorless", "34216": "humorous", "34221": "humpback", "34222": "humped", "34223": "humvee", "34224": "hunchback", "34225": "hundredth", "34226": "hunger", "34231": "hungrily", "34232": "hungry", "34233": "hunk", "34234": "hunter", "34235": "hunting", "34236": "huntress", "34241": "huntsman", "34242": "hurdle", "34243": "hurled", "34244": "hurler", "34245": "hurling", "34246": "hurray", "34251": "hurricane", "34252": "hurried", "34253": "hurry", "34254": "hurt", "34255": "husband", "34256": "hush", "34261": "husked", "34262": "huskiness", "34263": "hut", "34264": "hybrid", "34265": "hydrant", "34266": "hydrated", "34311": "hydration", "34312": "hydrogen", "34313": "hydroxide", "34314": "hyperlink", "34315": "hypertext", "34316": "hyphen", "34321": "hypnoses", "34322": "hypnosis", "34323": "hypnotic", "34324": "hypnotism", "34325": "hypnotist", "34326": "hypnotize", "34331": "hypocrisy", "34332": "hypocrite", "34333": "ibuprofen", "34334": "ice", "34335": "iciness", "34336": "icing", "34341": "icky", "34342": "icon", "34343": "icy", "34344": "idealism", "34345": "idealist", "34346": "idealize", "34351": "ideally", "34352": "idealness", "34353": "identical", "34354": "identify", "34355": "identity", "34356": "ideology", "34361": "idiocy", "34362": "idiom", "34363": "idly", "34364": "igloo", "34365": "ignition", "34366": "ignore", "34411": "iguana", "34412": "illicitly", "34413": "illusion", "34414": "illusive", "34415": "image", "34416": "imaginary", "34421": "imagines", "34422": "imaging", "34423": "imbecile", "34424": "imitate", "34425": "imitation", "34426": "immature", "34431": "immerse", "34432": "immersion", "34433": "imminent", "34434": "immobile", "34435": "immodest", "34436": "immorally", "34441": "immortal", "34442": "immovable", "34443": "immovably", "34444": "immunity", "34445": "immunize", "34446": "impaired", "34451": "impale", "34452": "impart", "34453": "impatient", "34454": "impeach", "34455": "impeding", "34456": "impending", "34461": "imperfect", "34462": "imperial", "34463": "impish", "34464": "implant", "34465": "implement", "34466": "implicate", "34511": "implicit", "34512": "implode", "34513": "implosion", "34514": "implosive", "34515": "imply", "34516": "impolite", "34521": "important", "34522": "importer", "34523": "impose", "34524": "imposing", "34525": "impotence", "34526": "impotency", "34531": "impotent", "34532": "impound", "34533": "imprecise", "34534": "imprint", "34535": "imprison", "34536": "impromptu", "34541": "improper", "34542": "improve", "34543": "improving", "34544": "improvise", "34545": "imprudent", "34546": "impulse", "34551": "impulsive", "34552": "impure", "34553": "impurity", "34554": "iodine", "34555": "iodize", "34556": "ion", "34561": "ipad", "34562": "iphone", "34563": "ipod", "34564": "irate", "34565": "irk", "34566": "iron", "34611": "irregular", "34612": "irrigate", "34613": "irritable", "34614": "irritably", "34615": "irritant", "34616": "irritate", "34621": "islamic", "34622": "islamist", "34623": "isolated", "34624": "isolating", "34625": "isolation", "34626": "isotope", "34631": "issue", "34632": "issuing", "34633": "italicize", "34634": "italics", "34635": "item", "34636": "itinerary", "34641": "itunes", "34642": "ivory", "34643": "ivy", "34644": "jab", "34645": "jackal", "34646": "jacket", "34651": "jackknife", "34652": "jackpot", "34653": "jailbird", "34654": "jailbreak", "34655": "jailer", "34656": "jailhouse", "34661": "jalapeno", "34662": "jam", "34663": "janitor", "34664": "january", "34665": "jargon", "34666": "jarring", "35111": "jasmine", "35112": "jaundice", "35113": "jaunt", "35114": "java", "35115": "jawed", "35116": "jawless", "35121": "jawline", "35122": "jaws", "35123": "jaybird", "35124": "jaywalker", "35125": "jazz", "35126": "jeep", "35131": "jeeringly", "35132": "jellied", "35133": "jelly", "35134": "jersey", "35135": "jester", "35136": "jet", "35141": "jiffy", "35142": "jigsaw", "35143": "jimmy", "35144": "jingle", "35145": "jingling", "35146": "jinx", "35151": "jitters", "35152": "jittery", "35153": "job", "35154": "jockey", "35155": "jockstrap", "35156": "jogger", "35161": "jogging", "35162": "john", "35163": "joining", "35164": "jokester", "35165": "jokingly", "35166": "jolliness", "35211": "jolly", "35212": "jolt", "35213": "jot", "35214": "jovial", "35215": "joyfully", "35216": "joylessly", "35221": "joyous", "35222": "joyride", "35223": "joystick", "35224": "jubilance", "35225": "jubilant", "35226": "judge", "35231": "judgingly", "35232": "judicial", "35233": "judiciary", "35234": "judo", "35235": "juggle", "35236": "juggling", "35241": "jugular", "35242": "juice", "35243": "juiciness", "35244": "juicy", "35245": "jujitsu", "35246": "jukebox", "35251": "july", "35252": "jumble", "35253": "jumbo", "35254": "jump", "35255": "junction", "35256": "juncture", "35261": "june", "35262": "junior", "35263": "juniper", "35264": "junkie", "35265": "junkman", "35266": "junkyard", "35311": "jurist", "35312": "juror", "35313": "jury", "35314": "justice", "35315": "justifier", "35316": "justify", "35321": "justly", "35322": "justness", "35323": "juvenile", "35324": "kabob", "35325": "kangaroo", "35326": "karaoke", "35331": "karate", "35332": "karma", "35333": "kebab", "35334": "keenly", "35335": "keenness", "35336": "keep", "35341": "keg", "35342": "kelp", "35343": "kennel", "35344": "kept", "35345": "kerchief", "35346": "kerosene", "35351": "kettle", "35352": "kick", "35353": "kiln", "35354": "kilobyte", "35355": "kilogram", "35356": "kilometer", "35361": "kilowatt", "35362": "kilt", "35363": "kimono", "35364": "kindle", "35365": "kindling", "35366": "kindly", "35411": "kindness", "35412": "kindred", "35413": "kinetic", "35414": "kinfolk", "35415": "king", "35416": "kinship", "35421": "kinsman", "35422": "kinswoman", "35423": "kissable", "35424": "kisser", "35425": "kissing", "35426": "kitchen", "35431": "kite", "35432": "kitten", "35433": "kitty", "35434": "kiwi", "35435": "kleenex", "35436": "knapsack", "35441": "knee", "35442": "knelt", "35443": "knickers", "35444": "knoll", "35445": "koala", "35446": "kooky", "35451": "kosher", "35452": "krypton", "35453": "kudos", "35454": "kung", "35455": "labored", "35456": "laborer", "35461": "laboring", "35462": "laborious", "35463": "labrador", "35464": "ladder", "35465": "ladies", "35466": "ladle", "35511": "ladybug", "35512": "ladylike", "35513": "lagged", "35514": "lagging", "35515": "lagoon", "35516": "lair", "35521": "lake", "35522": "lance", "35523": "landed", "35524": "landfall", "35525": "landfill", "35526": "landing", "35531": "landlady", "35532": "landless", "35533": "landline", "35534": "landlord", "35535": "landmark", "35536": "landmass", "35541": "landmine", "35542": "landowner", "35543": "landscape", "35544": "landside", "35545": "landslide", "35546": "language", "35551": "lankiness", "35552": "lanky", "35553": "lantern", "35554": "lapdog", "35555": "lapel", "35556": "lapped", "35561": "lapping", "35562": "laptop", "35563": "lard", "35564": "large", "35565": "lark", "35566": "lash", "35611": "lasso", "35612": "last", "35613": "latch", "35614": "late", "35615": "lather", "35616": "latitude", "35621": "latrine", "35622": "latter", "35623": "latticed", "35624": "launch", "35625": "launder", "35626": "laundry", "35631": "laurel", "35632": "lavender", "35633": "lavish", "35634": "laxative", "35635": "lazily", "35636": "laziness", "35641": "lazy", "35642": "lecturer", "35643": "left", "35644": "legacy", "35645": "legal", "35646": "legend", "35651": "legged", "35652": "leggings", "35653": "legible", "35654": "legibly", "35655": "legislate", "35656": "lego", "35661": "legroom", "35662": "legume", "35663": "legwarmer", "35664": "legwork", "35665": "lemon", "35666": "lend", "36111": "length", "36112": "lens", "36113": "lent", "36114": "leotard", "36115": "lesser", "36116": "letdown", "36121": "lethargic", "36122": "lethargy", "36123": "letter", "36124": "lettuce", "36125": "level", "36126": "leverage", "36131": "levers", "36132": "levitate", "36133": "levitator", "36134": "liability", "36135": "liable", "36136": "liberty", "36141": "librarian", "36142": "library", "36143": "licking", "36144": "licorice", "36145": "lid", "36146": "life", "36151": "lifter", "36152": "lifting", "36153": "liftoff", "36154": "ligament", "36155": "likely", "36156": "likeness", "36161": "likewise", "36162": "liking", "36163": "lilac", "36164": "lilly", "36165": "lily", "36166": "limb", "36211": "limeade", "36212": "limelight", "36213": "limes", "36214": "limit", "36215": "limping", "36216": "limpness", "36221": "line", "36222": "lingo", "36223": "linguini", "36224": "linguist", "36225": "lining", "36226": "linked", "36231": "linoleum", "36232": "linseed", "36233": "lint", "36234": "lion", "36235": "lip", "36236": "liquefy", "36241": "liqueur", "36242": "liquid", "36243": "lisp", "36244": "list", "36245": "litigate", "36246": "litigator", "36251": "litmus", "36252": "litter", "36253": "little", "36254": "livable", "36255": "lived", "36256": "lively", "36261": "liver", "36262": "livestock", "36263": "lividly", "36264": "living", "36265": "lizard", "36266": "lubricant", "36311": "lubricate", "36312": "lucid", "36313": "luckily", "36314": "luckiness", "36315": "luckless", "36316": "lucrative", "36321": "ludicrous", "36322": "lugged", "36323": "lukewarm", "36324": "lullaby", "36325": "lumber", "36326": "luminance", "36331": "luminous", "36332": "lumpiness", "36333": "lumping", "36334": "lumpish", "36335": "lunacy", "36336": "lunar", "36341": "lunchbox", "36342": "luncheon", "36343": "lunchroom", "36344": "lunchtime", "36345": "lung", "36346": "lurch", "36351": "lure", "36352": "luridness", "36353": "lurk", "36354": "lushly", "36355": "lushness", "36356": "luster", "36361": "lustfully", "36362": "lustily", "36363": "lustiness", "36364": "lustrous", "36365": "lusty", "36366": "luxurious", "36411": "luxury", "36412": "lying", "36413": "lyrically", "36414": "lyricism", "36415": "lyricist", "36416": "lyrics", "36421": "macarena", "36422": "macaroni", "36423": "macaw", "36424": "mace", "36425": "machine", "36426": "machinist", "36431": "magazine", "36432": "magenta", "36433": "maggot", "36434": "magical", "36435": "magician", "36436": "magma", "36441": "magnesium", "36442": "magnetic", "36443": "magnetism", "36444": "magnetize", "36445": "magnifier", "36446": "magnify", "36451": "magnitude", "36452": "magnolia", "36453": "mahogany", "36454": "maimed", "36455": "majestic", "36456": "majesty", "36461": "majorette", "36462": "majority", "36463": "makeover", "36464": "maker", "36465": "makeshift", "36466": "making", "36511": "malformed", "36512": "malt", "36513": "mama", "36514": "mammal", "36515": "mammary", "36516": "mammogram", "36521": "manager", "36522": "managing", "36523": "manatee", "36524": "mandarin", "36525": "mandate", "36526": "mandatory", "36531": "mandolin", "36532": "manger", "36533": "mangle", "36534": "mango", "36535": "mangy", "36536": "manhandle", "36541": "manhole", "36542": "manhood", "36543": "manhunt", "36544": "manicotti", "36545": "manicure", "36546": "manifesto", "36551": "manila", "36552": "mankind", "36553": "manlike", "36554": "manliness", "36555": "manly", "36556": "manmade", "36561": "manned", "36562": "mannish", "36563": "manor", "36564": "manpower", "36565": "mantis", "36566": "mantra", "36611": "manual", "36612": "many", "36613": "map", "36614": "marathon", "36615": "marauding", "36616": "marbled", "36621": "marbles", "36622": "marbling", "36623": "march", "36624": "mardi", "36625": "margarine", "36626": "margarita", "36631": "margin", "36632": "marigold", "36633": "marina", "36634": "marine", "36635": "marital", "36636": "maritime", "36641": "marlin", "36642": "marmalade", "36643": "maroon", "36644": "married", "36645": "marrow", "36646": "marry", "36651": "marshland", "36652": "marshy", "36653": "marsupial", "36654": "marvelous", "36655": "marxism", "36656": "mascot", "36661": "masculine", "36662": "mashed", "36663": "mashing", "36664": "massager", "36665": "masses", "36666": "massive", "41111": "mastiff", "41112": "matador", "41113": "matchbook", "41114": "matchbox", "41115": "matcher", "41116": "matching", "41121": "matchless", "41122": "material", "41123": "maternal", "41124": "maternity", "41125": "math", "41126": "mating", "41131": "matriarch", "41132": "matrimony", "41133": "matrix", "41134": "matron", "41135": "matted", "41136": "matter", "41141": "maturely", "41142": "maturing", "41143": "maturity", "41144": "mauve", "41145": "maverick", "41146": "maximize", "41151": "maximum", "41152": "maybe", "41153": "mayday", "41154": "mayflower", "41155": "moaner", "41156": "moaning", "41161": "mobile", "41162": "mobility", "41163": "mobilize", "41164": "mobster", "41165": "mocha", "41166": "mocker", "41211": "mockup", "41212": "modified", "41213": "modify", "41214": "modular", "41215": "modulator", "41216": "module", "41221": "moisten", "41222": "moistness", "41223": "moisture", "41224": "molar", "41225": "molasses", "41226": "mold", "41231": "molecular", "41232": "molecule", "41233": "molehill", "41234": "mollusk", "41235": "mom", "41236": "monastery", "41241": "monday", "41242": "monetary", "41243": "monetize", "41244": "moneybags", "41245": "moneyless", "41246": "moneywise", "41251": "mongoose", "41252": "mongrel", "41253": "monitor", "41254": "monkhood", "41255": "monogamy", "41256": "monogram", "41261": "monologue", "41262": "monopoly", "41263": "monorail", "41264": "monotone", "41265": "monotype", "41266": "monoxide", "41311": "monsieur", "41312": "monsoon", "41313": "monstrous", "41314": "monthly", "41315": "monument", "41316": "moocher", "41321": "moodiness", "41322": "moody", "41323": "mooing", "41324": "moonbeam", "41325": "mooned", "41326": "moonlight", "41331": "moonlike", "41332": "moonlit", "41333": "moonrise", "41334": "moonscape", "41335": "moonshine", "41336": "moonstone", "41341": "moonwalk", "41342": "mop", "41343": "morale", "41344": "morality", "41345": "morally", "41346": "morbidity", "41351": "morbidly", "41352": "morphine", "41353": "morphing", "41354": "morse", "41355": "mortality", "41356": "mortally", "41361": "mortician", "41362": "mortified", "41363": "mortify", "41364": "mortuary", "41365": "mosaic", "41366": "mossy", "41411": "most", "41412": "mothball", "41413": "mothproof", "41414": "motion", "41415": "motivate", "41416": "motivator", "41421": "motive", "41422": "motocross", "41423": "motor", "41424": "motto", "41425": "mountable", "41426": "mountain", "41431": "mounted", "41432": "mounting", "41433": "mourner", "41434": "mournful", "41435": "mouse", "41436": "mousiness", "41441": "moustache", "41442": "mousy", "41443": "mouth", "41444": "movable", "41445": "move", "41446": "movie", "41451": "moving", "41452": "mower", "41453": "mowing", "41454": "much", "41455": "muck", "41456": "mud", "41461": "mug", "41462": "mulberry", "41463": "mulch", "41464": "mule", "41465": "mulled", "41466": "mullets", "41511": "multiple", "41512": "multiply", "41513": "multitask", "41514": "multitude", "41515": "mumble", "41516": "mumbling", "41521": "mumbo", "41522": "mummified", "41523": "mummify", "41524": "mummy", "41525": "mumps", "41526": "munchkin", "41531": "mundane", "41532": "municipal", "41533": "muppet", "41534": "mural", "41535": "murkiness", "41536": "murky", "41541": "murmuring", "41542": "muscular", "41543": "museum", "41544": "mushily", "41545": "mushiness", "41546": "mushroom", "41551": "mushy", "41552": "music", "41553": "musket", "41554": "muskiness", "41555": "musky", "41556": "mustang", "41561": "mustard", "41562": "muster", "41563": "mustiness", "41564": "musty", "41565": "mutable", "41566": "mutate", "41611": "mutation", "41612": "mute", "41613": "mutilated", "41614": "mutilator", "41615": "mutiny", "41616": "mutt", "41621": "mutual", "41622": "muzzle", "41623": "myself", "41624": "myspace", "41625": "mystified", "41626": "mystify", "41631": "myth", "41632": "nacho", "41633": "nag", "41634": "nail", "41635": "name", "41636": "naming", "41641": "nanny", "41642": "nanometer", "41643": "nape", "41644": "napkin", "41645": "napped", "41646": "napping", "41651": "nappy", "41652": "narrow", "41653": "nastily", "41654": "nastiness", "41655": "national", "41656": "native", "41661": "nativity", "41662": "natural", "41663": "nature", "41664": "naturist", "41665": "nautical", "41666": "navigate", "42111": "navigator", "42112": "navy", "42113": "nearby", "42114": "nearest", "42115": "nearly", "42116": "nearness", "42121": "neatly", "42122": "neatness", "42123": "nebula", "42124": "nebulizer", "42125": "nectar", "42126": "negate", "42131": "negation", "42132": "negative", "42133": "neglector", "42134": "negligee", "42135": "negligent", "42136": "negotiate", "42141": "nemeses", "42142": "nemesis", "42143": "neon", "42144": "nephew", "42145": "nerd", "42146": "nervous", "42151": "nervy", "42152": "nest", "42153": "net", "42154": "neurology", "42155": "neuron", "42156": "neurosis", "42161": "neurotic", "42162": "neuter", "42163": "neutron", "42164": "never", "42165": "next", "42166": "nibble", "42211": "nickname", "42212": "nicotine", "42213": "niece", "42214": "nifty", "42215": "nimble", "42216": "nimbly", "42221": "nineteen", "42222": "ninetieth", "42223": "ninja", "42224": "nintendo", "42225": "ninth", "42226": "nuclear", "42231": "nuclei", "42232": "nucleus", "42233": "nugget", "42234": "nullify", "42235": "number", "42236": "numbing", "42241": "numbly", "42242": "numbness", "42243": "numeral", "42244": "numerate", "42245": "numerator", "42246": "numeric", "42251": "numerous", "42252": "nuptials", "42253": "nursery", "42254": "nursing", "42255": "nurture", "42256": "nutcase", "42261": "nutlike", "42262": "nutmeg", "42263": "nutrient", "42264": "nutshell", "42265": "nuttiness", "42266": "nutty", "42311": "nuzzle", "42312": "nylon", "42313": "oaf", "42314": "oak", "42315": "oasis", "42316": "oat", "42321": "obedience", "42322": "obedient", "42323": "obituary", "42324": "object", "42325": "obligate", "42326": "obliged", "42331": "oblivion", "42332": "oblivious", "42333": "oblong", "42334": "obnoxious", "42335": "oboe", "42336": "obscure", "42341": "obscurity", "42342": "observant", "42343": "observer", "42344": "observing", "42345": "obsessed", "42346": "obsession", "42351": "obsessive", "42352": "obsolete", "42353": "obstacle", "42354": "obstinate", "42355": "obstruct", "42356": "obtain", "42361": "obtrusive", "42362": "obtuse", "42363": "obvious", "42364": "occultist", "42365": "occupancy", "42366": "occupant", "42411": "occupier", "42412": "occupy", "42413": "ocean", "42414": "ocelot", "42415": "octagon", "42416": "octane", "42421": "october", "42422": "octopus", "42423": "ogle", "42424": "oil", "42425": "oink", "42426": "ointment", "42431": "okay", "42432": "old", "42433": "olive", "42434": "olympics", "42435": "omega", "42436": "omen", "42441": "ominous", "42442": "omission", "42443": "omit", "42444": "omnivore", "42445": "onboard", "42446": "oncoming", "42451": "ongoing", "42452": "onion", "42453": "online", "42454": "onlooker", "42455": "only", "42456": "onscreen", "42461": "onset", "42462": "onshore", "42463": "onslaught", "42464": "onstage", "42465": "onto", "42466": "onward", "42511": "onyx", "42512": "oops", "42513": "ooze", "42514": "oozy", "42515": "opacity", "42516": "opal", "42521": "open", "42522": "operable", "42523": "operate", "42524": "operating", "42525": "operation", "42526": "operative", "42531": "operator", "42532": "opium", "42533": "opossum", "42534": "opponent", "42535": "oppose", "42536": "opposing", "42541": "opposite", "42542": "oppressed", "42543": "oppressor", "42544": "opt", "42545": "opulently", "42546": "osmosis", "42551": "other", "42552": "otter", "42553": "ouch", "42554": "ought", "42555": "ounce", "42556": "outage", "42561": "outback", "42562": "outbid", "42563": "outboard", "42564": "outbound", "42565": "outbreak", "42566": "outburst", "42611": "outcast", "42612": "outclass", "42613": "outcome", "42614": "outdated", "42615": "outdoors", "42616": "outer", "42621": "outfield", "42622": "outfit", "42623": "outflank", "42624": "outgoing", "42625": "outgrow", "42626": "outhouse", "42631": "outing", "42632": "outlast", "42633": "outlet", "42634": "outline", "42635": "outlook", "42636": "outlying", "42641": "outmatch", "42642": "outmost", "42643": "outnumber", "42644": "outplayed", "42645": "outpost", "42646": "outpour", "42651": "output", "42652": "outrage", "42653": "outrank", "42654": "outreach", "42655": "outright", "42656": "outscore", "42661": "outsell", "42662": "outshine", "42663": "outshoot", "42664": "outsider", "42665": "outskirts", "42666": "outsmart", "43111": "outsource", "43112": "outspoken", "43113": "outtakes", "43114": "outthink", "43115": "outward", "43116": "outweigh", "43121": "outwit", "43122": "oval", "43123": "ovary", "43124": "oven", "43125": "overact", "43126": "overall", "43131": "overarch", "43132": "overbid", "43133": "overbill", "43134": "overbite", "43135": "overblown", "43136": "overboard", "43141": "overbook", "43142": "overbuilt", "43143": "overcast", "43144": "overcoat", "43145": "overcome", "43146": "overcook", "43151": "overcrowd", "43152": "overdraft", "43153": "overdrawn", "43154": "overdress", "43155": "overdrive", "43156": "overdue", "43161": "overeager", "43162": "overeater", "43163": "overexert", "43164": "overfed", "43165": "overfeed", "43166": "overfill", "43211": "overflow", "43212": "overfull", "43213": "overgrown", "43214": "overhand", "43215": "overhang", "43216": "overhaul", "43221": "overhead", "43222": "overhear", "43223": "overheat", "43224": "overhung", "43225": "overjoyed", "43226": "overkill", "43231": "overlabor", "43232": "overlaid", "43233": "overlap", "43234": "overlay", "43235": "overload", "43236": "overlook", "43241": "overlord", "43242": "overlying", "43243": "overnight", "43244": "overpass", "43245": "overpay", "43246": "overplant", "43251": "overplay", "43252": "overpower", "43253": "overprice", "43254": "overrate", "43255": "overreach", "43256": "overreact", "43261": "override", "43262": "overripe", "43263": "overrule", "43264": "overrun", "43265": "overshoot", "43266": "overshot", "43311": "oversight", "43312": "oversized", "43313": "oversleep", "43314": "oversold", "43315": "overspend", "43316": "overstate", "43321": "overstay", "43322": "overstep", "43323": "overstock", "43324": "overstuff", "43325": "oversweet", "43326": "overtake", "43331": "overthrow", "43332": "overtime", "43333": "overtly", "43334": "overtone", "43335": "overture", "43336": "overturn", "43341": "overuse", "43342": "overvalue", "43343": "overview", "43344": "overwrite", "43345": "owl", "43346": "oxford", "43351": "oxidant", "43352": "oxidation", "43353": "oxidize", "43354": "oxidizing", "43355": "oxygen", "43356": "oxymoron", "43361": "oyster", "43362": "ozone", "43363": "paced", "43364": "pacemaker", "43365": "pacific", "43366": "pacifier", "43411": "pacifism", "43412": "pacifist", "43413": "pacify", "43414": "padded", "43415": "padding", "43416": "paddle", "43421": "paddling", "43422": "padlock", "43423": "pagan", "43424": "pager", "43425": "paging", "43426": "pajamas", "43431": "palace", "43432": "palatable", "43433": "palm", "43434": "palpable", "43435": "palpitate", "43436": "paltry", "43441": "pampered", "43442": "pamperer", "43443": "pampers", "43444": "pamphlet", "43445": "panama", "43446": "pancake", "43451": "pancreas", "43452": "panda", "43453": "pandemic", "43454": "pang", "43455": "panhandle", "43456": "panic", "43461": "panning", "43462": "panorama", "43463": "panoramic", "43464": "panther", "43465": "pantomime", "43466": "pantry", "43511": "pants", "43512": "pantyhose", "43513": "paparazzi", "43514": "papaya", "43515": "paper", "43516": "paprika", "43521": "papyrus", "43522": "parabola", "43523": "parachute", "43524": "parade", "43525": "paradox", "43526": "paragraph", "43531": "parakeet", "43532": "paralegal", "43533": "paralyses", "43534": "paralysis", "43535": "paralyze", "43536": "paramedic", "43541": "parameter", "43542": "paramount", "43543": "parasail", "43544": "parasite", "43545": "parasitic", "43546": "parcel", "43551": "parched", "43552": "parchment", "43553": "pardon", "43554": "parish", "43555": "parka", "43556": "parking", "43561": "parkway", "43562": "parlor", "43563": "parmesan", "43564": "parole", "43565": "parrot", "43566": "parsley", "43611": "parsnip", "43612": "partake", "43613": "parted", "43614": "parting", "43615": "partition", "43616": "partly", "43621": "partner", "43622": "partridge", "43623": "party", "43624": "passable", "43625": "passably", "43626": "passage", "43631": "passcode", "43632": "passenger", "43633": "passerby", "43634": "passing", "43635": "passion", "43636": "passive", "43641": "passivism", "43642": "passover", "43643": "passport", "43644": "password", "43645": "pasta", "43646": "pasted", "43651": "pastel", "43652": "pastime", "43653": "pastor", "43654": "pastrami", "43655": "pasture", "43656": "pasty", "43661": "patchwork", "43662": "patchy", "43663": "paternal", "43664": "paternity", "43665": "path", "43666": "patience", "44111": "patient", "44112": "patio", "44113": "patriarch", "44114": "patriot", "44115": "patrol", "44116": "patronage", "44121": "patronize", "44122": "pauper", "44123": "pavement", "44124": "paver", "44125": "pavestone", "44126": "pavilion", "44131": "paving", "44132": "pawing", "44133": "payable", "44134": "payback", "44135": "paycheck", "44136": "payday", "44141": "payee", "44142": "payer", "44143": "paying", "44144": "payment", "44145": "payphone", "44146": "payroll", "44151": "pebble", "44152": "pebbly", "44153": "pecan", "44154": "pectin", "44155": "peculiar", "44156": "peddling", "44161": "pediatric", "44162": "pedicure", "44163": "pedigree", "44164": "pedometer", "44165": "pegboard", "44166": "pelican", "44211": "pellet", "44212": "pelt", "44213": "pelvis", "44214": "penalize", "44215": "penalty", "44216": "pencil", "44221": "pendant", "44222": "pending", "44223": "penholder", "44224": "penknife", "44225": "pennant", "44226": "penniless", "44231": "penny", "44232": "penpal", "44233": "pension", "44234": "pentagon", "44235": "pentagram", "44236": "pep", "44241": "perceive", "44242": "percent", "44243": "perch", "44244": "percolate", "44245": "perennial", "44246": "perfected", "44251": "perfectly", "44252": "perfume", "44253": "periscope", "44254": "perish", "44255": "perjurer", "44256": "perjury", "44261": "perkiness", "44262": "perky", "44263": "perm", "44264": "peroxide", "44265": "perpetual", "44266": "perplexed", "44311": "persecute", "44312": "persevere", "44313": "persuaded", "44314": "persuader", "44315": "pesky", "44316": "peso", "44321": "pessimism", "44322": "pessimist", "44323": "pester", "44324": "pesticide", "44325": "petal", "44326": "petite", "44331": "petition", "44332": "petri", "44333": "petroleum", "44334": "petted", "44335": "petticoat", "44336": "pettiness", "44341": "petty", "44342": "petunia", "44343": "phantom", "44344": "phobia", "44345": "phoenix", "44346": "phonebook", "44351": "phoney", "44352": "phonics", "44353": "phoniness", "44354": "phony", "44355": "phosphate", "44356": "photo", "44361": "phrase", "44362": "phrasing", "44363": "placard", "44364": "placate", "44365": "placidly", "44366": "plank", "44411": "planner", "44412": "plant", "44413": "plasma", "44414": "plaster", "44415": "plastic", "44416": "plated", "44421": "platform", "44422": "plating", "44423": "platinum", "44424": "platonic", "44425": "platter", "44426": "platypus", "44431": "plausible", "44432": "plausibly", "44433": "playable", "44434": "playback", "44435": "player", "44436": "playful", "44441": "playgroup", "44442": "playhouse", "44443": "playing", "44444": "playlist", "44445": "playmaker", "44446": "playmate", "44451": "playoff", "44452": "playpen", "44453": "playroom", "44454": "playset", "44455": "plaything", "44456": "playtime", "44461": "plaza", "44462": "pleading", "44463": "pleat", "44464": "pledge", "44465": "plentiful", "44466": "plenty", "44511": "plethora", "44512": "plexiglas", "44513": "pliable", "44514": "plod", "44515": "plop", "44516": "plot", "44521": "plow", "44522": "ploy", "44523": "pluck", "44524": "plug", "44525": "plunder", "44526": "plunging", "44531": "plural", "44532": "plus", "44533": "plutonium", "44534": "plywood", "44535": "poach", "44536": "pod", "44541": "poem", "44542": "poet", "44543": "pogo", "44544": "pointed", "44545": "pointer", "44546": "pointing", "44551": "pointless", "44552": "pointy", "44553": "poise", "44554": "poison", "44555": "poker", "44556": "poking", "44561": "polar", "44562": "police", "44563": "policy", "44564": "polio", "44565": "polish", "44566": "politely", "44611": "polka", "44612": "polo", "44613": "polyester", "44614": "polygon", "44615": "polygraph", "44616": "polymer", "44621": "poncho", "44622": "pond", "44623": "pony", "44624": "popcorn", "44625": "pope", "44626": "poplar", "44631": "popper", "44632": "poppy", "44633": "popsicle", "44634": "populace", "44635": "popular", "44636": "populate", "44641": "porcupine", "44642": "pork", "44643": "porous", "44644": "porridge", "44645": "portable", "44646": "portal", "44651": "portfolio", "44652": "porthole", "44653": "portion", "44654": "portly", "44655": "portside", "44656": "poser", "44661": "posh", "44662": "posing", "44663": "possible", "44664": "possibly", "44665": "possum", "44666": "postage", "45111": "postal", "45112": "postbox", "45113": "postcard", "45114": "posted", "45115": "poster", "45116": "posting", "45121": "postnasal", "45122": "posture", "45123": "postwar", "45124": "pouch", "45125": "pounce", "45126": "pouncing", "45131": "pound", "45132": "pouring", "45133": "pout", "45134": "powdered", "45135": "powdering", "45136": "powdery", "45141": "power", "45142": "powwow", "45143": "pox", "45144": "praising", "45145": "prance", "45146": "prancing", "45151": "pranker", "45152": "prankish", "45153": "prankster", "45154": "prayer", "45155": "praying", "45156": "preacher", "45161": "preaching", "45162": "preachy", "45163": "preamble", "45164": "precinct", "45165": "precise", "45166": "precision", "45211": "precook", "45212": "precut", "45213": "predator", "45214": "predefine", "45215": "predict", "45216": "preface", "45221": "prefix", "45222": "preflight", "45223": "preformed", "45224": "pregame", "45225": "pregnancy", "45226": "pregnant", "45231": "preheated", "45232": "prelaunch", "45233": "prelaw", "45234": "prelude", "45235": "premiere", "45236": "premises", "45241": "premium", "45242": "prenatal", "45243": "preoccupy", "45244": "preorder", "45245": "prepaid", "45246": "prepay", "45251": "preplan", "45252": "preppy", "45253": "preschool", "45254": "prescribe", "45255": "preseason", "45256": "preset", "45261": "preshow", "45262": "president", "45263": "presoak", "45264": "press", "45265": "presume", "45266": "presuming", "45311": "preteen", "45312": "pretended", "45313": "pretender", "45314": "pretense", "45315": "pretext", "45316": "pretty", "45321": "pretzel", "45322": "prevail", "45323": "prevalent", "45324": "prevent", "45325": "preview", "45326": "previous", "45331": "prewar", "45332": "prewashed", "45333": "prideful", "45334": "pried", "45335": "primal", "45336": "primarily", "45341": "primary", "45342": "primate", "45343": "primer", "45344": "primp", "45345": "princess", "45346": "print", "45351": "prior", "45352": "prism", "45353": "prison", "45354": "prissy", "45355": "pristine", "45356": "privacy", "45361": "private", "45362": "privatize", "45363": "prize", "45364": "proactive", "45365": "probable", "45366": "probably", "45411": "probation", "45412": "probe", "45413": "probing", "45414": "probiotic", "45415": "problem", "45416": "procedure", "45421": "process", "45422": "proclaim", "45423": "procreate", "45424": "procurer", "45425": "prodigal", "45426": "prodigy", "45431": "produce", "45432": "product", "45433": "profane", "45434": "profanity", "45435": "professed", "45436": "professor", "45441": "profile", "45442": "profound", "45443": "profusely", "45444": "progeny", "45445": "prognosis", "45446": "program", "45451": "progress", "45452": "projector", "45453": "prologue", "45454": "prolonged", "45455": "promenade", "45456": "prominent", "45461": "promoter", "45462": "promotion", "45463": "prompter", "45464": "promptly", "45465": "prone", "45466": "prong", "45511": "pronounce", "45512": "pronto", "45513": "proofing", "45514": "proofread", "45515": "proofs", "45516": "propeller", "45521": "properly", "45522": "property", "45523": "proponent", "45524": "proposal", "45525": "propose", "45526": "props", "45531": "prorate", "45532": "protector", "45533": "protegee", "45534": "proton", "45535": "prototype", "45536": "protozoan", "45541": "protract", "45542": "protrude", "45543": "proud", "45544": "provable", "45545": "proved", "45546": "proven", "45551": "provided", "45552": "provider", "45553": "providing", "45554": "province", "45555": "proving", "45556": "provoke", "45561": "provoking", "45562": "provolone", "45563": "prowess", "45564": "prowler", "45565": "prowling", "45566": "proximity", "45611": "proxy", "45612": "prozac", "45613": "prude", "45614": "prudishly", "45615": "prune", "45616": "pruning", "45621": "pry", "45622": "psychic", "45623": "public", "45624": "publisher", "45625": "pucker", "45626": "pueblo", "45631": "pug", "45632": "pull", "45633": "pulmonary", "45634": "pulp", "45635": "pulsate", "45636": "pulse", "45641": "pulverize", "45642": "puma", "45643": "pumice", "45644": "pummel", "45645": "punch", "45646": "punctual", "45651": "punctuate", "45652": "punctured", "45653": "pungent", "45654": "punisher", "45655": "punk", "45656": "pupil", "45661": "puppet", "45662": "puppy", "45663": "purchase", "45664": "pureblood", "45665": "purebred", "45666": "purely", "46111": "pureness", "46112": "purgatory", "46113": "purge", "46114": "purging", "46115": "purifier", "46116": "purify", "46121": "purist", "46122": "puritan", "46123": "purity", "46124": "purple", "46125": "purplish", "46126": "purposely", "46131": "purr", "46132": "purse", "46133": "pursuable", "46134": "pursuant", "46135": "pursuit", "46136": "purveyor", "46141": "pushcart", "46142": "pushchair", "46143": "pusher", "46144": "pushiness", "46145": "pushing", "46146": "pushover", "46151": "pushpin", "46152": "pushup", "46153": "pushy", "46154": "putdown", "46155": "putt", "46156": "puzzle", "46161": "puzzling", "46162": "pyramid", "46163": "pyromania", "46164": "python", "46165": "quack", "46166": "quadrant", "46211": "quail", "46212": "quaintly", "46213": "quake", "46214": "quaking", "46215": "qualified", "46216": "qualifier", "46221": "qualify", "46222": "quality", "46223": "qualm", "46224": "quantum", "46225": "quarrel", "46226": "quarry", "46231": "quartered", "46232": "quarterly", "46233": "quarters", "46234": "quartet", "46235": "quench", "46236": "query", "46241": "quicken", "46242": "quickly", "46243": "quickness", "46244": "quicksand", "46245": "quickstep", "46246": "quiet", "46251": "quill", "46252": "quilt", "46253": "quintet", "46254": "quintuple", "46255": "quirk", "46256": "quit", "46261": "quiver", "46262": "quizzical", "46263": "quotable", "46264": "quotation", "46265": "quote", "46266": "rabid", "46311": "race", "46312": "racing", "46313": "racism", "46314": "rack", "46315": "racoon", "46316": "radar", "46321": "radial", "46322": "radiance", "46323": "radiantly", "46324": "radiated", "46325": "radiation", "46326": "radiator", "46331": "radio", "46332": "radish", "46333": "raffle", "46334": "raft", "46335": "rage", "46336": "ragged", "46341": "raging", "46342": "ragweed", "46343": "raider", "46344": "railcar", "46345": "railing", "46346": "railroad", "46351": "railway", "46352": "raisin", "46353": "rake", "46354": "raking", "46355": "rally", "46356": "ramble", "46361": "rambling", "46362": "ramp", "46363": "ramrod", "46364": "ranch", "46365": "rancidity", "46366": "random", "46411": "ranged", "46412": "ranger", "46413": "ranging", "46414": "ranked", "46415": "ranking", "46416": "ransack", "46421": "ranting", "46422": "rants", "46423": "rare", "46424": "rarity", "46425": "rascal", "46426": "rash", "46431": "rasping", "46432": "ravage", "46433": "raven", "46434": "ravine", "46435": "raving", "46436": "ravioli", "46441": "ravishing", "46442": "reabsorb", "46443": "reach", "46444": "reacquire", "46445": "reaction", "46446": "reactive", "46451": "reactor", "46452": "reaffirm", "46453": "ream", "46454": "reanalyze", "46455": "reappear", "46456": "reapply", "46461": "reappoint", "46462": "reapprove", "46463": "rearrange", "46464": "rearview", "46465": "reason", "46466": "reassign", "46511": "reassure", "46512": "reattach", "46513": "reawake", "46514": "rebalance", "46515": "rebate", "46516": "rebel", "46521": "rebirth", "46522": "reboot", "46523": "reborn", "46524": "rebound", "46525": "rebuff", "46526": "rebuild", "46531": "rebuilt", "46532": "reburial", "46533": "rebuttal", "46534": "recall", "46535": "recant", "46536": "recapture", "46541": "recast", "46542": "recede", "46543": "recent", "46544": "recess", "46545": "recharger", "46546": "recipient", "46551": "recital", "46552": "recite", "46553": "reckless", "46554": "reclaim", "46555": "recliner", "46556": "reclining", "46561": "recluse", "46562": "reclusive", "46563": "recognize", "46564": "recoil", "46565": "recollect", "46566": "recolor", "46611": "reconcile", "46612": "reconfirm", "46613": "reconvene", "46614": "recopy", "46615": "record", "46616": "recount", "46621": "recoup", "46622": "recovery", "46623": "recreate", "46624": "rectal", "46625": "rectangle", "46626": "rectified", "46631": "rectify", "46632": "recycled", "46633": "recycler", "46634": "recycling", "46635": "reemerge", "46636": "reenact", "46641": "reenter", "46642": "reentry", "46643": "reexamine", "46644": "referable", "46645": "referee", "46646": "reference", "46651": "refill", "46652": "refinance", "46653": "refined", "46654": "refinery", "46655": "refining", "46656": "refinish", "46661": "reflected", "46662": "reflector", "46663": "reflex", "46664": "reflux", "46665": "refocus", "46666": "refold", "51111": "reforest", "51112": "reformat", "51113": "reformed", "51114": "reformer", "51115": "reformist", "51116": "refract", "51121": "refrain", "51122": "refreeze", "51123": "refresh", "51124": "refried", "51125": "refueling", "51126": "refund", "51131": "refurbish", "51132": "refurnish", "51133": "refusal", "51134": "refuse", "51135": "refusing", "51136": "refutable", "51141": "refute", "51142": "regain", "51143": "regalia", "51144": "regally", "51145": "reggae", "51146": "regime", "51151": "region", "51152": "register", "51153": "registrar", "51154": "registry", "51155": "regress", "51156": "regretful", "51161": "regroup", "51162": "regular", "51163": "regulate", "51164": "regulator", "51165": "rehab", "51166": "reheat", "51211": "rehire", "51212": "rehydrate", "51213": "reimburse", "51214": "reissue", "51215": "reiterate", "51216": "rejoice", "51221": "rejoicing", "51222": "rejoin", "51223": "rekindle", "51224": "relapse", "51225": "relapsing", "51226": "relatable", "51231": "related", "51232": "relation", "51233": "relative", "51234": "relax", "51235": "relay", "51236": "relearn", "51241": "release", "51242": "relenting", "51243": "reliable", "51244": "reliably", "51245": "reliance", "51246": "reliant", "51251": "relic", "51252": "relieve", "51253": "relieving", "51254": "relight", "51255": "relish", "51256": "relive", "51261": "reload", "51262": "relocate", "51263": "relock", "51264": "reluctant", "51265": "rely", "51266": "remake", "51311": "remark", "51312": "remarry", "51313": "rematch", "51314": "remedial", "51315": "remedy", "51316": "remember", "51321": "reminder", "51322": "remindful", "51323": "remission", "51324": "remix", "51325": "remnant", "51326": "remodeler", "51331": "remold", "51332": "remorse", "51333": "remote", "51334": "removable", "51335": "removal", "51336": "removed", "51341": "remover", "51342": "removing", "51343": "rename", "51344": "renderer", "51345": "rendering", "51346": "rendition", "51351": "renegade", "51352": "renewable", "51353": "renewably", "51354": "renewal", "51355": "renewed", "51356": "renounce", "51361": "renovate", "51362": "renovator", "51363": "rentable", "51364": "rental", "51365": "rented", "51366": "renter", "51411": "reoccupy", "51412": "reoccur", "51413": "reopen", "51414": "reorder", "51415": "repackage", "51416": "repacking", "51421": "repaint", "51422": "repair", "51423": "repave", "51424": "repaying", "51425": "repayment", "51426": "repeal", "51431": "repeated", "51432": "repeater", "51433": "repent", "51434": "rephrase", "51435": "replace", "51436": "replay", "51441": "replica", "51442": "reply", "51443": "reporter", "51444": "repose", "51445": "repossess", "51446": "repost", "51451": "repressed", "51452": "reprimand", "51453": "reprint", "51454": "reprise", "51455": "reproach", "51456": "reprocess", "51461": "reproduce", "51462": "reprogram", "51463": "reps", "51464": "reptile", "51465": "reptilian", "51466": "repugnant", "51511": "repulsion", "51512": "repulsive", "51513": "repurpose", "51514": "reputable", "51515": "reputably", "51516": "request", "51521": "require", "51522": "requisite", "51523": "reroute", "51524": "rerun", "51525": "resale", "51526": "resample", "51531": "rescuer", "51532": "reseal", "51533": "research", "51534": "reselect", "51535": "reseller", "51536": "resemble", "51541": "resend", "51542": "resent", "51543": "reset", "51544": "reshape", "51545": "reshoot", "51546": "reshuffle", "51551": "residence", "51552": "residency", "51553": "resident", "51554": "residual", "51555": "residue", "51556": "resigned", "51561": "resilient", "51562": "resistant", "51563": "resisting", "51564": "resize", "51565": "resolute", "51566": "resolved", "51611": "resonant", "51612": "resonate", "51613": "resort", "51614": "resource", "51615": "respect", "51616": "resubmit", "51621": "result", "51622": "resume", "51623": "resupply", "51624": "resurface", "51625": "resurrect", "51626": "retail", "51631": "retainer", "51632": "retaining", "51633": "retake", "51634": "retaliate", "51635": "retention", "51636": "rethink", "51641": "retinal", "51642": "retired", "51643": "retiree", "51644": "retiring", "51645": "retold", "51646": "retool", "51651": "retorted", "51652": "retouch", "51653": "retrace", "51654": "retract", "51655": "retrain", "51656": "retread", "51661": "retreat", "51662": "retrial", "51663": "retrieval", "51664": "retriever", "51665": "retry", "51666": "return", "52111": "retying", "52112": "retype", "52113": "reunion", "52114": "reunite", "52115": "reusable", "52116": "reuse", "52121": "reveal", "52122": "reveler", "52123": "revenge", "52124": "revenue", "52125": "reverb", "52126": "revered", "52131": "reverence", "52132": "reverend", "52133": "reversal", "52134": "reverse", "52135": "reversing", "52136": "reversion", "52141": "revert", "52142": "revisable", "52143": "revise", "52144": "revision", "52145": "revisit", "52146": "revivable", "52151": "revival", "52152": "reviver", "52153": "reviving", "52154": "revocable", "52155": "revoke", "52156": "revolt", "52161": "revolver", "52162": "revolving", "52163": "reward", "52164": "rewash", "52165": "rewind", "52166": "rewire", "52211": "reword", "52212": "rework", "52213": "rewrap", "52214": "rewrite", "52215": "rhyme", "52216": "ribbon", "52221": "ribcage", "52222": "rice", "52223": "riches", "52224": "richly", "52225": "richness", "52226": "rickety", "52231": "ricotta", "52232": "riddance", "52233": "ridden", "52234": "ride", "52235": "riding", "52236": "rifling", "52241": "rift", "52242": "rigging", "52243": "rigid", "52244": "rigor", "52245": "rimless", "52246": "rimmed", "52251": "rind", "52252": "rink", "52253": "rinse", "52254": "rinsing", "52255": "riot", "52256": "ripcord", "52261": "ripeness", "52262": "ripening", "52263": "ripping", "52264": "ripple", "52265": "rippling", "52266": "riptide", "52311": "rise", "52312": "rising", "52313": "risk", "52314": "risotto", "52315": "ritalin", "52316": "ritzy", "52321": "rival", "52322": "riverbank", "52323": "riverbed", "52324": "riverboat", "52325": "riverside", "52326": "riveter", "52331": "riveting", "52332": "roamer", "52333": "roaming", "52334": "roast", "52335": "robbing", "52336": "robe", "52341": "robin", "52342": "robotics", "52343": "robust", "52344": "rockband", "52345": "rocker", "52346": "rocket", "52351": "rockfish", "52352": "rockiness", "52353": "rocking", "52354": "rocklike", "52355": "rockslide", "52356": "rockstar", "52361": "rocky", "52362": "rogue", "52363": "roman", "52364": "romp", "52365": "rope", "52366": "roping", "52411": "roster", "52412": "rosy", "52413": "rotten", "52414": "rotting", "52415": "rotunda", "52416": "roulette", "52421": "rounding", "52422": "roundish", "52423": "roundness", "52424": "roundup", "52425": "roundworm", "52426": "routine", "52431": "routing", "52432": "rover", "52433": "roving", "52434": "royal", "52435": "rubbed", "52436": "rubber", "52441": "rubbing", "52442": "rubble", "52443": "rubdown", "52444": "ruby", "52445": "ruckus", "52446": "rudder", "52451": "rug", "52452": "ruined", "52453": "rule", "52454": "rumble", "52455": "rumbling", "52456": "rummage", "52461": "rumor", "52462": "runaround", "52463": "rundown", "52464": "runner", "52465": "running", "52466": "runny", "52511": "runt", "52512": "runway", "52513": "rupture", "52514": "rural", "52515": "ruse", "52516": "rush", "52521": "rust", "52522": "rut", "52523": "sabbath", "52524": "sabotage", "52525": "sacrament", "52526": "sacred", "52531": "sacrifice", "52532": "sadden", "52533": "saddlebag", "52534": "saddled", "52535": "saddling", "52536": "sadly", "52541": "sadness", "52542": "safari", "52543": "safeguard", "52544": "safehouse", "52545": "safely", "52546": "safeness", "52551": "saffron", "52552": "saga", "52553": "sage", "52554": "sagging", "52555": "saggy", "52556": "said", "52561": "saint", "52562": "sake", "52563": "salad", "52564": "salami", "52565": "salaried", "52566": "salary", "52611": "saline", "52612": "salon", "52613": "saloon", "52614": "salsa", "52615": "salt", "52616": "salutary", "52621": "salute", "52622": "salvage", "52623": "salvaging", "52624": "salvation", "52625": "same", "52626": "sample", "52631": "sampling", "52632": "sanction", "52633": "sanctity", "52634": "sanctuary", "52635": "sandal", "52636": "sandbag", "52641": "sandbank", "52642": "sandbar", "52643": "sandblast", "52644": "sandbox", "52645": "sanded", "52646": "sandfish", "52651": "sanding", "52652": "sandlot", "52653": "sandpaper", "52654": "sandpit", "52655": "sandstone", "52656": "sandstorm", "52661": "sandworm", "52662": "sandy", "52663": "sanitary", "52664": "sanitizer", "52665": "sank", "52666": "santa", "53111": "sapling", "53112": "sappiness", "53113": "sappy", "53114": "sarcasm", "53115": "sarcastic", "53116": "sardine", "53121": "sash", "53122": "sasquatch", "53123": "sassy", "53124": "satchel", "53125": "satiable", "53126": "satin", "53131": "satirical", "53132": "satisfied", "53133": "satisfy", "53134": "saturate", "53135": "saturday", "53136": "sauciness", "53141": "saucy", "53142": "sauna", "53143": "savage", "53144": "savanna", "53145": "saved", "53146": "savings", "53151": "savior", "53152": "savor", "53153": "saxophone", "53154": "say", "53155": "scabbed", "53156": "scabby", "53161": "scalded", "53162": "scalding", "53163": "scale", "53164": "scaling", "53165": "scallion", "53166": "scallop", "53211": "scalping", "53212": "scam", "53213": "scandal", "53214": "scanner", "53215": "scanning", "53216": "scant", "53221": "scapegoat", "53222": "scarce", "53223": "scarcity", "53224": "scarecrow", "53225": "scared", "53226": "scarf", "53231": "scarily", "53232": "scariness", "53233": "scarring", "53234": "scary", "53235": "scavenger", "53236": "scenic", "53241": "schedule", "53242": "schematic", "53243": "scheme", "53244": "scheming", "53245": "schilling", "53246": "schnapps", "53251": "scholar", "53252": "science", "53253": "scientist", "53254": "scion", "53255": "scoff", "53256": "scolding", "53261": "scone", "53262": "scoop", "53263": "scooter", "53264": "scope", "53265": "scorch", "53266": "scorebook", "53311": "scorecard", "53312": "scored", "53313": "scoreless", "53314": "scorer", "53315": "scoring", "53316": "scorn", "53321": "scorpion", "53322": "scotch", "53323": "scoundrel", "53324": "scoured", "53325": "scouring", "53326": "scouting", "53331": "scouts", "53332": "scowling", "53333": "scrabble", "53334": "scraggly", "53335": "scrambled", "53336": "scrambler", "53341": "scrap", "53342": "scratch", "53343": "scrawny", "53344": "screen", "53345": "scribble", "53346": "scribe", "53351": "scribing", "53352": "scrimmage", "53353": "script", "53354": "scroll", "53355": "scrooge", "53356": "scrounger", "53361": "scrubbed", "53362": "scrubber", "53363": "scruffy", "53364": "scrunch", "53365": "scrutiny", "53366": "scuba", "53411": "scuff", "53412": "sculptor", "53413": "sculpture", "53414": "scurvy", "53415": "scuttle", "53416": "secluded", "53421": "secluding", "53422": "seclusion", "53423": "second", "53424": "secrecy", "53425": "secret", "53426": "sectional", "53431": "sector", "53432": "secular", "53433": "securely", "53434": "security", "53435": "sedan", "53436": "sedate", "53441": "sedation", "53442": "sedative", "53443": "sediment", "53444": "seduce", "53445": "seducing", "53446": "segment", "53451": "seismic", "53452": "seizing", "53453": "seldom", "53454": "selected", "53455": "selection", "53456": "selective", "53461": "selector", "53462": "self", "53463": "seltzer", "53464": "semantic", "53465": "semester", "53466": "semicolon", "53511": "semifinal", "53512": "seminar", "53513": "semisoft", "53514": "semisweet", "53515": "senate", "53516": "senator", "53521": "send", "53522": "senior", "53523": "senorita", "53524": "sensation", "53525": "sensitive", "53526": "sensitize", "53531": "sensually", "53532": "sensuous", "53533": "sepia", "53534": "september", "53535": "septic", "53536": "septum", "53541": "sequel", "53542": "sequence", "53543": "sequester", "53544": "series", "53545": "sermon", "53546": "serotonin", "53551": "serpent", "53552": "serrated", "53553": "serve", "53554": "service", "53555": "serving", "53556": "sesame", "53561": "sessions", "53562": "setback", "53563": "setting", "53564": "settle", "53565": "settling", "53566": "setup", "53611": "sevenfold", "53612": "seventeen", "53613": "seventh", "53614": "seventy", "53615": "severity", "53616": "shabby", "53621": "shack", "53622": "shaded", "53623": "shadily", "53624": "shadiness", "53625": "shading", "53626": "shadow", "53631": "shady", "53632": "shaft", "53633": "shakable", "53634": "shakily", "53635": "shakiness", "53636": "shaking", "53641": "shaky", "53642": "shale", "53643": "shallot", "53644": "shallow", "53645": "shame", "53646": "shampoo", "53651": "shamrock", "53652": "shank", "53653": "shanty", "53654": "shape", "53655": "shaping", "53656": "share", "53661": "sharpener", "53662": "sharper", "53663": "sharpie", "53664": "sharply", "53665": "sharpness", "53666": "shawl", "54111": "sheath", "54112": "shed", "54113": "sheep", "54114": "sheet", "54115": "shelf", "54116": "shell", "54121": "shelter", "54122": "shelve", "54123": "shelving", "54124": "sherry", "54125": "shield", "54126": "shifter", "54131": "shifting", "54132": "shiftless", "54133": "shifty", "54134": "shimmer", "54135": "shimmy", "54136": "shindig", "54141": "shine", "54142": "shingle", "54143": "shininess", "54144": "shining", "54145": "shiny", "54146": "ship", "54151": "shirt", "54152": "shivering", "54153": "shock", "54154": "shone", "54155": "shoplift", "54156": "shopper", "54161": "shopping", "54162": "shoptalk", "54163": "shore", "54164": "shortage", "54165": "shortcake", "54166": "shortcut", "54211": "shorten", "54212": "shorter", "54213": "shorthand", "54214": "shortlist", "54215": "shortly", "54216": "shortness", "54221": "shorts", "54222": "shortwave", "54223": "shorty", "54224": "shout", "54225": "shove", "54226": "showbiz", "54231": "showcase", "54232": "showdown", "54233": "shower", "54234": "showgirl", "54235": "showing", "54236": "showman", "54241": "shown", "54242": "showoff", "54243": "showpiece", "54244": "showplace", "54245": "showroom", "54246": "showy", "54251": "shrank", "54252": "shrapnel", "54253": "shredder", "54254": "shredding", "54255": "shrewdly", "54256": "shriek", "54261": "shrill", "54262": "shrimp", "54263": "shrine", "54264": "shrink", "54265": "shrivel", "54266": "shrouded", "54311": "shrubbery", "54312": "shrubs", "54313": "shrug", "54314": "shrunk", "54315": "shucking", "54316": "shudder", "54321": "shuffle", "54322": "shuffling", "54323": "shun", "54324": "shush", "54325": "shut", "54326": "shy", "54331": "siamese", "54332": "siberian", "54333": "sibling", "54334": "siding", "54335": "sierra", "54336": "siesta", "54341": "sift", "54342": "sighing", "54343": "silenced", "54344": "silencer", "54345": "silent", "54346": "silica", "54351": "silicon", "54352": "silk", "54353": "silliness", "54354": "silly", "54355": "silo", "54356": "silt", "54361": "silver", "54362": "similarly", "54363": "simile", "54364": "simmering", "54365": "simple", "54366": "simplify", "54411": "simply", "54412": "sincere", "54413": "sincerity", "54414": "singer", "54415": "singing", "54416": "single", "54421": "singular", "54422": "sinister", "54423": "sinless", "54424": "sinner", "54425": "sinuous", "54426": "sip", "54431": "siren", "54432": "sister", "54433": "sitcom", "54434": "sitter", "54435": "sitting", "54436": "situated", "54441": "situation", "54442": "sixfold", "54443": "sixteen", "54444": "sixth", "54445": "sixties", "54446": "sixtieth", "54451": "sixtyfold", "54452": "sizable", "54453": "sizably", "54454": "size", "54455": "sizing", "54456": "sizzle", "54461": "sizzling", "54462": "skater", "54463": "skating", "54464": "skedaddle", "54465": "skeletal", "54466": "skeleton", "54511": "skeptic", "54512": "sketch", "54513": "skewed", "54514": "skewer", "54515": "skid", "54516": "skied", "54521": "skier", "54522": "skies", "54523": "skiing", "54524": "skilled", "54525": "skillet", "54526": "skillful", "54531": "skimmed", "54532": "skimmer", "54533": "skimming", "54534": "skimpily", "54535": "skincare", "54536": "skinhead", "54541": "skinless", "54542": "skinning", "54543": "skinny", "54544": "skintight", "54545": "skipper", "54546": "skipping", "54551": "skirmish", "54552": "skirt", "54553": "skittle", "54554": "skydiver", "54555": "skylight", "54556": "skyline", "54561": "skype", "54562": "skyrocket", "54563": "skyward", "54564": "slab", "54565": "slacked", "54566": "slacker", "54611": "slacking", "54612": "slackness", "54613": "slacks", "54614": "slain", "54615": "slam", "54616": "slander", "54621": "slang", "54622": "slapping", "54623": "slapstick", "54624": "slashed", "54625": "slashing", "54626": "slate", "54631": "slather", "54632": "slaw", "54633": "sled", "54634": "sleek", "54635": "sleep", "54636": "sleet", "54641": "sleeve", "54642": "slept", "54643": "sliceable", "54644": "sliced", "54645": "slicer", "54646": "slicing", "54651": "slick", "54652": "slider", "54653": "slideshow", "54654": "sliding", "54655": "slighted", "54656": "slighting", "54661": "slightly", "54662": "slimness", "54663": "slimy", "54664": "slinging", "54665": "slingshot", "54666": "slinky", "55111": "slip", "55112": "slit", "55113": "sliver", "55114": "slobbery", "55115": "slogan", "55116": "sloped", "55121": "sloping", "55122": "sloppily", "55123": "sloppy", "55124": "slot", "55125": "slouching", "55126": "slouchy", "55131": "sludge", "55132": "slug", "55133": "slum", "55134": "slurp", "55135": "slush", "55136": "sly", "55141": "small", "55142": "smartly", "55143": "smartness", "55144": "smasher", "55145": "smashing", "55146": "smashup", "55151": "smell", "55152": "smelting", "55153": "smile", "55154": "smilingly", "55155": "smirk", "55156": "smite", "55161": "smith", "55162": "smitten", "55163": "smock", "55164": "smog", "55165": "smoked", "55166": "smokeless", "55211": "smokiness", "55212": "smoking", "55213": "smoky", "55214": "smolder", "55215": "smooth", "55216": "smother", "55221": "smudge", "55222": "smudgy", "55223": "smuggler", "55224": "smuggling", "55225": "smugly", "55226": "smugness", "55231": "snack", "55232": "snagged", "55233": "snaking", "55234": "snap", "55235": "snare", "55236": "snarl", "55241": "snazzy", "55242": "sneak", "55243": "sneer", "55244": "sneeze", "55245": "sneezing", "55246": "snide", "55251": "sniff", "55252": "snippet", "55253": "snipping", "55254": "snitch", "55255": "snooper", "55256": "snooze", "55261": "snore", "55262": "snoring", "55263": "snorkel", "55264": "snort", "55265": "snout", "55266": "snowbird", "55311": "snowboard", "55312": "snowbound", "55313": "snowcap", "55314": "snowdrift", "55315": "snowdrop", "55316": "snowfall", "55321": "snowfield", "55322": "snowflake", "55323": "snowiness", "55324": "snowless", "55325": "snowman", "55326": "snowplow", "55331": "snowshoe", "55332": "snowstorm", "55333": "snowsuit", "55334": "snowy", "55335": "snub", "55336": "snuff", "55341": "snuggle", "55342": "snugly", "55343": "snugness", "55344": "speak", "55345": "spearfish", "55346": "spearhead", "55351": "spearman", "55352": "spearmint", "55353": "species", "55354": "specimen", "55355": "specked", "55356": "speckled", "55361": "specks", "55362": "spectacle", "55363": "spectator", "55364": "spectrum", "55365": "speculate", "55366": "speech", "55411": "speed", "55412": "spellbind", "55413": "speller", "55414": "spelling", "55415": "spendable", "55416": "spender", "55421": "spending", "55422": "spent", "55423": "spew", "55424": "sphere", "55425": "spherical", "55426": "sphinx", "55431": "spider", "55432": "spied", "55433": "spiffy", "55434": "spill", "55435": "spilt", "55436": "spinach", "55441": "spinal", "55442": "spindle", "55443": "spinner", "55444": "spinning", "55445": "spinout", "55446": "spinster", "55451": "spiny", "55452": "spiral", "55453": "spirited", "55454": "spiritism", "55455": "spirits", "55456": "spiritual", "55461": "splashed", "55462": "splashing", "55463": "splashy", "55464": "splatter", "55465": "spleen", "55466": "splendid", "55511": "splendor", "55512": "splice", "55513": "splicing", "55514": "splinter", "55515": "splotchy", "55516": "splurge", "55521": "spoilage", "55522": "spoiled", "55523": "spoiler", "55524": "spoiling", "55525": "spoils", "55526": "spoken", "55531": "spokesman", "55532": "sponge", "55533": "spongy", "55534": "sponsor", "55535": "spoof", "55536": "spookily", "55541": "spooky", "55542": "spool", "55543": "spoon", "55544": "spore", "55545": "sporting", "55546": "sports", "55551": "sporty", "55552": "spotless", "55553": "spotlight", "55554": "spotted", "55555": "spotter", "55556": "spotting", "55561": "spotty", "55562": "spousal", "55563": "spouse", "55564": "spout", "55565": "sprain", "55566": "sprang", "55611": "sprawl", "55612": "spray", "55613": "spree", "55614": "sprig", "55615": "spring", "55616": "sprinkled", "55621": "sprinkler", "55622": "sprint", "55623": "sprite", "55624": "sprout", "55625": "spruce", "55626": "sprung", "55631": "spry", "55632": "spud", "55633": "spur", "55634": "sputter", "55635": "spyglass", "55636": "squabble", "55641": "squad", "55642": "squall", "55643": "squander", "55644": "squash", "55645": "squatted", "55646": "squatter", "55651": "squatting", "55652": "squeak", "55653": "squealer", "55654": "squealing", "55655": "squeamish", "55656": "squeegee", "55661": "squeeze", "55662": "squeezing", "55663": "squid", "55664": "squiggle", "55665": "squiggly", "55666": "squint", "56111": "squire", "56112": "squirt", "56113": "squishier", "56114": "squishy", "56115": "stability", "56116": "stabilize", "56121": "stable", "56122": "stack", "56123": "stadium", "56124": "staff", "56125": "stage", "56126": "staging", "56131": "stagnant", "56132": "stagnate", "56133": "stainable", "56134": "stained", "56135": "staining", "56136": "stainless", "56141": "stalemate", "56142": "staleness", "56143": "stalling", "56144": "stallion", "56145": "stamina", "56146": "stammer", "56151": "stamp", "56152": "stand", "56153": "stank", "56154": "staple", "56155": "stapling", "56156": "starboard", "56161": "starch", "56162": "stardom", "56163": "stardust", "56164": "starfish", "56165": "stargazer", "56166": "staring", "56211": "stark", "56212": "starless", "56213": "starlet", "56214": "starlight", "56215": "starlit", "56216": "starring", "56221": "starry", "56222": "starship", "56223": "starter", "56224": "starting", "56225": "startle", "56226": "startling", "56231": "startup", "56232": "starved", "56233": "starving", "56234": "stash", "56235": "state", "56236": "static", "56241": "statistic", "56242": "statue", "56243": "stature", "56244": "status", "56245": "statute", "56246": "statutory", "56251": "staunch", "56252": "stays", "56253": "steadfast", "56254": "steadier", "56255": "steadily", "56256": "steadying", "56261": "steam", "56262": "steed", "56263": "steep", "56264": "steerable", "56265": "steering", "56266": "steersman", "56311": "stegosaur", "56312": "stellar", "56313": "stem", "56314": "stench", "56315": "stencil", "56316": "step", "56321": "stereo", "56322": "sterile", "56323": "sterility", "56324": "sterilize", "56325": "sterling", "56326": "sternness", "56331": "sternum", "56332": "stew", "56333": "stick", "56334": "stiffen", "56335": "stiffly", "56336": "stiffness", "56341": "stifle", "56342": "stifling", "56343": "stillness", "56344": "stilt", "56345": "stimulant", "56346": "stimulate", "56351": "stimuli", "56352": "stimulus", "56353": "stinger", "56354": "stingily", "56355": "stinging", "56356": "stingray", "56361": "stingy", "56362": "stinking", "56363": "stinky", "56364": "stipend", "56365": "stipulate", "56366": "stir", "56411": "stitch", "56412": "stock", "56413": "stoic", "56414": "stoke", "56415": "stole", "56416": "stomp", "56421": "stonewall", "56422": "stoneware", "56423": "stonework", "56424": "stoning", "56425": "stony", "56426": "stood", "56431": "stooge", "56432": "stool", "56433": "stoop", "56434": "stoplight", "56435": "stoppable", "56436": "stoppage", "56441": "stopped", "56442": "stopper", "56443": "stopping", "56444": "stopwatch", "56445": "storable", "56446": "storage", "56451": "storeroom", "56452": "storewide", "56453": "storm", "56454": "stout", "56455": "stove", "56456": "stowaway", "56461": "stowing", "56462": "straddle", "56463": "straggler", "56464": "strained", "56465": "strainer", "56466": "straining", "56511": "strangely", "56512": "stranger", "56513": "strangle", "56514": "strategic", "56515": "strategy", "56516": "stratus", "56521": "straw", "56522": "stray", "56523": "streak", "56524": "stream", "56525": "street", "56526": "strength", "56531": "strenuous", "56532": "strep", "56533": "stress", "56534": "stretch", "56535": "strewn", "56536": "stricken", "56541": "strict", "56542": "stride", "56543": "strife", "56544": "strike", "56545": "striking", "56546": "strive", "56551": "striving", "56552": "strobe", "56553": "strode", "56554": "stroller", "56555": "strongbox", "56556": "strongly", "56561": "strongman", "56562": "struck", "56563": "structure", "56564": "strudel", "56565": "struggle", "56566": "strum", "56611": "strung", "56612": "strut", "56613": "stubbed", "56614": "stubble", "56615": "stubbly", "56616": "stubborn", "56621": "stucco", "56622": "stuck", "56623": "student", "56624": "studied", "56625": "studio", "56626": "study", "56631": "stuffed", "56632": "stuffing", "56633": "stuffy", "56634": "stumble", "56635": "stumbling", "56636": "stump", "56641": "stung", "56642": "stunned", "56643": "stunner", "56644": "stunning", "56645": "stunt", "56646": "stupor", "56651": "sturdily", "56652": "sturdy", "56653": "styling", "56654": "stylishly", "56655": "stylist", "56656": "stylized", "56661": "stylus", "56662": "suave", "56663": "subarctic", "56664": "subatomic", "56665": "subdivide", "56666": "subdued", "61111": "subduing", "61112": "subfloor", "61113": "subgroup", "61114": "subheader", "61115": "subject", "61116": "sublease", "61121": "sublet", "61122": "sublevel", "61123": "sublime", "61124": "submarine", "61125": "submerge", "61126": "submersed", "61131": "submitter", "61132": "subpanel", "61133": "subpar", "61134": "subplot", "61135": "subprime", "61136": "subscribe", "61141": "subscript", "61142": "subsector", "61143": "subside", "61144": "subsiding", "61145": "subsidize", "61146": "subsidy", "61151": "subsoil", "61152": "subsonic", "61153": "substance", "61154": "subsystem", "61155": "subtext", "61156": "subtitle", "61161": "subtly", "61162": "subtotal", "61163": "subtract", "61164": "subtype", "61165": "suburb", "61166": "subway", "61211": "subwoofer", "61212": "subzero", "61213": "succulent", "61214": "such", "61215": "suction", "61216": "sudden", "61221": "sudoku", "61222": "suds", "61223": "sufferer", "61224": "suffering", "61225": "suffice", "61226": "suffix", "61231": "suffocate", "61232": "suffrage", "61233": "sugar", "61234": "suggest", "61235": "suing", "61236": "suitable", "61241": "suitably", "61242": "suitcase", "61243": "suitor", "61244": "sulfate", "61245": "sulfide", "61246": "sulfite", "61251": "sulfur", "61252": "sulk", "61253": "sullen", "61254": "sulphate", "61255": "sulphuric", "61256": "sultry", "61261": "superbowl", "61262": "superglue", "61263": "superhero", "61264": "superior", "61265": "superjet", "61266": "superman", "61311": "supermom", "61312": "supernova", "61313": "supervise", "61314": "supper", "61315": "supplier", "61316": "supply", "61321": "support", "61322": "supremacy", "61323": "supreme", "61324": "surcharge", "61325": "surely", "61326": "sureness", "61331": "surface", "61332": "surfacing", "61333": "surfboard", "61334": "surfer", "61335": "surgery", "61336": "surgical", "61341": "surging", "61342": "surname", "61343": "surpass", "61344": "surplus", "61345": "surprise", "61346": "surreal", "61351": "surrender", "61352": "surrogate", "61353": "surround", "61354": "survey", "61355": "survival", "61356": "survive", "61361": "surviving", "61362": "survivor", "61363": "sushi", "61364": "suspect", "61365": "suspend", "61366": "suspense", "61411": "sustained", "61412": "sustainer", "61413": "swab", "61414": "swaddling", "61415": "swagger", "61416": "swampland", "61421": "swan", "61422": "swapping", "61423": "swarm", "61424": "sway", "61425": "swear", "61426": "sweat", "61431": "sweep", "61432": "swell", "61433": "swept", "61434": "swerve", "61435": "swifter", "61436": "swiftly", "61441": "swiftness", "61442": "swimmable", "61443": "swimmer", "61444": "swimming", "61445": "swimsuit", "61446": "swimwear", "61451": "swinger", "61452": "swinging", "61453": "swipe", "61454": "swirl", "61455": "switch", "61456": "swivel", "61461": "swizzle", "61462": "swooned", "61463": "swoop", "61464": "swoosh", "61465": "swore", "61466": "sworn", "61511": "swung", "61512": "sycamore", "61513": "sympathy", "61514": "symphonic", "61515": "symphony", "61516": "symptom", "61521": "synapse", "61522": "syndrome", "61523": "synergy", "61524": "synopses", "61525": "synopsis", "61526": "synthesis", "61531": "synthetic", "61532": "syrup", "61533": "system", "61534": "tshirt", "61535": "tabasco", "61536": "tabby", "61541": "tableful", "61542": "tables", "61543": "tablet", "61544": "tableware", "61545": "tabloid", "61546": "tackiness", "61551": "tacking", "61552": "tackle", "61553": "tackling", "61554": "tacky", "61555": "taco", "61556": "tactful", "61561": "tactical", "61562": "tactics", "61563": "tactile", "61564": "tactless", "61565": "tadpole", "61566": "taekwondo", "61611": "tag", "61612": "tainted", "61613": "take", "61614": "taking", "61615": "talcum", "61616": "talisman", "61621": "tall", "61622": "talon", "61623": "tamale", "61624": "tameness", "61625": "tamer", "61626": "tamper", "61631": "tank", "61632": "tanned", "61633": "tannery", "61634": "tanning", "61635": "tantrum", "61636": "tapeless", "61641": "tapered", "61642": "tapering", "61643": "tapestry", "61644": "tapioca", "61645": "tapping", "61646": "taps", "61651": "tarantula", "61652": "target", "61653": "tarmac", "61654": "tarnish", "61655": "tarot", "61656": "tartar", "61661": "tartly", "61662": "tartness", "61663": "task", "61664": "tassel", "61665": "taste", "61666": "tastiness", "62111": "tasting", "62112": "tasty", "62113": "tattered", "62114": "tattle", "62115": "tattling", "62116": "tattoo", "62121": "taunt", "62122": "tavern", "62123": "thank", "62124": "that", "62125": "thaw", "62126": "theater", "62131": "theatrics", "62132": "thee", "62133": "theft", "62134": "theme", "62135": "theology", "62136": "theorize", "62141": "thermal", "62142": "thermos", "62143": "thesaurus", "62144": "these", "62145": "thesis", "62146": "thespian", "62151": "thicken", "62152": "thicket", "62153": "thickness", "62154": "thieving", "62155": "thievish", "62156": "thigh", "62161": "thimble", "62162": "thing", "62163": "think", "62164": "thinly", "62165": "thinner", "62166": "thinness", "62211": "thinning", "62212": "thirstily", "62213": "thirsting", "62214": "thirsty", "62215": "thirteen", "62216": "thirty", "62221": "thong", "62222": "thorn", "62223": "those", "62224": "thousand", "62225": "thrash", "62226": "thread", "62231": "threaten", "62232": "threefold", "62233": "thrift", "62234": "thrill", "62235": "thrive", "62236": "thriving", "62241": "throat", "62242": "throbbing", "62243": "throng", "62244": "throttle", "62245": "throwaway", "62246": "throwback", "62251": "thrower", "62252": "throwing", "62253": "thud", "62254": "thumb", "62255": "thumping", "62256": "thursday", "62261": "thus", "62262": "thwarting", "62263": "thyself", "62264": "tiara", "62265": "tibia", "62266": "tidal", "62311": "tidbit", "62312": "tidiness", "62313": "tidings", "62314": "tidy", "62315": "tiger", "62316": "tighten", "62321": "tightly", "62322": "tightness", "62323": "tightrope", "62324": "tightwad", "62325": "tigress", "62326": "tile", "62331": "tiling", "62332": "till", "62333": "tilt", "62334": "timid", "62335": "timing", "62336": "timothy", "62341": "tinderbox", "62342": "tinfoil", "62343": "tingle", "62344": "tingling", "62345": "tingly", "62346": "tinker", "62351": "tinkling", "62352": "tinsel", "62353": "tinsmith", "62354": "tint", "62355": "tinwork", "62356": "tiny", "62361": "tipoff", "62362": "tipped", "62363": "tipper", "62364": "tipping", "62365": "tiptoeing", "62366": "tiptop", "62411": "tiring", "62412": "tissue", "62413": "trace", "62414": "tracing", "62415": "track", "62416": "traction", "62421": "tractor", "62422": "trade", "62423": "trading", "62424": "tradition", "62425": "traffic", "62426": "tragedy", "62431": "trailing", "62432": "trailside", "62433": "train", "62434": "traitor", "62435": "trance", "62436": "tranquil", "62441": "transfer", "62442": "transform", "62443": "translate", "62444": "transpire", "62445": "transport", "62446": "transpose", "62451": "trapdoor", "62452": "trapeze", "62453": "trapezoid", "62454": "trapped", "62455": "trapper", "62456": "trapping", "62461": "traps", "62462": "trash", "62463": "travel", "62464": "traverse", "62465": "travesty", "62466": "tray", "62511": "treachery", "62512": "treading", "62513": "treadmill", "62514": "treason", "62515": "treat", "62516": "treble", "62521": "tree", "62522": "trekker", "62523": "tremble", "62524": "trembling", "62525": "tremor", "62526": "trench", "62531": "trend", "62532": "trespass", "62533": "triage", "62534": "trial", "62535": "triangle", "62536": "tribesman", "62541": "tribunal", "62542": "tribune", "62543": "tributary", "62544": "tribute", "62545": "triceps", "62546": "trickery", "62551": "trickily", "62552": "tricking", "62553": "trickle", "62554": "trickster", "62555": "tricky", "62556": "tricolor", "62561": "tricycle", "62562": "trident", "62563": "tried", "62564": "trifle", "62565": "trifocals", "62566": "trillion", "62611": "trilogy", "62612": "trimester", "62613": "trimmer", "62614": "trimming", "62615": "trimness", "62616": "trinity", "62621": "trio", "62622": "tripod", "62623": "tripping", "62624": "triumph", "62625": "trivial", "62626": "trodden", "62631": "trolling", "62632": "trombone", "62633": "trophy", "62634": "tropical", "62635": "tropics", "62636": "trouble", "62641": "troubling", "62642": "trough", "62643": "trousers", "62644": "trout", "62645": "trowel", "62646": "truce", "62651": "truck", "62652": "truffle", "62653": "trump", "62654": "trunks", "62655": "trustable", "62656": "trustee", "62661": "trustful", "62662": "trusting", "62663": "trustless", "62664": "truth", "62665": "try", "62666": "tubby", "63111": "tubeless", "63112": "tubular", "63113": "tucking", "63114": "tuesday", "63115": "tug", "63116": "tuition", "63121": "tulip", "63122": "tumble", "63123": "tumbling", "63124": "tummy", "63125": "turban", "63126": "turbine", "63131": "turbofan", "63132": "turbojet", "63133": "turbulent", "63134": "turf", "63135": "turkey", "63136": "turmoil", "63141": "turret", "63142": "turtle", "63143": "tusk", "63144": "tutor", "63145": "tutu", "63146": "tux", "63151": "tweak", "63152": "tweed", "63153": "tweet", "63154": "tweezers", "63155": "twelve", "63156": "twentieth", "63161": "twenty", "63162": "twerp", "63163": "twice", "63164": "twiddle", "63165": "twiddling", "63166": "twig", "63211": "twilight", "63212": "twine", "63213": "twins", "63214": "twirl", "63215": "twistable", "63216": "twisted", "63221": "twister", "63222": "twisting", "63223": "twisty", "63224": "twitch", "63225": "twitter", "63226": "tycoon", "63231": "tying", "63232": "tyke", "63233": "udder", "63234": "ultimate", "63235": "ultimatum", "63236": "ultra", "63241": "umbilical", "63242": "umbrella", "63243": "umpire", "63244": "unabashed", "63245": "unable", "63246": "unadorned", "63251": "unadvised", "63252": "unafraid", "63253": "unaired", "63254": "unaligned", "63255": "unaltered", "63256": "unarmored", "63261": "unashamed", "63262": "unaudited", "63263": "unawake", "63264": "unaware", "63265": "unbaked", "63266": "unbalance", "63311": "unbeaten", "63312": "unbend", "63313": "unbent", "63314": "unbiased", "63315": "unbitten", "63316": "unblended", "63321": "unblessed", "63322": "unblock", "63323": "unbolted", "63324": "unbounded", "63325": "unboxed", "63326": "unbraided", "63331": "unbridle", "63332": "unbroken", "63333": "unbuckled", "63334": "unbundle", "63335": "unburned", "63336": "unbutton", "63341": "uncanny", "63342": "uncapped", "63343": "uncaring", "63344": "uncertain", "63345": "unchain", "63346": "unchanged", "63351": "uncharted", "63352": "uncheck", "63353": "uncivil", "63354": "unclad", "63355": "unclaimed", "63356": "unclamped", "63361": "unclasp", "63362": "uncle", "63363": "unclip", "63364": "uncloak", "63365": "unclog", "63366": "unclothed", "63411": "uncoated", "63412": "uncoiled", "63413": "uncolored", "63414": "uncombed", "63415": "uncommon", "63416": "uncooked", "63421": "uncork", "63422": "uncorrupt", "63423": "uncounted", "63424": "uncouple", "63425": "uncouth", "63426": "uncover", "63431": "uncross", "63432": "uncrown", "63433": "uncrushed", "63434": "uncured", "63435": "uncurious", "63436": "uncurled", "63441": "uncut", "63442": "undamaged", "63443": "undated", "63444": "undaunted", "63445": "undead", "63446": "undecided", "63451": "undefined", "63452": "underage", "63453": "underarm", "63454": "undercoat", "63455": "undercook", "63456": "undercut", "63461": "underdog", "63462": "underdone", "63463": "underfed", "63464": "underfeed", "63465": "underfoot", "63466": "undergo", "63511": "undergrad", "63512": "underhand", "63513": "underline", "63514": "underling", "63515": "undermine", "63516": "undermost", "63521": "underpaid", "63522": "underpass", "63523": "underpay", "63524": "underrate", "63525": "undertake", "63526": "undertone", "63531": "undertook", "63532": "undertow", "63533": "underuse", "63534": "underwear", "63535": "underwent", "63536": "underwire", "63541": "undesired", "63542": "undiluted", "63543": "undivided", "63544": "undocked", "63545": "undoing", "63546": "undone", "63551": "undrafted", "63552": "undress", "63553": "undrilled", "63554": "undusted", "63555": "undying", "63556": "unearned", "63561": "unearth", "63562": "unease", "63563": "uneasily", "63564": "uneasy", "63565": "uneatable", "63566": "uneaten", "63611": "unedited", "63612": "unelected", "63613": "unending", "63614": "unengaged", "63615": "unenvied", "63616": "unequal", "63621": "unethical", "63622": "uneven", "63623": "unexpired", "63624": "unexposed", "63625": "unfailing", "63626": "unfair", "63631": "unfasten", "63632": "unfazed", "63633": "unfeeling", "63634": "unfiled", "63635": "unfilled", "63636": "unfitted", "63641": "unfitting", "63642": "unfixable", "63643": "unfixed", "63644": "unflawed", "63645": "unfocused", "63646": "unfold", "63651": "unfounded", "63652": "unframed", "63653": "unfreeze", "63654": "unfrosted", "63655": "unfrozen", "63656": "unfunded", "63661": "unglazed", "63662": "ungloved", "63663": "unglue", "63664": "ungodly", "63665": "ungraded", "63666": "ungreased", "64111": "unguarded", "64112": "unguided", "64113": "unhappily", "64114": "unhappy", "64115": "unharmed", "64116": "unhealthy", "64121": "unheard", "64122": "unhearing", "64123": "unheated", "64124": "unhelpful", "64125": "unhidden", "64126": "unhinge", "64131": "unhitched", "64132": "unholy", "64133": "unhook", "64134": "unicorn", "64135": "unicycle", "64136": "unified", "64141": "unifier", "64142": "uniformed", "64143": "uniformly", "64144": "unify", "64145": "unimpeded", "64146": "uninjured", "64151": "uninstall", "64152": "uninsured", "64153": "uninvited", "64154": "union", "64155": "uniquely", "64156": "unisexual", "64161": "unison", "64162": "unissued", "64163": "unit", "64164": "universal", "64165": "universe", "64166": "unjustly", "64211": "unkempt", "64212": "unkind", "64213": "unknotted", "64214": "unknowing", "64215": "unknown", "64216": "unlaced", "64221": "unlatch", "64222": "unlawful", "64223": "unleaded", "64224": "unlearned", "64225": "unleash", "64226": "unless", "64231": "unleveled", "64232": "unlighted", "64233": "unlikable", "64234": "unlimited", "64235": "unlined", "64236": "unlinked", "64241": "unlisted", "64242": "unlit", "64243": "unlivable", "64244": "unloaded", "64245": "unloader", "64246": "unlocked", "64251": "unlocking", "64252": "unlovable", "64253": "unloved", "64254": "unlovely", "64255": "unloving", "64256": "unluckily", "64261": "unlucky", "64262": "unmade", "64263": "unmanaged", "64264": "unmanned", "64265": "unmapped", "64266": "unmarked", "64311": "unmasked", "64312": "unmasking", "64313": "unmatched", "64314": "unmindful", "64315": "unmixable", "64316": "unmixed", "64321": "unmolded", "64322": "unmoral", "64323": "unmovable", "64324": "unmoved", "64325": "unmoving", "64326": "unnamable", "64331": "unnamed", "64332": "unnatural", "64333": "unneeded", "64334": "unnerve", "64335": "unnerving", "64336": "unnoticed", "64341": "unopened", "64342": "unopposed", "64343": "unpack", "64344": "unpadded", "64345": "unpaid", "64346": "unpainted", "64351": "unpaired", "64352": "unpaved", "64353": "unpeeled", "64354": "unpicked", "64355": "unpiloted", "64356": "unpinned", "64361": "unplanned", "64362": "unplanted", "64363": "unpleased", "64364": "unpledged", "64365": "unplowed", "64366": "unplug", "64411": "unpopular", "64412": "unproven", "64413": "unquote", "64414": "unranked", "64415": "unrated", "64416": "unraveled", "64421": "unreached", "64422": "unread", "64423": "unreal", "64424": "unreeling", "64425": "unrefined", "64426": "unrelated", "64431": "unrented", "64432": "unrest", "64433": "unretired", "64434": "unrevised", "64435": "unrigged", "64436": "unripe", "64441": "unrivaled", "64442": "unroasted", "64443": "unrobed", "64444": "unroll", "64445": "unruffled", "64446": "unruly", "64451": "unrushed", "64452": "unsaddle", "64453": "unsafe", "64454": "unsaid", "64455": "unsalted", "64456": "unsaved", "64461": "unsavory", "64462": "unscathed", "64463": "unscented", "64464": "unscrew", "64465": "unsealed", "64466": "unseated", "64511": "unsecured", "64512": "unseeing", "64513": "unseemly", "64514": "unseen", "64515": "unselect", "64516": "unselfish", "64521": "unsent", "64522": "unsettled", "64523": "unshackle", "64524": "unshaken", "64525": "unshaved", "64526": "unshaven", "64531": "unsheathe", "64532": "unshipped", "64533": "unsightly", "64534": "unsigned", "64535": "unskilled", "64536": "unsliced", "64541": "unsmooth", "64542": "unsnap", "64543": "unsocial", "64544": "unsoiled", "64545": "unsold", "64546": "unsolved", "64551": "unsorted", "64552": "unspoiled", "64553": "unspoken", "64554": "unstable", "64555": "unstaffed", "64556": "unstamped", "64561": "unsteady", "64562": "unsterile", "64563": "unstirred", "64564": "unstitch", "64565": "unstopped", "64566": "unstuck", "64611": "unstuffed", "64612": "unstylish", "64613": "unsubtle", "64614": "unsubtly", "64615": "unsuited", "64616": "unsure", "64621": "unsworn", "64622": "untagged", "64623": "untainted", "64624": "untaken", "64625": "untamed", "64626": "untangled", "64631": "untapped", "64632": "untaxed", "64633": "unthawed", "64634": "unthread", "64635": "untidy", "64636": "untie", "64641": "until", "64642": "untimed", "64643": "untimely", "64644": "untitled", "64645": "untoasted", "64646": "untold", "64651": "untouched", "64652": "untracked", "64653": "untrained", "64654": "untreated", "64655": "untried", "64656": "untrimmed", "64661": "untrue", "64662": "untruth", "64663": "unturned", "64664": "untwist", "64665": "untying", "64666": "unusable", "65111": "unused", "65112": "unusual", "65113": "unvalued", "65114": "unvaried", "65115": "unvarying", "65116": "unveiled", "65121": "unveiling", "65122": "unvented", "65123": "unviable", "65124": "unvisited", "65125": "unvocal", "65126": "unwanted", "65131": "unwarlike", "65132": "unwary", "65133": "unwashed", "65134": "unwatched", "65135": "unweave", "65136": "unwed", "65141": "unwelcome", "65142": "unwell", "65143": "unwieldy", "65144": "unwilling", "65145": "unwind", "65146": "unwired", "65151": "unwitting", "65152": "unwomanly", "65153": "unworldly", "65154": "unworn", "65155": "unworried", "65156": "unworthy", "65161": "unwound", "65162": "unwoven", "65163": "unwrapped", "65164": "unwritten", "65165": "unzip", "65166": "upbeat", "65211": "upchuck", "65212": "upcoming", "65213": "upcountry", "65214": "update", "65215": "upfront", "65216": "upgrade", "65221": "upheaval", "65222": "upheld", "65223": "uphill", "65224": "uphold", "65225": "uplifted", "65226": "uplifting", "65231": "upload", "65232": "upon", "65233": "upper", "65234": "upright", "65235": "uprising", "65236": "upriver", "65241": "uproar", "65242": "uproot", "65243": "upscale", "65244": "upside", "65245": "upstage", "65246": "upstairs", "65251": "upstart", "65252": "upstate", "65253": "upstream", "65254": "upstroke", "65255": "upswing", "65256": "uptake", "65261": "uptight", "65262": "uptown", "65263": "upturned", "65264": "upward", "65265": "upwind", "65266": "uranium", "65311": "urban", "65312": "urchin", "65313": "urethane", "65314": "urgency", "65315": "urgent", "65316": "urging", "65321": "urologist", "65322": "urology", "65323": "usable", "65324": "usage", "65325": "useable", "65326": "used", "65331": "uselessly", "65332": "user", "65333": "usher", "65334": "usual", "65335": "utensil", "65336": "utility", "65341": "utilize", "65342": "utmost", "65343": "utopia", "65344": "utter", "65345": "vacancy", "65346": "vacant", "65351": "vacate", "65352": "vacation", "65353": "vagabond", "65354": "vagrancy", "65355": "vagrantly", "65356": "vaguely", "65361": "vagueness", "65362": "valiant", "65363": "valid", "65364": "valium", "65365": "valley", "65366": "valuables", "65411": "value", "65412": "vanilla", "65413": "vanish", "65414": "vanity", "65415": "vanquish", "65416": "vantage", "65421": "vaporizer", "65422": "variable", "65423": "variably", "65424": "varied", "65425": "variety", "65426": "various", "65431": "varmint", "65432": "varnish", "65433": "varsity", "65434": "varying", "65435": "vascular", "65436": "vaseline", "65441": "vastly", "65442": "vastness", "65443": "veal", "65444": "vegan", "65445": "veggie", "65446": "vehicular", "65451": "velcro", "65452": "velocity", "65453": "velvet", "65454": "vendetta", "65455": "vending", "65456": "vendor", "65461": "veneering", "65462": "vengeful", "65463": "venomous", "65464": "ventricle", "65465": "venture", "65466": "venue", "65511": "venus", "65512": "verbalize", "65513": "verbally", "65514": "verbose", "65515": "verdict", "65516": "verify", "65521": "verse", "65522": "version", "65523": "versus", "65524": "vertebrae", "65525": "vertical", "65526": "vertigo", "65531": "very", "65532": "vessel", "65533": "vest", "65534": "veteran", "65535": "veto", "65536": "vexingly", "65541": "viability", "65542": "viable", "65543": "vibes", "65544": "vice", "65545": "vicinity", "65546": "victory", "65551": "video", "65552": "viewable", "65553": "viewer", "65554": "viewing", "65555": "viewless", "65556": "viewpoint", "65561": "vigorous", "65562": "village", "65563": "villain", "65564": "vindicate", "65565": "vineyard", "65566": "vintage", "65611": "violate", "65612": "violation", "65613": "violator", "65614": "violet", "65615": "violin", "65616": "viper", "65621": "viral", "65622": "virtual", "65623": "virtuous", "65624": "virus", "65625": "visa", "65626": "viscosity", "65631": "viscous", "65632": "viselike", "65633": "visible", "65634": "visibly", "65635": "vision", "65636": "visiting", "65641": "visitor", "65642": "visor", "65643": "vista", "65644": "vitality", "65645": "vitalize", "65646": "vitally", "65651": "vitamins", "65652": "vivacious", "65653": "vividly", "65654": "vividness", "65655": "vixen", "65656": "vocalist", "65661": "vocalize", "65662": "vocally", "65663": "vocation", "65664": "voice", "65665": "voicing", "65666": "void", "66111": "volatile", "66112": "volley", "66113": "voltage", "66114": "volumes", "66115": "voter", "66116": "voting", "66121": "voucher", "66122": "vowed", "66123": "vowel", "66124": "voyage", "66125": "wackiness", "66126": "wad", "66131": "wafer", "66132": "waffle", "66133": "waged", "66134": "wager", "66135": "wages", "66136": "waggle", "66141": "wagon", "66142": "wake", "66143": "waking", "66144": "walk", "66145": "walmart", "66146": "walnut", "66151": "walrus", "66152": "waltz", "66153": "wand", "66154": "wannabe", "66155": "wanted", "66156": "wanting", "66161": "wasabi", "66162": "washable", "66163": "washbasin", "66164": "washboard", "66165": "washbowl", "66166": "washcloth", "66211": "washday", "66212": "washed", "66213": "washer", "66214": "washhouse", "66215": "washing", "66216": "washout", "66221": "washroom", "66222": "washstand", "66223": "washtub", "66224": "wasp", "66225": "wasting", "66226": "watch", "66231": "water", "66232": "waviness", "66233": "waving", "66234": "wavy", "66235": "whacking", "66236": "whacky", "66241": "wham", "66242": "wharf", "66243": "wheat", "66244": "whenever", "66245": "whiff", "66246": "whimsical", "66251": "whinny", "66252": "whiny", "66253": "whisking", "66254": "whoever", "66255": "whole", "66256": "whomever", "66261": "whoopee", "66262": "whooping", "66263": "whoops", "66264": "why", "66265": "wick", "66266": "widely", "66311": "widen", "66312": "widget", "66313": "widow", "66314": "width", "66315": "wieldable", "66316": "wielder", "66321": "wife", "66322": "wifi", "66323": "wikipedia", "66324": "wildcard", "66325": "wildcat", "66326": "wilder", "66331": "wildfire", "66332": "wildfowl", "66333": "wildland", "66334": "wildlife", "66335": "wildly", "66336": "wildness", "66341": "willed", "66342": "willfully", "66343": "willing", "66344": "willow", "66345": "willpower", "66346": "wilt", "66351": "wimp", "66352": "wince", "66353": "wincing", "66354": "wind", "66355": "wing", "66356": "winking", "66361": "winner", "66362": "winnings", "66363": "winter", "66364": "wipe", "66365": "wired", "66366": "wireless", "66411": "wiring", "66412": "wiry", "66413": "wisdom", "66414": "wise", "66415": "wish", "66416": "wisplike", "66421": "wispy", "66422": "wistful", "66423": "wizard", "66424": "wobble", "66425": "wobbling", "66426": "wobbly", "66431": "wok", "66432": "wolf", "66433": "wolverine", "66434": "womanhood", "66435": "womankind", "66436": "womanless", "66441": "womanlike", "66442": "womanly", "66443": "womb", "66444": "woof", "66445": "wooing", "66446": "wool", "66451": "woozy", "66452": "word", "66453": "work", "66454": "worried", "66455": "worrier", "66456": "worrisome", "66461": "worry", "66462": "worsening", "66463": "worshiper", "66464": "worst", "66465": "wound", "66466": "woven", "66511": "wow", "66512": "wrangle", "66513": "wrath", "66514": "wreath", "66515": "wreckage", "66516": "wrecker", "66521": "wrecking", "66522": "wrench", "66523": "wriggle", "66524": "wriggly", "66525": "wrinkle", "66526": "wrinkly", "66531": "wrist", "66532": "writing", "66533": "written", "66534": "wrongdoer", "66535": "wronged", "66536": "wrongful", "66541": "wrongly", "66542": "wrongness", "66543": "wrought", "66544": "xbox", "66545": "xerox", "66546": "yahoo", "66551": "yam", "66552": "yanking", "66553": "yapping", "66554": "yard", "66555": "yarn", "66556": "yeah", "66561": "yearbook", "66562": "yearling", "66563": "yearly", "66564": "yearning", "66565": "yeast", "66566": "yelling", "66611": "yelp", "66612": "yen", "66613": "yesterday", "66614": "yiddish", "66615": "yield", "66616": "yin", "66621": "yippee", "66622": "yoyo", "66623": "yodel", "66624": "yoga", "66625": "yogurt", "66626": "yonder", "66631": "yoyo", "66632": "yummy", "66633": "zap", "66634": "zealous", "66635": "zebra", "66636": "zen", "66641": "zeppelin", "66642": "zero", "66643": "zestfully", "66644": "zesty", "66645": "zigzagged", "66646": "zipfile", "66651": "zipping", "66652": "zippy", "66653": "zips", "66654": "zit", "66655": "zodiac", "66656": "zombie", "66661": "zone", "66662": "zoning", "66663": "zookeeper", "66664": "zoologist", "66665": "zoology", "66666": "zoom" }
7,889
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib
petrpan-code/ProtonMail/WebClients/packages/pass/lib/search/match-any.spec.ts
import { matchAny } from './match-any'; describe('matchAny', () => { test('should return true if any term matches', () => { const terms = ['title', 'username', 'my secure notes', 'example.com']; const matcher = matchAny(terms); expect(matcher('title')).toBe(true); expect(matcher('username')).toBe(true); expect(matcher('my secure notes')).toBe(true); expect(matcher('example.com')).toBe(true); }); test('should match terms in any order', () => { const terms = ['title', 'username', 'my secure notes', 'example.com']; const matcher = matchAny(terms); expect(matcher('my notes secure')).toBe(true); expect(matcher('title username')).toBe(true); expect(matcher('username title')).toBe(true); }); test('should return false if no terms match', () => { const terms = ['title', 'username', 'my secure notes', 'example.com']; const matcher = matchAny(terms); expect(matcher('nothing')).toBe(false); expect(matcher('titles')).toBe(false); }); test('should be case-insensitive', () => { const terms = ['title', 'username', 'my secure notes', 'example.com']; const matcher = matchAny(terms); expect(matcher('Title')).toBe(true); expect(matcher('userNAME')).toBe(true); expect(matcher('secure NoTES')).toBe(true); }); test('should match partial terms', () => { const terms = ['title', 'username', 'my secure notes', 'example.com']; const matcher = matchAny(terms); expect(matcher('titl')).toBe(true); expect(matcher('secure')).toBe(true); expect(matcher('.com')).toBe(true); expect(matcher('.')).toBe(true); }); test('should match newline-separated terms', () => { const terms = ['title\nusername\nmy secure notes\nexample.com']; const matcher = matchAny(terms); expect(matcher('titl')).toBe(true); expect(matcher('my notes secure')).toBe(true); expect(matcher('title username')).toBe(true); expect(matcher('username title')).toBe(true); expect(matcher('nothing')).toBe(false); expect(matcher('titles')).toBe(false); }); });
7,890
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib
petrpan-code/ProtonMail/WebClients/packages/pass/lib/search/match-any.ts
import { normalize } from '@proton/shared/lib/helpers/string'; export const matchAny = (terms: string[]) => (match: string) => { const normalizedSearchTerm = normalize(match, true); return normalizedSearchTerm.split(' ').every((word) => terms.some((s) => normalize(s, true).includes(word))); };
7,891
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib
petrpan-code/ProtonMail/WebClients/packages/pass/lib/search/match-chunks.spec.ts
import { matchChunks } from './match-chunks'; describe('getItemNameSearchChunks', () => { test('should return empty array if no search term', () => { expect(matchChunks('', '')).toEqual([]); }); test('should not match if no term matches', () => { expect(matchChunks('my secure notes', 'nothing')).toEqual([]); }); test('should return a single item with a correct match', () => { expect(matchChunks('my secure notes', 'my')).toEqual([ { start: 0, end: 2, }, ]); }); test('should return all items with correct matches', () => { expect(matchChunks('my secure notes', 'my notes')).toEqual([ { start: 0, end: 2, }, { start: 10, end: 15, }, ]); }); test('should return all items with correct matches in any order', () => { expect(matchChunks('my secure notes', 'notes my')).toEqual([ { start: 0, end: 2, }, { start: 10, end: 15, }, ]); }); test('should match partial terms', () => { expect(matchChunks('my secure notes', 'my sec')).toEqual([ { start: 0, end: 2, }, { start: 3, end: 6, }, ]); }); test('should be case-insensitive', () => { expect(matchChunks('my secure notes', 'My SEc')).toEqual([ { start: 0, end: 2, }, { start: 3, end: 6, }, ]); }); });
7,892
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib
petrpan-code/ProtonMail/WebClients/packages/pass/lib/search/match-chunks.ts
import { escapeRegex, getMatches } from '@proton/shared/lib/helpers/regex'; import { normalize } from '@proton/shared/lib/helpers/string'; export const matchChunks = (haystack: string, needle: string) => { if (!needle) return []; const searchWords = escapeRegex(normalize(needle)).trim().replace(/\s+/g, '|'); const regex = new RegExp(searchWords, 'gi'); return getMatches(regex, normalize(haystack)); };
7,893
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib
petrpan-code/ProtonMail/WebClients/packages/pass/lib/search/match-items.ts
import type { Item, ItemRevision, ItemType } from '@proton/pass/types'; import { deobfuscate } from '@proton/pass/utils/obfuscate/xor'; import { matchAny } from './match-any'; import type { ItemMatchFunc, ItemMatchFuncMap } from './types'; export const matchesNoteItem: ItemMatchFunc<'note'> = ({ metadata: { name, note } }) => matchAny([name, deobfuscate(note)]); export const matchesLoginItem: ItemMatchFunc<'login'> = ({ metadata: { name, note }, content: { username, urls } }) => matchAny([name, deobfuscate(note), deobfuscate(username), ...urls]); export const matchesAliasItem: ItemMatchFunc<'alias'> = ({ metadata: { name, note } }) => matchAny([name, deobfuscate(note)]); export const matchesCreditCardItem: ItemMatchFunc<'creditCard'> = ({ metadata: { name, note }, content: { cardholderName, number }, }) => matchAny([name, deobfuscate(note), cardholderName, deobfuscate(number)]); /* Each item should expose its own searching mechanism : * we may include/exclude certain fields or add extra criteria * depending on the type of item we're targeting */ const itemMatchers: ItemMatchFuncMap = { login: matchesLoginItem, note: matchesNoteItem, alias: matchesAliasItem, creditCard: matchesCreditCardItem, }; export const matchItem: ItemMatchFunc = <T extends ItemType>(item: Item<T>) => itemMatchers[item.type](item); export const searchItems = <T extends ItemRevision>(items: T[], search?: string) => { if (!search || search.trim() === '') return items; return items.filter((item) => matchItem(item.data)(search)); };
7,894
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib
petrpan-code/ProtonMail/WebClients/packages/pass/lib/search/match-url.spec.ts
import type { Item } from '@proton/pass/types'; import { ItemUrlMatch, getItemPriorityForUrl } from './match-url'; const createMockItem = (urls: string[]) => { return { type: 'login', content: { urls } } as unknown as Item<'login'>; }; describe('match url', () => { describe('getItemPriorityForUrl', () => { test('should return `NO_MATCH` if no match', () => { expect( getItemPriorityForUrl(createMockItem(['https://proton.ch']))('pm.me', { protocolFilter: [], isPrivate: false, }) ).toBe(ItemUrlMatch.NO_MATCH); expect( getItemPriorityForUrl(createMockItem([]))('pm.me', { protocolFilter: [], isPrivate: false, }) ).toBe(ItemUrlMatch.NO_MATCH); expect( getItemPriorityForUrl(createMockItem([]))('', { protocolFilter: [], isPrivate: false, }) ).toBe(ItemUrlMatch.NO_MATCH); expect( getItemPriorityForUrl(createMockItem(['https://pproton.ch']))('proton.ch', { protocolFilter: ['https:'], isPrivate: false, }) ).toBe(ItemUrlMatch.NO_MATCH); expect( getItemPriorityForUrl(createMockItem(['https://p.pproton.ch']))('proton.ch', { protocolFilter: ['https:'], isPrivate: false, }) ).toBe(ItemUrlMatch.NO_MATCH); }); test('should return `SUB_MATCH` if non top-level domain match', () => { expect( getItemPriorityForUrl(createMockItem(['https://subdomain.pm.me']))('pm.me', { protocolFilter: [], isPrivate: false, }) ).toBe(ItemUrlMatch.SUB_MATCH); expect( getItemPriorityForUrl(createMockItem(['https://nested.subdomain.pm.me']))('subdomain.pm.me', { protocolFilter: [], isPrivate: false, }) ).toBe(ItemUrlMatch.SUB_MATCH); }); test('should return `TOP_MATCH` on top-level domain match', () => { expect( getItemPriorityForUrl(createMockItem(['https://pm.me']))('pm.me', { protocolFilter: [], isPrivate: false, }) ).toBe(ItemUrlMatch.TOP_MATCH); expect( getItemPriorityForUrl(createMockItem(['nomatch', 'https://proton.ch']))('proton.ch', { protocolFilter: [], isPrivate: false, }) ).toBe(ItemUrlMatch.TOP_MATCH); }); test('should use protocol filter', () => { expect( getItemPriorityForUrl(createMockItem(['https://proton.ch']))('proton.ch', { protocolFilter: ['http:'], isPrivate: false, }) ).toBe(ItemUrlMatch.NO_MATCH); expect( getItemPriorityForUrl(createMockItem(['http://proton.ch']))('proton.ch', { protocolFilter: ['http:'], isPrivate: false, }) ).toBe(ItemUrlMatch.TOP_MATCH); expect( getItemPriorityForUrl(createMockItem(['ftp://proton.ch']))('proton.ch', { protocolFilter: ['http:'], isPrivate: false, }) ).toBe(ItemUrlMatch.NO_MATCH); expect( getItemPriorityForUrl(createMockItem(['ftp://proton.ch']))('proton.ch', { protocolFilter: ['http:', 'ftp:'], isPrivate: false, }) ).toBe(ItemUrlMatch.TOP_MATCH); expect( getItemPriorityForUrl(createMockItem(['http://sub.proton.ch']))('proton.ch', { protocolFilter: ['http:', 'ftp:'], isPrivate: false, }) ).toBe(ItemUrlMatch.SUB_MATCH); expect( getItemPriorityForUrl(createMockItem(['https://sub.proton.ch']))('proton.ch', { protocolFilter: ['http:', 'ftp:'], isPrivate: false, }) ).toBe(ItemUrlMatch.NO_MATCH); }); test('should match deeper subdomains if non-private', () => { expect( getItemPriorityForUrl(createMockItem(['https://a.b.c.me']))('a.b.c.me', { protocolFilter: ['https:'], isPrivate: false, }) ).toBe(ItemUrlMatch.SUB_MATCH); expect( getItemPriorityForUrl(createMockItem(['https://a.b.c.me']))('b.c.me', { protocolFilter: ['https:'], isPrivate: false, }) ).toBe(ItemUrlMatch.SUB_MATCH); }); test('should not match deeper subdomains if private', () => { expect( getItemPriorityForUrl(createMockItem(['https://a.b.c.me']))('a.b.c.me', { protocolFilter: ['https:'], isPrivate: true, }) ).toBe(ItemUrlMatch.SUB_MATCH); expect( getItemPriorityForUrl(createMockItem(['https://a.b.c.me']))('b.c.me', { protocolFilter: ['https:'], isPrivate: true, }) ).toBe(ItemUrlMatch.NO_MATCH); }); test('should not match invalid urls', () => { const item1 = createMockItem(['https::/proton.ch']); const item2 = createMockItem([',,,,/proton.ch', ' ']); const item3 = createMockItem(['', 'https://proton.me']); expect(getItemPriorityForUrl(item1)('proton.ch', { protocolFilter: [], isPrivate: false })).toBe( ItemUrlMatch.NO_MATCH ); expect(getItemPriorityForUrl(item2)('proton.ch', { protocolFilter: [], isPrivate: false })).toBe( ItemUrlMatch.NO_MATCH ); expect(getItemPriorityForUrl(item3)('proton.ch', { protocolFilter: [], isPrivate: false })).toBe( ItemUrlMatch.NO_MATCH ); }); }); });
7,895
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib
petrpan-code/ProtonMail/WebClients/packages/pass/lib/search/match-url.ts
import type { Item } from '@proton/pass/types'; import { parseUrl } from '@proton/pass/utils/url/parser'; export enum ItemUrlMatch { TOP_MATCH = 1, SUB_MATCH = 0, NO_MATCH = -1, } /* This utility will give a score for a given login item : * - priority = -1 : no match * - priority = 0 : non-top level domain match * - priority = 1 : direct top-level domain match */ export const getItemPriorityForUrl = (item: Item<'login'>) => (match: string, options: { protocolFilter?: string[]; isPrivate: boolean }): ItemUrlMatch => item.content.urls.reduce<number>((priority, url) => { const parsedUrl = parseUrl(url); /* if an item's domain is parsed as null then * we're dealing with a corrupted url */ if (parsedUrl.domain === null) return priority; /* Check for strict domain match - this leverages * the public suffix list from `tldts`. If dealing * with a private domain, this will exclude private * top-level domains when trying to match a private * subdomain. */ const domainMatch = parsedUrl.domain === match; /* If the URL we are trying to match is a non-private * subdomain: allow resolving deeper subdomains for this * specific subdomain. */ const subdomainMatch = !options?.isPrivate ? parsedUrl.subdomain && parsedUrl.subdomain.endsWith(match) && match.includes(parsedUrl.domain) : parsedUrl.subdomain === match; /* no match -> skip */ if (!(domainMatch || subdomainMatch)) return priority; /* check protocol if filter provided */ if ( options?.protocolFilter && options.protocolFilter.length > 0 && !options.protocolFilter.some((protocol) => parsedUrl.protocol === protocol) ) { return priority; } return Math.max( priority, parsedUrl.isTopLevelDomain && parsedUrl.domain === match ? ItemUrlMatch.TOP_MATCH : ItemUrlMatch.SUB_MATCH ); }, ItemUrlMatch.NO_MATCH);
7,896
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib
petrpan-code/ProtonMail/WebClients/packages/pass/lib/search/types.ts
import type { Item, ItemSortFilter, ItemType, MaybeNull } from '@proton/pass/types'; import type { ParsedUrl } from '@proton/pass/utils/url/parser'; export type ItemMatchFuncMap = { [T in ItemType]: ItemMatchFunc<T> }; export type ItemMatchFunc<T extends ItemType = ItemType, Options extends any = any> = ( item: Item<T> ) => (searchTerm: string, options?: Options) => boolean; export type SelectItemsOptions = { type?: MaybeNull<ItemType>; shareId?: MaybeNull<string>; search?: string; sort?: MaybeNull<ItemSortFilter>; trashed?: boolean; }; export type SelectItemsByDomainOptions = { protocolFilter: string[]; isPrivate: boolean; shareIds?: string[]; sortOn?: 'priority' | 'lastUseTime'; }; export type SelectAutofillCandidatesOptions = ParsedUrl & { shareIds?: string[] }; export type SelectAutosaveCandidatesOptions = { domain: string; subdomain: MaybeNull<string>; username: string };
7,897
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib
petrpan-code/ProtonMail/WebClients/packages/pass/lib/settings/criteria.ts
import type { Maybe } from '@proton/pass/types'; import type { CriteriaMasks } from '@proton/pass/types/worker/settings'; import { CRITERIA_MASKS } from '@proton/pass/types/worker/settings'; export const toggleCriteria = (setting: number, criteria: CriteriaMasks) => (setting = setting ^ CRITERIA_MASKS[criteria]); export const hasCriteria = (setting: Maybe<number>, criteria: CriteriaMasks) => ((setting ?? 0) & CRITERIA_MASKS[criteria]) !== 0;
7,898
0
petrpan-code/ProtonMail/WebClients/packages/pass/lib
petrpan-code/ProtonMail/WebClients/packages/pass/lib/shares/share.parser.ts
import { PassCrypto } from '@proton/pass/lib/crypto/pass-crypto'; import { getAllShareKeys, getShareLatestEventId } from '@proton/pass/lib/shares/share.requests'; import { decodeVaultContent } from '@proton/pass/lib/vaults/vault-proto.transformer'; import type { Maybe, Share, ShareGetResponse, ShareKeyResponse, ShareType } from '@proton/pass/types'; export const parseShareResponse = async ( encryptedShare: ShareGetResponse, options?: { eventId?: string; shareKeys?: ShareKeyResponse[] } ): Promise<Maybe<Share<ShareType.Vault>>> => { const shareId = encryptedShare.ShareID; const [shareKeys, eventId] = await Promise.all([ options?.shareKeys ?? getAllShareKeys(shareId), options?.eventId ?? getShareLatestEventId(shareId), ]); const share = await PassCrypto.openShare<ShareType.Vault>({ encryptedShare, shareKeys }); if (share) { return { content: decodeVaultContent(share.content), createTime: share.createTime, eventId, newUserInvitesReady: share.newUserInvitesReady, owner: share.owner, shared: share.shared, shareId: share.shareId, shareRoleId: share.shareRoleId, targetId: share.targetId, targetMembers: share.targetMembers, targetMaxMembers: share.targetMaxMembers, targetType: share.targetType, vaultId: share.vaultId, }; } };
7,899