1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 09:13:33 +00:00

Rename files and folders per ADR #12 (#4106)

Renamed folders:
./apps/desktop/src/models/nativeMessaging
./apps/desktop/src/models/nativeMessaging/encryptedMessagePayloads
./apps/desktop/src/models/nativeMessaging/encryptedMessageResponses
Renamed all files
Cleaned up entries in whitelist-capital-letters.txt
This commit is contained in:
Daniel James Smith
2022-11-24 15:05:45 +01:00
committed by GitHub
parent 175eef5376
commit db2d8aaa7e
48 changed files with 109 additions and 145 deletions

View File

@@ -0,0 +1,6 @@
import { EncryptedCommand } from "./encrypted-command";
export type DecryptedCommandData = {
command: EncryptedCommand;
payload?: any;
};

View File

@@ -0,0 +1,6 @@
export type EncryptedCommand =
| "bw-status"
| "bw-credential-retrieval"
| "bw-credential-create"
| "bw-credential-update"
| "bw-generate-password";

View File

@@ -0,0 +1,7 @@
export type CredentialCreatePayload = {
userId: string;
userName: string;
password: string;
name: string;
uri: string;
};

View File

@@ -0,0 +1,4 @@
export type CredentialRetrievePayload = {
userId: string;
uri: string;
};

View File

@@ -0,0 +1,8 @@
export type CredentialUpdatePayload = {
userId: string;
userName: string;
password: string;
name: string;
uri: string;
credentialId: string;
};

View File

@@ -0,0 +1,3 @@
export type PasswordGeneratePayload = {
userId: string;
};

View File

@@ -0,0 +1,7 @@
import { EncString } from "@bitwarden/common/models/domain/enc-string";
import { MessageCommon } from "./message-common";
export type EncryptedMessageResponse = MessageCommon & {
encryptedPayload: EncString;
};

View File

@@ -0,0 +1,6 @@
export type AccountStatusResponse = {
id: string;
email: string;
status: "locked" | "unlocked";
active: boolean;
};

View File

@@ -0,0 +1,3 @@
export type CannotDecryptErrorResponse = {
error: "cannot-decrypt";
};

View File

@@ -0,0 +1,7 @@
export type CipherResponse = {
userId: string;
credentialId: string;
userName: string;
password: string;
name: string;
};

View File

@@ -0,0 +1,16 @@
import { AccountStatusResponse } from "./account-status-response";
import { CannotDecryptErrorResponse } from "./cannot-decrypt-error-response";
import { CipherResponse } from "./cipher-response";
import { FailureStatusResponse } from "./failure-status-response";
import { GenerateResponse } from "./generate-response";
import { SuccessStatusResponse } from "./success-status-response";
import { UserStatusErrorResponse } from "./user-status-error-response";
export type EncyptedMessageResponse =
| AccountStatusResponse[]
| CannotDecryptErrorResponse
| CipherResponse[]
| FailureStatusResponse
| GenerateResponse
| SuccessStatusResponse
| UserStatusErrorResponse;

View File

@@ -0,0 +1,3 @@
export type FailureStatusResponse = {
status: "failure";
};

View File

@@ -0,0 +1,3 @@
export type GenerateResponse = {
password: string;
};

View File

@@ -0,0 +1,3 @@
export type SuccessStatusResponse = {
status: "success";
};

View File

@@ -0,0 +1,3 @@
export type UserStatusErrorResponse = {
error: "locked" | "not-active-user";
};

View File

@@ -0,0 +1,8 @@
import { EncString } from "@bitwarden/common/models/domain/enc-string";
import { MessageCommon } from "./message-common";
export type EncryptedMessage = MessageCommon & {
// Will decrypt to a DecryptedCommandData object
encryptedCommand: EncString;
};

View File

@@ -0,0 +1,25 @@
export * from "./encrypted-message-payloads/credential-create-payload";
export * from "./encrypted-message-payloads/credential-retrieve-payload";
export * from "./encrypted-message-payloads/credential-update-payload";
export * from "./encrypted-message-payloads/password-generate-payload";
export * from "./encrypted-message-responses/account-status-response";
export * from "./encrypted-message-responses/cannot-decrypt-error-response";
export * from "./encrypted-message-responses/cipher-response";
export * from "./encrypted-message-responses/encrypted-message-response";
export * from "./encrypted-message-responses/failure-status-response";
export * from "./encrypted-message-responses/generate-response";
export * from "./encrypted-message-responses/success-status-response";
export * from "./encrypted-message-responses/user-status-error-response";
export * from "./decrypted-command-data";
export * from "./encrypted-command";
export * from "./encrypted-message";
export * from "./encrypted-message-response";
export * from "./legacy-message";
export * from "./legacy-message-wrapper";
export * from "./message";
export * from "./message-common";
export * from "./unencrypted-command";
export * from "./unencrypted-message";
export * from "./unencrypted-message-response";

View File

@@ -0,0 +1,8 @@
import { EncString } from "@bitwarden/common/models/domain/enc-string";
import { LegacyMessage } from "./legacy-message";
export type LegacyMessageWrapper = {
message: LegacyMessage | EncString;
appId: string;
};

View File

@@ -0,0 +1,8 @@
export type LegacyMessage = {
command: string;
userId?: string;
timestamp?: number;
publicKey?: string;
};

View File

@@ -0,0 +1,4 @@
export interface MessageCommon {
version: number;
messageId: string;
}

View File

@@ -0,0 +1,4 @@
import { EncryptedMessage } from "./encrypted-message";
import { UnencryptedMessage } from "./unencrypted-message";
export type Message = UnencryptedMessage | EncryptedMessage;

View File

@@ -0,0 +1 @@
export type UnencryptedCommand = "bw-handshake";

View File

@@ -0,0 +1,16 @@
import { MessageCommon } from "./message-common";
export type UnencryptedMessageResponse = MessageCommon &
(
| {
payload: {
status: "success";
sharedKey: string;
};
}
| {
payload: {
error: "canceled" | "locked" | "cannot-decrypt" | "version-discrepancy";
};
}
);

View File

@@ -0,0 +1,10 @@
import { MessageCommon } from "./message-common";
import { UnencryptedCommand } from "./unencrypted-command";
export type UnencryptedMessage = MessageCommon & {
command: UnencryptedCommand;
payload: {
publicKey: string;
applicationName: string;
};
};