Skip to content

Commit

Permalink
[EDR Workflows] Change Osquery shards schema (#166178)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomsonpl authored Sep 12, 2023
1 parent 982b2c8 commit fb5f8e3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const createPackRequestBodySchema = t.type({
description: t.union([t.string, t.undefined]),
enabled: t.union([t.boolean, t.undefined]),
policy_ids: t.union([t.array(t.string), t.undefined]),
shards: t.record(t.string, toNumberRt),
shards: t.union([t.record(t.string, toNumberRt), t.undefined]),
queries: t.record(
t.string,
t.type({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const createPackRoute = (router: IRouter, osqueryContext: OsqueryAppConte
const currentUser = await osqueryContext.security.authc.getCurrentUser(request)?.username;

// eslint-disable-next-line @typescript-eslint/naming-convention
const { name, description, queries, enabled, policy_ids, shards } = request.body;
const { name, description, queries, enabled, policy_ids, shards = {} } = request.body;
const conflictingEntries = await savedObjectsClient.find({
type: packSavedObjectType,
filter: `${packSavedObjectType}.attributes.name: "${name}"`,
Expand Down

0 comments on commit fb5f8e3

Please sign in to comment.