Skip to content

Commit

Permalink
PR fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ymao1 committed Jul 22, 2021
1 parent 1365d05 commit 7c55cf9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export const getCreateMigration = (
}

context.log.warn(
`Decryption failed for encrypted Saved Object "${encryptedDoc.id}" of type "${encryptedDoc.type}" with error: ${err.message}. Encrypted attributes have been stripped from the original document and migration will be applied but this may cause decryption errors later on.`
`Decryption failed for encrypted Saved Object "${encryptedDoc.id}" of type "${encryptedDoc.type}" with error: ${err.message}. Encrypted attributes have been stripped from the original document and migration will be applied but this may cause errors later on.`
);
return inputService.stripOrDecryptAttributesSync<any>(decryptDescriptor, inputAttributes, {
convertToMultiNamespaceType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ export default function ({ getService }: FtrProviderContext) {
// than what is used in the test. The SOs are from an older Kibana version to ensure that migrations will be applied,

// When the test runs, you will see in the console logs both the decryption error and a warning that the migration will run anyway.
// The test asserts that the alert and action SOs have the new fields expected post-migration but retrieving them via
// getDecryptedAsInternalUser fails (as expected) because the decryption fails.
// The test asserts that the alert and action SOs have the new fields expected post-migration

describe('migrations', () => {
before(async () => {
Expand All @@ -40,9 +39,9 @@ export default function ({ getService }: FtrProviderContext) {

await supertest
.get(
`/api/saved_objects/get-decrypted-as-internal-user/alert/a0d18560-e985-11eb-b1e3-5b27f0de1e72`
`/api/hidden_saved_objects/get-decrypted-as-internal-user/alert/a0d18560-e985-11eb-b1e3-5b27f0de1e72`
)
.expect(500);
.expect(200);

expect(migratedRule.apiKey).to.be(undefined);
expect(migratedRule.notify_when).to.eql('onActiveAlert');
Expand All @@ -54,9 +53,9 @@ export default function ({ getService }: FtrProviderContext) {

await supertest
.get(
`/api/saved_objects/get-decrypted-as-internal-user/action/b9127990-e985-11eb-b1e3-5b27f0de1e72`
`/api/hidden_saved_objects/get-decrypted-as-internal-user/action/b9127990-e985-11eb-b1e3-5b27f0de1e72`
)
.expect(500);
.expect(200);

expect(migratedRule.secrets).to.be(undefined);
expect(migratedConnector.is_missing_secrets).to.eql(false);
Expand Down

0 comments on commit 7c55cf9

Please sign in to comment.