Compare commits

...
Author SHA1 Message Date
StandardNotes CI 51b198b9e2 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].7
2026-09-17 03:11:14 +00:00
Antonella Sgarlatta 715ffbcfd5 chore: fix desktop build pipeline 2026-09-17 00:06:55 -03:00
StandardNotes CI 2df2419341 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].6
2026-09-16 21:26:06 +00:00
Antonella Sgarlatta 141b2e3b1e chore: pipeline issues (#3051)
* chore: bump android sdk

* chore: fix ios upload

* chore: upgrade electron builder dep

* chore: bump version
2026-09-16 18:19:16 -03:00
Antonella Sgarlatta 1265178100 chore: translation fixes [skip ci] (#3050)
* chore: fix strings with same msgid

* chore: make strings file format consistent

* chore: fix variable names to prevent creating new crowdin entries

* chore: fix lint errors
2026-09-16 17:10:07 -03:00
StandardNotes CI 452f46303e chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].8
 - @standardnotes/[email protected].4
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected].5
2026-09-15 17:02:22 +00:00
Antonella Sgarlatta d73ec8378d fix: Fixes scroll position shift on Super checkbox toggle (#3049) 2026-09-15 13:53:15 -03:00
Antonella Sgarlatta cd90a59559 fix: Fixes potential tag path transversal in plaintext backups (#3048) 2026-09-15 13:53:02 -03:00
Antonella Sgarlatta 24da23096f fix: Fixes blank screen when tagging untagged current note on mobile (#3047) 2026-09-15 13:52:40 -03:00
Antonella Sgarlatta 13e0a9dc24 fix: Fixes command palette shortcut for AZERTY layout (#3046)
* fix: Fixes command palette keyboard shortcut for non-QERTY layouts

* fix: Fixes command palette keyboard shortcut for AZERTY
2026-09-15 13:52:26 -03:00
Antonella Sgarlatta e4e0f6fd08 fix: Ensures minimum encryption version when decrypting payload (#3045)
* fix: Ensures items key version as minimum when decrypting payload

* chore: add more tests
2026-09-15 13:52:01 -03:00
b8ccb0f85c ci: pin third-party actions to full commit SHAs (#3026)
* ci: pin third-party actions to full commit SHAs

Pin third-party actions on mutable @master/@main tags in credentialed jobs:
- chetan/invalidate-cloudfront-action (web.release.prod.yml) — handed production AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY
- convictional/trigger-workflow-and-wait (snjs.pr.yml, e2e jobs) — handed CI_PAT_TOKEN
- johnnyhuy/actions-discord-git-webhook (web.release.prod.yml) — handed DISCORD_WEBHOOK_URL

A moved tag would run unreviewed code with those credentials. Behaviour
unchanged; per GitHub's pin-to-SHA guidance.

Signed-off-by: Kobi Hikri <[email protected]>

* Apply suggestion from @antsgar

---------

Signed-off-by: Kobi Hikri <[email protected]>
Co-authored-by: Antonella Sgarlatta <[email protected]>
Co-authored-by: Antonella Sgarlatta <[email protected]>
2026-09-15 13:44:08 -03:00
StandardNotes CI 6fcb991e62 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].4
2026-09-07 15:05:45 +00:00
Antonella Sgarlatta 41f95985d8 chore: listed banners 2026-09-07 11:59:25 -03:00
StandardNotes CI 9601d2df99 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected].3
2026-09-04 03:24:15 +00:00
Antonella Sgarlatta cb697984f4 chore: trigger release 2026-09-04 00:18:30 -03:00
Antonella Sgarlatta 17dd950d08 chore: fix mobile and desktop ts build errors [skip ci] 2026-09-04 00:06:13 -03:00
151 changed files with 1324 additions and 902 deletions
@@ -1,19 +0,0 @@
name: Desktop Manual Build
on:
workflow_dispatch:
inputs:
platform:
description: Platform to build
required: true
type: choice
options:
- mac
- linux
- windows
jobs:
build:
uses: ./.github/workflows/desktop.build.reuse.yml
with:
platform: ${{ inputs.platform }}
-254
View File
@@ -1,254 +0,0 @@
name: Desktop Reusable Manual Build Workflow
on:
workflow_call:
inputs:
platform:
required: true
type: string
jobs:
Mac:
if: inputs.platform == 'mac'
runs-on: macos-latest
env:
CSC_IDENTITY_AUTO_DISCOVERY: false
defaults:
run:
working-directory: packages/desktop
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- run: yarn install --immutable
- name: Rebuild Electron Native Modules
run: yarn workspace @standardnotes/desktop rebuild:home-server
- run: yarn build:desktop
- run: echo APP_VERSION=$(node -p "require('./../web/package.json').version") >> $GITHUB_ENV
- name: Compile Mac
run: yarn run webpack --config desktop.webpack.prod.js
- name: MacX64
run: |
yarn run electron-builder --mac --x64 --publish=never --config electron-builder.unsigned.cjs --c.extraMetadata.version=${{ env.APP_VERSION }}
node scripts/fixMacZip.js ${{ env.APP_VERSION }}
- name: MacArm64
run: yarn run electron-builder --mac --arm64 --publish=never --config electron-builder.unsigned.cjs --c.extraMetadata.version=${{ env.APP_VERSION }}
- name: Upload
uses: actions/upload-artifact@v4
with:
name: dist-macos
retention-days: 7
path: |
packages/desktop/dist/*.dmg
packages/desktop/dist/*.zip
packages/desktop/dist/*.blockmap
packages/desktop/dist/*.yml
packages/desktop/dist/*.yaml
Linux-AppImage-X64:
name: Linux AppImage X64
if: inputs.platform == 'linux'
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/desktop
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install FPM
run: sudo gem install fpm -f
- run: yarn install --immutable
- name: Rebuild Electron Native Modules
run: yarn workspace @standardnotes/desktop rebuild:home-server
- run: yarn build:desktop
- run: echo APP_VERSION=$(node -p "require('./../web/package.json').version") >> $GITHUB_ENV
- name: Compile for AppImage
run: yarn run webpack --config desktop.webpack.prod.js
- name: AppImageX64
run: yarn run electron-builder --linux --x64 -c.linux.target=AppImage --publish=never --c.extraMetadata.version=${{ env.APP_VERSION }}
- name: Upload
uses: actions/upload-artifact@v4
with:
name: dist-linux-appimage-x64
retention-days: 7
path: |
packages/desktop/dist/*.AppImage
packages/desktop/dist/*.yml
packages/desktop/dist/*.yaml
Linux-AppImage-ARM64:
name: Linux AppImage ARM64
if: inputs.platform == 'linux'
runs-on: ubuntu-24.04-arm
defaults:
run:
working-directory: packages/desktop
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install FPM
run: sudo gem install fpm -f
- run: yarn install --immutable
- name: Rebuild Electron Native Modules
run: yarn workspace @standardnotes/desktop rebuild:home-server
- run: yarn build:desktop
- run: echo APP_VERSION=$(node -p "require('./../web/package.json').version") >> $GITHUB_ENV
- name: Compile for AppImage
run: yarn run webpack --config desktop.webpack.prod.js
- name: AppImageArm64
run: yarn run electron-builder --linux --arm64 -c.linux.target=AppImage --publish=never --c.extraMetadata.version=${{ env.APP_VERSION }}
- name: Upload
uses: actions/upload-artifact@v4
with:
name: dist-linux-appimage-arm64
retention-days: 7
path: |
packages/desktop/dist/*.AppImage
packages/desktop/dist/*.yml
packages/desktop/dist/*.yaml
Linux-Deb-X64:
name: Linux Deb X64
if: inputs.platform == 'linux'
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/desktop
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install FPM
run: sudo gem install fpm -f
- run: yarn install --immutable
- name: Rebuild Electron Native Modules
run: yarn workspace @standardnotes/desktop rebuild:home-server
- run: yarn build:desktop
- run: echo APP_VERSION=$(node -p "require('./../web/package.json').version") >> $GITHUB_ENV
- name: Deb
run: |
yarn run webpack --config desktop.webpack.prod.js --env deb
yarn run electron-builder --linux --x64 -c.linux.target=deb --publish=never --c.extraMetadata.version=${{ env.APP_VERSION }}
- name: Upload
uses: actions/upload-artifact@v4
with:
name: dist-linux-deb-x64
retention-days: 7
path: |
packages/desktop/dist/*.deb
packages/desktop/dist/*.yml
packages/desktop/dist/*.yaml
Linux-Deb-ARM64:
name: Linux Deb ARM64
if: inputs.platform == 'linux'
runs-on: ubuntu-24.04-arm
defaults:
run:
working-directory: packages/desktop
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install FPM
run: sudo gem install fpm -f
- run: yarn install --immutable
- name: Rebuild Electron Native Modules
run: yarn workspace @standardnotes/desktop rebuild:home-server
- run: yarn build:desktop
- run: echo APP_VERSION=$(node -p "require('./../web/package.json').version") >> $GITHUB_ENV
- name: DebArm64
env:
USE_SYSTEM_FPM: 'true'
run: |
yarn run webpack --config desktop.webpack.prod.js --env deb
yarn run electron-builder --linux --arm64 -c.linux.target=deb --publish=never --c.extraMetadata.version=${{ env.APP_VERSION }}
- name: Upload
uses: actions/upload-artifact@v4
with:
name: dist-linux-deb-arm64
retention-days: 7
path: |
packages/desktop/dist/*.deb
packages/desktop/dist/*.yml
packages/desktop/dist/*.yaml
Windows:
name: Windows
if: inputs.platform == 'windows'
runs-on: windows-latest
env:
NODE_OPTIONS: --max-old-space-size=8192
CSC_IDENTITY_AUTO_DISCOVERY: false
defaults:
run:
working-directory: packages/desktop
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- run: corepack enable
- run: yarn install --immutable
- run: yarn build:desktop
- name: Set app version
shell: bash
run: echo APP_VERSION=$(node -p "require('./../web/package.json').version") >> $GITHUB_ENV
- name: Compile
run: yarn run webpack --config desktop.webpack.prod.js
- name: Build Windows installers
shell: bash
run: yarn run electron-builder --windows --x64 --ia32 --publish=never --config electron-builder.unsigned.cjs --c.extraMetadata.version=$APP_VERSION
- name: Upload
uses: actions/upload-artifact@v4
with:
name: dist-windows
retention-days: 7
path: |
packages/desktop/dist/*.exe
packages/desktop/dist/*.yml
packages/desktop/dist/*.yaml
packages/desktop/dist/*.blockmap
@@ -23,6 +23,9 @@ jobs:
with:
distribution: 'zulu'
java-version: '17'
- name: Setup Android SDK
run: |
echo "y" | "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" "platforms;android-36" "build-tools;36.0.0"
- name: Export version for closed beta
run: |
BASE_VERSION=$(grep '"version"' ../web/package.json | cut -d '"' -f 4 | cut -d "-" -f 1)
@@ -21,6 +21,9 @@ jobs:
with:
distribution: 'zulu'
java-version: '17'
- name: Setup Android SDK
run: |
echo "y" | "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" "platforms;android-36" "build-tools;36.0.0"
- name: Export version from package.json
run:
echo "PACKAGE_VERSION=$(grep '"version"' ../web/package.json | cut -d '"' -f 4 | cut -d "-" -f 1)" >> $GITHUB_ENV
+2 -2
View File
@@ -79,7 +79,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Run E2E test suite
uses: convictional/trigger-workflow-and-wait@master
uses: convictional/trigger-workflow-and-wait@224756e4cc7fa0b711a281193496319f816cd880 # master
with:
owner: standardnotes
repo: server
@@ -97,7 +97,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Run E2E vaults test suite
uses: convictional/trigger-workflow-and-wait@master
uses: convictional/trigger-workflow-and-wait@224756e4cc7fa0b711a281193496319f816cd880 # master
with:
owner: standardnotes
repo: server
+2 -2
View File
@@ -31,7 +31,7 @@ jobs:
- name: Deploy static site to S3 bucket
run: aws s3 sync packages/web/dist/ s3://app.standardnotes.com --delete
- name: Invalidate CloudFront Cache
uses: chetan/invalidate-cloudfront-action@master
uses: chetan/invalidate-cloudfront-action@fce6f6f546fae2e9fe55f3bd1411063a908f2557 # master
env:
DISTRIBUTION: ${{ secrets.WEBAPP_CLOUDFRONT_COM_DISTRIBUTION_ID }}
PATHS: '/*'
@@ -46,6 +46,6 @@ jobs:
steps:
- name: Run Discord Webhook
uses: johnnyhuy/actions-discord-git-webhook@main
uses: johnnyhuy/actions-discord-git-webhook@59b728b6b5cd1c18e4b462f4876d3a0d8e26f23a # main
with:
webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+20
View File
@@ -3,6 +3,26 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.1.602](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2026-09-17)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.601](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2026-09-16)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.600](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2026-09-15)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.599](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2026-09-07)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.598](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2026-09-04)
**Note:** Version bump only for package @standardnotes/clipper
## [1.1.597](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2026-09-03)
**Note:** Version bump only for package @standardnotes/clipper
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@standardnotes/clipper",
"description": "Web clipper browser extension for Standard Notes",
"version": "1.1.597",
"version": "1.1.602",
"private": true,
"scripts": {
"build-mv2": "yarn clean && webpack --config ./webpack.config.prod.js",
+1 -1
View File
@@ -5,7 +5,7 @@ module.exports = {
project: './tsconfig.json',
tsconfigRootDir: __dirname,
},
ignorePatterns: ['**/*.spec.ts', '@types', 'node_modules', 'dist', 'electron-builder.unsigned.cjs'],
ignorePatterns: ['**/*.spec.ts', '@types', 'node_modules', 'dist'],
rules: {
'no-console': ['warn', { allow: ['warn', 'error'] }],
'@typescript-eslint/no-var-requires': 'off',
+22
View File
@@ -3,6 +3,28 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [3.110.207](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2026-09-17)
**Note:** Version bump only for package @standardnotes/desktop
## [3.110.206](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2026-09-16)
**Note:** Version bump only for package @standardnotes/desktop
## [3.110.205](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2026-09-15)
### Bug Fixes
* Fixes potential tag path transversal in plaintext backups ([#3048](https://github.com/standardnotes/app/issues/3048)) ([cd90a59](https://github.com/standardnotes/app/commit/cd90a59559d8257065d0e022f7afc02fc78beb41))
## [3.110.204](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2026-09-07)
**Note:** Version bump only for package @standardnotes/desktop
## [3.110.203](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2026-09-04)
**Note:** Version bump only for package @standardnotes/desktop
## [3.110.202](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2026-09-03)
**Note:** Version bump only for package @standardnotes/desktop
@@ -319,7 +319,12 @@ export class FilesBackupManager implements FileBackupsDevice {
const relativePath = forTag ?? ''
const filenameWithSlashesEscaped = filename.replace(/\//g, '\u2215')
const sanitizedFilename = sanitizeFileName(filenameWithSlashesEscaped)
const fileAbsolutePath = path.join(absolutePath, relativePath, sanitizedFilename)
const fileAbsolutePath = path.resolve(absolutePath, relativePath, sanitizedFilename)
if (!this.filesManager.isChildOfDir(path.resolve(absolutePath), fileAbsolutePath)) {
throw new Error(`Plaintext backup path escapes backup directory: ${forTag}`)
}
await this.filesManager.writeFile(fileAbsolutePath, data)
const existingRecord = findMappingRecord(forTag)
@@ -1,13 +0,0 @@
const packageJson = require('./package.json')
module.exports = {
...packageJson.build,
afterSign: null,
win: {
...packageJson.build.win,
certificateSubjectName: null,
publisherName: null,
sign: null,
signDlls: false,
},
}
+5 -12
View File
@@ -1,7 +1,7 @@
{
"name": "@standardnotes/desktop",
"main": "./app/dist/index.js",
"version": "3.110.202",
"version": "3.110.207",
"license": "AGPL-3.0",
"author": "Standard Notes.",
"private": true,
@@ -69,7 +69,7 @@
"ava": "^5.1.0",
"babel-loader": "^9.1.0",
"copy-webpack-plugin": "^11.0.0",
"electron-builder": "^24.9.1",
"electron-builder": "^26.15.7",
"eslint": "*",
"eslint-config-prettier": "^8.9.0",
"eslint-plugin-import": "^2.26.0",
@@ -123,21 +123,14 @@
"zip"
]
},
"win": {
"certificateSubjectName": "Standard Notes Ltd.",
"publisherName": "Standard Notes Ltd.",
"signDlls": true,
"sign": "./scripts/windowsSign.js"
},
"nsis": {
"deleteAppDataOnUninstall": true
},
"linux": {
"category": "Office",
"icon": "build/icon/",
"executableName": "standard-notes",
"desktop": {
"StartupWMClass": "standard notes"
"entry": {
"StartupWMClass": "standard notes"
}
},
"target": [
"AppImage",
+6
View File
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.21.118](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2026-09-15)
### Bug Fixes
* Ensures minimum encryption version when decrypting payload ([#3045](https://github.com/standardnotes/app/issues/3045)) ([e4e0f6f](https://github.com/standardnotes/app/commit/e4e0f6fd08e4edfdbbf996ad82e8bf65205f5c25))
## [1.21.117](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2026-09-03)
**Note:** Version bump only for package @standardnotes/encryption
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/encryption",
"version": "1.21.117",
"version": "1.21.118",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -0,0 +1,129 @@
import { ContentType } from '@standardnotes/domain-core'
import { EncryptedPayloadInterface, ItemsKeyInterface, ProtocolVersion } from '@standardnotes/models'
import { EncryptionOperatorsInterface } from './EncryptionOperatorsInterface'
import { decryptPayload } from './OperatorWrapper'
describe('decryptPayload', () => {
const createPayload = (version: ProtocolVersion): EncryptedPayloadInterface =>
({
uuid: 'item-1',
version,
content: 'encrypted',
content_type: ContentType.TYPES.Note,
enc_item_key: 'enc-item-key',
}) as EncryptedPayloadInterface
const createKey = (keyVersion: ProtocolVersion): ItemsKeyInterface =>
({
keyVersion,
itemsKey: 'key',
}) as ItemsKeyInterface
describe('version guard', () => {
it('rejects payloads claiming a protocol version below the items key version', async () => {
const payload = createPayload(ProtocolVersion.V001)
const key = createKey(ProtocolVersion.V004)
const operatorManager = {
operatorForVersion: jest.fn(),
} as unknown as EncryptionOperatorsInterface
const result = await decryptPayload(payload, key, operatorManager)
expect(result).toEqual({ uuid: 'item-1', errorDecrypting: true })
expect(operatorManager.operatorForVersion).not.toHaveBeenCalled()
})
it('proceeds when payload version equals items key version', async () => {
const payload = createPayload(ProtocolVersion.V004)
const key = createKey(ProtocolVersion.V004)
const syncOperator = {
generateDecryptedParameters: jest.fn().mockReturnValue({ uuid: 'item-1', content: {} }),
}
const operatorManager = {
operatorForVersion: jest.fn().mockReturnValue(syncOperator),
} as unknown as EncryptionOperatorsInterface
await decryptPayload(payload, key, operatorManager)
expect(operatorManager.operatorForVersion).toHaveBeenCalledWith(ProtocolVersion.V004)
})
it('proceeds when payload version is above items key version', async () => {
const payload = createPayload(ProtocolVersion.V004)
const key = createKey(ProtocolVersion.V003)
const syncOperator = {
generateDecryptedParameters: jest.fn().mockReturnValue({ uuid: 'item-1', content: {} }),
}
const operatorManager = {
operatorForVersion: jest.fn().mockReturnValue(syncOperator),
} as unknown as EncryptionOperatorsInterface
await decryptPayload(payload, key, operatorManager)
expect(operatorManager.operatorForVersion).toHaveBeenCalledWith(ProtocolVersion.V004)
})
})
describe('operator delegation', () => {
it('uses sync operator when operator is not async', async () => {
const payload = createPayload(ProtocolVersion.V004)
const key = createKey(ProtocolVersion.V004)
const decrypted = { uuid: 'item-1', content: { text: 'hello' } }
const syncOperator = {
generateDecryptedParameters: jest.fn().mockReturnValue(decrypted),
}
const operatorManager = {
operatorForVersion: jest.fn().mockReturnValue(syncOperator),
} as unknown as EncryptionOperatorsInterface
const result = await decryptPayload(payload, key, operatorManager)
expect(result).toEqual(decrypted)
expect(syncOperator.generateDecryptedParameters).toHaveBeenCalledWith(
expect.objectContaining({ uuid: 'item-1', version: ProtocolVersion.V004 }),
key,
)
})
it('uses async operator when operator is async', async () => {
const payload = createPayload(ProtocolVersion.V004)
const key = createKey(ProtocolVersion.V004)
const decrypted = { uuid: 'item-1', content: { text: 'hello' } }
const asyncOperator = {
generateEncryptedParametersAsync: jest.fn(),
generateDecryptedParametersAsync: jest.fn().mockResolvedValue(decrypted),
}
const operatorManager = {
operatorForVersion: jest.fn().mockReturnValue(asyncOperator),
} as unknown as EncryptionOperatorsInterface
const result = await decryptPayload(payload, key, operatorManager)
expect(result).toEqual(decrypted)
expect(asyncOperator.generateDecryptedParametersAsync).toHaveBeenCalledWith(
expect.objectContaining({ uuid: 'item-1', version: ProtocolVersion.V004 }),
key,
)
})
it('returns error when operator throws', async () => {
const payload = createPayload(ProtocolVersion.V004)
const key = createKey(ProtocolVersion.V004)
const syncOperator = {
generateDecryptedParameters: jest.fn().mockImplementation(() => {
throw new Error('decryption failed')
}),
}
const operatorManager = {
operatorForVersion: jest.fn().mockReturnValue(syncOperator),
} as unknown as EncryptionOperatorsInterface
const consoleErrorSpy = jest.spyOn(console, 'error').mockImplementation()
const result = await decryptPayload(payload, key, operatorManager)
expect(result).toEqual({ uuid: 'item-1', errorDecrypting: true })
consoleErrorSpy.mockRestore()
})
})
})
@@ -1,4 +1,5 @@
import {
compareVersions,
DecryptedPayloadInterface,
ItemsKeyInterface,
RootKeyInterface,
@@ -44,6 +45,13 @@ export async function decryptPayload<C extends ItemContent = ItemContent>(
key: ItemsKeyInterface | KeySystemItemsKeyInterface | KeySystemRootKeyInterface | RootKeyInterface,
operatorManager: EncryptionOperatorsInterface,
): Promise<DecryptedParameters<C> | ErrorDecryptingParameters> {
if (compareVersions(payload.version, key.keyVersion) < 0) {
return {
uuid: payload.uuid,
errorDecrypting: true,
}
}
const operator = operatorManager.operatorForVersion(payload.version)
try {
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.28.139](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2026-09-15)
**Note:** Version bump only for package @standardnotes/filepicker
## [1.28.138](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2026-09-03)
**Note:** Version bump only for package @standardnotes/filepicker
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/filepicker",
"version": "1.28.138",
"version": "1.28.139",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.20.22](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2026-09-15)
**Note:** Version bump only for package @standardnotes/files
## [1.20.21](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2026-09-03)
**Note:** Version bump only for package @standardnotes/files

Some files were not shown because too many files have changed in this diff Show More