[Fleet] Fix frozen key definition (#99232)

* [Fleet] Fix frozen key definition

* Add integration test for frozen vars
This commit is contained in:
Zacqary Adam Xeper 2021-05-04 17:24:11 -05:00 committed by GitHub
parent ed8dc62f77
commit a72b0393f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 0 deletions

View file

@ -24,6 +24,7 @@ const ConfigRecordSchema = schema.recordOf(
schema.object({
type: schema.maybe(schema.string()),
value: schema.maybe(schema.any()),
frozen: schema.maybe(schema.boolean()),
})
);

View file

@ -174,5 +174,42 @@ export default function (providerContext: FtrProviderContext) {
})
.expect(500);
});
it('should work with frozen input vars', async function () {
await supertest
.put(`/api/fleet/package_policies/${packagePolicyId}`)
.set('kbn-xsrf', 'xxxx')
.send({
name: 'filetest-1',
description: '',
namespace: 'updated_namespace',
policy_id: agentPolicyId,
enabled: true,
output_id: '',
inputs: [
{
enabled: true,
type: 'test-input',
streams: [],
vars: {
frozen_var: {
type: 'text',
value: 'abc',
frozen: true,
},
unfrozen_var: {
type: 'text',
value: 'def',
},
},
},
],
package: {
name: 'filetest',
title: 'For File Tests',
version: '0.1.0',
},
});
});
});
}