-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Verify that encryption + entities doesn't break things #668
Comments
I verified that with the "current" entity worker code, it reports an error creating an entity but it doesn't break. But we're going to change up the entity worker (#669) so we ought to re-verify this again after that change (or as part of that change). |
Just checked this. It doesn't break but it does note a problem creating the entity that says: "There was a problem with entity processing: Dataset empty or missing." In the future, we could check for encryption and either not process it or leave a different kind of note that says something like "Entities on encrypted submissions are not supported." Here's a test (not included in the code) that sets up this encryption scenario. it.only('should do something reasonable when processing an encrypted submission', testService(async (service, container) => {
// eslint-disable-next-line import/no-dynamic-require
const { extractPubkey, extractVersion, sendEncrypted } = require(appRoot + '/test/util/crypto-odk');
const asAlice = await service.login('alice', identity);
await asAlice.post('/v1/projects/1/forms?publish=true')
.send(testData.forms.simpleEntity)
.set('Content-Type', 'application/xml')
.expect(200);
await asAlice.post('/v1/projects/1/key')
.send({ passphrase: 'supersecret', hint: 'it is a secret' })
.expect(200);
await asAlice.get('/v1/projects/1/forms/simpleEntity.xml')
.expect(200)
.then(({ text }) => sendEncrypted(asAlice, extractVersion(text), extractPubkey(text)))
.then((send) => send(testData.instances.simpleEntity.one));
await asAlice.patch('/v1/projects/1/forms/simpleEntity/submissions/one')
.send({ reviewState: 'approved' })
.expect(200);
await exhaust(container);
const createEvent = await container.Audits.getLatestByAction('entity.create');
const errorEvent = await container.Audits.getLatestByAction('entity.create.error');
// eslint-disable-next-line no-console
console.log(errorEvent);
createEvent.isEmpty().should.equal(true);
errorEvent.isEmpty().should.equal(true); // currently this assertion fails - there IS an error event
})); |
Putting this in a future issue #698 and closing this one. |
From Matt:
The text was updated successfully, but these errors were encountered: