1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-12-05 09:14:28 +01:00

Remove org id parameter

This commit is contained in:
Bernd Schoolmann 2025-11-10 17:25:20 +01:00
parent 793eb74175
commit cfe2bc8c3e
No known key found for this signature in database
16 changed files with 8 additions and 37 deletions

View File

@ -73,14 +73,13 @@ export default class Domain {
domain: DomainEncryptableKeys<D>,
viewModel: ViewEncryptableKeys<V>,
props: EncryptableKeys<D, V>[],
orgId: string | null,
key: SymmetricCryptoKey | null = null,
objectContext: string = "No Domain Context",
): Promise<V> {
for (const prop of props) {
viewModel[prop] =
(await domain[prop]?.decrypt(
orgId,
null,
key,
`Property: ${prop as string}; ObjectContext: ${objectContext}`,
)) ?? null;

View File

@ -54,7 +54,7 @@ export class SendAccess extends Domain {
async decrypt(key: SymmetricCryptoKey): Promise<SendAccessView> {
const model = new SendAccessView(this);
await this.decryptObj<SendAccess, SendAccessView>(this, model, ["name"], null, key);
await this.decryptObj<SendAccess, SendAccessView>(this, model, ["name"], key);
switch (this.type) {
case SendType.File:

View File

@ -38,7 +38,6 @@ export class SendFile extends Domain {
this,
new SendFileView(this),
["fileName"],
null,
key,
);
}

View File

@ -30,13 +30,7 @@ export class SendText extends Domain {
}
decrypt(key: SymmetricCryptoKey): Promise<SendTextView> {
return this.decryptObj<SendText, SendTextView>(
this,
new SendTextView(this),
["text"],
null,
key,
);
return this.decryptObj<SendText, SendTextView>(this, new SendTextView(this), ["text"], key);
}
static fromJSON(obj: Jsonify<SendText>) {

View File

@ -89,7 +89,7 @@ export class Send extends Domain {
model.key = await encryptService.decryptBytes(this.key, sendKeyEncryptionKey);
model.cryptoKey = await keyService.makeSendKey(model.key);
await this.decryptObj<Send, SendView>(this, model, ["name", "notes"], null, model.cryptoKey);
await this.decryptObj<Send, SendView>(this, model, ["name", "notes"], model.cryptoKey);
switch (this.type) {
case SendType.File:

View File

@ -40,7 +40,6 @@ export class Attachment extends Domain {
this,
new AttachmentView(this),
["fileName"],
null,
decryptionKey,
"DomainType: Attachment; " + context,
);

View File

@ -36,7 +36,6 @@ export class Card extends Domain {
this,
new CardView(),
["cardholderName", "brand", "number", "expMonth", "expYear", "code"],
null,
encKey,
"DomainType: Card; " + context,
);

View File

@ -145,13 +145,7 @@ export class Cipher extends Domain implements Decryptable<CipherView> {
}
}
await this.decryptObj<Cipher, CipherView>(
this,
model,
["name", "notes"],
null,
cipherDecryptionKey,
);
await this.decryptObj<Cipher, CipherView>(this, model, ["name", "notes"], cipherDecryptionKey);
switch (this.type) {
case CipherType.Login:

View File

@ -62,7 +62,6 @@ export class Fido2Credential extends Domain {
"rpName",
"userDisplayName",
],
null,
decryptionKey,
);
@ -71,7 +70,7 @@ export class Fido2Credential extends Domain {
{
counter: string;
}
>(this, { counter: "" }, ["counter"], null, decryptionKey);
>(this, { counter: "" }, ["counter"], decryptionKey);
// Counter will end up as NaN if this fails
view.counter = parseInt(counter);
@ -79,7 +78,6 @@ export class Fido2Credential extends Domain {
this,
{ discoverable: "" },
["discoverable"],
null,
decryptionKey,
);
view.discoverable = discoverable === "true";

View File

@ -29,13 +29,7 @@ export class Field extends Domain {
}
decrypt(encKey: SymmetricCryptoKey): Promise<FieldView> {
return this.decryptObj<Field, FieldView>(
this,
new FieldView(this),
["name", "value"],
null,
encKey,
);
return this.decryptObj<Field, FieldView>(this, new FieldView(this), ["name", "value"], encKey);
}
toFieldData(): FieldData {

View File

@ -40,7 +40,7 @@ export class Folder extends Domain {
}
decrypt(key: SymmetricCryptoKey): Promise<FolderView> {
return this.decryptObj<Folder, FolderView>(this, new FolderView(this), ["name"], null, key);
return this.decryptObj<Folder, FolderView>(this, new FolderView(this), ["name"], key);
}
async decryptWithKey(

View File

@ -82,7 +82,6 @@ export class Identity extends Domain {
"passportNumber",
"licenseNumber",
],
null,
encKey,
"DomainType: Identity; " + context,
);

View File

@ -35,7 +35,6 @@ export class LoginUri extends Domain {
this,
new LoginUriView(this),
["uri"],
null,
encKey,
context,
);

View File

@ -52,7 +52,6 @@ export class Login extends Domain {
this,
new LoginView(this),
["username", "password", "totp"],
null,
encKey,
`DomainType: Login; ${context}`,
);

View File

@ -27,7 +27,6 @@ export class Password extends Domain {
this,
new PasswordHistoryView(this),
["password"],
null,
encKey,
"DomainType: PasswordHistory",
);

View File

@ -29,7 +29,6 @@ export class SshKey extends Domain {
this,
new SshKeyView(),
["privateKey", "publicKey", "keyFingerprint"],
null,
encKey,
"DomainType: SshKey; " + context,
);