mirror of
https://github.com/tutao/tutanota.git
synced 2025-10-19 16:03:43 +00:00
Adapt to key verification model changes
This commit is contained in:
parent
ed5c320a31
commit
ec7952de18
26 changed files with 2149 additions and 860 deletions
|
@ -1,5 +1,5 @@
|
|||
const modelInfo = {
|
||||
version: 128,
|
||||
version: 129,
|
||||
}
|
||||
|
||||
export default modelInfo
|
|
@ -37,6 +37,9 @@ import { GiftCardCreateReturnTypeRef } from "./TypeRefs.js"
|
|||
import { GiftCardDeleteDataTypeRef } from "./TypeRefs.js"
|
||||
import { GroupKeyRotationInfoGetOutTypeRef } from "./TypeRefs.js"
|
||||
import { GroupKeyRotationPostInTypeRef } from "./TypeRefs.js"
|
||||
import { IdentityKeyGetInTypeRef } from "./TypeRefs.js"
|
||||
import { IdentityKeyGetOutTypeRef } from "./TypeRefs.js"
|
||||
import { IdentityKeyPostInTypeRef } from "./TypeRefs.js"
|
||||
import { InvoiceDataGetInTypeRef } from "./TypeRefs.js"
|
||||
import { InvoiceDataGetOutTypeRef } from "./TypeRefs.js"
|
||||
import { LocationServiceGetReturnTypeRef } from "./TypeRefs.js"
|
||||
|
@ -69,6 +72,7 @@ import { RegistrationServiceDataTypeRef } from "./TypeRefs.js"
|
|||
import { RegistrationReturnTypeRef } from "./TypeRefs.js"
|
||||
import { ResetFactorsDeleteDataTypeRef } from "./TypeRefs.js"
|
||||
import { ResetPasswordPostInTypeRef } from "./TypeRefs.js"
|
||||
import { RolloutGetOutTypeRef } from "./TypeRefs.js"
|
||||
import { SaltDataTypeRef } from "./TypeRefs.js"
|
||||
import { SaltReturnTypeRef } from "./TypeRefs.js"
|
||||
import { SecondFactorAuthAllowedReturnTypeRef } from "./TypeRefs.js"
|
||||
|
@ -292,6 +296,15 @@ export const GroupKeyRotationService = Object.freeze({
|
|||
delete: null,
|
||||
} as const)
|
||||
|
||||
export const IdentityKeyService = Object.freeze({
|
||||
app: "sys",
|
||||
name: "IdentityKeyService",
|
||||
get: { data: IdentityKeyGetInTypeRef, return: IdentityKeyGetOutTypeRef },
|
||||
post: { data: IdentityKeyPostInTypeRef, return: null },
|
||||
put: null,
|
||||
delete: null,
|
||||
} as const)
|
||||
|
||||
export const InvoiceDataService = Object.freeze({
|
||||
app: "sys",
|
||||
name: "InvoiceDataService",
|
||||
|
@ -418,6 +431,15 @@ export const ResetPasswordService = Object.freeze({
|
|||
delete: null,
|
||||
} as const)
|
||||
|
||||
export const RolloutService = Object.freeze({
|
||||
app: "sys",
|
||||
name: "RolloutService",
|
||||
get: { data: null, return: RolloutGetOutTypeRef },
|
||||
post: null,
|
||||
put: null,
|
||||
delete: null,
|
||||
} as const)
|
||||
|
||||
export const SaltService = Object.freeze({
|
||||
app: "sys",
|
||||
name: "SaltService",
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -20,6 +20,8 @@ export type KeyPair = {
|
|||
symEncPrivEccKey: null | Uint8Array;
|
||||
pubKyberKey: null | Uint8Array;
|
||||
symEncPrivKyberKey: null | Uint8Array;
|
||||
|
||||
signature: null | PublicKeySignature;
|
||||
}
|
||||
export const GroupTypeRef: TypeRef<Group> = new TypeRef("sys", 5)
|
||||
|
||||
|
@ -51,8 +53,9 @@ export type Group = {
|
|||
members: Id;
|
||||
archives: ArchiveType[];
|
||||
storageCounter: null | Id;
|
||||
formerGroupKeys: null | GroupKeysRef;
|
||||
formerGroupKeys: GroupKeysRef;
|
||||
pubAdminGroupEncGKey: null | PubEncKeyData;
|
||||
identityKeyPair: null | IdentityKeyPair;
|
||||
}
|
||||
export const GroupInfoTypeRef: TypeRef<GroupInfo> = new TypeRef("sys", 14)
|
||||
|
||||
|
@ -681,6 +684,8 @@ export type PublicKeyGetOut = {
|
|||
pubKeyVersion: NumberString;
|
||||
pubEccKey: null | Uint8Array;
|
||||
pubKyberKey: null | Uint8Array;
|
||||
|
||||
signature: null | PublicKeySignature;
|
||||
}
|
||||
export const SaltDataTypeRef: TypeRef<SaltData> = new TypeRef("sys", 417)
|
||||
|
||||
|
@ -2539,7 +2544,7 @@ export type UserGroupRoot = {
|
|||
_ownerGroup: null | Id;
|
||||
|
||||
invitations: Id;
|
||||
keyRotations: null | KeyRotationsRef;
|
||||
keyRotations: KeyRotationsRef;
|
||||
groupKeyUpdates: null | GroupKeyUpdatesRef;
|
||||
}
|
||||
export const PaymentErrorInfoTypeRef: TypeRef<PaymentErrorInfo> = new TypeRef("sys", 1632)
|
||||
|
@ -3938,3 +3943,108 @@ export type PatchList = {
|
|||
|
||||
patches: Patch[];
|
||||
}
|
||||
export const IdentityKeyPairTypeRef: TypeRef<IdentityKeyPair> = new TypeRef("sys", 2575)
|
||||
|
||||
export function createIdentityKeyPair(values: StrippedEntity<IdentityKeyPair>): IdentityKeyPair {
|
||||
return Object.assign(create(typeModels[IdentityKeyPairTypeRef.typeId], IdentityKeyPairTypeRef), values)
|
||||
}
|
||||
|
||||
export type IdentityKeyPair = {
|
||||
_type: TypeRef<IdentityKeyPair>;
|
||||
_original?: IdentityKeyPair
|
||||
|
||||
_id: Id;
|
||||
identityKeyVersion: NumberString;
|
||||
encryptingKeyVersion: NumberString;
|
||||
publicEd25519Key: Uint8Array;
|
||||
privateEd25519Key: Uint8Array;
|
||||
|
||||
publicKeyMac: KeyMac;
|
||||
}
|
||||
export const PublicKeySignatureTypeRef: TypeRef<PublicKeySignature> = new TypeRef("sys", 2582)
|
||||
|
||||
export function createPublicKeySignature(values: StrippedEntity<PublicKeySignature>): PublicKeySignature {
|
||||
return Object.assign(create(typeModels[PublicKeySignatureTypeRef.typeId], PublicKeySignatureTypeRef), values)
|
||||
}
|
||||
|
||||
export type PublicKeySignature = {
|
||||
_type: TypeRef<PublicKeySignature>;
|
||||
_original?: PublicKeySignature
|
||||
|
||||
_id: Id;
|
||||
signature: Uint8Array;
|
||||
signingKeyVersion: NumberString;
|
||||
signatureType: NumberString;
|
||||
publicKeyVersion: NumberString;
|
||||
}
|
||||
export const IdentityKeyGetInTypeRef: TypeRef<IdentityKeyGetIn> = new TypeRef("sys", 2590)
|
||||
|
||||
export function createIdentityKeyGetIn(values: StrippedEntity<IdentityKeyGetIn>): IdentityKeyGetIn {
|
||||
return Object.assign(create(typeModels[IdentityKeyGetInTypeRef.typeId], IdentityKeyGetInTypeRef), values)
|
||||
}
|
||||
|
||||
export type IdentityKeyGetIn = {
|
||||
_type: TypeRef<IdentityKeyGetIn>;
|
||||
_original?: IdentityKeyGetIn
|
||||
|
||||
_format: NumberString;
|
||||
version: null | NumberString;
|
||||
identifierType: NumberString;
|
||||
identifier: string;
|
||||
}
|
||||
export const IdentityKeyGetOutTypeRef: TypeRef<IdentityKeyGetOut> = new TypeRef("sys", 2595)
|
||||
|
||||
export function createIdentityKeyGetOut(values: StrippedEntity<IdentityKeyGetOut>): IdentityKeyGetOut {
|
||||
return Object.assign(create(typeModels[IdentityKeyGetOutTypeRef.typeId], IdentityKeyGetOutTypeRef), values)
|
||||
}
|
||||
|
||||
export type IdentityKeyGetOut = {
|
||||
_type: TypeRef<IdentityKeyGetOut>;
|
||||
_original?: IdentityKeyGetOut
|
||||
|
||||
_format: NumberString;
|
||||
publicIdentityKey: Uint8Array;
|
||||
publicIdentityKeyVersion: NumberString;
|
||||
}
|
||||
export const IdentityKeyPostInTypeRef: TypeRef<IdentityKeyPostIn> = new TypeRef("sys", 2599)
|
||||
|
||||
export function createIdentityKeyPostIn(values: StrippedEntity<IdentityKeyPostIn>): IdentityKeyPostIn {
|
||||
return Object.assign(create(typeModels[IdentityKeyPostInTypeRef.typeId], IdentityKeyPostInTypeRef), values)
|
||||
}
|
||||
|
||||
export type IdentityKeyPostIn = {
|
||||
_type: TypeRef<IdentityKeyPostIn>;
|
||||
_original?: IdentityKeyPostIn
|
||||
|
||||
_format: NumberString;
|
||||
|
||||
identityKeyPair: IdentityKeyPair;
|
||||
signatures: PublicKeySignature[];
|
||||
}
|
||||
export const RolloutTypeRef: TypeRef<Rollout> = new TypeRef("sys", 2604)
|
||||
|
||||
export function createRollout(values: StrippedEntity<Rollout>): Rollout {
|
||||
return Object.assign(create(typeModels[RolloutTypeRef.typeId], RolloutTypeRef), values)
|
||||
}
|
||||
|
||||
export type Rollout = {
|
||||
_type: TypeRef<Rollout>;
|
||||
_original?: Rollout
|
||||
|
||||
_id: Id;
|
||||
rolloutType: NumberString;
|
||||
}
|
||||
export const RolloutGetOutTypeRef: TypeRef<RolloutGetOut> = new TypeRef("sys", 2607)
|
||||
|
||||
export function createRolloutGetOut(values: StrippedEntity<RolloutGetOut>): RolloutGetOut {
|
||||
return Object.assign(create(typeModels[RolloutGetOutTypeRef.typeId], RolloutGetOutTypeRef), values)
|
||||
}
|
||||
|
||||
export type RolloutGetOut = {
|
||||
_type: TypeRef<RolloutGetOut>;
|
||||
_original?: RolloutGetOut
|
||||
|
||||
_format: NumberString;
|
||||
|
||||
rollouts: Rollout[];
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
const modelInfo = {
|
||||
version: 87,
|
||||
version: 88,
|
||||
}
|
||||
|
||||
export default modelInfo
|
|
@ -26,6 +26,7 @@ import { CreateMailFolderReturnTypeRef } from "./TypeRefs.js"
|
|||
import { UpdateMailFolderDataTypeRef } from "./TypeRefs.js"
|
||||
import { DeleteMailFolderDataTypeRef } from "./TypeRefs.js"
|
||||
import { CreateMailGroupDataTypeRef } from "./TypeRefs.js"
|
||||
import { MailGroupPostOutTypeRef } from "./TypeRefs.js"
|
||||
import { DeleteGroupDataTypeRef } from "./TypeRefs.js"
|
||||
import { DeleteMailDataTypeRef } from "./TypeRefs.js"
|
||||
import { ManageLabelServicePostInTypeRef } from "./TypeRefs.js"
|
||||
|
@ -45,6 +46,7 @@ import { TranslationGetInTypeRef } from "./TypeRefs.js"
|
|||
import { TranslationGetOutTypeRef } from "./TypeRefs.js"
|
||||
import { UnreadMailStatePostInTypeRef } from "./TypeRefs.js"
|
||||
import { UserAccountCreateDataTypeRef } from "./TypeRefs.js"
|
||||
import { UserAccountPostOutTypeRef } from "./TypeRefs.js"
|
||||
|
||||
export const ApplyLabelService = Object.freeze({
|
||||
app: "tutanota",
|
||||
|
@ -167,7 +169,7 @@ export const MailGroupService = Object.freeze({
|
|||
app: "tutanota",
|
||||
name: "MailGroupService",
|
||||
get: null,
|
||||
post: { data: CreateMailGroupDataTypeRef, return: null },
|
||||
post: { data: CreateMailGroupDataTypeRef, return: MailGroupPostOutTypeRef },
|
||||
put: null,
|
||||
delete: { data: DeleteGroupDataTypeRef, return: null },
|
||||
} as const)
|
||||
|
@ -284,7 +286,7 @@ export const UserAccountService = Object.freeze({
|
|||
app: "tutanota",
|
||||
name: "UserAccountService",
|
||||
get: null,
|
||||
post: { data: UserAccountCreateDataTypeRef, return: null },
|
||||
post: { data: UserAccountCreateDataTypeRef, return: UserAccountPostOutTypeRef },
|
||||
put: null,
|
||||
delete: null,
|
||||
} as const)
|
File diff suppressed because it is too large
Load diff
|
@ -2501,3 +2501,31 @@ export type ResolveConversationsServiceGetOut = {
|
|||
|
||||
mailIds: IdTupleWrapper[];
|
||||
}
|
||||
export const UserAccountPostOutTypeRef: TypeRef<UserAccountPostOut> = new TypeRef("tutanota", 1664)
|
||||
|
||||
export function createUserAccountPostOut(values: StrippedEntity<UserAccountPostOut>): UserAccountPostOut {
|
||||
return Object.assign(create(typeModels[UserAccountPostOutTypeRef.typeId], UserAccountPostOutTypeRef), values)
|
||||
}
|
||||
|
||||
export type UserAccountPostOut = {
|
||||
_type: TypeRef<UserAccountPostOut>;
|
||||
_original?: UserAccountPostOut
|
||||
|
||||
_format: NumberString;
|
||||
userId: Id;
|
||||
userGroup: Id;
|
||||
}
|
||||
export const MailGroupPostOutTypeRef: TypeRef<MailGroupPostOut> = new TypeRef("tutanota", 1668)
|
||||
|
||||
export function createMailGroupPostOut(values: StrippedEntity<MailGroupPostOut>): MailGroupPostOut {
|
||||
return Object.assign(create(typeModels[MailGroupPostOutTypeRef.typeId], MailGroupPostOutTypeRef), values)
|
||||
}
|
||||
|
||||
export type MailGroupPostOut = {
|
||||
_type: TypeRef<MailGroupPostOut>;
|
||||
_original?: MailGroupPostOut
|
||||
|
||||
_format: NumberString;
|
||||
|
||||
mailGroup: Id;
|
||||
}
|
||||
|
|
|
@ -68,10 +68,8 @@ import { checkKeyVersionConstraints, KeyLoaderFacade, parseKeyVersion } from "./
|
|||
import {
|
||||
Aes256Key,
|
||||
AesKey,
|
||||
PublicKey,
|
||||
bitArrayToUint8Array,
|
||||
createAuthVerifier,
|
||||
X25519KeyPair,
|
||||
EncryptedPqKeyPairs,
|
||||
getKeyLengthBytes,
|
||||
isEncryptedPqKeyPairs,
|
||||
|
@ -79,7 +77,9 @@ import {
|
|||
KEY_LENGTH_BYTES_AES_256,
|
||||
PQKeyPairs,
|
||||
PQPublicKeys,
|
||||
PublicKey,
|
||||
uint8ArrayToKey,
|
||||
X25519KeyPair,
|
||||
} from "@tutao/tutanota-crypto"
|
||||
import { PQFacade } from "./PQFacade.js"
|
||||
import {
|
||||
|
@ -687,7 +687,12 @@ export class KeyRotationFacade {
|
|||
const distributionKeyEncNewUserGroupKey = this.cryptoWrapper.encryptKey(legacyUserDistKey, newUserGroupKeys.symGroupKey.object)
|
||||
const authVerifier = createAuthVerifier(passphraseKey)
|
||||
const newGroupKeyEncCurrentGroupKey = this.cryptoWrapper.encryptKeyWithVersionedKey(newUserGroupKeys.symGroupKey, currentGroupKey.object)
|
||||
return { membershipSymEncNewGroupKey, distributionKeyEncNewUserGroupKey, authVerifier, newGroupKeyEncCurrentGroupKey }
|
||||
return {
|
||||
membershipSymEncNewGroupKey,
|
||||
distributionKeyEncNewUserGroupKey,
|
||||
authVerifier,
|
||||
newGroupKeyEncCurrentGroupKey,
|
||||
}
|
||||
}
|
||||
|
||||
private async handlePendingInvitations(targetGroup: Group, newTargetGroupKey: VersionedKey) {
|
||||
|
@ -825,9 +830,9 @@ export class KeyRotationFacade {
|
|||
}
|
||||
|
||||
/*
|
||||
Gets the userGroupKey for the given userId via the adminEncGKey and symmetrically encrypts the given newGroupKey with it. Note that the logged-in user needs
|
||||
to be the admin of the same customer that the uer with userId belongs to.
|
||||
*/
|
||||
Gets the userGroupKey for the given userId via the adminEncGKey and symmetrically encrypts the given newGroupKey with it. Note that the logged-in user needs
|
||||
to be the admin of the same customer that the uer with userId belongs to.
|
||||
*/
|
||||
private async encryptGroupKeyForOtherUsers(userId: Id, newGroupKey: VersionedKey): Promise<VersionedEncryptedKey> {
|
||||
const groupManagementFacade = await this.groupManagementFacade()
|
||||
const user = await this.entityClient.load(UserTypeRef, userId)
|
||||
|
@ -1402,5 +1407,15 @@ function hasNonQuantumSafeKeys(...keys: AesKey[]) {
|
|||
}
|
||||
|
||||
function makeKeyPair(keyPair: EncryptedPqKeyPairs | null): KeyPair | null {
|
||||
return keyPair != null ? createKeyPair(keyPair) : null
|
||||
return keyPair != null
|
||||
? createKeyPair({
|
||||
pubEccKey: keyPair.pubEccKey,
|
||||
symEncPrivEccKey: keyPair.symEncPrivEccKey,
|
||||
pubKyberKey: keyPair.pubKyberKey,
|
||||
symEncPrivKyberKey: keyPair.symEncPrivKyberKey,
|
||||
pubRsaKey: keyPair.pubRsaKey,
|
||||
symEncPrivRsaKey: keyPair.symEncPrivRsaKey,
|
||||
signature: null,
|
||||
})
|
||||
: null
|
||||
}
|
||||
|
|
|
@ -623,6 +623,7 @@ o.spec("CryptoFacadeTest", function () {
|
|||
symEncPrivKyberKey: null,
|
||||
pubRsaKey: null,
|
||||
symEncPrivRsaKey: null,
|
||||
signature: null,
|
||||
})
|
||||
|
||||
const senderKeyPairs = await pqFacade.generateKeyPairs()
|
||||
|
@ -635,6 +636,7 @@ o.spec("CryptoFacadeTest", function () {
|
|||
symEncPrivEccKey: aesEncrypt(senderGroupKey, senderKeyPairs.x25519KeyPair.privateKey),
|
||||
pubKyberKey: kyberPublicKeyToBytes(senderKeyPairs.kyberKeyPair.publicKey),
|
||||
symEncPrivKyberKey: aesEncrypt(senderGroupKey, kyberPrivateKeyToBytes(senderKeyPairs.kyberKeyPair.privateKey)),
|
||||
signature: null,
|
||||
})
|
||||
|
||||
const senderUserGroup = createGroup({
|
||||
|
@ -657,8 +659,9 @@ o.spec("CryptoFacadeTest", function () {
|
|||
_id: "userGroupId",
|
||||
currentKeys: senderKeyPair,
|
||||
groupKeyVersion: "0",
|
||||
formerGroupKeys: null,
|
||||
formerGroupKeys: object(),
|
||||
pubAdminGroupEncGKey: null,
|
||||
identityKeyPair: null,
|
||||
})
|
||||
when(keyLoaderFacade.loadCurrentKeyPair(senderUserGroup._id)).thenResolve({ version: 0, object: senderKeyPairs })
|
||||
|
||||
|
@ -764,8 +767,9 @@ o.spec("CryptoFacadeTest", function () {
|
|||
storageCounter: null,
|
||||
type: "",
|
||||
user: null,
|
||||
formerGroupKeys: null,
|
||||
formerGroupKeys: object(),
|
||||
pubAdminGroupEncGKey: null,
|
||||
identityKeyPair: null,
|
||||
})
|
||||
|
||||
when(keyLoaderFacade.loadCurrentKeyPair(senderUserGroup._id)).thenResolve(senderAsymmetricKeyPair)
|
||||
|
@ -1474,6 +1478,7 @@ o.spec("CryptoFacadeTest", function () {
|
|||
symEncPrivKyberKey: aesEncrypt(recipientUser.userGroupKey, kyberPrivateKeyToBytes(pqKeyPairs.kyberKeyPair.privateKey)),
|
||||
pubRsaKey: null,
|
||||
symEncPrivRsaKey: null,
|
||||
signature: null,
|
||||
})
|
||||
|
||||
recipientUser.userGroup.currentKeys = recipientKeyPair
|
||||
|
|
|
@ -121,7 +121,8 @@ o.spec("KeyLoaderFacadeTest", function () {
|
|||
userGroup = createTestEntity(GroupTypeRef, {
|
||||
_id: "my userGroup",
|
||||
groupKeyVersion: String(userGroupKey.version),
|
||||
formerGroupKeys: null,
|
||||
formerGroupKeys: object(),
|
||||
identityKeyPair: null,
|
||||
})
|
||||
|
||||
membership = createTestEntity(GroupMembershipTypeRef, {
|
||||
|
@ -206,6 +207,7 @@ o.spec("KeyLoaderFacadeTest", function () {
|
|||
symEncPrivKyberKey: null,
|
||||
symEncPrivRsaKey: encryptRsaKey(currentGroupKey.object, RSA_TEST_KEYPAIR.privateKey),
|
||||
pubRsaKey: hexToUint8Array(rsaPublicKeyToHex(RSA_TEST_KEYPAIR.publicKey)),
|
||||
signature: null,
|
||||
})
|
||||
keyCache = object()
|
||||
keyLoaderFacade = new KeyLoaderFacade(keyCache, userFacade, entityClient, async () => cacheManagementFacade)
|
||||
|
@ -225,6 +227,7 @@ o.spec("KeyLoaderFacadeTest", function () {
|
|||
symEncPrivKyberKey: null,
|
||||
symEncPrivRsaKey: encryptRsaKey(currentGroupKey.object, RSA_TEST_KEYPAIR.privateKey),
|
||||
pubRsaKey: hexToUint8Array(rsaPublicKeyToHex(RSA_TEST_KEYPAIR.publicKey)),
|
||||
signature: null,
|
||||
})
|
||||
keyCache = object()
|
||||
keyLoaderFacade = new KeyLoaderFacade(keyCache, userFacade, entityClient, async () => cacheManagementFacade)
|
||||
|
@ -254,6 +257,7 @@ o.spec("KeyLoaderFacadeTest", function () {
|
|||
symEncPrivKyberKey: null,
|
||||
symEncPrivRsaKey: encryptRsaKey(currentGroupKey.object, RSA_TEST_KEYPAIR.privateKey),
|
||||
pubRsaKey: hexToUint8Array(rsaPublicKeyToHex(RSA_TEST_KEYPAIR.publicKey)),
|
||||
signature: null,
|
||||
})
|
||||
keyCache = object()
|
||||
keyLoaderFacade = new KeyLoaderFacade(keyCache, userFacade, entityClient, async () => cacheManagementFacade)
|
||||
|
|
|
@ -369,6 +369,7 @@ function prepareMultiAdminUserKeyRotation(
|
|||
symEncPrivKyberKey: object(),
|
||||
pubRsaKey: null,
|
||||
symEncPrivRsaKey: null,
|
||||
signature: null,
|
||||
})
|
||||
const adminDistPqKeyPair = object<PQKeyPairs>()
|
||||
const adminGroupDistributionKeyPairKey = object<Aes256Key>()
|
||||
|
@ -644,6 +645,7 @@ o.spec("KeyRotationFacade", function () {
|
|||
symEncPrivKyberKey: generatedKeyPair.encryptedKyberPrivKey,
|
||||
pubRsaKey: null,
|
||||
symEncPrivRsaKey: null,
|
||||
signature: null,
|
||||
})
|
||||
o(update.keyPair).deepEquals(sentKeyPairs)
|
||||
o(update.group).equals(groupId)
|
||||
|
@ -1860,6 +1862,7 @@ o.spec("KeyRotationFacade", function () {
|
|||
symEncPrivKyberKey: generatedKeyPairs.encryptedKyberPrivKey,
|
||||
pubRsaKey: null,
|
||||
symEncPrivRsaKey: null,
|
||||
signature: null,
|
||||
})
|
||||
o(update.keyPair).deepEquals(sentKeyPairs)
|
||||
o(update.group).equals(groupId)
|
||||
|
|
|
@ -27,6 +27,7 @@ const PUBLIC_KEY_GET_OUT: PublicKeyGetOut = {
|
|||
pubEccKey: stringToUtf8Uint8Array("ecc-key"),
|
||||
pubKyberKey: stringToUtf8Uint8Array("kyb-key"),
|
||||
pubRsaKey: null,
|
||||
signature: null,
|
||||
}
|
||||
const PUBLIC_KEY: Versioned<PQPublicKeys> = {
|
||||
version: 0,
|
||||
|
|
|
@ -58,6 +58,7 @@ o.spec("PublicKeyProviderTest", function () {
|
|||
pubRsaKey: null,
|
||||
pubKyberKey: kyberPublicKey,
|
||||
pubEccKey: x25519PublicKey,
|
||||
signature: null,
|
||||
})
|
||||
when(serviceExecutor.get(PublicKeyService, matchers.anything())).thenResolve(publicKeyGetOut)
|
||||
|
||||
|
@ -81,6 +82,7 @@ o.spec("PublicKeyProviderTest", function () {
|
|||
pubKyberKey: null,
|
||||
pubRsaKey: rsaPublicKey,
|
||||
pubKeyVersion: "0",
|
||||
signature: null,
|
||||
})
|
||||
|
||||
when(serviceExecutor.get(PublicKeyService, matchers.anything())).thenResolve(publicKeyGetOut)
|
||||
|
@ -110,6 +112,7 @@ o.spec("PublicKeyProviderTest", function () {
|
|||
pubRsaKey,
|
||||
pubKyberKey: null,
|
||||
pubEccKey: null,
|
||||
signature: null,
|
||||
}),
|
||||
)
|
||||
await assertThrows(CryptoError, async () => publicKeyProvider.loadCurrentPubKey(publicKeyIdentifier))
|
||||
|
@ -128,6 +131,7 @@ o.spec("PublicKeyProviderTest", function () {
|
|||
pubRsaKey: null,
|
||||
pubKyberKey: kyberPublicKey,
|
||||
pubEccKey: x25519PublicKey,
|
||||
signature: null,
|
||||
}),
|
||||
)
|
||||
|
||||
|
@ -151,6 +155,7 @@ o.spec("PublicKeyProviderTest", function () {
|
|||
pubRsaKey: null,
|
||||
pubKyberKey: kyberPublicKey,
|
||||
pubEccKey: x25519PublicKey,
|
||||
signature: null,
|
||||
}),
|
||||
)
|
||||
o(currentVersion).notEquals(requestedVersion)
|
||||
|
@ -166,6 +171,7 @@ o.spec("PublicKeyProviderTest", function () {
|
|||
pubRsaKey,
|
||||
pubKyberKey: null,
|
||||
pubEccKey: null,
|
||||
signature: null,
|
||||
}),
|
||||
)
|
||||
await assertThrows(CryptoError, async () => publicKeyProvider.loadPubKey(publicKeyIdentifier, currentVersion))
|
||||
|
@ -175,7 +181,13 @@ o.spec("PublicKeyProviderTest", function () {
|
|||
o.spec("version validation", function () {
|
||||
o("throws if the version is negative", async function () {
|
||||
when(serviceExecutor.get(PublicKeyService, matchers.anything())).thenResolve(
|
||||
createPublicKeyGetOut({ pubKeyVersion: "-1", pubRsaKey: object(), pubKyberKey: null, pubEccKey: null }),
|
||||
createPublicKeyGetOut({
|
||||
pubKeyVersion: "-1",
|
||||
pubRsaKey: object(),
|
||||
pubKyberKey: null,
|
||||
pubEccKey: null,
|
||||
signature: null,
|
||||
}),
|
||||
)
|
||||
|
||||
const e = await assertThrows(CryptoError, async () => publicKeyProvider.loadCurrentPubKey(publicKeyIdentifier))
|
||||
|
@ -184,7 +196,13 @@ o.spec("PublicKeyProviderTest", function () {
|
|||
|
||||
o("throws if the version is not an integer", async function () {
|
||||
when(serviceExecutor.get(PublicKeyService, matchers.anything())).thenResolve(
|
||||
createPublicKeyGetOut({ pubKeyVersion: "1.5", pubRsaKey: object(), pubKyberKey: null, pubEccKey: null }),
|
||||
createPublicKeyGetOut({
|
||||
pubKeyVersion: "1.5",
|
||||
pubRsaKey: object(),
|
||||
pubKyberKey: null,
|
||||
pubEccKey: null,
|
||||
signature: null,
|
||||
}),
|
||||
)
|
||||
|
||||
const e = await assertThrows(CryptoError, async () => publicKeyProvider.loadCurrentPubKey(publicKeyIdentifier))
|
||||
|
@ -218,6 +236,7 @@ o.spec("PublicKeyProvider - convert keys", function () {
|
|||
pubKyberKey: kyberPublicKey,
|
||||
pubRsaKey: null,
|
||||
pubKeyVersion: "1",
|
||||
signature: null,
|
||||
})
|
||||
|
||||
const fromPublicKeyGetOut = publicKeyProvider.convertFromPublicKeyGetOut(publicKeyGetOut)
|
||||
|
@ -240,6 +259,7 @@ o.spec("PublicKeyProvider - convert keys", function () {
|
|||
pubKyberKey: null,
|
||||
pubRsaKey: rsaPublicKey,
|
||||
pubKeyVersion: "1",
|
||||
signature: null,
|
||||
})
|
||||
const fromPublicKeyGetOut = publicKeyProvider.convertFromPublicKeyGetOut(publicKeyGetOut)
|
||||
|
||||
|
@ -264,6 +284,7 @@ o.spec("PublicKeyProvider - convert keys", function () {
|
|||
pubKyberKey: null,
|
||||
pubRsaKey: rsaPublicKey,
|
||||
pubKeyVersion: "1",
|
||||
signature: null,
|
||||
})
|
||||
const fromPublicKeyGetOut = publicKeyProvider.convertFromPublicKeyGetOut(publicKeyGetOut)
|
||||
|
||||
|
@ -292,6 +313,7 @@ o.spec("PublicKeyProvider - convert keys", function () {
|
|||
pubKyberKey: null,
|
||||
pubRsaKey: null,
|
||||
pubKeyVersion: "1",
|
||||
signature: null,
|
||||
}),
|
||||
),
|
||||
)
|
||||
|
@ -305,6 +327,7 @@ o.spec("PublicKeyProvider - convert keys", function () {
|
|||
pubKyberKey: null,
|
||||
pubRsaKey: null,
|
||||
pubKeyVersion: "1",
|
||||
signature: null,
|
||||
}),
|
||||
),
|
||||
)
|
||||
|
@ -319,6 +342,7 @@ o.spec("PublicKeyProvider - convert keys", function () {
|
|||
pubKyberKey: kyberPublicKey,
|
||||
pubRsaKey: null,
|
||||
pubKeyVersion: "1",
|
||||
signature: null,
|
||||
}),
|
||||
),
|
||||
)
|
||||
|
|
|
@ -155,6 +155,7 @@ mod tests {
|
|||
.unwrap(),
|
||||
),
|
||||
symEncPrivRsaKey: Some(generate_random_string::<17>().as_bytes().to_vec()),
|
||||
signature: None,
|
||||
};
|
||||
|
||||
let decrypted_key_pair =
|
||||
|
@ -196,6 +197,7 @@ mod tests {
|
|||
)
|
||||
.unwrap(),
|
||||
),
|
||||
signature: None,
|
||||
};
|
||||
|
||||
let decrypted_key_pair =
|
||||
|
@ -248,6 +250,7 @@ mod tests {
|
|||
)
|
||||
.unwrap(),
|
||||
),
|
||||
signature: None,
|
||||
};
|
||||
|
||||
let decrypted_key_pair =
|
||||
|
|
|
@ -179,6 +179,7 @@ mod tests {
|
|||
pubKeyVersion: current_key_version as i64,
|
||||
pubKyberKey: Some(pub_key_for_mock.clone()),
|
||||
pubRsaKey: None,
|
||||
signature: None,
|
||||
})
|
||||
});
|
||||
let public_key_provider = make_public_key_provider(service_executor);
|
||||
|
@ -211,6 +212,7 @@ mod tests {
|
|||
pubKeyVersion: current_key_version as i64,
|
||||
pubKyberKey: None,
|
||||
pubRsaKey: Some(pub_key_for_mock.clone()),
|
||||
signature: None,
|
||||
})
|
||||
});
|
||||
let public_key_provider = make_public_key_provider(service_executor);
|
||||
|
@ -258,6 +260,7 @@ mod tests {
|
|||
pubKeyVersion: requested_version as i64,
|
||||
pubKyberKey: Some(pub_key_for_mock.clone()),
|
||||
pubRsaKey: None,
|
||||
signature: None,
|
||||
})
|
||||
});
|
||||
let public_key_provider = make_public_key_provider(service_executor);
|
||||
|
@ -296,6 +299,7 @@ mod tests {
|
|||
pubKeyVersion: current_key_version as i64,
|
||||
pubKyberKey: Some(pub_key_for_mock.clone()),
|
||||
pubRsaKey: None,
|
||||
signature: None,
|
||||
})
|
||||
});
|
||||
let public_key_provider = make_public_key_provider(service_executor);
|
||||
|
@ -333,6 +337,7 @@ mod tests {
|
|||
pubKeyVersion: requested_version as i64,
|
||||
pubKyberKey: None,
|
||||
pubRsaKey: Some(pub_key_for_mock.clone()),
|
||||
signature: None,
|
||||
})
|
||||
});
|
||||
let public_key_provider = make_public_key_provider(service_executor);
|
||||
|
@ -375,6 +380,7 @@ mod tests {
|
|||
pubKeyVersion: bad_version_from_server,
|
||||
pubKyberKey: Some(pub_key_for_mock.clone()),
|
||||
pubRsaKey: None,
|
||||
signature: None,
|
||||
})
|
||||
});
|
||||
let public_key_provider = make_public_key_provider(service_executor);
|
||||
|
|
|
@ -27,6 +27,8 @@ pub struct KeyPair {
|
|||
#[serde(rename = "2147")]
|
||||
#[serde(with = "serde_bytes")]
|
||||
pub symEncPrivKyberKey: Option<Vec<u8>>,
|
||||
#[serde(rename = "2589")]
|
||||
pub signature: Option<PublicKeySignature>,
|
||||
}
|
||||
|
||||
impl Entity for KeyPair {
|
||||
|
@ -81,9 +83,11 @@ pub struct Group {
|
|||
#[serde(rename = "2092")]
|
||||
pub storageCounter: Option<GeneratedId>,
|
||||
#[serde(rename = "2273")]
|
||||
pub formerGroupKeys: Option<GroupKeysRef>,
|
||||
pub formerGroupKeys: GroupKeysRef,
|
||||
#[serde(rename = "2475")]
|
||||
pub pubAdminGroupEncGKey: Option<PubEncKeyData>,
|
||||
#[serde(rename = "2588")]
|
||||
pub identityKeyPair: Option<IdentityKeyPair>,
|
||||
}
|
||||
|
||||
impl Entity for Group {
|
||||
|
@ -1095,6 +1099,8 @@ pub struct PublicKeyGetOut {
|
|||
#[serde(rename = "2149")]
|
||||
#[serde(with = "serde_bytes")]
|
||||
pub pubKyberKey: Option<Vec<u8>>,
|
||||
#[serde(rename = "2611")]
|
||||
pub signature: Option<PublicKeySignature>,
|
||||
}
|
||||
|
||||
impl Entity for PublicKeyGetOut {
|
||||
|
@ -3894,7 +3900,7 @@ pub struct UserGroupRoot {
|
|||
#[serde(rename = "1624")]
|
||||
pub invitations: GeneratedId,
|
||||
#[serde(rename = "2294")]
|
||||
pub keyRotations: Option<KeyRotationsRef>,
|
||||
pub keyRotations: KeyRotationsRef,
|
||||
#[serde(rename = "2383")]
|
||||
pub groupKeyUpdates: Option<GroupKeyUpdatesRef>,
|
||||
}
|
||||
|
@ -5985,3 +5991,155 @@ impl Entity for PatchList {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(uniffi::Record, Clone, Serialize, Deserialize)]
|
||||
#[cfg_attr(any(test, feature = "testing"), derive(PartialEq, Debug))]
|
||||
pub struct IdentityKeyPair {
|
||||
#[serde(rename = "2576")]
|
||||
pub _id: Option<CustomId>,
|
||||
#[serde(rename = "2577")]
|
||||
pub identityKeyVersion: i64,
|
||||
#[serde(rename = "2578")]
|
||||
pub encryptingKeyVersion: i64,
|
||||
#[serde(rename = "2579")]
|
||||
#[serde(with = "serde_bytes")]
|
||||
pub publicEd25519Key: Vec<u8>,
|
||||
#[serde(rename = "2580")]
|
||||
#[serde(with = "serde_bytes")]
|
||||
pub privateEd25519Key: Vec<u8>,
|
||||
#[serde(rename = "2581")]
|
||||
pub publicKeyMac: KeyMac,
|
||||
}
|
||||
|
||||
impl Entity for IdentityKeyPair {
|
||||
fn type_ref() -> TypeRef {
|
||||
TypeRef {
|
||||
app: AppName::Sys,
|
||||
type_id: TypeId::from(2575),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(uniffi::Record, Clone, Serialize, Deserialize)]
|
||||
#[cfg_attr(any(test, feature = "testing"), derive(PartialEq, Debug))]
|
||||
pub struct PublicKeySignature {
|
||||
#[serde(rename = "2583")]
|
||||
pub _id: Option<CustomId>,
|
||||
#[serde(rename = "2584")]
|
||||
#[serde(with = "serde_bytes")]
|
||||
pub signature: Vec<u8>,
|
||||
#[serde(rename = "2585")]
|
||||
pub signingKeyVersion: i64,
|
||||
#[serde(rename = "2586")]
|
||||
pub signatureType: i64,
|
||||
#[serde(rename = "2587")]
|
||||
pub publicKeyVersion: i64,
|
||||
}
|
||||
|
||||
impl Entity for PublicKeySignature {
|
||||
fn type_ref() -> TypeRef {
|
||||
TypeRef {
|
||||
app: AppName::Sys,
|
||||
type_id: TypeId::from(2582),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(uniffi::Record, Clone, Serialize, Deserialize)]
|
||||
#[cfg_attr(any(test, feature = "testing"), derive(PartialEq, Debug))]
|
||||
pub struct IdentityKeyGetIn {
|
||||
#[serde(rename = "2591")]
|
||||
pub _format: i64,
|
||||
#[serde(rename = "2592")]
|
||||
pub version: Option<i64>,
|
||||
#[serde(rename = "2593")]
|
||||
pub identifierType: i64,
|
||||
#[serde(rename = "2594")]
|
||||
pub identifier: String,
|
||||
}
|
||||
|
||||
impl Entity for IdentityKeyGetIn {
|
||||
fn type_ref() -> TypeRef {
|
||||
TypeRef {
|
||||
app: AppName::Sys,
|
||||
type_id: TypeId::from(2590),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(uniffi::Record, Clone, Serialize, Deserialize)]
|
||||
#[cfg_attr(any(test, feature = "testing"), derive(PartialEq, Debug))]
|
||||
pub struct IdentityKeyGetOut {
|
||||
#[serde(rename = "2596")]
|
||||
pub _format: i64,
|
||||
#[serde(rename = "2597")]
|
||||
#[serde(with = "serde_bytes")]
|
||||
pub publicIdentityKey: Vec<u8>,
|
||||
#[serde(rename = "2598")]
|
||||
pub publicIdentityKeyVersion: i64,
|
||||
}
|
||||
|
||||
impl Entity for IdentityKeyGetOut {
|
||||
fn type_ref() -> TypeRef {
|
||||
TypeRef {
|
||||
app: AppName::Sys,
|
||||
type_id: TypeId::from(2595),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(uniffi::Record, Clone, Serialize, Deserialize)]
|
||||
#[cfg_attr(any(test, feature = "testing"), derive(PartialEq, Debug))]
|
||||
pub struct IdentityKeyPostIn {
|
||||
#[serde(rename = "2600")]
|
||||
pub _format: i64,
|
||||
#[serde(rename = "2601")]
|
||||
pub identityKeyPair: IdentityKeyPair,
|
||||
#[serde(rename = "2602")]
|
||||
pub signatures: Vec<PublicKeySignature>,
|
||||
}
|
||||
|
||||
impl Entity for IdentityKeyPostIn {
|
||||
fn type_ref() -> TypeRef {
|
||||
TypeRef {
|
||||
app: AppName::Sys,
|
||||
type_id: TypeId::from(2599),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(uniffi::Record, Clone, Serialize, Deserialize)]
|
||||
#[cfg_attr(any(test, feature = "testing"), derive(PartialEq, Debug))]
|
||||
pub struct Rollout {
|
||||
#[serde(rename = "2605")]
|
||||
pub _id: Option<CustomId>,
|
||||
#[serde(rename = "2606")]
|
||||
pub rolloutType: i64,
|
||||
}
|
||||
|
||||
impl Entity for Rollout {
|
||||
fn type_ref() -> TypeRef {
|
||||
TypeRef {
|
||||
app: AppName::Sys,
|
||||
type_id: TypeId::from(2604),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(uniffi::Record, Clone, Serialize, Deserialize)]
|
||||
#[cfg_attr(any(test, feature = "testing"), derive(PartialEq, Debug))]
|
||||
pub struct RolloutGetOut {
|
||||
#[serde(rename = "2608")]
|
||||
pub _format: i64,
|
||||
#[serde(rename = "2609")]
|
||||
pub rollouts: Vec<Rollout>,
|
||||
}
|
||||
|
||||
impl Entity for RolloutGetOut {
|
||||
fn type_ref() -> TypeRef {
|
||||
TypeRef {
|
||||
app: AppName::Sys,
|
||||
type_id: TypeId::from(2607),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3996,3 +3996,41 @@ impl Entity for ResolveConversationsServiceGetOut {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(uniffi::Record, Clone, Serialize, Deserialize)]
|
||||
#[cfg_attr(any(test, feature = "testing"), derive(PartialEq, Debug))]
|
||||
pub struct UserAccountPostOut {
|
||||
#[serde(rename = "1665")]
|
||||
pub _format: i64,
|
||||
#[serde(rename = "1666")]
|
||||
pub userId: GeneratedId,
|
||||
#[serde(rename = "1667")]
|
||||
pub userGroup: GeneratedId,
|
||||
}
|
||||
|
||||
impl Entity for UserAccountPostOut {
|
||||
fn type_ref() -> TypeRef {
|
||||
TypeRef {
|
||||
app: AppName::Tutanota,
|
||||
type_id: TypeId::from(1664),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(uniffi::Record, Clone, Serialize, Deserialize)]
|
||||
#[cfg_attr(any(test, feature = "testing"), derive(PartialEq, Debug))]
|
||||
pub struct MailGroupPostOut {
|
||||
#[serde(rename = "1669")]
|
||||
pub _format: i64,
|
||||
#[serde(rename = "1670")]
|
||||
pub mailGroup: GeneratedId,
|
||||
}
|
||||
|
||||
impl Entity for MailGroupPostOut {
|
||||
fn type_ref() -> TypeRef {
|
||||
TypeRef {
|
||||
app: AppName::Tutanota,
|
||||
type_id: TypeId::from(1668),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1485,7 +1485,9 @@ mod tests {
|
|||
FORMAT_FIELD, ID_FIELD, OWNER_GROUP_FIELD, PERMISSIONS_FIELD,
|
||||
};
|
||||
use crate::entities::generated::sys;
|
||||
use crate::entities::generated::sys::{BucketKey, Group, GroupInfo, InstanceSessionKey};
|
||||
use crate::entities::generated::sys::{
|
||||
BucketKey, Group, GroupInfo, GroupKeysRef, InstanceSessionKey,
|
||||
};
|
||||
use crate::entities::generated::tutanota::{
|
||||
CalendarEventUidIndex, Mail, MailAddress, MailDetailsBlob, MailboxGroupRoot,
|
||||
OutOfOfficeNotification, OutOfOfficeNotificationRecipientList,
|
||||
|
@ -1774,7 +1776,13 @@ mod tests {
|
|||
.resolve_server_type_ref(&sys::PubEncKeyData::type_ref())
|
||||
.unwrap();
|
||||
|
||||
let group = generate_random_group(None, None);
|
||||
let group = generate_random_group(
|
||||
None,
|
||||
GroupKeysRef {
|
||||
_id: Some(CustomId::test_random()),
|
||||
list: GeneratedId::test_random(),
|
||||
},
|
||||
);
|
||||
let result = mapper.serialize_entity(group.clone()).unwrap();
|
||||
assert_eq!(
|
||||
&group.groupInfo,
|
||||
|
|
|
@ -70,7 +70,7 @@ impl KeyLoaderFacade {
|
|||
current_group_key: &VersionedAesKey,
|
||||
target_key_version: u64,
|
||||
) -> Result<FormerGroupKey, KeyLoadError> {
|
||||
let list_id = group.formerGroupKeys.clone().unwrap().list;
|
||||
let list_id = group.formerGroupKeys.clone().list;
|
||||
|
||||
let start_id = CustomId::from_custom_string(¤t_group_key.version.to_string());
|
||||
let amount_of_keys_including_target =
|
||||
|
@ -294,7 +294,7 @@ impl KeyLoaderFacade {
|
|||
if convert_version_to_u64(group.groupKeyVersion) == sym_group_key.version {
|
||||
key_pair = group.currentKeys
|
||||
} else {
|
||||
let former_keys_list = group.formerGroupKeys.unwrap().list;
|
||||
let former_keys_list = group.formerGroupKeys.list;
|
||||
// we load by the version and thus can be sure that we are able to decrypt this key
|
||||
let former_group_key: GroupKey = self
|
||||
.entity_client
|
||||
|
@ -385,7 +385,16 @@ mod tests {
|
|||
}
|
||||
|
||||
fn generate_group_data() -> (Group, VersionedAesKey) {
|
||||
(generate_random_group(None, None), generate_group_key(1))
|
||||
(
|
||||
generate_random_group(
|
||||
None,
|
||||
GroupKeysRef {
|
||||
_id: Some(CustomId::test_random()),
|
||||
list: GeneratedId::test_random(),
|
||||
},
|
||||
),
|
||||
generate_group_key(1),
|
||||
)
|
||||
}
|
||||
|
||||
fn generate_group_with_keys(
|
||||
|
@ -402,6 +411,7 @@ mod tests {
|
|||
symEncPrivEccKey: None,
|
||||
symEncPrivKyberKey: None,
|
||||
symEncPrivRsaKey: None,
|
||||
signature: None,
|
||||
};
|
||||
match current_key_pair {
|
||||
AsymmetricKeyPair::RSAX25519KeyPair(_) => {
|
||||
|
@ -441,10 +451,10 @@ mod tests {
|
|||
|
||||
let mut group = generate_random_group(
|
||||
Some(current_keys),
|
||||
Some(GroupKeysRef {
|
||||
GroupKeysRef {
|
||||
_id: Default::default(),
|
||||
list: GeneratedId("list".to_owned()), // Refers to `former_keys`
|
||||
}),
|
||||
},
|
||||
);
|
||||
group.groupKeyVersion = current_group_key.version as i64;
|
||||
group
|
||||
|
@ -529,6 +539,7 @@ mod tests {
|
|||
.unwrap(),
|
||||
),
|
||||
symEncPrivRsaKey: None,
|
||||
signature: None,
|
||||
}),
|
||||
},
|
||||
);
|
||||
|
@ -559,7 +570,7 @@ mod tests {
|
|||
typed_entity_client_mock
|
||||
.expect_load_range::<GroupKey, CustomId>()
|
||||
.with(
|
||||
predicate::eq(group.formerGroupKeys.unwrap().list),
|
||||
predicate::eq(group.formerGroupKeys.list),
|
||||
predicate::eq(CustomId::from_custom_string(
|
||||
¤t_group_key.version.to_string(),
|
||||
)),
|
||||
|
@ -582,7 +593,13 @@ mod tests {
|
|||
randomizer: &RandomizerFacade,
|
||||
) -> (MockUserFacade, MockTypedEntityClient) {
|
||||
let user_group_key = generate_group_key(0);
|
||||
let user_group = generate_random_group(None, None);
|
||||
let user_group = generate_random_group(
|
||||
None,
|
||||
GroupKeysRef {
|
||||
_id: Some(CustomId::test_random()),
|
||||
list: GeneratedId::test_random(),
|
||||
},
|
||||
);
|
||||
|
||||
let mut user_facade_mock = MockUserFacade::default();
|
||||
{
|
||||
|
|
|
@ -44,6 +44,9 @@ use crate::entities::generated::sys::GiftCardGetReturn;
|
|||
use crate::entities::generated::sys::GiftCardDeleteData;
|
||||
use crate::entities::generated::sys::GroupKeyRotationInfoGetOut;
|
||||
use crate::entities::generated::sys::GroupKeyRotationPostIn;
|
||||
use crate::entities::generated::sys::IdentityKeyPostIn;
|
||||
use crate::entities::generated::sys::IdentityKeyGetIn;
|
||||
use crate::entities::generated::sys::IdentityKeyGetOut;
|
||||
use crate::entities::generated::sys::InvoiceDataGetIn;
|
||||
use crate::entities::generated::sys::InvoiceDataGetOut;
|
||||
use crate::entities::generated::sys::LocationServiceGetReturn;
|
||||
|
@ -76,6 +79,7 @@ use crate::entities::generated::sys::RegistrationServiceData;
|
|||
use crate::entities::generated::sys::RegistrationReturn;
|
||||
use crate::entities::generated::sys::ResetFactorsDeleteData;
|
||||
use crate::entities::generated::sys::ResetPasswordPostIn;
|
||||
use crate::entities::generated::sys::RolloutGetOut;
|
||||
use crate::entities::generated::sys::SaltData;
|
||||
use crate::entities::generated::sys::SaltReturn;
|
||||
use crate::entities::generated::sys::SecondFactorAuthAllowedReturn;
|
||||
|
@ -102,7 +106,7 @@ use crate::entities::generated::sys::VersionData;
|
|||
use crate::entities::generated::sys::VersionReturn;
|
||||
pub struct AdminGroupKeyRotationService;
|
||||
|
||||
crate::service_impl!(declare, AdminGroupKeyRotationService, "sys/admingroupkeyrotationservice", 128);
|
||||
crate::service_impl!(declare, AdminGroupKeyRotationService, "sys/admingroupkeyrotationservice", 129);
|
||||
crate::service_impl!(POST, AdminGroupKeyRotationService, AdminGroupKeyRotationPostIn, ());
|
||||
crate::service_impl!(GET, AdminGroupKeyRotationService, (), AdminGroupKeyRotationGetOut);
|
||||
crate::service_impl!(PUT, AdminGroupKeyRotationService, AdminGroupKeyRotationPutIn, ());
|
||||
|
@ -110,25 +114,25 @@ crate::service_impl!(PUT, AdminGroupKeyRotationService, AdminGroupKeyRotationPut
|
|||
|
||||
pub struct AffiliatePartnerKpiService;
|
||||
|
||||
crate::service_impl!(declare, AffiliatePartnerKpiService, "sys/affiliatepartnerkpiservice", 128);
|
||||
crate::service_impl!(declare, AffiliatePartnerKpiService, "sys/affiliatepartnerkpiservice", 129);
|
||||
crate::service_impl!(GET, AffiliatePartnerKpiService, (), AffiliatePartnerKpiServiceGetOut);
|
||||
|
||||
|
||||
pub struct AlarmService;
|
||||
|
||||
crate::service_impl!(declare, AlarmService, "sys/alarmservice", 128);
|
||||
crate::service_impl!(declare, AlarmService, "sys/alarmservice", 129);
|
||||
crate::service_impl!(POST, AlarmService, AlarmServicePost, ());
|
||||
|
||||
|
||||
pub struct AppStoreSubscriptionService;
|
||||
|
||||
crate::service_impl!(declare, AppStoreSubscriptionService, "sys/appstoresubscriptionservice", 128);
|
||||
crate::service_impl!(declare, AppStoreSubscriptionService, "sys/appstoresubscriptionservice", 129);
|
||||
crate::service_impl!(GET, AppStoreSubscriptionService, AppStoreSubscriptionGetIn, AppStoreSubscriptionGetOut);
|
||||
|
||||
|
||||
pub struct AutoLoginService;
|
||||
|
||||
crate::service_impl!(declare, AutoLoginService, "sys/autologinservice", 128);
|
||||
crate::service_impl!(declare, AutoLoginService, "sys/autologinservice", 129);
|
||||
crate::service_impl!(POST, AutoLoginService, AutoLoginDataReturn, AutoLoginPostReturn);
|
||||
crate::service_impl!(GET, AutoLoginService, AutoLoginDataGet, AutoLoginDataReturn);
|
||||
crate::service_impl!(DELETE, AutoLoginService, AutoLoginDataDelete, ());
|
||||
|
@ -136,7 +140,7 @@ crate::service_impl!(DELETE, AutoLoginService, AutoLoginDataDelete, ());
|
|||
|
||||
pub struct BrandingDomainService;
|
||||
|
||||
crate::service_impl!(declare, BrandingDomainService, "sys/brandingdomainservice", 128);
|
||||
crate::service_impl!(declare, BrandingDomainService, "sys/brandingdomainservice", 129);
|
||||
crate::service_impl!(POST, BrandingDomainService, BrandingDomainData, ());
|
||||
crate::service_impl!(GET, BrandingDomainService, (), BrandingDomainGetReturn);
|
||||
crate::service_impl!(PUT, BrandingDomainService, BrandingDomainData, ());
|
||||
|
@ -145,37 +149,37 @@ crate::service_impl!(DELETE, BrandingDomainService, BrandingDomainDeleteData, ()
|
|||
|
||||
pub struct ChangeKdfService;
|
||||
|
||||
crate::service_impl!(declare, ChangeKdfService, "sys/changekdfservice", 128);
|
||||
crate::service_impl!(declare, ChangeKdfService, "sys/changekdfservice", 129);
|
||||
crate::service_impl!(POST, ChangeKdfService, ChangeKdfPostIn, ());
|
||||
|
||||
|
||||
pub struct ChangePasswordService;
|
||||
|
||||
crate::service_impl!(declare, ChangePasswordService, "sys/changepasswordservice", 128);
|
||||
crate::service_impl!(declare, ChangePasswordService, "sys/changepasswordservice", 129);
|
||||
crate::service_impl!(POST, ChangePasswordService, ChangePasswordPostIn, ());
|
||||
|
||||
|
||||
pub struct CloseSessionService;
|
||||
|
||||
crate::service_impl!(declare, CloseSessionService, "sys/closesessionservice", 128);
|
||||
crate::service_impl!(declare, CloseSessionService, "sys/closesessionservice", 129);
|
||||
crate::service_impl!(POST, CloseSessionService, CloseSessionServicePost, ());
|
||||
|
||||
|
||||
pub struct CreateCustomerServerProperties;
|
||||
|
||||
crate::service_impl!(declare, CreateCustomerServerProperties, "sys/createcustomerserverproperties", 128);
|
||||
crate::service_impl!(declare, CreateCustomerServerProperties, "sys/createcustomerserverproperties", 129);
|
||||
crate::service_impl!(POST, CreateCustomerServerProperties, CreateCustomerServerPropertiesData, CreateCustomerServerPropertiesReturn);
|
||||
|
||||
|
||||
pub struct CustomDomainCheckService;
|
||||
|
||||
crate::service_impl!(declare, CustomDomainCheckService, "sys/customdomaincheckservice", 128);
|
||||
crate::service_impl!(declare, CustomDomainCheckService, "sys/customdomaincheckservice", 129);
|
||||
crate::service_impl!(GET, CustomDomainCheckService, CustomDomainCheckGetIn, CustomDomainCheckGetOut);
|
||||
|
||||
|
||||
pub struct CustomDomainService;
|
||||
|
||||
crate::service_impl!(declare, CustomDomainService, "sys/customdomainservice", 128);
|
||||
crate::service_impl!(declare, CustomDomainService, "sys/customdomainservice", 129);
|
||||
crate::service_impl!(POST, CustomDomainService, CustomDomainData, CustomDomainReturn);
|
||||
crate::service_impl!(PUT, CustomDomainService, CustomDomainData, ());
|
||||
crate::service_impl!(DELETE, CustomDomainService, CustomDomainData, ());
|
||||
|
@ -183,50 +187,50 @@ crate::service_impl!(DELETE, CustomDomainService, CustomDomainData, ());
|
|||
|
||||
pub struct CustomerAccountTerminationService;
|
||||
|
||||
crate::service_impl!(declare, CustomerAccountTerminationService, "sys/customeraccountterminationservice", 128);
|
||||
crate::service_impl!(declare, CustomerAccountTerminationService, "sys/customeraccountterminationservice", 129);
|
||||
crate::service_impl!(POST, CustomerAccountTerminationService, CustomerAccountTerminationPostIn, CustomerAccountTerminationPostOut);
|
||||
|
||||
|
||||
pub struct CustomerPublicKeyService;
|
||||
|
||||
crate::service_impl!(declare, CustomerPublicKeyService, "sys/customerpublickeyservice", 128);
|
||||
crate::service_impl!(declare, CustomerPublicKeyService, "sys/customerpublickeyservice", 129);
|
||||
crate::service_impl!(GET, CustomerPublicKeyService, (), PublicKeyGetOut);
|
||||
|
||||
|
||||
pub struct CustomerService;
|
||||
|
||||
crate::service_impl!(declare, CustomerService, "sys/customerservice", 128);
|
||||
crate::service_impl!(declare, CustomerService, "sys/customerservice", 129);
|
||||
crate::service_impl!(DELETE, CustomerService, DeleteCustomerData, ());
|
||||
|
||||
|
||||
pub struct DebitService;
|
||||
|
||||
crate::service_impl!(declare, DebitService, "sys/debitservice", 128);
|
||||
crate::service_impl!(declare, DebitService, "sys/debitservice", 129);
|
||||
crate::service_impl!(PUT, DebitService, DebitServicePutData, ());
|
||||
|
||||
|
||||
pub struct DomainMailAddressAvailabilityService;
|
||||
|
||||
crate::service_impl!(declare, DomainMailAddressAvailabilityService, "sys/domainmailaddressavailabilityservice", 128);
|
||||
crate::service_impl!(declare, DomainMailAddressAvailabilityService, "sys/domainmailaddressavailabilityservice", 129);
|
||||
crate::service_impl!(GET, DomainMailAddressAvailabilityService, DomainMailAddressAvailabilityData, DomainMailAddressAvailabilityReturn);
|
||||
|
||||
|
||||
pub struct ExternalPropertiesService;
|
||||
|
||||
crate::service_impl!(declare, ExternalPropertiesService, "sys/externalpropertiesservice", 128);
|
||||
crate::service_impl!(declare, ExternalPropertiesService, "sys/externalpropertiesservice", 129);
|
||||
crate::service_impl!(GET, ExternalPropertiesService, (), ExternalPropertiesReturn);
|
||||
|
||||
|
||||
pub struct GiftCardRedeemService;
|
||||
|
||||
crate::service_impl!(declare, GiftCardRedeemService, "sys/giftcardredeemservice", 128);
|
||||
crate::service_impl!(declare, GiftCardRedeemService, "sys/giftcardredeemservice", 129);
|
||||
crate::service_impl!(POST, GiftCardRedeemService, GiftCardRedeemData, ());
|
||||
crate::service_impl!(GET, GiftCardRedeemService, GiftCardRedeemData, GiftCardRedeemGetReturn);
|
||||
|
||||
|
||||
pub struct GiftCardService;
|
||||
|
||||
crate::service_impl!(declare, GiftCardService, "sys/giftcardservice", 128);
|
||||
crate::service_impl!(declare, GiftCardService, "sys/giftcardservice", 129);
|
||||
crate::service_impl!(POST, GiftCardService, GiftCardCreateData, GiftCardCreateReturn);
|
||||
crate::service_impl!(GET, GiftCardService, (), GiftCardGetReturn);
|
||||
crate::service_impl!(DELETE, GiftCardService, GiftCardDeleteData, ());
|
||||
|
@ -234,31 +238,38 @@ crate::service_impl!(DELETE, GiftCardService, GiftCardDeleteData, ());
|
|||
|
||||
pub struct GroupKeyRotationInfoService;
|
||||
|
||||
crate::service_impl!(declare, GroupKeyRotationInfoService, "sys/groupkeyrotationinfoservice", 128);
|
||||
crate::service_impl!(declare, GroupKeyRotationInfoService, "sys/groupkeyrotationinfoservice", 129);
|
||||
crate::service_impl!(GET, GroupKeyRotationInfoService, (), GroupKeyRotationInfoGetOut);
|
||||
|
||||
|
||||
pub struct GroupKeyRotationService;
|
||||
|
||||
crate::service_impl!(declare, GroupKeyRotationService, "sys/groupkeyrotationservice", 128);
|
||||
crate::service_impl!(declare, GroupKeyRotationService, "sys/groupkeyrotationservice", 129);
|
||||
crate::service_impl!(POST, GroupKeyRotationService, GroupKeyRotationPostIn, ());
|
||||
|
||||
|
||||
pub struct IdentityKeyService;
|
||||
|
||||
crate::service_impl!(declare, IdentityKeyService, "sys/identitykeyservice", 129);
|
||||
crate::service_impl!(POST, IdentityKeyService, IdentityKeyPostIn, ());
|
||||
crate::service_impl!(GET, IdentityKeyService, IdentityKeyGetIn, IdentityKeyGetOut);
|
||||
|
||||
|
||||
pub struct InvoiceDataService;
|
||||
|
||||
crate::service_impl!(declare, InvoiceDataService, "sys/invoicedataservice", 128);
|
||||
crate::service_impl!(declare, InvoiceDataService, "sys/invoicedataservice", 129);
|
||||
crate::service_impl!(GET, InvoiceDataService, InvoiceDataGetIn, InvoiceDataGetOut);
|
||||
|
||||
|
||||
pub struct LocationService;
|
||||
|
||||
crate::service_impl!(declare, LocationService, "sys/locationservice", 128);
|
||||
crate::service_impl!(declare, LocationService, "sys/locationservice", 129);
|
||||
crate::service_impl!(GET, LocationService, (), LocationServiceGetReturn);
|
||||
|
||||
|
||||
pub struct MailAddressAliasService;
|
||||
|
||||
crate::service_impl!(declare, MailAddressAliasService, "sys/mailaddressaliasservice", 128);
|
||||
crate::service_impl!(declare, MailAddressAliasService, "sys/mailaddressaliasservice", 129);
|
||||
crate::service_impl!(POST, MailAddressAliasService, MailAddressAliasServiceData, ());
|
||||
crate::service_impl!(GET, MailAddressAliasService, MailAddressAliasGetIn, MailAddressAliasServiceReturn);
|
||||
crate::service_impl!(DELETE, MailAddressAliasService, MailAddressAliasServiceDataDelete, ());
|
||||
|
@ -266,7 +277,7 @@ crate::service_impl!(DELETE, MailAddressAliasService, MailAddressAliasServiceDat
|
|||
|
||||
pub struct MembershipService;
|
||||
|
||||
crate::service_impl!(declare, MembershipService, "sys/membershipservice", 128);
|
||||
crate::service_impl!(declare, MembershipService, "sys/membershipservice", 129);
|
||||
crate::service_impl!(POST, MembershipService, MembershipAddData, ());
|
||||
crate::service_impl!(PUT, MembershipService, MembershipPutIn, ());
|
||||
crate::service_impl!(DELETE, MembershipService, MembershipRemoveData, ());
|
||||
|
@ -274,13 +285,13 @@ crate::service_impl!(DELETE, MembershipService, MembershipRemoveData, ());
|
|||
|
||||
pub struct MultipleMailAddressAvailabilityService;
|
||||
|
||||
crate::service_impl!(declare, MultipleMailAddressAvailabilityService, "sys/multiplemailaddressavailabilityservice", 128);
|
||||
crate::service_impl!(declare, MultipleMailAddressAvailabilityService, "sys/multiplemailaddressavailabilityservice", 129);
|
||||
crate::service_impl!(GET, MultipleMailAddressAvailabilityService, MultipleMailAddressAvailabilityData, MultipleMailAddressAvailabilityReturn);
|
||||
|
||||
|
||||
pub struct PaymentDataService;
|
||||
|
||||
crate::service_impl!(declare, PaymentDataService, "sys/paymentdataservice", 128);
|
||||
crate::service_impl!(declare, PaymentDataService, "sys/paymentdataservice", 129);
|
||||
crate::service_impl!(POST, PaymentDataService, PaymentDataServicePostData, ());
|
||||
crate::service_impl!(GET, PaymentDataService, PaymentDataServiceGetData, PaymentDataServiceGetReturn);
|
||||
crate::service_impl!(PUT, PaymentDataService, PaymentDataServicePutData, PaymentDataServicePutReturn);
|
||||
|
@ -288,71 +299,77 @@ crate::service_impl!(PUT, PaymentDataService, PaymentDataServicePutData, Payment
|
|||
|
||||
pub struct PlanService;
|
||||
|
||||
crate::service_impl!(declare, PlanService, "sys/planservice", 128);
|
||||
crate::service_impl!(declare, PlanService, "sys/planservice", 129);
|
||||
crate::service_impl!(GET, PlanService, (), PlanServiceGetOut);
|
||||
|
||||
|
||||
pub struct PriceService;
|
||||
|
||||
crate::service_impl!(declare, PriceService, "sys/priceservice", 128);
|
||||
crate::service_impl!(declare, PriceService, "sys/priceservice", 129);
|
||||
crate::service_impl!(GET, PriceService, PriceServiceData, PriceServiceReturn);
|
||||
|
||||
|
||||
pub struct PublicKeyService;
|
||||
|
||||
crate::service_impl!(declare, PublicKeyService, "sys/publickeyservice", 128);
|
||||
crate::service_impl!(declare, PublicKeyService, "sys/publickeyservice", 129);
|
||||
crate::service_impl!(GET, PublicKeyService, PublicKeyGetIn, PublicKeyGetOut);
|
||||
crate::service_impl!(PUT, PublicKeyService, PublicKeyPutIn, ());
|
||||
|
||||
|
||||
pub struct ReferralCodeService;
|
||||
|
||||
crate::service_impl!(declare, ReferralCodeService, "sys/referralcodeservice", 128);
|
||||
crate::service_impl!(declare, ReferralCodeService, "sys/referralcodeservice", 129);
|
||||
crate::service_impl!(POST, ReferralCodeService, ReferralCodePostIn, ReferralCodePostOut);
|
||||
crate::service_impl!(GET, ReferralCodeService, ReferralCodeGetIn, ());
|
||||
|
||||
|
||||
pub struct RegistrationCaptchaService;
|
||||
|
||||
crate::service_impl!(declare, RegistrationCaptchaService, "sys/registrationcaptchaservice", 128);
|
||||
crate::service_impl!(declare, RegistrationCaptchaService, "sys/registrationcaptchaservice", 129);
|
||||
crate::service_impl!(POST, RegistrationCaptchaService, RegistrationCaptchaServiceData, ());
|
||||
crate::service_impl!(GET, RegistrationCaptchaService, RegistrationCaptchaServiceGetData, RegistrationCaptchaServiceReturn);
|
||||
|
||||
|
||||
pub struct RegistrationService;
|
||||
|
||||
crate::service_impl!(declare, RegistrationService, "sys/registrationservice", 128);
|
||||
crate::service_impl!(declare, RegistrationService, "sys/registrationservice", 129);
|
||||
crate::service_impl!(POST, RegistrationService, RegistrationServiceData, RegistrationReturn);
|
||||
crate::service_impl!(GET, RegistrationService, (), RegistrationServiceData);
|
||||
|
||||
|
||||
pub struct ResetFactorsService;
|
||||
|
||||
crate::service_impl!(declare, ResetFactorsService, "sys/resetfactorsservice", 128);
|
||||
crate::service_impl!(declare, ResetFactorsService, "sys/resetfactorsservice", 129);
|
||||
crate::service_impl!(DELETE, ResetFactorsService, ResetFactorsDeleteData, ());
|
||||
|
||||
|
||||
pub struct ResetPasswordService;
|
||||
|
||||
crate::service_impl!(declare, ResetPasswordService, "sys/resetpasswordservice", 128);
|
||||
crate::service_impl!(declare, ResetPasswordService, "sys/resetpasswordservice", 129);
|
||||
crate::service_impl!(POST, ResetPasswordService, ResetPasswordPostIn, ());
|
||||
|
||||
|
||||
pub struct RolloutService;
|
||||
|
||||
crate::service_impl!(declare, RolloutService, "sys/rolloutservice", 129);
|
||||
crate::service_impl!(GET, RolloutService, (), RolloutGetOut);
|
||||
|
||||
|
||||
pub struct SaltService;
|
||||
|
||||
crate::service_impl!(declare, SaltService, "sys/saltservice", 128);
|
||||
crate::service_impl!(declare, SaltService, "sys/saltservice", 129);
|
||||
crate::service_impl!(GET, SaltService, SaltData, SaltReturn);
|
||||
|
||||
|
||||
pub struct SecondFactorAuthAllowedService;
|
||||
|
||||
crate::service_impl!(declare, SecondFactorAuthAllowedService, "sys/secondfactorauthallowedservice", 128);
|
||||
crate::service_impl!(declare, SecondFactorAuthAllowedService, "sys/secondfactorauthallowedservice", 129);
|
||||
crate::service_impl!(GET, SecondFactorAuthAllowedService, (), SecondFactorAuthAllowedReturn);
|
||||
|
||||
|
||||
pub struct SecondFactorAuthService;
|
||||
|
||||
crate::service_impl!(declare, SecondFactorAuthService, "sys/secondfactorauthservice", 128);
|
||||
crate::service_impl!(declare, SecondFactorAuthService, "sys/secondfactorauthservice", 129);
|
||||
crate::service_impl!(POST, SecondFactorAuthService, SecondFactorAuthData, ());
|
||||
crate::service_impl!(GET, SecondFactorAuthService, SecondFactorAuthGetData, SecondFactorAuthGetReturn);
|
||||
crate::service_impl!(DELETE, SecondFactorAuthService, SecondFactorAuthDeleteData, ());
|
||||
|
@ -360,77 +377,77 @@ crate::service_impl!(DELETE, SecondFactorAuthService, SecondFactorAuthDeleteData
|
|||
|
||||
pub struct SessionService;
|
||||
|
||||
crate::service_impl!(declare, SessionService, "sys/sessionservice", 128);
|
||||
crate::service_impl!(declare, SessionService, "sys/sessionservice", 129);
|
||||
crate::service_impl!(POST, SessionService, CreateSessionData, CreateSessionReturn);
|
||||
|
||||
|
||||
pub struct SignOrderProcessingAgreementService;
|
||||
|
||||
crate::service_impl!(declare, SignOrderProcessingAgreementService, "sys/signorderprocessingagreementservice", 128);
|
||||
crate::service_impl!(declare, SignOrderProcessingAgreementService, "sys/signorderprocessingagreementservice", 129);
|
||||
crate::service_impl!(POST, SignOrderProcessingAgreementService, SignOrderProcessingAgreementData, ());
|
||||
|
||||
|
||||
pub struct SurveyService;
|
||||
|
||||
crate::service_impl!(declare, SurveyService, "sys/surveyservice", 128);
|
||||
crate::service_impl!(declare, SurveyService, "sys/surveyservice", 129);
|
||||
crate::service_impl!(POST, SurveyService, SurveyDataPostIn, ());
|
||||
|
||||
|
||||
pub struct SwitchAccountTypeService;
|
||||
|
||||
crate::service_impl!(declare, SwitchAccountTypeService, "sys/switchaccounttypeservice", 128);
|
||||
crate::service_impl!(declare, SwitchAccountTypeService, "sys/switchaccounttypeservice", 129);
|
||||
crate::service_impl!(POST, SwitchAccountTypeService, SwitchAccountTypePostIn, ());
|
||||
|
||||
|
||||
pub struct SystemKeysService;
|
||||
|
||||
crate::service_impl!(declare, SystemKeysService, "sys/systemkeysservice", 128);
|
||||
crate::service_impl!(declare, SystemKeysService, "sys/systemkeysservice", 129);
|
||||
crate::service_impl!(GET, SystemKeysService, (), SystemKeysReturn);
|
||||
|
||||
|
||||
pub struct TakeOverDeletedAddressService;
|
||||
|
||||
crate::service_impl!(declare, TakeOverDeletedAddressService, "sys/takeoverdeletedaddressservice", 128);
|
||||
crate::service_impl!(declare, TakeOverDeletedAddressService, "sys/takeoverdeletedaddressservice", 129);
|
||||
crate::service_impl!(POST, TakeOverDeletedAddressService, TakeOverDeletedAddressData, ());
|
||||
|
||||
|
||||
pub struct UpdatePermissionKeyService;
|
||||
|
||||
crate::service_impl!(declare, UpdatePermissionKeyService, "sys/updatepermissionkeyservice", 128);
|
||||
crate::service_impl!(declare, UpdatePermissionKeyService, "sys/updatepermissionkeyservice", 129);
|
||||
crate::service_impl!(POST, UpdatePermissionKeyService, UpdatePermissionKeyData, ());
|
||||
|
||||
|
||||
pub struct UpdateSessionKeysService;
|
||||
|
||||
crate::service_impl!(declare, UpdateSessionKeysService, "sys/updatesessionkeysservice", 128);
|
||||
crate::service_impl!(declare, UpdateSessionKeysService, "sys/updatesessionkeysservice", 129);
|
||||
crate::service_impl!(POST, UpdateSessionKeysService, UpdateSessionKeysPostIn, ());
|
||||
|
||||
|
||||
pub struct UpgradePriceService;
|
||||
|
||||
crate::service_impl!(declare, UpgradePriceService, "sys/upgradepriceservice", 128);
|
||||
crate::service_impl!(declare, UpgradePriceService, "sys/upgradepriceservice", 129);
|
||||
crate::service_impl!(GET, UpgradePriceService, UpgradePriceServiceData, UpgradePriceServiceReturn);
|
||||
|
||||
|
||||
pub struct UserGroupKeyRotationService;
|
||||
|
||||
crate::service_impl!(declare, UserGroupKeyRotationService, "sys/usergroupkeyrotationservice", 128);
|
||||
crate::service_impl!(declare, UserGroupKeyRotationService, "sys/usergroupkeyrotationservice", 129);
|
||||
crate::service_impl!(POST, UserGroupKeyRotationService, UserGroupKeyRotationPostIn, ());
|
||||
|
||||
|
||||
pub struct UserService;
|
||||
|
||||
crate::service_impl!(declare, UserService, "sys/userservice", 128);
|
||||
crate::service_impl!(declare, UserService, "sys/userservice", 129);
|
||||
crate::service_impl!(DELETE, UserService, UserDataDelete, ());
|
||||
|
||||
|
||||
pub struct VerifierTokenService;
|
||||
|
||||
crate::service_impl!(declare, VerifierTokenService, "sys/verifiertokenservice", 128);
|
||||
crate::service_impl!(declare, VerifierTokenService, "sys/verifiertokenservice", 129);
|
||||
crate::service_impl!(POST, VerifierTokenService, VerifierTokenServiceIn, VerifierTokenServiceOut);
|
||||
|
||||
|
||||
pub struct VersionService;
|
||||
|
||||
crate::service_impl!(declare, VersionService, "sys/versionservice", 128);
|
||||
crate::service_impl!(declare, VersionService, "sys/versionservice", 129);
|
||||
crate::service_impl!(GET, VersionService, VersionData, VersionReturn);
|
||||
|
|
|
@ -33,6 +33,7 @@ use crate::entities::generated::tutanota::CreateMailFolderReturn;
|
|||
use crate::entities::generated::tutanota::UpdateMailFolderData;
|
||||
use crate::entities::generated::tutanota::DeleteMailFolderData;
|
||||
use crate::entities::generated::tutanota::CreateMailGroupData;
|
||||
use crate::entities::generated::tutanota::MailGroupPostOut;
|
||||
use crate::entities::generated::tutanota::DeleteGroupData;
|
||||
use crate::entities::generated::tutanota::DeleteMailData;
|
||||
use crate::entities::generated::tutanota::ManageLabelServicePostIn;
|
||||
|
@ -52,60 +53,61 @@ use crate::entities::generated::tutanota::TranslationGetIn;
|
|||
use crate::entities::generated::tutanota::TranslationGetOut;
|
||||
use crate::entities::generated::tutanota::UnreadMailStatePostIn;
|
||||
use crate::entities::generated::tutanota::UserAccountCreateData;
|
||||
use crate::entities::generated::tutanota::UserAccountPostOut;
|
||||
pub struct ApplyLabelService;
|
||||
|
||||
crate::service_impl!(declare, ApplyLabelService, "tutanota/applylabelservice", 87);
|
||||
crate::service_impl!(declare, ApplyLabelService, "tutanota/applylabelservice", 88);
|
||||
crate::service_impl!(POST, ApplyLabelService, ApplyLabelServicePostIn, ());
|
||||
|
||||
|
||||
pub struct CalendarService;
|
||||
|
||||
crate::service_impl!(declare, CalendarService, "tutanota/calendarservice", 87);
|
||||
crate::service_impl!(declare, CalendarService, "tutanota/calendarservice", 88);
|
||||
crate::service_impl!(POST, CalendarService, UserAreaGroupPostData, CreateGroupPostReturn);
|
||||
crate::service_impl!(DELETE, CalendarService, CalendarDeleteData, ());
|
||||
|
||||
|
||||
pub struct ContactListGroupService;
|
||||
|
||||
crate::service_impl!(declare, ContactListGroupService, "tutanota/contactlistgroupservice", 87);
|
||||
crate::service_impl!(declare, ContactListGroupService, "tutanota/contactlistgroupservice", 88);
|
||||
crate::service_impl!(POST, ContactListGroupService, UserAreaGroupPostData, CreateGroupPostReturn);
|
||||
crate::service_impl!(DELETE, ContactListGroupService, UserAreaGroupDeleteData, ());
|
||||
|
||||
|
||||
pub struct CustomerAccountService;
|
||||
|
||||
crate::service_impl!(declare, CustomerAccountService, "tutanota/customeraccountservice", 87);
|
||||
crate::service_impl!(declare, CustomerAccountService, "tutanota/customeraccountservice", 88);
|
||||
crate::service_impl!(POST, CustomerAccountService, CustomerAccountCreateData, ());
|
||||
|
||||
|
||||
pub struct DraftService;
|
||||
|
||||
crate::service_impl!(declare, DraftService, "tutanota/draftservice", 87);
|
||||
crate::service_impl!(declare, DraftService, "tutanota/draftservice", 88);
|
||||
crate::service_impl!(POST, DraftService, DraftCreateData, DraftCreateReturn);
|
||||
crate::service_impl!(PUT, DraftService, DraftUpdateData, DraftUpdateReturn);
|
||||
|
||||
|
||||
pub struct EncryptTutanotaPropertiesService;
|
||||
|
||||
crate::service_impl!(declare, EncryptTutanotaPropertiesService, "tutanota/encrypttutanotapropertiesservice", 87);
|
||||
crate::service_impl!(declare, EncryptTutanotaPropertiesService, "tutanota/encrypttutanotapropertiesservice", 88);
|
||||
crate::service_impl!(POST, EncryptTutanotaPropertiesService, EncryptTutanotaPropertiesData, ());
|
||||
|
||||
|
||||
pub struct EntropyService;
|
||||
|
||||
crate::service_impl!(declare, EntropyService, "tutanota/entropyservice", 87);
|
||||
crate::service_impl!(declare, EntropyService, "tutanota/entropyservice", 88);
|
||||
crate::service_impl!(PUT, EntropyService, EntropyData, ());
|
||||
|
||||
|
||||
pub struct ExternalUserService;
|
||||
|
||||
crate::service_impl!(declare, ExternalUserService, "tutanota/externaluserservice", 87);
|
||||
crate::service_impl!(declare, ExternalUserService, "tutanota/externaluserservice", 88);
|
||||
crate::service_impl!(POST, ExternalUserService, ExternalUserData, ());
|
||||
|
||||
|
||||
pub struct GroupInvitationService;
|
||||
|
||||
crate::service_impl!(declare, GroupInvitationService, "tutanota/groupinvitationservice", 87);
|
||||
crate::service_impl!(declare, GroupInvitationService, "tutanota/groupinvitationservice", 88);
|
||||
crate::service_impl!(POST, GroupInvitationService, GroupInvitationPostData, GroupInvitationPostReturn);
|
||||
crate::service_impl!(PUT, GroupInvitationService, GroupInvitationPutData, ());
|
||||
crate::service_impl!(DELETE, GroupInvitationService, GroupInvitationDeleteData, ());
|
||||
|
@ -113,26 +115,26 @@ crate::service_impl!(DELETE, GroupInvitationService, GroupInvitationDeleteData,
|
|||
|
||||
pub struct ImportMailService;
|
||||
|
||||
crate::service_impl!(declare, ImportMailService, "tutanota/importmailservice", 87);
|
||||
crate::service_impl!(declare, ImportMailService, "tutanota/importmailservice", 88);
|
||||
crate::service_impl!(POST, ImportMailService, ImportMailPostIn, ImportMailPostOut);
|
||||
crate::service_impl!(GET, ImportMailService, ImportMailGetIn, ImportMailGetOut);
|
||||
|
||||
|
||||
pub struct ListUnsubscribeService;
|
||||
|
||||
crate::service_impl!(declare, ListUnsubscribeService, "tutanota/listunsubscribeservice", 87);
|
||||
crate::service_impl!(declare, ListUnsubscribeService, "tutanota/listunsubscribeservice", 88);
|
||||
crate::service_impl!(POST, ListUnsubscribeService, ListUnsubscribeData, ());
|
||||
|
||||
|
||||
pub struct MailExportTokenService;
|
||||
|
||||
crate::service_impl!(declare, MailExportTokenService, "tutanota/mailexporttokenservice", 87);
|
||||
crate::service_impl!(declare, MailExportTokenService, "tutanota/mailexporttokenservice", 88);
|
||||
crate::service_impl!(POST, MailExportTokenService, (), MailExportTokenServicePostOut);
|
||||
|
||||
|
||||
pub struct MailFolderService;
|
||||
|
||||
crate::service_impl!(declare, MailFolderService, "tutanota/mailfolderservice", 87);
|
||||
crate::service_impl!(declare, MailFolderService, "tutanota/mailfolderservice", 88);
|
||||
crate::service_impl!(POST, MailFolderService, CreateMailFolderData, CreateMailFolderReturn);
|
||||
crate::service_impl!(PUT, MailFolderService, UpdateMailFolderData, ());
|
||||
crate::service_impl!(DELETE, MailFolderService, DeleteMailFolderData, ());
|
||||
|
@ -140,87 +142,87 @@ crate::service_impl!(DELETE, MailFolderService, DeleteMailFolderData, ());
|
|||
|
||||
pub struct MailGroupService;
|
||||
|
||||
crate::service_impl!(declare, MailGroupService, "tutanota/mailgroupservice", 87);
|
||||
crate::service_impl!(POST, MailGroupService, CreateMailGroupData, ());
|
||||
crate::service_impl!(declare, MailGroupService, "tutanota/mailgroupservice", 88);
|
||||
crate::service_impl!(POST, MailGroupService, CreateMailGroupData, MailGroupPostOut);
|
||||
crate::service_impl!(DELETE, MailGroupService, DeleteGroupData, ());
|
||||
|
||||
|
||||
pub struct MailService;
|
||||
|
||||
crate::service_impl!(declare, MailService, "tutanota/mailservice", 87);
|
||||
crate::service_impl!(declare, MailService, "tutanota/mailservice", 88);
|
||||
crate::service_impl!(DELETE, MailService, DeleteMailData, ());
|
||||
|
||||
|
||||
pub struct ManageLabelService;
|
||||
|
||||
crate::service_impl!(declare, ManageLabelService, "tutanota/managelabelservice", 87);
|
||||
crate::service_impl!(declare, ManageLabelService, "tutanota/managelabelservice", 88);
|
||||
crate::service_impl!(POST, ManageLabelService, ManageLabelServicePostIn, ());
|
||||
crate::service_impl!(DELETE, ManageLabelService, ManageLabelServiceDeleteIn, ());
|
||||
|
||||
|
||||
pub struct MoveMailService;
|
||||
|
||||
crate::service_impl!(declare, MoveMailService, "tutanota/movemailservice", 87);
|
||||
crate::service_impl!(declare, MoveMailService, "tutanota/movemailservice", 88);
|
||||
crate::service_impl!(POST, MoveMailService, MoveMailData, ());
|
||||
|
||||
|
||||
pub struct NewsService;
|
||||
|
||||
crate::service_impl!(declare, NewsService, "tutanota/newsservice", 87);
|
||||
crate::service_impl!(declare, NewsService, "tutanota/newsservice", 88);
|
||||
crate::service_impl!(POST, NewsService, NewsIn, ());
|
||||
crate::service_impl!(GET, NewsService, (), NewsOut);
|
||||
|
||||
|
||||
pub struct ReceiveInfoService;
|
||||
|
||||
crate::service_impl!(declare, ReceiveInfoService, "tutanota/receiveinfoservice", 87);
|
||||
crate::service_impl!(declare, ReceiveInfoService, "tutanota/receiveinfoservice", 88);
|
||||
crate::service_impl!(POST, ReceiveInfoService, ReceiveInfoServiceData, ReceiveInfoServicePostOut);
|
||||
|
||||
|
||||
pub struct ReportMailService;
|
||||
|
||||
crate::service_impl!(declare, ReportMailService, "tutanota/reportmailservice", 87);
|
||||
crate::service_impl!(declare, ReportMailService, "tutanota/reportmailservice", 88);
|
||||
crate::service_impl!(POST, ReportMailService, ReportMailPostData, ());
|
||||
|
||||
|
||||
pub struct ResolveConversationsService;
|
||||
|
||||
crate::service_impl!(declare, ResolveConversationsService, "tutanota/resolveconversationsservice", 87);
|
||||
crate::service_impl!(declare, ResolveConversationsService, "tutanota/resolveconversationsservice", 88);
|
||||
crate::service_impl!(GET, ResolveConversationsService, ResolveConversationsServiceGetIn, ResolveConversationsServiceGetOut);
|
||||
|
||||
|
||||
pub struct SendDraftService;
|
||||
|
||||
crate::service_impl!(declare, SendDraftService, "tutanota/senddraftservice", 87);
|
||||
crate::service_impl!(declare, SendDraftService, "tutanota/senddraftservice", 88);
|
||||
crate::service_impl!(POST, SendDraftService, SendDraftData, SendDraftReturn);
|
||||
|
||||
|
||||
pub struct SimpleMoveMailService;
|
||||
|
||||
crate::service_impl!(declare, SimpleMoveMailService, "tutanota/simplemovemailservice", 87);
|
||||
crate::service_impl!(declare, SimpleMoveMailService, "tutanota/simplemovemailservice", 88);
|
||||
crate::service_impl!(POST, SimpleMoveMailService, SimpleMoveMailPostIn, ());
|
||||
|
||||
|
||||
pub struct TemplateGroupService;
|
||||
|
||||
crate::service_impl!(declare, TemplateGroupService, "tutanota/templategroupservice", 87);
|
||||
crate::service_impl!(declare, TemplateGroupService, "tutanota/templategroupservice", 88);
|
||||
crate::service_impl!(POST, TemplateGroupService, UserAreaGroupPostData, CreateGroupPostReturn);
|
||||
crate::service_impl!(DELETE, TemplateGroupService, UserAreaGroupDeleteData, ());
|
||||
|
||||
|
||||
pub struct TranslationService;
|
||||
|
||||
crate::service_impl!(declare, TranslationService, "tutanota/translationservice", 87);
|
||||
crate::service_impl!(declare, TranslationService, "tutanota/translationservice", 88);
|
||||
crate::service_impl!(GET, TranslationService, TranslationGetIn, TranslationGetOut);
|
||||
|
||||
|
||||
pub struct UnreadMailStateService;
|
||||
|
||||
crate::service_impl!(declare, UnreadMailStateService, "tutanota/unreadmailstateservice", 87);
|
||||
crate::service_impl!(declare, UnreadMailStateService, "tutanota/unreadmailstateservice", 88);
|
||||
crate::service_impl!(POST, UnreadMailStateService, UnreadMailStatePostIn, ());
|
||||
|
||||
|
||||
pub struct UserAccountService;
|
||||
|
||||
crate::service_impl!(declare, UserAccountService, "tutanota/useraccountservice", 87);
|
||||
crate::service_impl!(POST, UserAccountService, UserAccountCreateData, ());
|
||||
crate::service_impl!(declare, UserAccountService, "tutanota/useraccountservice", 88);
|
||||
crate::service_impl!(POST, UserAccountService, UserAccountCreateData, UserAccountPostOut);
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -40,10 +40,7 @@ pub fn generate_random_string<const SIZE: usize>() -> String {
|
|||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn generate_random_group(
|
||||
current_keys: Option<KeyPair>,
|
||||
former_keys: Option<GroupKeysRef>,
|
||||
) -> Group {
|
||||
pub fn generate_random_group(current_keys: Option<KeyPair>, former_keys: GroupKeysRef) -> Group {
|
||||
let group_id = GeneratedId::test_random();
|
||||
Group {
|
||||
_format: 0,
|
||||
|
@ -90,6 +87,7 @@ pub fn generate_random_group(
|
|||
}),
|
||||
storageCounter: None,
|
||||
user: None,
|
||||
identityKeyPair: None,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
"2146": null,
|
||||
"2145": null,
|
||||
"1": "nS9dTQ",
|
||||
"2147": null
|
||||
"2147": null,
|
||||
"2589": []
|
||||
}
|
||||
],
|
||||
"8": "LIopQQN--R-0",
|
||||
|
@ -34,5 +35,6 @@
|
|||
}
|
||||
],
|
||||
"224": ["O0IlmJn--c-0"],
|
||||
"981": "O0IlmJq----0"
|
||||
"981": "O0IlmJq----0",
|
||||
"2588": []
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue