Skip to content

Commit

Permalink
Update x-pack/plugins/encrypted_saved_objects/server/crypto/encrypted…
Browse files Browse the repository at this point in the history
…_saved_objects_service.ts

Co-authored-by: Aleh Zasypkin <aleh.zasypkin@gmail.com>
  • Loading branch information
jportner and azasypkin committed Jul 29, 2021
1 parent b60a5eb commit 30cd5a0
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -538,9 +538,10 @@ export class EncryptedSavedObjectsService {
// it with several different descriptors depending upon how the migrations are structured, and whether this is a full index
// migration or a single document migration. Note that the originId is set either when the document is converted _or_ when it is
// imported with "createNewCopies: false", so we have to try with and without it.
const ids = params.originId ? [params.originId, descriptor.id] : [descriptor.id];
for (const id of ids) {
const decryptDescriptor = { ...descriptor, id };
const decryptDescriptors = params.originId
? [{ ...descriptor, id: params.originId }, descriptor]
: [descriptor];
for (const decryptDescriptor of decryptDescriptors) {
encryptionAADs.push(this.getAAD(typeDefinition, decryptDescriptor, attributes));
if (descriptor.namespace) {
const { namespace, ...alternateDescriptor } = decryptDescriptor;
Expand Down

0 comments on commit 30cd5a0

Please sign in to comment.