Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions docs/gdpr.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,35 @@ browser. Neither sends plaintext, a passphrase, or a derived key to the server.

### Scope

Both modes export the whole vault or a selected folder subtree. Scope never
changes the security gating of the chosen mode.
Every mode exports the whole vault, or only what you choose:

- **Chosen folders**: the secrets in those folders and their subfolders.
- **Chosen types**: the secrets of those types, system or custom.
- **Selected items**: from the list, select the items and use **Export
selected** on the selection strip; the export holds exactly those.

Choosing folders or types and then choosing none exports the whole vault, never
an empty file by accident. Scope never changes the security gating of the
chosen mode.

### Fields to leave out

Under **Leave out** you can drop usernames, additional fields or authenticator
seeds from every exported secret. A file with fields left out says so: it
carries `partial: true` and the list of fields left out, so a restore knows it
is not a full copy.

### Nothing is left out in silence

When some secrets could not be decrypted, the dialog says how many before
anything is written, and the export waits until you choose to continue without
them.

### Types travel by name

Each exported secret carries its type's name (`typeName`) and, for a custom
type, its label (`typeLabel`), so a backup restores with its types on another
account or another instance, where type ids differ.

## GDPR data export (Art. 15, right of access)

Expand Down
16 changes: 16 additions & 0 deletions docs/importing.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,22 @@ guidance.
reasons), and how many folders were created. You can download the rejected
rows as a CSV (generated locally, never uploaded) to fix and re-import.

## Restoring a Keepiq backup

A restored secret keeps its type. Each row is matched in this order:

1. the system type with the backup's type name;
2. a custom type of your own with that name;
3. a new custom type with the backup's name and label, created once for all
rows that need it;
4. the default type, with a warning naming the row.

A backup written before type names were exported carries type ids; system types
are recovered from those, because their ids are the same on every instance.
The summary lists the types it created and every row that fell back, and every
restored or rejected row names its position in the backup. A backup made with
fields left out is restored as it is, and the summary says it was partial.

## What is not imported

- **Shares, link shares, and delegations** — set these up again in Keepiq.
Expand Down
9 changes: 8 additions & 1 deletion l10n/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -1890,7 +1890,14 @@ OC.L10N.register(
"This browser could not generate a key pair.": "This browser could not generate a key pair.",
"This is not a private key. Paste an OpenSSH or PEM private key, or generate one.": "This is not a private key. Paste an OpenSSH or PEM private key, or generate one.",
"This is not an OpenSSH public key.": "This is not an OpenSSH public key.",
"This public key does not belong to the private key.": "This public key does not belong to the private key."
"This public key does not belong to the private key.": "This public key does not belong to the private key.",
"Authenticator seeds": "Authenticator seeds",
"Chosen folders": "Chosen folders",
"Chosen types": "Chosen types",
"Export selected": "Export selected",
"Leave out": "Leave out",
"Types": "Types",
"Usernames": "Usernames"
},
"nplurals=2; plural=(n != 1);"
)
9 changes: 8 additions & 1 deletion l10n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1967,7 +1967,14 @@
"This browser could not generate a key pair.": "This browser could not generate a key pair.",
"This is not a private key. Paste an OpenSSH or PEM private key, or generate one.": "This is not a private key. Paste an OpenSSH or PEM private key, or generate one.",
"This is not an OpenSSH public key.": "This is not an OpenSSH public key.",
"This public key does not belong to the private key.": "This public key does not belong to the private key."
"This public key does not belong to the private key.": "This public key does not belong to the private key.",
"Authenticator seeds": "Authenticator seeds",
"Chosen folders": "Chosen folders",
"Chosen types": "Chosen types",
"Export selected": "Export selected",
"Leave out": "Leave out",
"Types": "Types",
"Usernames": "Usernames"
},
"plurals": "",
"pluralForm": "nplurals=2; plural=(n != 1);"
Expand Down
9 changes: 8 additions & 1 deletion l10n/nl.js
Original file line number Diff line number Diff line change
Expand Up @@ -1902,7 +1902,14 @@ OC.L10N.register(
"These sites offer passkeys, and your vault holds no passkey for them. A passkey cannot be phished or reused.": "Deze sites bieden passkeys aan, en je kluis bevat er geen voor deze sites. Een passkey kan niet worden gephisht of hergebruikt.",
"Site data: 2FA Directory (MIT) and Passkeys Directory (CC BY 4.0), by 2factorauth and contributors.": "Sitegegevens: 2FA Directory (MIT) en Passkeys Directory (CC BY 4.0), door 2factorauth en bijdragers.",
"Two-factor available and Passkey available are unavailable: the site directory could not be loaded. Other findings are unaffected.": "Tweestapsaanmelding beschikbaar en Passkey beschikbaar zijn niet beschikbaar: de sitedirectory kon niet worden geladen. Andere bevindingen blijven gelden.",
"Two-factor available and Passkey available are unavailable: your administrator has not switched on the site directory.": "Tweestapsaanmelding beschikbaar en Passkey beschikbaar zijn niet beschikbaar: je beheerder heeft de sitedirectory niet aangezet."
"Two-factor available and Passkey available are unavailable: your administrator has not switched on the site directory.": "Tweestapsaanmelding beschikbaar en Passkey beschikbaar zijn niet beschikbaar: je beheerder heeft de sitedirectory niet aangezet.",
"Authenticator seeds": "Authenticatorsleutels",
"Chosen folders": "Gekozen mappen",
"Chosen types": "Gekozen typen",
"Export selected": "Selectie exporteren",
"Leave out": "Weglaten",
"Types": "Typen",
"Usernames": "Gebruikersnamen"
},
"nplurals=2; plural=(n != 1);"
)
9 changes: 8 additions & 1 deletion l10n/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -1979,7 +1979,14 @@
"These sites offer passkeys, and your vault holds no passkey for them. A passkey cannot be phished or reused.": "Deze sites bieden passkeys aan, en je kluis bevat er geen voor deze sites. Een passkey kan niet worden gephisht of hergebruikt.",
"Site data: 2FA Directory (MIT) and Passkeys Directory (CC BY 4.0), by 2factorauth and contributors.": "Sitegegevens: 2FA Directory (MIT) en Passkeys Directory (CC BY 4.0), door 2factorauth en bijdragers.",
"Two-factor available and Passkey available are unavailable: the site directory could not be loaded. Other findings are unaffected.": "Tweestapsaanmelding beschikbaar en Passkey beschikbaar zijn niet beschikbaar: de sitedirectory kon niet worden geladen. Andere bevindingen blijven gelden.",
"Two-factor available and Passkey available are unavailable: your administrator has not switched on the site directory.": "Tweestapsaanmelding beschikbaar en Passkey beschikbaar zijn niet beschikbaar: je beheerder heeft de sitedirectory niet aangezet."
"Two-factor available and Passkey available are unavailable: your administrator has not switched on the site directory.": "Tweestapsaanmelding beschikbaar en Passkey beschikbaar zijn niet beschikbaar: je beheerder heeft de sitedirectory niet aangezet.",
"Authenticator seeds": "Authenticatorsleutels",
"Chosen folders": "Gekozen mappen",
"Chosen types": "Gekozen typen",
"Export selected": "Selectie exporteren",
"Leave out": "Weglaten",
"Types": "Typen",
"Usernames": "Gebruikersnamen"
},
"plurals": null,
"pluralForm": "nplurals=2; plural=(n != 1);"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,23 @@

- [x] 1.1 Extend `serializeVault()` with the combined scope, the field deny list, `typeName` and `typeLabel`, and the partial marker; fix the test fixtures to use UUID type ids. Verify: vitest for each scope, each left-out field, a custom type, and a UUID type id resolving to its name.
- [ ] 1.2 Rebuild the scope and fields part of `ExportDialog.vue` (entire vault, folders, types, selection; fields to leave out). Verify: vitest on `buildScope()`, and a Playwright flow export two folders and one type.
- Round 2 (2026-11-17): built. `src/export/exportScope.js` `buildScope()`; the dialog offers entire vault, chosen folders, chosen types and the selection, plus Leave out (usernames, additional fields, authenticator seeds), and passes the vault's types so the file names them. vitest `tests/vitest/export-scope.spec.js` against the real serializer. Playwright flow in `tests/e2e/workflows/export-choice.spec.ts`, not yet run live.
- [ ] 1.3 Add Export selected to the bulk strip in `SecretList.vue`, and return and show the skipped count from `decryptAllSecrets()`. Verify: Playwright flow select three items, export, the file holds three; vitest that a secret failing to decrypt is counted.
- Round 2: Export selected on the selection strip opens the dialog on the selection; the skipped count was already returned and shown. Playwright "Export selected writes exactly the three selected items" written, not yet run live. Still owed: a vitest that a secret failing to decrypt is counted (decryptAllSecrets lives in SecretList.vue).
- Round 2, continued (2026-11-17): the vitest was already there: `tests/dialogs/ExportSkippedSecrets.spec.js` ("decryptAllSecrets() returns the decrypted secrets and the skipped count", and the count reaching both dialogs) and `tests/views/SecretList.methods.more.spec.js` (a blocked row and a failing decrypt both counted). The box stays open for the live Playwright run.

## 2. Restore

- [x] 2.1 In `backupParser.js`, set `sourceRow` and read `typeName`, `typeLabel` and the partial marker. Verify: vitest on a new-format and an old-format fixture.
- [ ] 2.2 In `import.js`, resolve types by D3's order, creating missing custom types through `POST /api/v1/secret-types`, and list created types and fallbacks in the summary. Verify: vitest for each resolution branch, and a Playwright round trip export then restore on a fresh user keeps every type.
- Round 2: the resolution was already in `import.js` (`resolveRowTypes`); vitest for every branch in `tests/vitest/import-resolveRowTypes.spec.js`. The Playwright round trip is a `test.fixme` in export-choice.spec.ts: not written yet.
- Round 2, continued (2026-11-17): written. "a backup restored by a fresh user keeps every type" in `tests/e2e/workflows/export-choice.spec.ts`: two fresh non-admin accounts from an empty storage state; the first makes a custom type, a secret of it and a note, and exports an encrypted backup; the second, whose vault has never seen the type, restores it through the import wizard with the passphrase, and the test reads back that the custom type was recreated by name and label and that both secrets carry their type. Lints and lists (`playwright test --list`); not yet run against a live instance, so the box stays open.

## 3. Docs

- [ ] 3.1 Update `docs/gdpr.md` and `docs/importing.md` with the scope, field and restore rules. Verify: docs build.
- [x] 3.1 Update `docs/gdpr.md` and `docs/importing.md` with the scope, field and restore rules. Verify: docs build.
- Round 2: `docs/gdpr.md` (scope, fields left out, the skipped-secrets wait, types by name) and `docs/importing.md` (restore order) updated; the docs build was not run here.
- Round 2, continued (2026-11-17): `npm run build` in `docs/` succeeds ("Generated static files"); the broken links it lists are on other pages (ARCHITECTURE, FEATURES, intro), none on these two.

## Acceptance criteria

Expand Down
130 changes: 120 additions & 10 deletions src/dialogs/ExportDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,40 @@
</NcNoteCard>

<NcSelect
v-model="scopeFolder"
v-model="scopeKind"
data-testid="export-scope-kind"
:inputLabel="t('keepiq', 'Scope')"
:options="scopeOptions"
:reduce="(opt) => opt.value"
:clearable="false" />
<NcSelect
v-if="scopeKind === 'folders'"
v-model="scopeFolderIds"
data-testid="export-scope-folders"
multiple
:inputLabel="t('keepiq', 'Folders')"
:options="folderOptions"
:reduce="(opt) => opt.value" />
<NcSelect
v-if="scopeKind === 'types'"
v-model="scopeTypeIds"
data-testid="export-scope-types"
multiple
:inputLabel="t('keepiq', 'Types')"
:options="typeOptions"
:reduce="(opt) => opt.value" />
<fieldset class="export-dialog__omit" data-testid="export-omit-fields">
<legend>{{ t('keepiq', 'Leave out') }}</legend>
<NcCheckboxRadioSwitch
v-for="field in omitChoices"
:key="field.value"
v-model="omitFields"
type="checkbox"
:value="field.value"
:data-testid="'export-omit-' + field.value">
{{ field.label }}
</NcCheckboxRadioSwitch>
</fieldset>

<!-- Encrypted backup path -->
<div
Expand Down Expand Up @@ -206,6 +235,7 @@ import {
import zxcvbn from 'zxcvbn'
import RecoveryKitPanel from '../components/RecoveryKitPanel.vue'
import SkippedSecretsNotice from '../components/SkippedSecretsNotice.vue'
import { buildScope, serializerOptions } from '../export/exportScope.js'
import exportSourceProps from '../mixins/exportSourceProps.js'
import exportStoreDialog from '../mixins/exportStoreDialog.js'
import masterPasswordCheck from '../mixins/masterPasswordCheck.js'
Expand All @@ -230,6 +260,20 @@ export default {

mixins: [exportSourceProps, exportStoreDialog, masterPasswordCheck],

props: {
/** The items selected on the list, for an export of just those. */
selectedIds: {
type: Array,
default: () => [],
},

/** The scope the dialog opens on: `vault`, or `selection` from the bulk strip. */
initialScope: {
type: String,
default: 'vault',
},
},

emits: ['update:open'],
data() {
return {
Expand All @@ -240,7 +284,14 @@ export default {
warningAcknowledged: false,
/** Whether the user chose to export without the skipped secrets. */
skippedAcknowledged: false,
scopeFolder: 'vault',
/** What the export covers: vault, folders, types or selection. */
scopeKind: 'vault',
/** The folders chosen when scopeKind is folders. */
scopeFolderIds: [],
/** The types chosen when scopeKind is types. */
scopeTypeIds: [],
/** The fields to leave out (OMITTABLE_FIELDS). */
omitFields: [],
error: null,
/** CXF pre-download unmapped-item report (null = not built yet). */
cxfReport: null,
Expand Down Expand Up @@ -270,13 +321,62 @@ export default {
scopeOptions() {
const opts = [
{ label: this.t('keepiq', 'Entire vault'), value: 'vault' },
{ label: this.t('keepiq', 'Chosen folders'), value: 'folders' },
{ label: this.t('keepiq', 'Chosen types'), value: 'types' },
]
for (const folder of this.folders) {
opts.push({ label: folder.name, value: folder.id })
if (this.selectedIds.length > 0) {
opts.push({
label: this.t('keepiq', 'Selected items ({count})', { count: this.selectedIds.length }),
value: 'selection',
})
}
return opts
},

/**
* The folders to choose from.
*
* @return {Array<object>}
* @spec openspec/changes/portability-export-choice-and-restore-fidelity/specs/export-selection-and-restore/spec.md#requirement-choose-what-an-export-contains
*/
folderOptions() {
return this.folders.map((folder) => ({ label: folder.name, value: folder.id }))
},

/**
* The types to choose from.
*
* @return {Array<object>}
* @spec openspec/changes/portability-export-choice-and-restore-fidelity/specs/export-selection-and-restore/spec.md#requirement-choose-what-an-export-contains
*/
typeOptions() {
return useSecretTypeStore().types.map((type) => ({ label: type.label || type.name, value: type.id }))
},

/**
* The fields a user can leave out.
*
* @return {Array<object>}
* @spec openspec/changes/portability-export-choice-and-restore-fidelity/specs/export-selection-and-restore/spec.md#requirement-choose-what-an-export-contains
*/
omitChoices() {
return [
{ label: this.t('keepiq', 'Usernames'), value: 'login' },
{ label: this.t('keepiq', 'Additional fields'), value: 'additionalFields' },
{ label: this.t('keepiq', 'Authenticator seeds'), value: 'totp' },
]
},

/**
* The serializer options: the types, so the file names them, and the fields left out.
*
* @return {object}
* @spec openspec/changes/portability-export-choice-and-restore-fidelity/specs/export-selection-and-restore/spec.md#requirement-a-restored-backup-keeps-types-and-row-positions
*/
exportOptions() {
return serializerOptions(useSecretTypeStore().types, this.omitFields)
},

/**
* The live passphrase-strength feedback label.
*
Expand Down Expand Up @@ -338,11 +438,14 @@ export default {
* @param {boolean} open Whether the dialog is open now.
* @return {Promise<void>}
* @spec openspec/specs/vault-policies/spec.md#requirement-personal-vault-export-can-be-blocked
* @spec openspec/changes/portability-export-choice-and-restore-fidelity/specs/export-selection-and-restore/spec.md#requirement-choose-what-an-export-contains
*/
async open(open) {
if (open !== true) {
return
}
// Opened from the bulk strip, the export starts on the selection.
this.scopeKind = this.initialScope === 'selection' && this.selectedIds.length > 0 ? 'selection' : 'vault'
resetPolicyCache()
this.exportBlocked =
(await fetchPolicy())?.vault_export_disabled === true
Expand Down Expand Up @@ -380,10 +483,12 @@ export default {
* @spec openspec/specs/secret-export/spec.md
*/
buildScope() {
if (this.scopeFolder === 'vault') {
return { mode: 'vault' }
}
return { mode: 'folders', folderIds: [this.scopeFolder] }
return buildScope({
kind: this.scopeKind,
folderIds: this.scopeFolderIds,
typeIds: this.scopeTypeIds,
secretIds: this.selectedIds,
})
},

/**
Expand Down Expand Up @@ -427,6 +532,7 @@ export default {
this.folders,
this.passphrase,
scope,
this.exportOptions,
)
return true
}
Expand All @@ -436,7 +542,7 @@ export default {
if (this.mode === 'cxf') {
return this.exportCxf(scope)
}
await this.exportStore.exportCsv(this.secrets, this.folders, scope)
await this.exportStore.exportCsv(this.secrets, this.folders, scope, this.exportOptions)
return true
},

Expand All @@ -454,6 +560,7 @@ export default {
return false
}
await this.exportStore.exportCxf(this.secrets, this.folders, scope, {
...this.exportOptions,
typeNamesById: this.typeNamesById,
})
return true
Expand Down Expand Up @@ -514,7 +621,10 @@ export default {
this.masterPassword = ''
this.warningAcknowledged = false
this.skippedAcknowledged = false
this.scopeFolder = 'vault'
this.scopeKind = 'vault'
this.scopeFolderIds = []
this.scopeTypeIds = []
this.omitFields = []
this.error = null
this.cxfReport = null
},
Expand Down
Loading