fix: extraction abstract key split
This commit is contained in:
23
packages/encryption/src/Domain/Split/AbstractKeySplit.ts
Normal file
23
packages/encryption/src/Domain/Split/AbstractKeySplit.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import {
|
||||
DecryptedPayloadInterface,
|
||||
EncryptedPayloadInterface,
|
||||
ItemsKeyInterface,
|
||||
RootKeyInterface,
|
||||
} from '@standardnotes/models'
|
||||
|
||||
export interface AbstractKeySplit<T = EncryptedPayloadInterface | DecryptedPayloadInterface> {
|
||||
usesRootKey?: {
|
||||
items: T[]
|
||||
key: RootKeyInterface
|
||||
}
|
||||
usesItemsKey?: {
|
||||
items: T[]
|
||||
key: ItemsKeyInterface
|
||||
}
|
||||
usesRootKeyWithKeyLookup?: {
|
||||
items: T[]
|
||||
}
|
||||
usesItemsKeyWithKeyLookup?: {
|
||||
items: T[]
|
||||
}
|
||||
}
|
||||
@@ -2,29 +2,11 @@ import { Uuid } from '@standardnotes/common'
|
||||
import {
|
||||
DecryptedPayloadInterface,
|
||||
EncryptedPayloadInterface,
|
||||
ItemsKeyInterface,
|
||||
PayloadInterface,
|
||||
RootKeyInterface,
|
||||
} from '@standardnotes/models'
|
||||
import { AbstractKeySplit } from './AbstractKeySplit'
|
||||
import { EncryptionTypeSplit } from './EncryptionTypeSplit'
|
||||
|
||||
export interface AbstractKeySplit<T = EncryptedPayloadInterface | DecryptedPayloadInterface> {
|
||||
usesRootKey?: {
|
||||
items: T[]
|
||||
key: RootKeyInterface
|
||||
}
|
||||
usesItemsKey?: {
|
||||
items: T[]
|
||||
key: ItemsKeyInterface
|
||||
}
|
||||
usesRootKeyWithKeyLookup?: {
|
||||
items: T[]
|
||||
}
|
||||
usesItemsKeyWithKeyLookup?: {
|
||||
items: T[]
|
||||
}
|
||||
}
|
||||
|
||||
export type KeyedEncryptionSplit = AbstractKeySplit<DecryptedPayloadInterface>
|
||||
export type KeyedDecryptionSplit = AbstractKeySplit<EncryptedPayloadInterface>
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ export * from './Service/Functions'
|
||||
export * from './Service/Items/ItemsEncryption'
|
||||
export * from './Service/RootKey/KeyMode'
|
||||
export * from './Service/RootKey/RootKeyEncryption'
|
||||
export * from './Split/AbstractKeySplit'
|
||||
export * from './Split/EncryptionSplit'
|
||||
export * from './Split/EncryptionTypeSplit'
|
||||
export * from './Split/Functions'
|
||||
|
||||
Reference in New Issue
Block a user