fix: align API responses with Bitwarden 2026.7 clients

This commit is contained in:
shuaiplus
2026-07-25 21:25:51 +08:00
parent 8e5d9e294b
commit a0128908e1
4 changed files with 18 additions and 1 deletions
+1
View File
@@ -31,6 +31,7 @@ export function buildConfigResponse(origin: string) {
communication: null, communication: null,
settings: { settings: {
disableUserRegistration: false, disableUserRegistration: false,
suppressOnboardingInterstitials: false,
}, },
_icon_service_url: buildIconServiceTemplate(origin), _icon_service_url: buildIconServiceTemplate(origin),
_icon_service_csp: buildIconServiceCsp(origin), _icon_service_csp: buildIconServiceCsp(origin),
+3 -1
View File
@@ -156,7 +156,9 @@
compatibility: { compatibility: {
// Single source of truth for /config.version and /api/version. // Single source of truth for /config.version and /api/version.
// /config.version 与 /api/version 的统一版本号来源。 // /config.version 与 /api/version 的统一版本号来源。
bitwardenServerVersion: '2026.4.1', // Vaultwarden 1.37.0 advertises 2026.6.0 after aligning its API response
// with the response contract required by Bitwarden 2026.7.x clients.
bitwardenServerVersion: '2026.6.0',
// Official 2026.4.x clients need this flag to receive and use cipher.key. // Official 2026.4.x clients need this flag to receive and use cipher.key.
// Hiding existing item keys makes item-key encrypted vault data unreadable. // Hiding existing item keys makes item-key encrypted vault data unreadable.
// 官方 2026.4.x 客户端需要该开关来接收并使用 cipher.key。 // 官方 2026.4.x 客户端需要该开关来接收并使用 cipher.key。
+10
View File
@@ -206,6 +206,16 @@ function buildPreloginResponse(
kdfIterations, kdfIterations,
kdfMemory, kdfMemory,
kdfParallelism, kdfParallelism,
// Current official servers expose the consolidated KDF model alongside
// the legacy flat fields. Keep both shapes while clients migrate.
kdfSettings: {
kdfType,
iterations: kdfIterations,
memory: kdfMemory,
parallelism: kdfParallelism,
},
salt: null,
// Preserve the historic NodeWarden aliases for older integrations.
KdfSettings: { KdfSettings: {
KdfType: kdfType, KdfType: kdfType,
Iterations: kdfIterations, Iterations: kdfIterations,
+4
View File
@@ -17,8 +17,12 @@ export function buildAccountKeys(user: Pick<User, 'privateKey' | 'publicKey'>):
wrappedPrivateKey: user.privateKey, wrappedPrivateKey: user.privateKey,
publicKey, publicKey,
signedPublicKey: null, signedPublicKey: null,
object: 'publicKeyEncryptionKeyPair',
Object: 'publicKeyEncryptionKeyPair', Object: 'publicKeyEncryptionKeyPair',
}, },
securityState: null,
signatureKeyPair: null,
object: 'privateKeys',
Object: 'privateKeys', Object: 'privateKeys',
}; };
} }