@vrtmrz/livesync-commonlib 0.4.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -5
- package/dist/API/DirectFileManipulatorV2.d.ts +1 -0
- package/dist/API/DirectFileManipulatorV2.js +3 -1
- package/dist/API/processSetting.d.ts +1 -0
- package/dist/API/processSetting.js +3 -0
- package/dist/common/models/setting.const.defaults.js +1 -0
- package/dist/common/models/setting.const.qr.js +2 -1
- package/dist/common/models/setting.encryption.d.ts +2 -0
- package/dist/common/models/setting.encryption.js +6 -0
- package/dist/common/models/setting.lifecycle.js +7 -2
- package/dist/common/models/setting.policy.d.ts +4 -0
- package/dist/common/models/setting.policy.js +9 -0
- package/dist/common/models/setting.type.d.ts +2 -0
- package/dist/common/models/shared.definition.configNames.js +5 -0
- package/dist/common/models/tweak.definition.d.ts +1 -0
- package/dist/common/settingConstants.d.ts +1 -0
- package/dist/common/utils.js +5 -4
- package/dist/diagnostics/couchdb.js +4 -2
- package/dist/managers/ChunkFetcher.js +27 -4
- package/dist/managers/chunkFetcher.helper.js +1 -1
- package/dist/pouchdb/StreamingFetch.d.ts +1 -2
- package/dist/pouchdb/encryption.d.ts +5 -10
- package/dist/pouchdb/encryption.eden.d.ts +11 -0
- package/dist/pouchdb/encryption.eden.js +37 -0
- package/dist/pouchdb/encryption.js +67 -63
- package/dist/pouchdb/encryption.policy.d.ts +9 -0
- package/dist/pouchdb/encryption.policy.js +125 -0
- package/dist/replication/UnencryptedContentRejectedError.d.ts +16 -0
- package/dist/replication/UnencryptedContentRejectedError.js +44 -0
- package/dist/replication/couchdb/LiveSyncReplicator.js +41 -4
- package/dist/replication/index.d.ts +2 -0
- package/dist/replication/index.js +3 -0
- package/dist/replication/trystero/TrysteroReplicator.d.ts +2 -0
- package/dist/replication/unencryptedContentMessages.d.ts +8 -0
- package/dist/replication/unencryptedContentMessages.js +12 -0
- package/dist/serviceModules/Rebuilder.js +28 -4
- package/dist/services/base/RemoteConnection.d.ts +2 -0
- package/dist/services/base/RemoteService.js +2 -1
- package/dist/services/base/SettingService.js +2 -0
- package/dist/settings.d.ts +2 -1
- package/dist/settings.js +2 -0
- package/dist/worker/bgWorker.js +1 -1
- package/docs/offline-scanner.md +2 -1
- package/docs/settings-lifecycle.md +4 -0
- package/package.json +1 -1
|
@@ -8,6 +8,8 @@ export interface RemoteConnectionOpenOptions {
|
|
|
8
8
|
readonly encryptionAlgorithm?: E2EEAlgorithm;
|
|
9
9
|
/** Apply HKDF Metadata encryption to obfuscated internal entries on writes. */
|
|
10
10
|
readonly encryptInternalMetadata?: boolean;
|
|
11
|
+
/** Accept plaintext file content on reads while E2EE is enabled. */
|
|
12
|
+
readonly acceptUnencryptedContent?: boolean;
|
|
11
13
|
/** Use HTTP headers alone for cache control; an absent value is false. */
|
|
12
14
|
readonly useCouchDBCacheControlHeadersOnly?: boolean;
|
|
13
15
|
/**
|
|
@@ -316,7 +316,8 @@ class RemoteService extends ServiceBase {
|
|
|
316
316
|
false,
|
|
317
317
|
getPBKDF2Salt,
|
|
318
318
|
encryptionAlgorithm,
|
|
319
|
-
connectionOptions.encryptInternalMetadata ?? false
|
|
319
|
+
connectionOptions.encryptInternalMetadata ?? false,
|
|
320
|
+
connectionOptions.acceptUnencryptedContent ?? false
|
|
320
321
|
);
|
|
321
322
|
}
|
|
322
323
|
} catch (ex) {
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
import { handlers } from "../lib/HandlerUtils.js";
|
|
13
13
|
import { ServiceBase } from "./ServiceBase.js";
|
|
14
14
|
import { createInstanceLogFunction } from "../lib/logUtils.js";
|
|
15
|
+
import { normaliseAcceptUnencryptedContent } from "../../common/models/setting.encryption.js";
|
|
15
16
|
import { isCloudantURI } from "../../pouchdb/utils_couchdb.js";
|
|
16
17
|
import { decryptString, encryptString } from "../../encryption/stringEncryption.js";
|
|
17
18
|
import { encryptWithEphemeralSalt, HKDF_SALTED_ENCRYPTED_PREFIX } from "octagonal-wheels/encryption/hkdf";
|
|
@@ -78,6 +79,7 @@ class SettingService extends ServiceBase {
|
|
|
78
79
|
* @param settings The settings to adjust.
|
|
79
80
|
*/
|
|
80
81
|
adjustSettings(settings) {
|
|
82
|
+
settings.acceptUnencryptedContent = normaliseAcceptUnencryptedContent(settings.acceptUnencryptedContent);
|
|
81
83
|
if (migrateLegacyRemoteConfigurationsInPlace(settings, (message) => {
|
|
82
84
|
this._log(message, LOG_LEVEL_NOTICE);
|
|
83
85
|
})) {
|
package/dist/settings.d.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
export { DEFAULT_SETTINGS, NEW_VAULT_SETTINGS, P2P_DEFAULT_SETTINGS, SETTINGS_SCHEMA_DEFAULTS, createNewVaultSettings, } from "./common/models/setting.const.defaults.js";
|
|
7
7
|
export { PREFERRED_BASE, PREFERRED_JOURNAL_SYNC, PREFERRED_SETTING_CLOUDANT, PREFERRED_SETTING_SELF_HOSTED, } from "./common/models/setting.const.preferred.js";
|
|
8
8
|
export { CURRENT_SETTING_VERSION } from "./common/models/setting.const.js";
|
|
9
|
+
export { normaliseAcceptUnencryptedContent } from "./common/models/setting.encryption.js";
|
|
9
10
|
export { deriveIdKey, deriveOrImportIdKey, formatIdRecoveryCode, configuredIdKey, ID_DERIVATION_VERSION, ID_RECOVERY_CODE_PREFIX, } from "./common/idDerivation.js";
|
|
10
11
|
export { getPathNormalizationVersion, normalisePathForIdentity } from "./common/pathNormalization.js";
|
|
11
12
|
export type { PathNormalizationVersion, PathIdentitySettings } from "./common/models/setting.type.js";
|
|
@@ -13,5 +14,5 @@ export { prepareSettingsForLoad, SettingsMigrationReviewCodes, type PreparedSett
|
|
|
13
14
|
export { assessTweakCompatibility } from "./common/models/tweak.compatibility.js";
|
|
14
15
|
export type { TweakAssessment, TweakAssessmentEntry, TweakAssessmentRelation, TweakAssessmentValue, TweakTransition, TweakTransitionReason, } from "./common/models/tweak.compatibility.js";
|
|
15
16
|
export type { TweakReconstruction, TweakValues } from "./common/models/tweak.definition.js";
|
|
16
|
-
export type { ObsidianLiveSyncSettings, RemoteDBSettings, RemoteTypeSettings } from "./common/models/setting.type.js";
|
|
17
|
+
export type { EncryptionSettings, ObsidianLiveSyncSettings, RemoteDBSettings, RemoteTypeSettings, } from "./common/models/setting.type.js";
|
|
17
18
|
export { SETTINGS_PROPERTY_POLICY, SettingPolicies, createMarkdownSettings, mergeMarkdownSettings, type SettingPropertyPolicy, type MarkdownSettings, type CredentialFreeMarkdownSettings, type PersistedSettings, } from "./common/models/setting.policy.js";
|
package/dist/settings.js
CHANGED
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
PREFERRED_SETTING_SELF_HOSTED
|
|
13
13
|
} from "./common/models/setting.const.preferred.js";
|
|
14
14
|
import { CURRENT_SETTING_VERSION } from "./common/models/setting.const.js";
|
|
15
|
+
import { normaliseAcceptUnencryptedContent } from "./common/models/setting.encryption.js";
|
|
15
16
|
import {
|
|
16
17
|
deriveIdKey,
|
|
17
18
|
deriveOrImportIdKey,
|
|
@@ -56,6 +57,7 @@ export {
|
|
|
56
57
|
formatIdRecoveryCode,
|
|
57
58
|
getPathNormalizationVersion,
|
|
58
59
|
mergeMarkdownSettings,
|
|
60
|
+
normaliseAcceptUnencryptedContent,
|
|
59
61
|
normalisePathForIdentity,
|
|
60
62
|
prepareSettingsForLoad
|
|
61
63
|
};
|