mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 09:13:33 +00:00
Assign ownership to many libs files (#6928)
Assign ownership to many of the remaining libs/common files. Criteria for ownership: * Files used by a single team, is now owned by that team. * Files related to a domain owned by a team is now owned by that team. * Where ownership is unclear the "lowest level" service takes ownership.
This commit is contained in:
34
libs/common/src/platform/enums/encryption-type.enum.ts
Normal file
34
libs/common/src/platform/enums/encryption-type.enum.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
export enum EncryptionType {
|
||||
AesCbc256_B64 = 0,
|
||||
AesCbc128_HmacSha256_B64 = 1,
|
||||
AesCbc256_HmacSha256_B64 = 2,
|
||||
Rsa2048_OaepSha256_B64 = 3,
|
||||
Rsa2048_OaepSha1_B64 = 4,
|
||||
Rsa2048_OaepSha256_HmacSha256_B64 = 5,
|
||||
Rsa2048_OaepSha1_HmacSha256_B64 = 6,
|
||||
}
|
||||
|
||||
/** The expected number of parts to a serialized EncString of the given encryption type.
|
||||
* For example, an EncString of type AesCbc256_B64 will have 2 parts, and an EncString of type
|
||||
* AesCbc128_HmacSha256_B64 will have 3 parts.
|
||||
*
|
||||
* Example of annotated serialized EncStrings:
|
||||
* 0.iv|data
|
||||
* 1.iv|data|mac
|
||||
* 2.iv|data|mac
|
||||
* 3.data
|
||||
* 4.data
|
||||
*
|
||||
* @see EncString
|
||||
* @see EncryptionType
|
||||
* @see EncString.parseEncryptedString
|
||||
*/
|
||||
export const EXPECTED_NUM_PARTS_BY_ENCRYPTION_TYPE = {
|
||||
[EncryptionType.AesCbc256_B64]: 2,
|
||||
[EncryptionType.AesCbc128_HmacSha256_B64]: 3,
|
||||
[EncryptionType.AesCbc256_HmacSha256_B64]: 3,
|
||||
[EncryptionType.Rsa2048_OaepSha256_B64]: 1,
|
||||
[EncryptionType.Rsa2048_OaepSha1_B64]: 1,
|
||||
[EncryptionType.Rsa2048_OaepSha256_HmacSha256_B64]: 2,
|
||||
[EncryptionType.Rsa2048_OaepSha1_HmacSha256_B64]: 2,
|
||||
};
|
||||
4
libs/common/src/platform/enums/file-upload-type.enum.ts
Normal file
4
libs/common/src/platform/enums/file-upload-type.enum.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export enum FileUploadType {
|
||||
Direct = 0,
|
||||
Azure = 1,
|
||||
}
|
||||
4
libs/common/src/platform/enums/hash-purpose.enum.ts
Normal file
4
libs/common/src/platform/enums/hash-purpose.enum.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export enum HashPurpose {
|
||||
ServerAuthorization = 1,
|
||||
LocalAuthorization = 2,
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
export enum HtmlStorageLocation {
|
||||
Local = "local",
|
||||
Memory = "memory",
|
||||
Session = "session",
|
||||
}
|
||||
9
libs/common/src/platform/enums/index.ts
Normal file
9
libs/common/src/platform/enums/index.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
export * from "./encryption-type.enum";
|
||||
export * from "./file-upload-type.enum";
|
||||
export * from "./hash-purpose.enum";
|
||||
export * from "./html-storage-location.enum";
|
||||
export * from "./kdf-type.enum";
|
||||
export * from "./key-suffix-options.enum";
|
||||
export * from "./log-level-type.enum";
|
||||
export * from "./storage-location.enum";
|
||||
export * from "./theme-type.enum";
|
||||
14
libs/common/src/platform/enums/kdf-type.enum.ts
Normal file
14
libs/common/src/platform/enums/kdf-type.enum.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { KdfConfig } from "../../auth/models/domain/kdf-config";
|
||||
|
||||
export enum KdfType {
|
||||
PBKDF2_SHA256 = 0,
|
||||
Argon2id = 1,
|
||||
}
|
||||
|
||||
export const DEFAULT_ARGON2_MEMORY = 64;
|
||||
export const DEFAULT_ARGON2_PARALLELISM = 4;
|
||||
export const DEFAULT_ARGON2_ITERATIONS = 3;
|
||||
|
||||
export const DEFAULT_KDF_TYPE = KdfType.PBKDF2_SHA256;
|
||||
export const DEFAULT_PBKDF2_ITERATIONS = 600000;
|
||||
export const DEFAULT_KDF_CONFIG = new KdfConfig(DEFAULT_PBKDF2_ITERATIONS);
|
||||
@@ -0,0 +1,5 @@
|
||||
export enum KeySuffixOptions {
|
||||
Auto = "auto",
|
||||
Biometric = "biometric",
|
||||
Pin = "pin",
|
||||
}
|
||||
6
libs/common/src/platform/enums/log-level-type.enum.ts
Normal file
6
libs/common/src/platform/enums/log-level-type.enum.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export enum LogLevelType {
|
||||
Debug,
|
||||
Info,
|
||||
Warning,
|
||||
Error,
|
||||
}
|
||||
5
libs/common/src/platform/enums/storage-location.enum.ts
Normal file
5
libs/common/src/platform/enums/storage-location.enum.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export enum StorageLocation {
|
||||
Both = "both",
|
||||
Disk = "disk",
|
||||
Memory = "memory",
|
||||
}
|
||||
7
libs/common/src/platform/enums/theme-type.enum.ts
Normal file
7
libs/common/src/platform/enums/theme-type.enum.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export enum ThemeType {
|
||||
System = "system",
|
||||
Light = "light",
|
||||
Dark = "dark",
|
||||
Nord = "nord",
|
||||
SolarizedDark = "solarizedDark",
|
||||
}
|
||||
Reference in New Issue
Block a user