mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-21 11:35:34 +01:00
Move key types to central location (#7531)
This commit is contained in:
parent
5906a36335
commit
160a636fa0
@ -10,11 +10,8 @@ import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/pl
|
|||||||
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
||||||
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
||||||
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
||||||
import {
|
import { SymmetricCryptoKey } from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
||||||
MasterKey,
|
import { UserKey, MasterKey } from "@bitwarden/common/types/key";
|
||||||
SymmetricCryptoKey,
|
|
||||||
UserKey,
|
|
||||||
} from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
|
||||||
|
|
||||||
import { BrowserApi } from "../platform/browser/browser-api";
|
import { BrowserApi } from "../platform/browser/browser-api";
|
||||||
|
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
import { KeySuffixOptions } from "@bitwarden/common/platform/enums";
|
import { KeySuffixOptions } from "@bitwarden/common/platform/enums";
|
||||||
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
||||||
import {
|
import { SymmetricCryptoKey } from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
||||||
SymmetricCryptoKey,
|
|
||||||
UserKey,
|
|
||||||
} from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
|
||||||
import { CryptoService } from "@bitwarden/common/platform/services/crypto.service";
|
import { CryptoService } from "@bitwarden/common/platform/services/crypto.service";
|
||||||
import { UserId } from "@bitwarden/common/types/guid";
|
import { UserId } from "@bitwarden/common/types/guid";
|
||||||
|
import { UserKey } from "@bitwarden/common/types/key";
|
||||||
|
|
||||||
export class BrowserCryptoService extends CryptoService {
|
export class BrowserCryptoService extends CryptoService {
|
||||||
override async hasUserKeyStored(keySuffix: KeySuffixOptions, userId?: UserId): Promise<boolean> {
|
override async hasUserKeyStored(keySuffix: KeySuffixOptions, userId?: UserId): Promise<boolean> {
|
||||||
|
@ -14,8 +14,8 @@ import { MessagingService } from "@bitwarden/common/platform/abstractions/messag
|
|||||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||||
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
||||||
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
||||||
import { MasterKey, UserKey } from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
|
||||||
import { PasswordGenerationServiceAbstraction } from "@bitwarden/common/tools/generator/password";
|
import { PasswordGenerationServiceAbstraction } from "@bitwarden/common/tools/generator/password";
|
||||||
|
import { MasterKey, UserKey } from "@bitwarden/common/types/key";
|
||||||
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
||||||
import { DialogService } from "@bitwarden/components";
|
import { DialogService } from "@bitwarden/components";
|
||||||
|
|
||||||
|
@ -5,12 +5,10 @@ import { CryptoFunctionService } from "@bitwarden/common/platform/abstractions/c
|
|||||||
import { EncryptService } from "@bitwarden/common/platform/abstractions/encrypt.service";
|
import { EncryptService } from "@bitwarden/common/platform/abstractions/encrypt.service";
|
||||||
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
||||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||||
import {
|
import { SymmetricCryptoKey } from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
||||||
SymmetricCryptoKey,
|
|
||||||
UserKey,
|
|
||||||
} from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
|
||||||
import { CsprngArray } from "@bitwarden/common/types/csprng";
|
import { CsprngArray } from "@bitwarden/common/types/csprng";
|
||||||
import { UserId } from "@bitwarden/common/types/guid";
|
import { UserId } from "@bitwarden/common/types/guid";
|
||||||
|
import { UserKey } from "@bitwarden/common/types/key";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
FakeAccountService,
|
FakeAccountService,
|
||||||
|
@ -6,15 +6,12 @@ import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/pl
|
|||||||
import { KeySuffixOptions } from "@bitwarden/common/platform/enums";
|
import { KeySuffixOptions } from "@bitwarden/common/platform/enums";
|
||||||
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
||||||
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
||||||
import {
|
import { SymmetricCryptoKey } from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
||||||
MasterKey,
|
|
||||||
SymmetricCryptoKey,
|
|
||||||
UserKey,
|
|
||||||
} from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
|
||||||
import { CryptoService } from "@bitwarden/common/platform/services/crypto.service";
|
import { CryptoService } from "@bitwarden/common/platform/services/crypto.service";
|
||||||
import { StateProvider } from "@bitwarden/common/platform/state";
|
import { StateProvider } from "@bitwarden/common/platform/state";
|
||||||
import { CsprngString } from "@bitwarden/common/types/csprng";
|
import { CsprngString } from "@bitwarden/common/types/csprng";
|
||||||
import { UserId } from "@bitwarden/common/types/guid";
|
import { UserId } from "@bitwarden/common/types/guid";
|
||||||
|
import { UserKey, MasterKey } from "@bitwarden/common/types/key";
|
||||||
|
|
||||||
import { ElectronStateService } from "./electron-state.service.abstraction";
|
import { ElectronStateService } from "./electron-state.service.abstraction";
|
||||||
|
|
||||||
|
@ -2,11 +2,9 @@ import { Utils } from "@bitwarden/common/platform/misc/utils";
|
|||||||
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
||||||
import { GlobalState } from "@bitwarden/common/platform/models/domain/global-state";
|
import { GlobalState } from "@bitwarden/common/platform/models/domain/global-state";
|
||||||
import { StorageOptions } from "@bitwarden/common/platform/models/domain/storage-options";
|
import { StorageOptions } from "@bitwarden/common/platform/models/domain/storage-options";
|
||||||
import {
|
import { SymmetricCryptoKey } from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
||||||
DeviceKey,
|
|
||||||
SymmetricCryptoKey,
|
|
||||||
} from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
|
||||||
import { StateService as BaseStateService } from "@bitwarden/common/platform/services/state.service";
|
import { StateService as BaseStateService } from "@bitwarden/common/platform/services/state.service";
|
||||||
|
import { DeviceKey } from "@bitwarden/common/types/key";
|
||||||
|
|
||||||
import { Account } from "../../models/account";
|
import { Account } from "../../models/account";
|
||||||
|
|
||||||
|
@ -11,13 +11,9 @@ import { EncryptService } from "@bitwarden/common/platform/abstractions/encrypt.
|
|||||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||||
import { EncryptionType, KdfType } from "@bitwarden/common/platform/enums";
|
import { EncryptionType, KdfType } from "@bitwarden/common/platform/enums";
|
||||||
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
||||||
import {
|
import { SymmetricCryptoKey } from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
||||||
MasterKey,
|
|
||||||
OrgKey,
|
|
||||||
SymmetricCryptoKey,
|
|
||||||
UserKey,
|
|
||||||
} from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
|
||||||
import { CsprngArray } from "@bitwarden/common/types/csprng";
|
import { CsprngArray } from "@bitwarden/common/types/csprng";
|
||||||
|
import { UserKey, OrgKey, MasterKey } from "@bitwarden/common/types/key";
|
||||||
|
|
||||||
import { OrganizationUserResetPasswordService } from "./organization-user-reset-password.service";
|
import { OrganizationUserResetPasswordService } from "./organization-user-reset-password.service";
|
||||||
|
|
||||||
|
@ -13,10 +13,8 @@ import { EncryptService } from "@bitwarden/common/platform/abstractions/encrypt.
|
|||||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||||
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
||||||
import { EncryptedString, EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
import { EncryptedString, EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
||||||
import {
|
import { SymmetricCryptoKey } from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
||||||
SymmetricCryptoKey,
|
import { UserKey } from "@bitwarden/common/types/key";
|
||||||
UserKey,
|
|
||||||
} from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: "root",
|
providedIn: "root",
|
||||||
|
@ -19,7 +19,7 @@ import { MessagingService } from "@bitwarden/common/platform/abstractions/messag
|
|||||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||||
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
||||||
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
||||||
import { OrgKey } from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
import { OrgKey } from "@bitwarden/common/types/key";
|
||||||
|
|
||||||
import { BaseAcceptComponent } from "../common/base.accept.component";
|
import { BaseAcceptComponent } from "../common/base.accept.component";
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import { WebAuthnLoginCredentialAssertionView } from "@bitwarden/common/auth/mod
|
|||||||
import { WebAuthnLoginAssertionResponseRequest } from "@bitwarden/common/auth/services/webauthn-login/request/webauthn-login-assertion-response.request";
|
import { WebAuthnLoginAssertionResponseRequest } from "@bitwarden/common/auth/services/webauthn-login/request/webauthn-login-assertion-response.request";
|
||||||
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
||||||
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
||||||
import { PrfKey } from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
import { PrfKey } from "@bitwarden/common/types/key";
|
||||||
|
|
||||||
import { CredentialCreateOptionsView } from "../../views/credential-create-options.view";
|
import { CredentialCreateOptionsView } from "../../views/credential-create-options.view";
|
||||||
import { PendingWebauthnLoginCredentialView } from "../../views/pending-webauthn-login-credential.view";
|
import { PendingWebauthnLoginCredentialView } from "../../views/pending-webauthn-login-credential.view";
|
||||||
|
@ -9,12 +9,9 @@ import { EncryptService } from "@bitwarden/common/platform/abstractions/encrypt.
|
|||||||
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
||||||
import { EncryptionType, KdfType } from "@bitwarden/common/platform/enums";
|
import { EncryptionType, KdfType } from "@bitwarden/common/platform/enums";
|
||||||
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
||||||
import {
|
import { SymmetricCryptoKey } from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
||||||
UserKey,
|
|
||||||
SymmetricCryptoKey,
|
|
||||||
MasterKey,
|
|
||||||
} from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
|
||||||
import { CsprngArray } from "@bitwarden/common/types/csprng";
|
import { CsprngArray } from "@bitwarden/common/types/csprng";
|
||||||
|
import { UserKey, MasterKey } from "@bitwarden/common/types/key";
|
||||||
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
|
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
|
||||||
|
|
||||||
import { EmergencyAccessStatusType } from "../enums/emergency-access-status-type";
|
import { EmergencyAccessStatusType } from "../enums/emergency-access-status-type";
|
||||||
|
@ -9,10 +9,8 @@ import { EncryptService } from "@bitwarden/common/platform/abstractions/encrypt.
|
|||||||
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
||||||
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
||||||
import { EncryptedString } from "@bitwarden/common/platform/models/domain/enc-string";
|
import { EncryptedString } from "@bitwarden/common/platform/models/domain/enc-string";
|
||||||
import {
|
import { SymmetricCryptoKey } from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
||||||
SymmetricCryptoKey,
|
import { UserKey } from "@bitwarden/common/types/key";
|
||||||
UserKey,
|
|
||||||
} from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
|
||||||
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
|
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
|
||||||
import { Cipher } from "@bitwarden/common/vault/models/domain/cipher";
|
import { Cipher } from "@bitwarden/common/vault/models/domain/cipher";
|
||||||
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
|
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
|
||||||
|
@ -7,12 +7,10 @@ import { CryptoService } from "@bitwarden/common/platform/abstractions/crypto.se
|
|||||||
import { EncryptService } from "@bitwarden/common/platform/abstractions/encrypt.service";
|
import { EncryptService } from "@bitwarden/common/platform/abstractions/encrypt.service";
|
||||||
import { EncryptionType } from "@bitwarden/common/platform/enums";
|
import { EncryptionType } from "@bitwarden/common/platform/enums";
|
||||||
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
||||||
import {
|
import { SymmetricCryptoKey } from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
||||||
SymmetricCryptoKey,
|
|
||||||
UserKey,
|
|
||||||
} from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
|
||||||
import { Send } from "@bitwarden/common/tools/send/models/domain/send";
|
import { Send } from "@bitwarden/common/tools/send/models/domain/send";
|
||||||
import { SendService } from "@bitwarden/common/tools/send/services/send.service.abstraction";
|
import { SendService } from "@bitwarden/common/tools/send/services/send.service.abstraction";
|
||||||
|
import { UserKey } from "@bitwarden/common/types/key";
|
||||||
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
|
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
|
||||||
import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction";
|
import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction";
|
||||||
import { CipherType } from "@bitwarden/common/vault/enums/cipher-type";
|
import { CipherType } from "@bitwarden/common/vault/enums/cipher-type";
|
||||||
|
@ -8,8 +8,8 @@ import { CryptoService } from "@bitwarden/common/platform/abstractions/crypto.se
|
|||||||
import { EncryptService } from "@bitwarden/common/platform/abstractions/encrypt.service";
|
import { EncryptService } from "@bitwarden/common/platform/abstractions/encrypt.service";
|
||||||
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
||||||
import { EncryptedString } from "@bitwarden/common/platform/models/domain/enc-string";
|
import { EncryptedString } from "@bitwarden/common/platform/models/domain/enc-string";
|
||||||
import { UserKey } from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
|
||||||
import { SendService } from "@bitwarden/common/tools/send/services/send.service.abstraction";
|
import { SendService } from "@bitwarden/common/tools/send/services/send.service.abstraction";
|
||||||
|
import { UserKey } from "@bitwarden/common/types/key";
|
||||||
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
|
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
|
||||||
import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction";
|
import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction";
|
||||||
import { CipherWithIdRequest } from "@bitwarden/common/vault/models/request/cipher-with-id.request";
|
import { CipherWithIdRequest } from "@bitwarden/common/vault/models/request/cipher-with-id.request";
|
||||||
|
@ -16,8 +16,8 @@ import { MessagingService } from "@bitwarden/common/platform/abstractions/messag
|
|||||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||||
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
||||||
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
||||||
import { MasterKey, UserKey } from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
|
||||||
import { PasswordGenerationServiceAbstraction } from "@bitwarden/common/tools/generator/password";
|
import { PasswordGenerationServiceAbstraction } from "@bitwarden/common/tools/generator/password";
|
||||||
|
import { MasterKey, UserKey } from "@bitwarden/common/types/key";
|
||||||
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
|
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
|
||||||
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
||||||
import { DialogService } from "@bitwarden/components";
|
import { DialogService } from "@bitwarden/components";
|
||||||
|
@ -34,10 +34,8 @@ import { LogService } from "@bitwarden/common/platform/abstractions/log.service"
|
|||||||
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
|
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
|
||||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||||
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
||||||
import {
|
import { SymmetricCryptoKey } from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
||||||
OrgKey,
|
import { OrgKey } from "@bitwarden/common/types/key";
|
||||||
SymmetricCryptoKey,
|
|
||||||
} from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
|
||||||
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
||||||
|
|
||||||
import { OrganizationCreateModule } from "../../admin-console/organizations/create/organization-create.module";
|
import { OrganizationCreateModule } from "../../admin-console/organizations/create/organization-create.module";
|
||||||
|
@ -8,7 +8,7 @@ import { CryptoService } from "@bitwarden/common/platform/abstractions/crypto.se
|
|||||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||||
import { ValidationService } from "@bitwarden/common/platform/abstractions/validation.service";
|
import { ValidationService } from "@bitwarden/common/platform/abstractions/validation.service";
|
||||||
import { ProviderKey } from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
import { ProviderKey } from "@bitwarden/common/types/key";
|
||||||
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -12,8 +12,8 @@ import { StateService } from "@bitwarden/common/platform/abstractions/state.serv
|
|||||||
import { KdfType } from "@bitwarden/common/platform/enums";
|
import { KdfType } from "@bitwarden/common/platform/enums";
|
||||||
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
||||||
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
||||||
import { MasterKey, UserKey } from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
|
||||||
import { PasswordGenerationServiceAbstraction } from "@bitwarden/common/tools/generator/password";
|
import { PasswordGenerationServiceAbstraction } from "@bitwarden/common/tools/generator/password";
|
||||||
|
import { UserKey, MasterKey } from "@bitwarden/common/types/key";
|
||||||
import { DialogService } from "@bitwarden/components";
|
import { DialogService } from "@bitwarden/components";
|
||||||
|
|
||||||
import { PasswordColorText } from "../../tools/password-strength/password-strength.component";
|
import { PasswordColorText } from "../../tools/password-strength/password-strength.component";
|
||||||
|
@ -24,9 +24,9 @@ import { MessagingService } from "@bitwarden/common/platform/abstractions/messag
|
|||||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||||
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
||||||
import { HashPurpose, KeySuffixOptions } from "@bitwarden/common/platform/enums";
|
import { HashPurpose, KeySuffixOptions } from "@bitwarden/common/platform/enums";
|
||||||
import { UserKey } from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
|
||||||
import { PinLockType } from "@bitwarden/common/services/vault-timeout/vault-timeout-settings.service";
|
import { PinLockType } from "@bitwarden/common/services/vault-timeout/vault-timeout-settings.service";
|
||||||
import { PasswordStrengthServiceAbstraction } from "@bitwarden/common/tools/password-strength";
|
import { PasswordStrengthServiceAbstraction } from "@bitwarden/common/tools/password-strength";
|
||||||
|
import { UserKey } from "@bitwarden/common/types/key";
|
||||||
import { DialogService } from "@bitwarden/components";
|
import { DialogService } from "@bitwarden/components";
|
||||||
|
|
||||||
@Directive()
|
@Directive()
|
||||||
|
@ -27,8 +27,8 @@ import {
|
|||||||
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
||||||
import { AccountDecryptionOptions } from "@bitwarden/common/platform/models/domain/account";
|
import { AccountDecryptionOptions } from "@bitwarden/common/platform/models/domain/account";
|
||||||
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
||||||
import { MasterKey, UserKey } from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
|
||||||
import { PasswordGenerationServiceAbstraction } from "@bitwarden/common/tools/generator/password";
|
import { PasswordGenerationServiceAbstraction } from "@bitwarden/common/tools/generator/password";
|
||||||
|
import { MasterKey, UserKey } from "@bitwarden/common/types/key";
|
||||||
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
||||||
import { DialogService } from "@bitwarden/components";
|
import { DialogService } from "@bitwarden/components";
|
||||||
|
|
||||||
|
@ -15,8 +15,8 @@ import { MessagingService } from "@bitwarden/common/platform/abstractions/messag
|
|||||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||||
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
||||||
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
||||||
import { MasterKey, UserKey } from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
|
||||||
import { PasswordGenerationServiceAbstraction } from "@bitwarden/common/tools/generator/password";
|
import { PasswordGenerationServiceAbstraction } from "@bitwarden/common/tools/generator/password";
|
||||||
|
import { MasterKey, UserKey } from "@bitwarden/common/types/key";
|
||||||
import { DialogService } from "@bitwarden/components";
|
import { DialogService } from "@bitwarden/components";
|
||||||
|
|
||||||
import { ChangePasswordComponent as BaseChangePasswordComponent } from "./change-password.component";
|
import { ChangePasswordComponent as BaseChangePasswordComponent } from "./change-password.component";
|
||||||
|
@ -17,8 +17,8 @@ import { MessagingService } from "@bitwarden/common/platform/abstractions/messag
|
|||||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||||
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
||||||
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
||||||
import { MasterKey, UserKey } from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
|
||||||
import { PasswordGenerationServiceAbstraction } from "@bitwarden/common/tools/generator/password";
|
import { PasswordGenerationServiceAbstraction } from "@bitwarden/common/tools/generator/password";
|
||||||
|
import { MasterKey, UserKey } from "@bitwarden/common/types/key";
|
||||||
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
||||||
import { DialogService } from "@bitwarden/components";
|
import { DialogService } from "@bitwarden/components";
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { UserKey } from "../../../../common/src/platform/models/domain/symmetric-crypto-key";
|
import { UserKey } from "@bitwarden/common/types/key";
|
||||||
|
|
||||||
export abstract class PinCryptoServiceAbstraction {
|
export abstract class PinCryptoServiceAbstraction {
|
||||||
decryptUserKeyWithPin: (pin: string) => Promise<UserKey | null>;
|
decryptUserKeyWithPin: (pin: string) => Promise<UserKey | null>;
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
||||||
import {
|
import { SymmetricCryptoKey } from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
||||||
PrfKey,
|
import { PrfKey } from "@bitwarden/common/types/key";
|
||||||
SymmetricCryptoKey,
|
|
||||||
} from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
|
||||||
|
|
||||||
declare const tag: unique symbol;
|
declare const tag: unique symbol;
|
||||||
|
|
||||||
|
@ -5,8 +5,8 @@ import { LogService } from "@bitwarden/common/platform/abstractions/log.service"
|
|||||||
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
||||||
import { KdfType } from "@bitwarden/common/platform/enums";
|
import { KdfType } from "@bitwarden/common/platform/enums";
|
||||||
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
||||||
import { UserKey } from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
|
||||||
import { PinLockType } from "@bitwarden/common/services/vault-timeout/vault-timeout-settings.service";
|
import { PinLockType } from "@bitwarden/common/services/vault-timeout/vault-timeout-settings.service";
|
||||||
|
import { UserKey } from "@bitwarden/common/types/key";
|
||||||
|
|
||||||
import { PinCryptoServiceAbstraction } from "../../abstractions/pin-crypto.service.abstraction";
|
import { PinCryptoServiceAbstraction } from "../../abstractions/pin-crypto.service.abstraction";
|
||||||
|
|
||||||
|
@ -5,14 +5,12 @@ import { CryptoService } from "@bitwarden/common/platform/abstractions/crypto.se
|
|||||||
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
||||||
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
||||||
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
|
||||||
import {
|
import { SymmetricCryptoKey } from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
||||||
SymmetricCryptoKey,
|
|
||||||
UserKey,
|
|
||||||
} from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";
|
|
||||||
import {
|
import {
|
||||||
VaultTimeoutSettingsService,
|
VaultTimeoutSettingsService,
|
||||||
PinLockType,
|
PinLockType,
|
||||||
} from "@bitwarden/common/services/vault-timeout/vault-timeout-settings.service";
|
} from "@bitwarden/common/services/vault-timeout/vault-timeout-settings.service";
|
||||||
|
import { UserKey } from "@bitwarden/common/types/key";
|
||||||
|
|
||||||
import { PinCryptoService } from "./pin-crypto.service.implementation";
|
import { PinCryptoService } from "./pin-crypto.service.implementation";
|
||||||
describe("PinCryptoService", () => {
|
describe("PinCryptoService", () => {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { UserKey, MasterKey } from "../../platform/models/domain/symmetric-crypto-key";
|
import { UserKey, MasterKey } from "../../types/key";
|
||||||
import { AuthRequestResponse } from "../models/response/auth-request.response";
|
import { AuthRequestResponse } from "../models/response/auth-request.response";
|
||||||
|
|
||||||
export abstract class AuthRequestCryptoServiceAbstraction {
|
export abstract class AuthRequestCryptoServiceAbstraction {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Observable } from "rxjs";
|
import { Observable } from "rxjs";
|
||||||
|
|
||||||
import { AuthRequestPushNotification } from "../../models/response/notification.response";
|
import { AuthRequestPushNotification } from "../../models/response/notification.response";
|
||||||
import { MasterKey } from "../../platform/models/domain/symmetric-crypto-key";
|
import { MasterKey } from "../../types/key";
|
||||||
import { AuthenticationStatus } from "../enums/authentication-status";
|
import { AuthenticationStatus } from "../enums/authentication-status";
|
||||||
import { AuthResult } from "../models/domain/auth-result";
|
import { AuthResult } from "../models/domain/auth-result";
|
||||||
import {
|
import {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { EncString } from "../../platform/models/domain/enc-string";
|
import { EncString } from "../../platform/models/domain/enc-string";
|
||||||
import { DeviceKey, UserKey } from "../../platform/models/domain/symmetric-crypto-key";
|
import { DeviceKey, UserKey } from "../../types/key";
|
||||||
import { DeviceResponse } from "../abstractions/devices/responses/device.response";
|
import { DeviceResponse } from "../abstractions/devices/responses/device.response";
|
||||||
|
|
||||||
export abstract class DeviceTrustCryptoServiceAbstraction {
|
export abstract class DeviceTrustCryptoServiceAbstraction {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { UserKey } from "../../platform/models/domain/symmetric-crypto-key";
|
import { UserKey } from "../../types/key";
|
||||||
|
|
||||||
export abstract class PasswordResetEnrollmentServiceAbstraction {
|
export abstract class PasswordResetEnrollmentServiceAbstraction {
|
||||||
/*
|
/*
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { PrfKey } from "../../../platform/models/domain/symmetric-crypto-key";
|
import { PrfKey } from "../../../types/key";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contains methods for all crypto operations specific to the WebAuthn login flow.
|
* Contains methods for all crypto operations specific to the WebAuthn login flow.
|
||||||
|
@ -8,12 +8,9 @@ import { MessagingService } from "../../platform/abstractions/messaging.service"
|
|||||||
import { PlatformUtilsService } from "../../platform/abstractions/platform-utils.service";
|
import { PlatformUtilsService } from "../../platform/abstractions/platform-utils.service";
|
||||||
import { StateService } from "../../platform/abstractions/state.service";
|
import { StateService } from "../../platform/abstractions/state.service";
|
||||||
import { Utils } from "../../platform/misc/utils";
|
import { Utils } from "../../platform/misc/utils";
|
||||||
import {
|
import { SymmetricCryptoKey } from "../../platform/models/domain/symmetric-crypto-key";
|
||||||
MasterKey,
|
|
||||||
SymmetricCryptoKey,
|
|
||||||
UserKey,
|
|
||||||
} from "../../platform/models/domain/symmetric-crypto-key";
|
|
||||||
import { CsprngArray } from "../../types/csprng";
|
import { CsprngArray } from "../../types/csprng";
|
||||||
|
import { MasterKey, UserKey } from "../../types/key";
|
||||||
import { DeviceTrustCryptoServiceAbstraction } from "../abstractions/device-trust-crypto.service.abstraction";
|
import { DeviceTrustCryptoServiceAbstraction } from "../abstractions/device-trust-crypto.service.abstraction";
|
||||||
import { TokenService } from "../abstractions/token.service";
|
import { TokenService } from "../abstractions/token.service";
|
||||||
import { TwoFactorService } from "../abstractions/two-factor.service";
|
import { TwoFactorService } from "../abstractions/two-factor.service";
|
||||||
|
@ -17,17 +17,13 @@ import {
|
|||||||
AccountTokens,
|
AccountTokens,
|
||||||
} from "../../platform/models/domain/account";
|
} from "../../platform/models/domain/account";
|
||||||
import { EncString } from "../../platform/models/domain/enc-string";
|
import { EncString } from "../../platform/models/domain/enc-string";
|
||||||
import {
|
import { SymmetricCryptoKey } from "../../platform/models/domain/symmetric-crypto-key";
|
||||||
DeviceKey,
|
|
||||||
MasterKey,
|
|
||||||
SymmetricCryptoKey,
|
|
||||||
UserKey,
|
|
||||||
} from "../../platform/models/domain/symmetric-crypto-key";
|
|
||||||
import {
|
import {
|
||||||
PasswordStrengthService,
|
PasswordStrengthService,
|
||||||
PasswordStrengthServiceAbstraction,
|
PasswordStrengthServiceAbstraction,
|
||||||
} from "../../tools/password-strength";
|
} from "../../tools/password-strength";
|
||||||
import { CsprngArray } from "../../types/csprng";
|
import { CsprngArray } from "../../types/csprng";
|
||||||
|
import { UserKey, MasterKey, DeviceKey } from "../../types/key";
|
||||||
import { AuthService } from "../abstractions/auth.service";
|
import { AuthService } from "../abstractions/auth.service";
|
||||||
import { TokenService } from "../abstractions/token.service";
|
import { TokenService } from "../abstractions/token.service";
|
||||||
import { TwoFactorService } from "../abstractions/two-factor.service";
|
import { TwoFactorService } from "../abstractions/two-factor.service";
|
||||||
|
@ -10,16 +10,13 @@ import { PlatformUtilsService } from "../../platform/abstractions/platform-utils
|
|||||||
import { StateService } from "../../platform/abstractions/state.service";
|
import { StateService } from "../../platform/abstractions/state.service";
|
||||||
import { HashPurpose } from "../../platform/enums";
|
import { HashPurpose } from "../../platform/enums";
|
||||||
import { Utils } from "../../platform/misc/utils";
|
import { Utils } from "../../platform/misc/utils";
|
||||||
import {
|
import { SymmetricCryptoKey } from "../../platform/models/domain/symmetric-crypto-key";
|
||||||
MasterKey,
|
|
||||||
SymmetricCryptoKey,
|
|
||||||
UserKey,
|
|
||||||
} from "../../platform/models/domain/symmetric-crypto-key";
|
|
||||||
import {
|
import {
|
||||||
PasswordStrengthService,
|
PasswordStrengthService,
|
||||||
PasswordStrengthServiceAbstraction,
|
PasswordStrengthServiceAbstraction,
|
||||||
} from "../../tools/password-strength";
|
} from "../../tools/password-strength";
|
||||||
import { CsprngArray } from "../../types/csprng";
|
import { CsprngArray } from "../../types/csprng";
|
||||||
|
import { MasterKey, UserKey } from "../../types/key";
|
||||||
import { AuthService } from "../abstractions/auth.service";
|
import { AuthService } from "../abstractions/auth.service";
|
||||||
import { TokenService } from "../abstractions/token.service";
|
import { TokenService } from "../abstractions/token.service";
|
||||||
import { TwoFactorService } from "../abstractions/two-factor.service";
|
import { TwoFactorService } from "../abstractions/two-factor.service";
|
||||||
|
@ -8,8 +8,8 @@ import { MessagingService } from "../../platform/abstractions/messaging.service"
|
|||||||
import { PlatformUtilsService } from "../../platform/abstractions/platform-utils.service";
|
import { PlatformUtilsService } from "../../platform/abstractions/platform-utils.service";
|
||||||
import { StateService } from "../../platform/abstractions/state.service";
|
import { StateService } from "../../platform/abstractions/state.service";
|
||||||
import { HashPurpose } from "../../platform/enums";
|
import { HashPurpose } from "../../platform/enums";
|
||||||
import { MasterKey } from "../../platform/models/domain/symmetric-crypto-key";
|
|
||||||
import { PasswordStrengthServiceAbstraction } from "../../tools/password-strength";
|
import { PasswordStrengthServiceAbstraction } from "../../tools/password-strength";
|
||||||
|
import { MasterKey } from "../../types/key";
|
||||||
import { AuthService } from "../abstractions/auth.service";
|
import { AuthService } from "../abstractions/auth.service";
|
||||||
import { TokenService } from "../abstractions/token.service";
|
import { TokenService } from "../abstractions/token.service";
|
||||||
import { TwoFactorService } from "../abstractions/two-factor.service";
|
import { TwoFactorService } from "../abstractions/two-factor.service";
|
||||||
|
@ -9,13 +9,9 @@ import { MessagingService } from "../../platform/abstractions/messaging.service"
|
|||||||
import { PlatformUtilsService } from "../../platform/abstractions/platform-utils.service";
|
import { PlatformUtilsService } from "../../platform/abstractions/platform-utils.service";
|
||||||
import { StateService } from "../../platform/abstractions/state.service";
|
import { StateService } from "../../platform/abstractions/state.service";
|
||||||
import { Utils } from "../../platform/misc/utils";
|
import { Utils } from "../../platform/misc/utils";
|
||||||
import {
|
import { SymmetricCryptoKey } from "../../platform/models/domain/symmetric-crypto-key";
|
||||||
DeviceKey,
|
|
||||||
MasterKey,
|
|
||||||
SymmetricCryptoKey,
|
|
||||||
UserKey,
|
|
||||||
} from "../../platform/models/domain/symmetric-crypto-key";
|
|
||||||
import { CsprngArray } from "../../types/csprng";
|
import { CsprngArray } from "../../types/csprng";
|
||||||
|
import { DeviceKey, UserKey, MasterKey } from "../../types/key";
|
||||||
import { AuthRequestCryptoServiceAbstraction } from "../abstractions/auth-request-crypto.service.abstraction";
|
import { AuthRequestCryptoServiceAbstraction } from "../abstractions/auth-request-crypto.service.abstraction";
|
||||||
import { DeviceTrustCryptoServiceAbstraction } from "../abstractions/device-trust-crypto.service.abstraction";
|
import { DeviceTrustCryptoServiceAbstraction } from "../abstractions/device-trust-crypto.service.abstraction";
|
||||||
import { KeyConnectorService } from "../abstractions/key-connector.service";
|
import { KeyConnectorService } from "../abstractions/key-connector.service";
|
||||||
|
@ -9,12 +9,9 @@ import { MessagingService } from "../../platform/abstractions/messaging.service"
|
|||||||
import { PlatformUtilsService } from "../../platform/abstractions/platform-utils.service";
|
import { PlatformUtilsService } from "../../platform/abstractions/platform-utils.service";
|
||||||
import { StateService } from "../../platform/abstractions/state.service";
|
import { StateService } from "../../platform/abstractions/state.service";
|
||||||
import { Utils } from "../../platform/misc/utils";
|
import { Utils } from "../../platform/misc/utils";
|
||||||
import {
|
import { SymmetricCryptoKey } from "../../platform/models/domain/symmetric-crypto-key";
|
||||||
MasterKey,
|
|
||||||
SymmetricCryptoKey,
|
|
||||||
UserKey,
|
|
||||||
} from "../../platform/models/domain/symmetric-crypto-key";
|
|
||||||
import { CsprngArray } from "../../types/csprng";
|
import { CsprngArray } from "../../types/csprng";
|
||||||
|
import { UserKey, MasterKey } from "../../types/key";
|
||||||
import { KeyConnectorService } from "../abstractions/key-connector.service";
|
import { KeyConnectorService } from "../abstractions/key-connector.service";
|
||||||
import { TokenService } from "../abstractions/token.service";
|
import { TokenService } from "../abstractions/token.service";
|
||||||
import { TwoFactorService } from "../abstractions/two-factor.service";
|
import { TwoFactorService } from "../abstractions/two-factor.service";
|
||||||
|
@ -8,11 +8,8 @@ import { MessagingService } from "../../platform/abstractions/messaging.service"
|
|||||||
import { PlatformUtilsService } from "../../platform/abstractions/platform-utils.service";
|
import { PlatformUtilsService } from "../../platform/abstractions/platform-utils.service";
|
||||||
import { StateService } from "../../platform/abstractions/state.service";
|
import { StateService } from "../../platform/abstractions/state.service";
|
||||||
import { Utils } from "../../platform/misc/utils";
|
import { Utils } from "../../platform/misc/utils";
|
||||||
import {
|
import { SymmetricCryptoKey } from "../../platform/models/domain/symmetric-crypto-key";
|
||||||
PrfKey,
|
import { PrfKey, UserKey } from "../../types/key";
|
||||||
SymmetricCryptoKey,
|
|
||||||
UserKey,
|
|
||||||
} from "../../platform/models/domain/symmetric-crypto-key";
|
|
||||||
import { TokenService } from "../abstractions/token.service";
|
import { TokenService } from "../abstractions/token.service";
|
||||||
import { TwoFactorService } from "../abstractions/two-factor.service";
|
import { TwoFactorService } from "../abstractions/two-factor.service";
|
||||||
import { AuthResult } from "../models/domain/auth-result";
|
import { AuthResult } from "../models/domain/auth-result";
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { SymmetricCryptoKey, UserKey } from "../../platform/models/domain/symmetric-crypto-key";
|
import { SymmetricCryptoKey } from "../../platform/models/domain/symmetric-crypto-key";
|
||||||
|
import { UserKey } from "../../types/key";
|
||||||
import { AuthResult } from "../models/domain/auth-result";
|
import { AuthResult } from "../models/domain/auth-result";
|
||||||
import { WebAuthnLoginCredentials } from "../models/domain/login-credentials";
|
import { WebAuthnLoginCredentials } from "../models/domain/login-credentials";
|
||||||
import { WebAuthnLoginTokenRequest } from "../models/request/identity-token/webauthn-login-token.request";
|
import { WebAuthnLoginTokenRequest } from "../models/request/identity-token/webauthn-login-token.request";
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
import {
|
import { SymmetricCryptoKey } from "../../../platform/models/domain/symmetric-crypto-key";
|
||||||
MasterKey,
|
import { UserKey, MasterKey } from "../../../types/key";
|
||||||
UserKey,
|
|
||||||
SymmetricCryptoKey,
|
|
||||||
} from "../../../platform/models/domain/symmetric-crypto-key";
|
|
||||||
import { AuthenticationType } from "../../enums/authentication-type";
|
import { AuthenticationType } from "../../enums/authentication-type";
|
||||||
import { WebAuthnLoginAssertionResponseRequest } from "../../services/webauthn-login/request/webauthn-login-assertion-response.request";
|
import { WebAuthnLoginAssertionResponseRequest } from "../../services/webauthn-login/request/webauthn-login-assertion-response.request";
|
||||||
import { TokenTwoFactorRequest } from "../request/identity-token/token-two-factor.request";
|
import { TokenTwoFactorRequest } from "../request/identity-token/token-two-factor.request";
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { PrfKey } from "../../../../platform/models/domain/symmetric-crypto-key";
|
import { PrfKey } from "../../../../types/key";
|
||||||
import { WebAuthnLoginAssertionResponseRequest } from "../../../services/webauthn-login/request/webauthn-login-assertion-response.request";
|
import { WebAuthnLoginAssertionResponseRequest } from "../../../services/webauthn-login/request/webauthn-login-assertion-response.request";
|
||||||
|
|
||||||
export class WebAuthnLoginCredentialAssertionView {
|
export class WebAuthnLoginCredentialAssertionView {
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
import { CryptoService } from "../../platform/abstractions/crypto.service";
|
import { CryptoService } from "../../platform/abstractions/crypto.service";
|
||||||
import { Utils } from "../../platform/misc/utils";
|
import { Utils } from "../../platform/misc/utils";
|
||||||
import {
|
import { SymmetricCryptoKey } from "../../platform/models/domain/symmetric-crypto-key";
|
||||||
UserKey,
|
import { UserKey, MasterKey } from "../../types/key";
|
||||||
SymmetricCryptoKey,
|
|
||||||
MasterKey,
|
|
||||||
} from "../../platform/models/domain/symmetric-crypto-key";
|
|
||||||
import { AuthRequestCryptoServiceAbstraction } from "../abstractions/auth-request-crypto.service.abstraction";
|
import { AuthRequestCryptoServiceAbstraction } from "../abstractions/auth-request-crypto.service.abstraction";
|
||||||
import { AuthRequestResponse } from "../models/response/auth-request.response";
|
import { AuthRequestResponse } from "../models/response/auth-request.response";
|
||||||
|
|
||||||
|
@ -2,11 +2,8 @@ import { mock } from "jest-mock-extended";
|
|||||||
|
|
||||||
import { CryptoService } from "../../platform/abstractions/crypto.service";
|
import { CryptoService } from "../../platform/abstractions/crypto.service";
|
||||||
import { Utils } from "../../platform/misc/utils";
|
import { Utils } from "../../platform/misc/utils";
|
||||||
import {
|
import { SymmetricCryptoKey } from "../../platform/models/domain/symmetric-crypto-key";
|
||||||
MasterKey,
|
import { UserKey, MasterKey } from "../../types/key";
|
||||||
SymmetricCryptoKey,
|
|
||||||
UserKey,
|
|
||||||
} from "../../platform/models/domain/symmetric-crypto-key";
|
|
||||||
import { AuthRequestCryptoServiceAbstraction } from "../abstractions/auth-request-crypto.service.abstraction";
|
import { AuthRequestCryptoServiceAbstraction } from "../abstractions/auth-request-crypto.service.abstraction";
|
||||||
import { AuthRequestResponse } from "../models/response/auth-request.response";
|
import { AuthRequestResponse } from "../models/response/auth-request.response";
|
||||||
|
|
||||||
|
@ -16,8 +16,8 @@ import { PlatformUtilsService } from "../../platform/abstractions/platform-utils
|
|||||||
import { StateService } from "../../platform/abstractions/state.service";
|
import { StateService } from "../../platform/abstractions/state.service";
|
||||||
import { KdfType, KeySuffixOptions } from "../../platform/enums";
|
import { KdfType, KeySuffixOptions } from "../../platform/enums";
|
||||||
import { Utils } from "../../platform/misc/utils";
|
import { Utils } from "../../platform/misc/utils";
|
||||||
import { MasterKey } from "../../platform/models/domain/symmetric-crypto-key";
|
|
||||||
import { PasswordStrengthServiceAbstraction } from "../../tools/password-strength";
|
import { PasswordStrengthServiceAbstraction } from "../../tools/password-strength";
|
||||||
|
import { MasterKey } from "../../types/key";
|
||||||
import { AuthRequestCryptoServiceAbstraction } from "../abstractions/auth-request-crypto.service.abstraction";
|
import { AuthRequestCryptoServiceAbstraction } from "../abstractions/auth-request-crypto.service.abstraction";
|
||||||
import { AuthService as AuthServiceAbstraction } from "../abstractions/auth.service";
|
import { AuthService as AuthServiceAbstraction } from "../abstractions/auth.service";
|
||||||
import { DeviceTrustCryptoServiceAbstraction } from "../abstractions/device-trust-crypto.service.abstraction";
|
import { DeviceTrustCryptoServiceAbstraction } from "../abstractions/device-trust-crypto.service.abstraction";
|
||||||
|
@ -6,12 +6,9 @@ import { I18nService } from "../../platform/abstractions/i18n.service";
|
|||||||
import { PlatformUtilsService } from "../../platform/abstractions/platform-utils.service";
|
import { PlatformUtilsService } from "../../platform/abstractions/platform-utils.service";
|
||||||
import { StateService } from "../../platform/abstractions/state.service";
|
import { StateService } from "../../platform/abstractions/state.service";
|
||||||
import { EncString } from "../../platform/models/domain/enc-string";
|
import { EncString } from "../../platform/models/domain/enc-string";
|
||||||
import {
|
import { SymmetricCryptoKey } from "../../platform/models/domain/symmetric-crypto-key";
|
||||||
SymmetricCryptoKey,
|
|
||||||
DeviceKey,
|
|
||||||
UserKey,
|
|
||||||
} from "../../platform/models/domain/symmetric-crypto-key";
|
|
||||||
import { CsprngArray } from "../../types/csprng";
|
import { CsprngArray } from "../../types/csprng";
|
||||||
|
import { UserKey, DeviceKey } from "../../types/key";
|
||||||
import { DeviceTrustCryptoServiceAbstraction } from "../abstractions/device-trust-crypto.service.abstraction";
|
import { DeviceTrustCryptoServiceAbstraction } from "../abstractions/device-trust-crypto.service.abstraction";
|
||||||
import { DeviceResponse } from "../abstractions/devices/responses/device.response";
|
import { DeviceResponse } from "../abstractions/devices/responses/device.response";
|
||||||
import { DevicesApiServiceAbstraction } from "../abstractions/devices-api.service.abstraction";
|
import { DevicesApiServiceAbstraction } from "../abstractions/devices-api.service.abstraction";
|
||||||
|
@ -10,12 +10,9 @@ import { PlatformUtilsService } from "../../platform/abstractions/platform-utils
|
|||||||
import { StateService } from "../../platform/abstractions/state.service";
|
import { StateService } from "../../platform/abstractions/state.service";
|
||||||
import { EncryptionType } from "../../platform/enums/encryption-type.enum";
|
import { EncryptionType } from "../../platform/enums/encryption-type.enum";
|
||||||
import { EncString } from "../../platform/models/domain/enc-string";
|
import { EncString } from "../../platform/models/domain/enc-string";
|
||||||
import {
|
import { SymmetricCryptoKey } from "../../platform/models/domain/symmetric-crypto-key";
|
||||||
SymmetricCryptoKey,
|
|
||||||
DeviceKey,
|
|
||||||
UserKey,
|
|
||||||
} from "../../platform/models/domain/symmetric-crypto-key";
|
|
||||||
import { CsprngArray } from "../../types/csprng";
|
import { CsprngArray } from "../../types/csprng";
|
||||||
|
import { DeviceKey, UserKey } from "../../types/key";
|
||||||
import { DeviceResponse } from "../abstractions/devices/responses/device.response";
|
import { DeviceResponse } from "../abstractions/devices/responses/device.response";
|
||||||
import { DevicesApiServiceAbstraction } from "../abstractions/devices-api.service.abstraction";
|
import { DevicesApiServiceAbstraction } from "../abstractions/devices-api.service.abstraction";
|
||||||
import { UpdateDevicesTrustRequest } from "../models/request/update-devices-trust.request";
|
import { UpdateDevicesTrustRequest } from "../models/request/update-devices-trust.request";
|
||||||
|
@ -7,7 +7,8 @@ import { CryptoService } from "../../platform/abstractions/crypto.service";
|
|||||||
import { LogService } from "../../platform/abstractions/log.service";
|
import { LogService } from "../../platform/abstractions/log.service";
|
||||||
import { StateService } from "../../platform/abstractions/state.service";
|
import { StateService } from "../../platform/abstractions/state.service";
|
||||||
import { Utils } from "../../platform/misc/utils";
|
import { Utils } from "../../platform/misc/utils";
|
||||||
import { MasterKey, SymmetricCryptoKey } from "../../platform/models/domain/symmetric-crypto-key";
|
import { SymmetricCryptoKey } from "../../platform/models/domain/symmetric-crypto-key";
|
||||||
|
import { MasterKey } from "../../types/key";
|
||||||
import { KeyConnectorService as KeyConnectorServiceAbstraction } from "../abstractions/key-connector.service";
|
import { KeyConnectorService as KeyConnectorServiceAbstraction } from "../abstractions/key-connector.service";
|
||||||
import { TokenService } from "../abstractions/token.service";
|
import { TokenService } from "../abstractions/token.service";
|
||||||
import { KdfConfig } from "../models/domain/kdf-config";
|
import { KdfConfig } from "../models/domain/kdf-config";
|
||||||
|
@ -5,7 +5,7 @@ import { CryptoService } from "../../platform/abstractions/crypto.service";
|
|||||||
import { I18nService } from "../../platform/abstractions/i18n.service";
|
import { I18nService } from "../../platform/abstractions/i18n.service";
|
||||||
import { StateService } from "../../platform/abstractions/state.service";
|
import { StateService } from "../../platform/abstractions/state.service";
|
||||||
import { Utils } from "../../platform/misc/utils";
|
import { Utils } from "../../platform/misc/utils";
|
||||||
import { UserKey } from "../../platform/models/domain/symmetric-crypto-key";
|
import { UserKey } from "../../types/key";
|
||||||
import { PasswordResetEnrollmentServiceAbstraction } from "../abstractions/password-reset-enrollment.service.abstraction";
|
import { PasswordResetEnrollmentServiceAbstraction } from "../abstractions/password-reset-enrollment.service.abstraction";
|
||||||
|
|
||||||
export class PasswordResetEnrollmentServiceImplementation
|
export class PasswordResetEnrollmentServiceImplementation
|
||||||
|
@ -4,7 +4,7 @@ import { I18nService } from "../../../platform/abstractions/i18n.service";
|
|||||||
import { LogService } from "../../../platform/abstractions/log.service";
|
import { LogService } from "../../../platform/abstractions/log.service";
|
||||||
import { StateService } from "../../../platform/abstractions/state.service";
|
import { StateService } from "../../../platform/abstractions/state.service";
|
||||||
import { KeySuffixOptions } from "../../../platform/enums/key-suffix-options.enum";
|
import { KeySuffixOptions } from "../../../platform/enums/key-suffix-options.enum";
|
||||||
import { UserKey } from "../../../platform/models/domain/symmetric-crypto-key";
|
import { UserKey } from "../../../types/key";
|
||||||
import { UserVerificationApiServiceAbstraction } from "../../abstractions/user-verification/user-verification-api.service.abstraction";
|
import { UserVerificationApiServiceAbstraction } from "../../abstractions/user-verification/user-verification-api.service.abstraction";
|
||||||
import { UserVerificationService as UserVerificationServiceAbstraction } from "../../abstractions/user-verification/user-verification.service.abstraction";
|
import { UserVerificationService as UserVerificationServiceAbstraction } from "../../abstractions/user-verification/user-verification.service.abstraction";
|
||||||
import { VerificationType } from "../../enums/verification-type";
|
import { VerificationType } from "../../enums/verification-type";
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { CryptoFunctionService } from "../../../platform/abstractions/crypto-function.service";
|
import { CryptoFunctionService } from "../../../platform/abstractions/crypto-function.service";
|
||||||
import { PrfKey, SymmetricCryptoKey } from "../../../platform/models/domain/symmetric-crypto-key";
|
import { SymmetricCryptoKey } from "../../../platform/models/domain/symmetric-crypto-key";
|
||||||
|
import { PrfKey } from "../../../types/key";
|
||||||
import { WebAuthnLoginPrfCryptoServiceAbstraction } from "../../abstractions/webauthn/webauthn-login-prf-crypto.service.abstraction";
|
import { WebAuthnLoginPrfCryptoServiceAbstraction } from "../../abstractions/webauthn/webauthn-login-prf-crypto.service.abstraction";
|
||||||
|
|
||||||
const LoginWithPrfSalt = "passwordless-login";
|
const LoginWithPrfSalt = "passwordless-login";
|
||||||
|
@ -4,7 +4,8 @@ import { firstValueFrom, of } from "rxjs";
|
|||||||
import { ConfigServiceAbstraction } from "../../../platform/abstractions/config/config.service.abstraction";
|
import { ConfigServiceAbstraction } from "../../../platform/abstractions/config/config.service.abstraction";
|
||||||
import { LogService } from "../../../platform/abstractions/log.service";
|
import { LogService } from "../../../platform/abstractions/log.service";
|
||||||
import { Utils } from "../../../platform/misc/utils";
|
import { Utils } from "../../../platform/misc/utils";
|
||||||
import { PrfKey, SymmetricCryptoKey } from "../../../platform/models/domain/symmetric-crypto-key";
|
import { SymmetricCryptoKey } from "../../../platform/models/domain/symmetric-crypto-key";
|
||||||
|
import { PrfKey } from "../../../types/key";
|
||||||
import { AuthService } from "../../abstractions/auth.service";
|
import { AuthService } from "../../abstractions/auth.service";
|
||||||
import { WebAuthnLoginApiServiceAbstraction } from "../../abstractions/webauthn/webauthn-login-api.service.abstraction";
|
import { WebAuthnLoginApiServiceAbstraction } from "../../abstractions/webauthn/webauthn-login-api.service.abstraction";
|
||||||
import { WebAuthnLoginPrfCryptoServiceAbstraction } from "../../abstractions/webauthn/webauthn-login-prf-crypto.service.abstraction";
|
import { WebAuthnLoginPrfCryptoServiceAbstraction } from "../../abstractions/webauthn/webauthn-login-prf-crypto.service.abstraction";
|
||||||
|
@ -3,7 +3,7 @@ import { Observable } from "rxjs";
|
|||||||
import { FeatureFlag } from "../../../enums/feature-flag.enum";
|
import { FeatureFlag } from "../../../enums/feature-flag.enum";
|
||||||
import { ConfigServiceAbstraction } from "../../../platform/abstractions/config/config.service.abstraction";
|
import { ConfigServiceAbstraction } from "../../../platform/abstractions/config/config.service.abstraction";
|
||||||
import { LogService } from "../../../platform/abstractions/log.service";
|
import { LogService } from "../../../platform/abstractions/log.service";
|
||||||
import { PrfKey } from "../../../platform/models/domain/symmetric-crypto-key";
|
import { PrfKey } from "../../../types/key";
|
||||||
import { AuthService } from "../../abstractions/auth.service";
|
import { AuthService } from "../../abstractions/auth.service";
|
||||||
import { WebAuthnLoginApiServiceAbstraction } from "../../abstractions/webauthn/webauthn-login-api.service.abstraction";
|
import { WebAuthnLoginApiServiceAbstraction } from "../../abstractions/webauthn/webauthn-login-api.service.abstraction";
|
||||||
import { WebAuthnLoginPrfCryptoServiceAbstraction } from "../../abstractions/webauthn/webauthn-login-prf-crypto.service.abstraction";
|
import { WebAuthnLoginPrfCryptoServiceAbstraction } from "../../abstractions/webauthn/webauthn-login-prf-crypto.service.abstraction";
|
||||||
|
@ -4,18 +4,11 @@ import { ProfileOrganizationResponse } from "../../admin-console/models/response
|
|||||||
import { ProfileProviderOrganizationResponse } from "../../admin-console/models/response/profile-provider-organization.response";
|
import { ProfileProviderOrganizationResponse } from "../../admin-console/models/response/profile-provider-organization.response";
|
||||||
import { ProfileProviderResponse } from "../../admin-console/models/response/profile-provider.response";
|
import { ProfileProviderResponse } from "../../admin-console/models/response/profile-provider.response";
|
||||||
import { KdfConfig } from "../../auth/models/domain/kdf-config";
|
import { KdfConfig } from "../../auth/models/domain/kdf-config";
|
||||||
|
import { UserKey, MasterKey, OrgKey, ProviderKey, PinKey, CipherKey } from "../../types/key";
|
||||||
import { KeySuffixOptions, KdfType, HashPurpose } from "../enums";
|
import { KeySuffixOptions, KdfType, HashPurpose } from "../enums";
|
||||||
import { EncArrayBuffer } from "../models/domain/enc-array-buffer";
|
import { EncArrayBuffer } from "../models/domain/enc-array-buffer";
|
||||||
import { EncString } from "../models/domain/enc-string";
|
import { EncString } from "../models/domain/enc-string";
|
||||||
import {
|
import { SymmetricCryptoKey } from "../models/domain/symmetric-crypto-key";
|
||||||
CipherKey,
|
|
||||||
MasterKey,
|
|
||||||
OrgKey,
|
|
||||||
PinKey,
|
|
||||||
ProviderKey,
|
|
||||||
SymmetricCryptoKey,
|
|
||||||
UserKey,
|
|
||||||
} from "../models/domain/symmetric-crypto-key";
|
|
||||||
|
|
||||||
export abstract class CryptoService {
|
export abstract class CryptoService {
|
||||||
/**
|
/**
|
||||||
|
@ -18,6 +18,7 @@ import { UsernameGeneratorOptions } from "../../tools/generator/username";
|
|||||||
import { SendData } from "../../tools/send/models/data/send.data";
|
import { SendData } from "../../tools/send/models/data/send.data";
|
||||||
import { SendView } from "../../tools/send/models/view/send.view";
|
import { SendView } from "../../tools/send/models/view/send.view";
|
||||||
import { UserId } from "../../types/guid";
|
import { UserId } from "../../types/guid";
|
||||||
|
import { UserKey, MasterKey, DeviceKey } from "../../types/key";
|
||||||
import { UriMatchType } from "../../vault/enums";
|
import { UriMatchType } from "../../vault/enums";
|
||||||
import { CipherData } from "../../vault/models/data/cipher.data";
|
import { CipherData } from "../../vault/models/data/cipher.data";
|
||||||
import { CollectionData } from "../../vault/models/data/collection.data";
|
import { CollectionData } from "../../vault/models/data/collection.data";
|
||||||
@ -35,12 +36,7 @@ import {
|
|||||||
} from "../models/domain/account";
|
} from "../models/domain/account";
|
||||||
import { EncString } from "../models/domain/enc-string";
|
import { EncString } from "../models/domain/enc-string";
|
||||||
import { StorageOptions } from "../models/domain/storage-options";
|
import { StorageOptions } from "../models/domain/storage-options";
|
||||||
import {
|
import { SymmetricCryptoKey } from "../models/domain/symmetric-crypto-key";
|
||||||
DeviceKey,
|
|
||||||
MasterKey,
|
|
||||||
SymmetricCryptoKey,
|
|
||||||
UserKey,
|
|
||||||
} from "../models/domain/symmetric-crypto-key";
|
|
||||||
|
|
||||||
export abstract class StateService<T extends Account = Account> {
|
export abstract class StateService<T extends Account = Account> {
|
||||||
accounts$: Observable<{ [userId: string]: T }>;
|
accounts$: Observable<{ [userId: string]: T }>;
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
import { makeStaticByteArray } from "../../../../spec";
|
import { makeStaticByteArray } from "../../../../spec";
|
||||||
import { CsprngArray } from "../../../types/csprng";
|
import { CsprngArray } from "../../../types/csprng";
|
||||||
|
import { DeviceKey } from "../../../types/key";
|
||||||
import { Utils } from "../../misc/utils";
|
import { Utils } from "../../misc/utils";
|
||||||
|
|
||||||
import { AccountKeys, EncryptionPair } from "./account";
|
import { AccountKeys, EncryptionPair } from "./account";
|
||||||
import { DeviceKey, SymmetricCryptoKey } from "./symmetric-crypto-key";
|
import { SymmetricCryptoKey } from "./symmetric-crypto-key";
|
||||||
|
|
||||||
describe("AccountKeys", () => {
|
describe("AccountKeys", () => {
|
||||||
describe("toJSON", () => {
|
describe("toJSON", () => {
|
||||||
|
@ -21,6 +21,7 @@ import { UsernameGeneratorOptions } from "../../../tools/generator/username/user
|
|||||||
import { SendData } from "../../../tools/send/models/data/send.data";
|
import { SendData } from "../../../tools/send/models/data/send.data";
|
||||||
import { SendView } from "../../../tools/send/models/view/send.view";
|
import { SendView } from "../../../tools/send/models/view/send.view";
|
||||||
import { DeepJsonify } from "../../../types/deep-jsonify";
|
import { DeepJsonify } from "../../../types/deep-jsonify";
|
||||||
|
import { UserKey, MasterKey } from "../../../types/key";
|
||||||
import { UriMatchType } from "../../../vault/enums";
|
import { UriMatchType } from "../../../vault/enums";
|
||||||
import { CipherData } from "../../../vault/models/data/cipher.data";
|
import { CipherData } from "../../../vault/models/data/cipher.data";
|
||||||
import { CollectionData } from "../../../vault/models/data/collection.data";
|
import { CollectionData } from "../../../vault/models/data/collection.data";
|
||||||
@ -33,7 +34,7 @@ import { Utils } from "../../misc/utils";
|
|||||||
import { ServerConfigData } from "../../models/data/server-config.data";
|
import { ServerConfigData } from "../../models/data/server-config.data";
|
||||||
|
|
||||||
import { EncryptedString, EncString } from "./enc-string";
|
import { EncryptedString, EncString } from "./enc-string";
|
||||||
import { MasterKey, SymmetricCryptoKey, UserKey } from "./symmetric-crypto-key";
|
import { SymmetricCryptoKey } from "./symmetric-crypto-key";
|
||||||
|
|
||||||
export class EncryptionPair<TEncrypted, TDecrypted> {
|
export class EncryptionPair<TEncrypted, TDecrypted> {
|
||||||
encrypted?: TEncrypted;
|
encrypted?: TEncrypted;
|
||||||
|
@ -2,11 +2,8 @@ import { mock, MockProxy } from "jest-mock-extended";
|
|||||||
|
|
||||||
import { makeStaticByteArray } from "../../../../spec";
|
import { makeStaticByteArray } from "../../../../spec";
|
||||||
import { EncryptService } from "../../../platform/abstractions/encrypt.service";
|
import { EncryptService } from "../../../platform/abstractions/encrypt.service";
|
||||||
import {
|
import { SymmetricCryptoKey } from "../../../platform/models/domain/symmetric-crypto-key";
|
||||||
OrgKey,
|
import { UserKey, OrgKey } from "../../../types/key";
|
||||||
SymmetricCryptoKey,
|
|
||||||
UserKey,
|
|
||||||
} from "../../../platform/models/domain/symmetric-crypto-key";
|
|
||||||
import { CryptoService } from "../../abstractions/crypto.service";
|
import { CryptoService } from "../../abstractions/crypto.service";
|
||||||
import { EncryptionType } from "../../enums";
|
import { EncryptionType } from "../../enums";
|
||||||
import { ContainerService } from "../../services/container.service";
|
import { ContainerService } from "../../services/container.service";
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Jsonify, Opaque } from "type-fest";
|
import { Jsonify } from "type-fest";
|
||||||
|
|
||||||
import { Utils } from "../../../platform/misc/utils";
|
import { Utils } from "../../../platform/misc/utils";
|
||||||
import { EncryptionType } from "../../enums";
|
import { EncryptionType } from "../../enums";
|
||||||
@ -75,13 +75,3 @@ export class SymmetricCryptoKey {
|
|||||||
return SymmetricCryptoKey.fromString(obj?.keyB64);
|
return SymmetricCryptoKey.fromString(obj?.keyB64);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Setup all separate key types as opaque types
|
|
||||||
export type DeviceKey = Opaque<SymmetricCryptoKey, "DeviceKey">;
|
|
||||||
export type PrfKey = Opaque<SymmetricCryptoKey, "PrfKey">;
|
|
||||||
export type UserKey = Opaque<SymmetricCryptoKey, "UserKey">;
|
|
||||||
export type MasterKey = Opaque<SymmetricCryptoKey, "MasterKey">;
|
|
||||||
export type PinKey = Opaque<SymmetricCryptoKey, "PinKey">;
|
|
||||||
export type OrgKey = Opaque<SymmetricCryptoKey, "OrgKey">;
|
|
||||||
export type ProviderKey = Opaque<SymmetricCryptoKey, "ProviderKey">;
|
|
||||||
export type CipherKey = Opaque<SymmetricCryptoKey, "CipherKey">;
|
|
||||||
|
@ -6,6 +6,7 @@ import { FakeActiveUserState, FakeSingleUserState } from "../../../spec/fake-sta
|
|||||||
import { FakeStateProvider } from "../../../spec/fake-state-provider";
|
import { FakeStateProvider } from "../../../spec/fake-state-provider";
|
||||||
import { CsprngArray } from "../../types/csprng";
|
import { CsprngArray } from "../../types/csprng";
|
||||||
import { UserId } from "../../types/guid";
|
import { UserId } from "../../types/guid";
|
||||||
|
import { UserKey, MasterKey, PinKey } from "../../types/key";
|
||||||
import { CryptoFunctionService } from "../abstractions/crypto-function.service";
|
import { CryptoFunctionService } from "../abstractions/crypto-function.service";
|
||||||
import { EncryptService } from "../abstractions/encrypt.service";
|
import { EncryptService } from "../abstractions/encrypt.service";
|
||||||
import { LogService } from "../abstractions/log.service";
|
import { LogService } from "../abstractions/log.service";
|
||||||
@ -13,12 +14,7 @@ import { PlatformUtilsService } from "../abstractions/platform-utils.service";
|
|||||||
import { StateService } from "../abstractions/state.service";
|
import { StateService } from "../abstractions/state.service";
|
||||||
import { Utils } from "../misc/utils";
|
import { Utils } from "../misc/utils";
|
||||||
import { EncString } from "../models/domain/enc-string";
|
import { EncString } from "../models/domain/enc-string";
|
||||||
import {
|
import { SymmetricCryptoKey } from "../models/domain/symmetric-crypto-key";
|
||||||
MasterKey,
|
|
||||||
PinKey,
|
|
||||||
SymmetricCryptoKey,
|
|
||||||
UserKey,
|
|
||||||
} from "../models/domain/symmetric-crypto-key";
|
|
||||||
import { CryptoService, USER_EVER_HAD_USER_KEY } from "../services/crypto.service";
|
import { CryptoService, USER_EVER_HAD_USER_KEY } from "../services/crypto.service";
|
||||||
|
|
||||||
describe("cryptoService", () => {
|
describe("cryptoService", () => {
|
||||||
|
@ -10,6 +10,7 @@ import { AccountService } from "../../auth/abstractions/account.service";
|
|||||||
import { KdfConfig } from "../../auth/models/domain/kdf-config";
|
import { KdfConfig } from "../../auth/models/domain/kdf-config";
|
||||||
import { Utils } from "../../platform/misc/utils";
|
import { Utils } from "../../platform/misc/utils";
|
||||||
import { UserId } from "../../types/guid";
|
import { UserId } from "../../types/guid";
|
||||||
|
import { UserKey, MasterKey, OrgKey, ProviderKey, PinKey, CipherKey } from "../../types/key";
|
||||||
import { CryptoFunctionService } from "../abstractions/crypto-function.service";
|
import { CryptoFunctionService } from "../abstractions/crypto-function.service";
|
||||||
import { CryptoService as CryptoServiceAbstraction } from "../abstractions/crypto.service";
|
import { CryptoService as CryptoServiceAbstraction } from "../abstractions/crypto.service";
|
||||||
import { EncryptService } from "../abstractions/encrypt.service";
|
import { EncryptService } from "../abstractions/encrypt.service";
|
||||||
@ -30,15 +31,7 @@ import { sequentialize } from "../misc/sequentialize";
|
|||||||
import { EFFLongWordList } from "../misc/wordlist";
|
import { EFFLongWordList } from "../misc/wordlist";
|
||||||
import { EncArrayBuffer } from "../models/domain/enc-array-buffer";
|
import { EncArrayBuffer } from "../models/domain/enc-array-buffer";
|
||||||
import { EncString } from "../models/domain/enc-string";
|
import { EncString } from "../models/domain/enc-string";
|
||||||
import {
|
import { SymmetricCryptoKey } from "../models/domain/symmetric-crypto-key";
|
||||||
CipherKey,
|
|
||||||
MasterKey,
|
|
||||||
OrgKey,
|
|
||||||
PinKey,
|
|
||||||
ProviderKey,
|
|
||||||
SymmetricCryptoKey,
|
|
||||||
UserKey,
|
|
||||||
} from "../models/domain/symmetric-crypto-key";
|
|
||||||
import { ActiveUserState, CRYPTO_DISK, KeyDefinition, StateProvider } from "../state";
|
import { ActiveUserState, CRYPTO_DISK, KeyDefinition, StateProvider } from "../state";
|
||||||
|
|
||||||
export const USER_EVER_HAD_USER_KEY = new KeyDefinition<boolean>(CRYPTO_DISK, "everHadUserKey", {
|
export const USER_EVER_HAD_USER_KEY = new KeyDefinition<boolean>(CRYPTO_DISK, "everHadUserKey", {
|
||||||
|
@ -24,6 +24,7 @@ import { UsernameGeneratorOptions } from "../../tools/generator/username";
|
|||||||
import { SendData } from "../../tools/send/models/data/send.data";
|
import { SendData } from "../../tools/send/models/data/send.data";
|
||||||
import { SendView } from "../../tools/send/models/view/send.view";
|
import { SendView } from "../../tools/send/models/view/send.view";
|
||||||
import { UserId } from "../../types/guid";
|
import { UserId } from "../../types/guid";
|
||||||
|
import { UserKey, MasterKey, DeviceKey } from "../../types/key";
|
||||||
import { UriMatchType } from "../../vault/enums";
|
import { UriMatchType } from "../../vault/enums";
|
||||||
import { CipherData } from "../../vault/models/data/cipher.data";
|
import { CipherData } from "../../vault/models/data/cipher.data";
|
||||||
import { CollectionData } from "../../vault/models/data/collection.data";
|
import { CollectionData } from "../../vault/models/data/collection.data";
|
||||||
@ -53,12 +54,7 @@ import { EncString } from "../models/domain/enc-string";
|
|||||||
import { GlobalState } from "../models/domain/global-state";
|
import { GlobalState } from "../models/domain/global-state";
|
||||||
import { State } from "../models/domain/state";
|
import { State } from "../models/domain/state";
|
||||||
import { StorageOptions } from "../models/domain/storage-options";
|
import { StorageOptions } from "../models/domain/storage-options";
|
||||||
import {
|
import { SymmetricCryptoKey } from "../models/domain/symmetric-crypto-key";
|
||||||
DeviceKey,
|
|
||||||
MasterKey,
|
|
||||||
SymmetricCryptoKey,
|
|
||||||
UserKey,
|
|
||||||
} from "../models/domain/symmetric-crypto-key";
|
|
||||||
|
|
||||||
const keys = {
|
const keys = {
|
||||||
state: "state",
|
state: "state",
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import { Observable } from "rxjs";
|
import { Observable } from "rxjs";
|
||||||
|
|
||||||
import { EncArrayBuffer } from "../../../platform/models/domain/enc-array-buffer";
|
import { EncArrayBuffer } from "../../../platform/models/domain/enc-array-buffer";
|
||||||
import { SymmetricCryptoKey, UserKey } from "../../../platform/models/domain/symmetric-crypto-key";
|
import { SymmetricCryptoKey } from "../../../platform/models/domain/symmetric-crypto-key";
|
||||||
|
import { UserKey } from "../../../types/key";
|
||||||
import { SendData } from "../models/data/send.data";
|
import { SendData } from "../models/data/send.data";
|
||||||
import { Send } from "../models/domain/send";
|
import { Send } from "../models/domain/send";
|
||||||
import { SendWithIdRequest } from "../models/request/send-with-id.request";
|
import { SendWithIdRequest } from "../models/request/send-with-id.request";
|
||||||
|
@ -7,8 +7,9 @@ import { EncryptService } from "../../../platform/abstractions/encrypt.service";
|
|||||||
import { I18nService } from "../../../platform/abstractions/i18n.service";
|
import { I18nService } from "../../../platform/abstractions/i18n.service";
|
||||||
import { StateService } from "../../../platform/abstractions/state.service";
|
import { StateService } from "../../../platform/abstractions/state.service";
|
||||||
import { EncString } from "../../../platform/models/domain/enc-string";
|
import { EncString } from "../../../platform/models/domain/enc-string";
|
||||||
import { SymmetricCryptoKey, UserKey } from "../../../platform/models/domain/symmetric-crypto-key";
|
import { SymmetricCryptoKey } from "../../../platform/models/domain/symmetric-crypto-key";
|
||||||
import { ContainerService } from "../../../platform/services/container.service";
|
import { ContainerService } from "../../../platform/services/container.service";
|
||||||
|
import { UserKey } from "../../../types/key";
|
||||||
import { SendData } from "../models/data/send.data";
|
import { SendData } from "../models/data/send.data";
|
||||||
import { Send } from "../models/domain/send";
|
import { Send } from "../models/domain/send";
|
||||||
import { SendView } from "../models/view/send.view";
|
import { SendView } from "../models/view/send.view";
|
||||||
|
@ -7,7 +7,8 @@ import { StateService } from "../../../platform/abstractions/state.service";
|
|||||||
import { Utils } from "../../../platform/misc/utils";
|
import { Utils } from "../../../platform/misc/utils";
|
||||||
import { EncArrayBuffer } from "../../../platform/models/domain/enc-array-buffer";
|
import { EncArrayBuffer } from "../../../platform/models/domain/enc-array-buffer";
|
||||||
import { EncString } from "../../../platform/models/domain/enc-string";
|
import { EncString } from "../../../platform/models/domain/enc-string";
|
||||||
import { SymmetricCryptoKey, UserKey } from "../../../platform/models/domain/symmetric-crypto-key";
|
import { SymmetricCryptoKey } from "../../../platform/models/domain/symmetric-crypto-key";
|
||||||
|
import { UserKey } from "../../../types/key";
|
||||||
import { SendType } from "../enums/send-type";
|
import { SendType } from "../enums/send-type";
|
||||||
import { SendData } from "../models/data/send.data";
|
import { SendData } from "../models/data/send.data";
|
||||||
import { Send } from "../models/domain/send";
|
import { Send } from "../models/domain/send";
|
||||||
|
@ -4,6 +4,6 @@ import { Opaque } from "type-fest";
|
|||||||
// represents an array or string value generated from a
|
// represents an array or string value generated from a
|
||||||
// cryptographic secure pseudorandom number generator (CSPRNG)
|
// cryptographic secure pseudorandom number generator (CSPRNG)
|
||||||
|
|
||||||
type CsprngArray = Opaque<Uint8Array, "CSPRNG">;
|
export type CsprngArray = Opaque<Uint8Array, "CSPRNG">;
|
||||||
|
|
||||||
type CsprngString = Opaque<string, "CSPRNG">;
|
export type CsprngString = Opaque<string, "CSPRNG">;
|
5
libs/common/src/types/guid.d.ts
vendored
5
libs/common/src/types/guid.d.ts
vendored
@ -1,5 +0,0 @@
|
|||||||
import { Opaque } from "type-fest";
|
|
||||||
|
|
||||||
type Guid = Opaque<string, "Guid">;
|
|
||||||
|
|
||||||
type UserId = Opaque<string, "UserId">;
|
|
5
libs/common/src/types/guid.ts
Normal file
5
libs/common/src/types/guid.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import { Opaque } from "type-fest";
|
||||||
|
|
||||||
|
export type Guid = Opaque<string, "Guid">;
|
||||||
|
|
||||||
|
export type UserId = Opaque<string, "UserId">;
|
13
libs/common/src/types/key.ts
Normal file
13
libs/common/src/types/key.ts
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import { Opaque } from "type-fest";
|
||||||
|
|
||||||
|
import { SymmetricCryptoKey } from "../platform/models/domain/symmetric-crypto-key";
|
||||||
|
|
||||||
|
// symmetric keys
|
||||||
|
export type DeviceKey = Opaque<SymmetricCryptoKey, "DeviceKey">;
|
||||||
|
export type PrfKey = Opaque<SymmetricCryptoKey, "PrfKey">;
|
||||||
|
export type UserKey = Opaque<SymmetricCryptoKey, "UserKey">;
|
||||||
|
export type MasterKey = Opaque<SymmetricCryptoKey, "MasterKey">;
|
||||||
|
export type PinKey = Opaque<SymmetricCryptoKey, "PinKey">;
|
||||||
|
export type OrgKey = Opaque<SymmetricCryptoKey, "OrgKey">;
|
||||||
|
export type ProviderKey = Opaque<SymmetricCryptoKey, "ProviderKey">;
|
||||||
|
export type CipherKey = Opaque<SymmetricCryptoKey, "CipherKey">;
|
5
libs/common/src/types/state.d.ts
vendored
5
libs/common/src/types/state.d.ts
vendored
@ -1,5 +0,0 @@
|
|||||||
import { Opaque } from "type-fest";
|
|
||||||
|
|
||||||
type StorageKey = Opaque<string, "StorageKey">;
|
|
||||||
|
|
||||||
type DerivedStateDependencies = Record<string, unknown>;
|
|
5
libs/common/src/types/state.ts
Normal file
5
libs/common/src/types/state.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import { Opaque } from "type-fest";
|
||||||
|
|
||||||
|
export type StorageKey = Opaque<string, "StorageKey">;
|
||||||
|
|
||||||
|
export type DerivedStateDependencies = Record<string, unknown>;
|
@ -4,12 +4,9 @@ import { makeStaticByteArray, mockEnc, mockFromJson } from "../../../../spec";
|
|||||||
import { CryptoService } from "../../../platform/abstractions/crypto.service";
|
import { CryptoService } from "../../../platform/abstractions/crypto.service";
|
||||||
import { EncryptService } from "../../../platform/abstractions/encrypt.service";
|
import { EncryptService } from "../../../platform/abstractions/encrypt.service";
|
||||||
import { EncryptedString, EncString } from "../../../platform/models/domain/enc-string";
|
import { EncryptedString, EncString } from "../../../platform/models/domain/enc-string";
|
||||||
import {
|
import { SymmetricCryptoKey } from "../../../platform/models/domain/symmetric-crypto-key";
|
||||||
OrgKey,
|
|
||||||
SymmetricCryptoKey,
|
|
||||||
UserKey,
|
|
||||||
} from "../../../platform/models/domain/symmetric-crypto-key";
|
|
||||||
import { ContainerService } from "../../../platform/services/container.service";
|
import { ContainerService } from "../../../platform/services/container.service";
|
||||||
|
import { OrgKey, UserKey } from "../../../types/key";
|
||||||
import { AttachmentData } from "../../models/data/attachment.data";
|
import { AttachmentData } from "../../models/data/attachment.data";
|
||||||
import { Attachment } from "../../models/domain/attachment";
|
import { Attachment } from "../../models/domain/attachment";
|
||||||
|
|
||||||
|
@ -12,12 +12,9 @@ import { I18nService } from "../../platform/abstractions/i18n.service";
|
|||||||
import { StateService } from "../../platform/abstractions/state.service";
|
import { StateService } from "../../platform/abstractions/state.service";
|
||||||
import { EncArrayBuffer } from "../../platform/models/domain/enc-array-buffer";
|
import { EncArrayBuffer } from "../../platform/models/domain/enc-array-buffer";
|
||||||
import { EncString } from "../../platform/models/domain/enc-string";
|
import { EncString } from "../../platform/models/domain/enc-string";
|
||||||
import {
|
import { SymmetricCryptoKey } from "../../platform/models/domain/symmetric-crypto-key";
|
||||||
CipherKey,
|
|
||||||
OrgKey,
|
|
||||||
SymmetricCryptoKey,
|
|
||||||
} from "../../platform/models/domain/symmetric-crypto-key";
|
|
||||||
import { ContainerService } from "../../platform/services/container.service";
|
import { ContainerService } from "../../platform/services/container.service";
|
||||||
|
import { CipherKey, OrgKey } from "../../types/key";
|
||||||
import { CipherFileUploadService } from "../abstractions/file-upload/cipher-file-upload.service";
|
import { CipherFileUploadService } from "../abstractions/file-upload/cipher-file-upload.service";
|
||||||
import { UriMatchType, FieldType } from "../enums";
|
import { UriMatchType, FieldType } from "../enums";
|
||||||
import { CipherRepromptType } from "../enums/cipher-reprompt-type";
|
import { CipherRepromptType } from "../enums/cipher-reprompt-type";
|
||||||
|
@ -17,11 +17,8 @@ import { Utils } from "../../platform/misc/utils";
|
|||||||
import Domain from "../../platform/models/domain/domain-base";
|
import Domain from "../../platform/models/domain/domain-base";
|
||||||
import { EncArrayBuffer } from "../../platform/models/domain/enc-array-buffer";
|
import { EncArrayBuffer } from "../../platform/models/domain/enc-array-buffer";
|
||||||
import { EncString } from "../../platform/models/domain/enc-string";
|
import { EncString } from "../../platform/models/domain/enc-string";
|
||||||
import {
|
import { SymmetricCryptoKey } from "../../platform/models/domain/symmetric-crypto-key";
|
||||||
OrgKey,
|
import { UserKey, OrgKey } from "../../types/key";
|
||||||
SymmetricCryptoKey,
|
|
||||||
UserKey,
|
|
||||||
} from "../../platform/models/domain/symmetric-crypto-key";
|
|
||||||
import { CipherService as CipherServiceAbstraction } from "../abstractions/cipher.service";
|
import { CipherService as CipherServiceAbstraction } from "../abstractions/cipher.service";
|
||||||
import { CipherFileUploadService } from "../abstractions/file-upload/cipher-file-upload.service";
|
import { CipherFileUploadService } from "../abstractions/file-upload/cipher-file-upload.service";
|
||||||
import { FieldType, UriMatchType } from "../enums";
|
import { FieldType, UriMatchType } from "../enums";
|
||||||
|
@ -7,8 +7,9 @@ import { EncryptService } from "../../../platform/abstractions/encrypt.service";
|
|||||||
import { I18nService } from "../../../platform/abstractions/i18n.service";
|
import { I18nService } from "../../../platform/abstractions/i18n.service";
|
||||||
import { StateService } from "../../../platform/abstractions/state.service";
|
import { StateService } from "../../../platform/abstractions/state.service";
|
||||||
import { EncString } from "../../../platform/models/domain/enc-string";
|
import { EncString } from "../../../platform/models/domain/enc-string";
|
||||||
import { SymmetricCryptoKey, UserKey } from "../../../platform/models/domain/symmetric-crypto-key";
|
import { SymmetricCryptoKey } from "../../../platform/models/domain/symmetric-crypto-key";
|
||||||
import { ContainerService } from "../../../platform/services/container.service";
|
import { ContainerService } from "../../../platform/services/container.service";
|
||||||
|
import { UserKey } from "../../../types/key";
|
||||||
import { CipherService } from "../../abstractions/cipher.service";
|
import { CipherService } from "../../abstractions/cipher.service";
|
||||||
import { FolderData } from "../../models/data/folder.data";
|
import { FolderData } from "../../models/data/folder.data";
|
||||||
import { FolderView } from "../../models/view/folder.view";
|
import { FolderView } from "../../models/view/folder.view";
|
||||||
|
Loading…
Reference in New Issue
Block a user