mirror of
https://github.com/bitwarden/browser
synced 2025-12-22 03:03:43 +00:00
[deps] Autofill: Update prettier to v3 (#7014)
* [deps] Autofill: Update prettier to v3 * prettier formatting updates --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jonathan Prusik <jprusik@classynemesis.com>
This commit is contained in:
@@ -25,7 +25,7 @@ const { name } = argv;
|
||||
LogUtils.logInfo("Sending Handshake");
|
||||
const handshakeResponse = await nativeMessageService.sendHandshake(
|
||||
config.testRsaPublicKey,
|
||||
config.applicationName
|
||||
config.applicationName,
|
||||
);
|
||||
|
||||
if (!handshakeResponse.status) {
|
||||
|
||||
@@ -24,7 +24,7 @@ const { uri } = argv;
|
||||
LogUtils.logInfo("Sending Handshake");
|
||||
const handshakeResponse = await nativeMessageService.sendHandshake(
|
||||
config.testRsaPublicKey,
|
||||
config.applicationName
|
||||
config.applicationName,
|
||||
);
|
||||
|
||||
if (!handshakeResponse.status) {
|
||||
|
||||
@@ -49,7 +49,7 @@ const { name, username, password, uri, credentialId } = argv;
|
||||
LogUtils.logInfo("Sending Handshake");
|
||||
const handshakeResponse = await nativeMessageService.sendHandshake(
|
||||
config.testRsaPublicKey,
|
||||
config.applicationName
|
||||
config.applicationName,
|
||||
);
|
||||
|
||||
if (!handshakeResponse.status) {
|
||||
|
||||
@@ -24,7 +24,7 @@ const { userId } = argv;
|
||||
LogUtils.logInfo("Sending Handshake");
|
||||
const handshakeResponse = await nativeMessageService.sendHandshake(
|
||||
config.testRsaPublicKey,
|
||||
config.applicationName
|
||||
config.applicationName,
|
||||
);
|
||||
|
||||
if (!handshakeResponse.status) {
|
||||
|
||||
@@ -11,7 +11,7 @@ import * as config from "../variables";
|
||||
|
||||
const response = await nativeMessageService.sendHandshake(
|
||||
config.testRsaPublicKey,
|
||||
config.applicationName
|
||||
config.applicationName,
|
||||
);
|
||||
LogUtils.logSuccess("Received response to handshake request");
|
||||
if (response.status) {
|
||||
|
||||
@@ -12,7 +12,7 @@ import * as config from "../variables";
|
||||
LogUtils.logInfo("Sending Handshake");
|
||||
const handshakeResponse = await nativeMessageService.sendHandshake(
|
||||
config.testRsaPublicKey,
|
||||
config.applicationName
|
||||
config.applicationName,
|
||||
);
|
||||
LogUtils.logSuccess("Received response to handshake request");
|
||||
|
||||
|
||||
@@ -37,7 +37,10 @@ export default class IPCService {
|
||||
// A set of deferred promises that are awaiting socket connection
|
||||
private awaitingConnection = new Set<Deferred<void>>();
|
||||
|
||||
constructor(private socketName: string, private messageHandler: MessageHandler) {}
|
||||
constructor(
|
||||
private socketName: string,
|
||||
private messageHandler: MessageHandler,
|
||||
) {}
|
||||
|
||||
async connect(): Promise<void> {
|
||||
console.log("[IPCService] connecting...");
|
||||
@@ -75,7 +78,7 @@ export default class IPCService {
|
||||
// invoked multiple times each time a connection error happens
|
||||
console.log("[IPCService] errored");
|
||||
console.log(
|
||||
"\x1b[33m Please make sure the desktop app is running locally and 'Allow DuckDuckGo browser integration' setting is enabled \x1b[0m"
|
||||
"\x1b[33m Please make sure the desktop app is running locally and 'Allow DuckDuckGo browser integration' setting is enabled \x1b[0m",
|
||||
);
|
||||
this.awaitingConnection.forEach((deferred) => {
|
||||
console.log(`rejecting: ${deferred}`);
|
||||
@@ -110,7 +113,7 @@ export default class IPCService {
|
||||
|
||||
async sendMessage(
|
||||
message: MessageCommon,
|
||||
options: IPCOptions = {}
|
||||
options: IPCOptions = {},
|
||||
): Promise<UnencryptedMessageResponse> {
|
||||
console.log("[IPCService] sendMessage");
|
||||
if (this.pendingMessages.has(message.messageId)) {
|
||||
|
||||
@@ -44,7 +44,7 @@ export default class NativeMessageService {
|
||||
this.encryptService = new EncryptServiceImplementation(
|
||||
this.nodeCryptoFunctionService,
|
||||
new ConsoleLogService(false),
|
||||
false
|
||||
false,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ export default class NativeMessageService {
|
||||
},
|
||||
{
|
||||
overrideTimeout: CONFIRMATION_MESSAGE_TIMEOUT,
|
||||
}
|
||||
},
|
||||
);
|
||||
return rawResponse.payload as HandshakeResponse;
|
||||
}
|
||||
@@ -71,7 +71,7 @@ export default class NativeMessageService {
|
||||
{
|
||||
command: "bw-status",
|
||||
},
|
||||
key
|
||||
key,
|
||||
);
|
||||
|
||||
const response = await this.sendEncryptedMessage({
|
||||
@@ -89,7 +89,7 @@ export default class NativeMessageService {
|
||||
uri: uri,
|
||||
},
|
||||
},
|
||||
key
|
||||
key,
|
||||
);
|
||||
const response = await this.sendEncryptedMessage({
|
||||
encryptedCommand,
|
||||
@@ -100,14 +100,14 @@ export default class NativeMessageService {
|
||||
|
||||
async credentialCreation(
|
||||
key: string,
|
||||
credentialData: CredentialCreatePayload
|
||||
credentialData: CredentialCreatePayload,
|
||||
): Promise<DecryptedCommandData> {
|
||||
const encryptedCommand = await this.encryptCommandData(
|
||||
{
|
||||
command: "bw-credential-create",
|
||||
payload: credentialData,
|
||||
},
|
||||
key
|
||||
key,
|
||||
);
|
||||
const response = await this.sendEncryptedMessage({
|
||||
encryptedCommand,
|
||||
@@ -118,14 +118,14 @@ export default class NativeMessageService {
|
||||
|
||||
async credentialUpdate(
|
||||
key: string,
|
||||
credentialData: CredentialUpdatePayload
|
||||
credentialData: CredentialUpdatePayload,
|
||||
): Promise<DecryptedCommandData> {
|
||||
const encryptedCommand = await this.encryptCommandData(
|
||||
{
|
||||
command: "bw-credential-update",
|
||||
payload: credentialData,
|
||||
},
|
||||
key
|
||||
key,
|
||||
);
|
||||
const response = await this.sendEncryptedMessage({
|
||||
encryptedCommand,
|
||||
@@ -142,7 +142,7 @@ export default class NativeMessageService {
|
||||
userId: userId,
|
||||
},
|
||||
},
|
||||
key
|
||||
key,
|
||||
);
|
||||
const response = await this.sendEncryptedMessage({
|
||||
encryptedCommand,
|
||||
@@ -155,7 +155,7 @@ export default class NativeMessageService {
|
||||
|
||||
private async sendEncryptedMessage(
|
||||
message: Omit<EncryptedMessage, keyof MessageCommon>,
|
||||
options: IPCOptions = {}
|
||||
options: IPCOptions = {},
|
||||
): Promise<EncryptedMessageResponse> {
|
||||
const result = await this.sendMessage(message, options);
|
||||
return result as EncryptedMessageResponse;
|
||||
@@ -163,7 +163,7 @@ export default class NativeMessageService {
|
||||
|
||||
private async sendUnencryptedMessage(
|
||||
message: Omit<UnencryptedMessage, keyof MessageCommon>,
|
||||
options: IPCOptions = {}
|
||||
options: IPCOptions = {},
|
||||
): Promise<UnencryptedMessageResponse> {
|
||||
const result = await this.sendMessage(message, options);
|
||||
return result as UnencryptedMessageResponse;
|
||||
@@ -173,7 +173,7 @@ export default class NativeMessageService {
|
||||
message:
|
||||
| Omit<UnencryptedMessage, keyof MessageCommon>
|
||||
| Omit<EncryptedMessage, keyof MessageCommon>,
|
||||
options: IPCOptions
|
||||
options: IPCOptions,
|
||||
): Promise<EncryptedMessageResponse | UnencryptedMessageResponse> {
|
||||
// Attempt to connect before sending any messages. If the connection has already
|
||||
// been made, this is a NOOP within the IPCService.
|
||||
@@ -205,7 +205,7 @@ export default class NativeMessageService {
|
||||
// Data Encryption
|
||||
private async encryptCommandData(
|
||||
commandData: DecryptedCommandData,
|
||||
key: string
|
||||
key: string,
|
||||
): Promise<EncString> {
|
||||
const commandDataString = JSON.stringify(commandData);
|
||||
|
||||
@@ -216,7 +216,7 @@ export default class NativeMessageService {
|
||||
|
||||
private async decryptResponsePayload(
|
||||
payload: EncString,
|
||||
key: string
|
||||
key: string,
|
||||
): Promise<DecryptedCommandData> {
|
||||
const sharedKey = await this.getSharedKeyForKey(key);
|
||||
const decrypted = await this.encryptService.decryptToUtf8(payload, sharedKey);
|
||||
@@ -229,7 +229,7 @@ export default class NativeMessageService {
|
||||
const privKey = Utils.fromB64ToArray(config.testRsaPrivateKey);
|
||||
|
||||
return new SymmetricCryptoKey(
|
||||
await this.nodeCryptoFunctionService.rsaDecrypt(dataBuffer, privKey, "sha1")
|
||||
await this.nodeCryptoFunctionService.rsaDecrypt(dataBuffer, privKey, "sha1"),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user