Skip to content

Commit

Permalink
use snake_case
Browse files Browse the repository at this point in the history
  • Loading branch information
Alejandro Fernández Gómez committed Mar 24, 2021
1 parent e34895b commit b9180fc
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const POLICY_KEYS_ORDER = [
'dataset',
'type',
'outputs',
'outputPermissions',
'output_permissions',
'agent',
'inputs',
'enabled',
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/fleet/common/types/models/agent_policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export interface FullAgentPolicy {
[key: string]: any;
};
};
outputPermissions?: {
output_permissions?: {
[output: string]: {
[role: string]: FullAgentPolicyPermission[];
};
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/fleet/server/services/agent_policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -699,8 +699,8 @@ class AgentPolicyService {
};

// Only add permissions if output.type is "elasticsearch"
fullAgentPolicy.outputPermissions = Object.keys(fullAgentPolicy.outputs).reduce<
NonNullable<FullAgentPolicy['outputPermissions']>
fullAgentPolicy.output_permissions = Object.keys(fullAgentPolicy.outputs).reduce<
NonNullable<FullAgentPolicy['output_permissions']>
>((permissions, outputName) => {
const output = fullAgentPolicy.outputs[outputName];
if (output && output.type === 'elasticsearch') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ describe('test agent checkin new action services', () => {
api_key: undefined,
},
},
outputPermissions: {
output_permissions: {
default: { fallback: [] },
},
inputs: [],
Expand Down

0 comments on commit b9180fc

Please sign in to comment.