Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
Binary file added .buildkite/.DS_Store
Comment thread
Supplementing marked this conversation as resolved.
Outdated
Binary file not shown.
Binary file added .github/.DS_Store
Binary file not shown.
Binary file added code/.DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions code/go/pkg/validator/validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func TestValidateFile(t *testing.T) {
"good_v2": {},
"good_v3": {},
"good_var_groups": {},
"good_var_groups_input": {},
"good_input": {},
"good_input_otel": {},
"good_input_dynamic_signal_type": {},
Expand Down
Binary file added compliance/.DS_Store
Binary file not shown.
Binary file added spec/.DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions spec/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
- description: Add var_groups schema to support conditional variable groups for Cloud Connector integration.
type: enhancement
link: https://github.com/elastic/package-spec/issues/1054
- description: Add var_groups support to policy template and input levels in integration packages, and to policy template and package root levels in input packages.
type: enhancement
link: https://github.com/elastic/package-spec/pull/PLACEHOLDER
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
- description: Allow to set time series index mode in input packages.
type: enhancement
link: https://github.com/elastic/package-spec/pull/1066
Expand Down
8 changes: 8 additions & 0 deletions spec/input/manifest.spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ spec:
$ref: "../integration/manifest.spec.yml#/definitions/screenshots"
vars:
$ref: "../integration/data_stream/manifest.spec.yml#/definitions/vars"
var_groups:
$ref: "../integration/manifest.spec.yml#/definitions/var_groups"
Comment thread
Supplementing marked this conversation as resolved.
input:
type: string
examples:
Expand Down Expand Up @@ -138,6 +140,8 @@ spec:
$ref: "../integration/manifest.spec.yml#/definitions/screenshots"
vars:
$ref: "../integration/data_stream/manifest.spec.yml#/definitions/vars"
var_groups:
$ref: "../integration/manifest.spec.yml#/definitions/var_groups"
owner:
$ref: "../integration/manifest.spec.yml#/definitions/owner"
agent:
Expand Down Expand Up @@ -166,6 +170,10 @@ spec:
versions:
- before: 3.6.0
patch:
- op: remove
path: "/properties/var_groups" # removes var_groups from package root
- op: remove
path: "/properties/policy_templates/items/properties/var_groups" # removes var_groups from policy templates
- op: remove
path: "/properties/policy_templates/items/properties/template_paths" # removes template_paths field for policy templates
- op: remove
Expand Down
8 changes: 8 additions & 0 deletions spec/integration/manifest.spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,8 @@ spec:
$ref: "./data_stream/manifest.spec.yml#/definitions/required_vars"
vars:
$ref: "./data_stream/manifest.spec.yml#/definitions/vars"
var_groups:
$ref: "#/definitions/var_groups"
Comment thread
mrodm marked this conversation as resolved.
dynamic_signal_types:
$ref: "#/definitions/dynamic_signal_types"
deprecated:
Expand Down Expand Up @@ -859,6 +861,8 @@ spec:
$ref: "#/definitions/screenshots"
vars:
$ref: "./data_stream/manifest.spec.yml#/definitions/vars"
var_groups:
$ref: "#/definitions/var_groups"
deprecated:
$ref: "#/definitions/deprecated"
required:
Expand Down Expand Up @@ -974,6 +978,10 @@ versions:
path: "/definitions/var_groups"
- op: remove
path: "/properties/var_groups"
- op: remove
path: "/properties/policy_templates/items/properties/var_groups"
- op: remove
path: "/properties/policy_templates/items/properties/inputs/items/properties/var_groups"
- op: remove
path: "/properties/policy_templates/items/properties/inputs/items/properties/hide_in_var_group_options"
# Input migration.
Expand Down
Binary file added test/.DS_Store
Binary file not shown.
52 changes: 52 additions & 0 deletions test/packages/good_var_groups/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,35 @@ policy_templates:
description: Collect sample logs and metrics
data_streams:
- findings
vars:
- name: username
type: text
title: Username
show_user: true
- name: password
type: password
title: Password
show_user: true
secret: true
- name: token
type: password
title: API Token
show_user: true
secret: true
var_groups:
- name: auth_method
title: Authentication Method
selector_title: Authentication method
options:
- name: basic
title: Basic Auth
vars:
- username
- password
- name: token
title: Token Auth
vars:
- token
inputs:
- type: httpjson
title: Collect via API
Expand All @@ -98,6 +127,29 @@ policy_templates:
title: API URL
show_user: true
required: true
- name: bearer_token
type: password
title: Bearer Token
show_user: true
secret: true
- name: api_key
type: password
title: API Key
show_user: true
secret: true
var_groups:
- name: auth_method
title: Authentication
selector_title: Authentication method
options:
- name: bearer
title: Bearer Token
vars:
- bearer_token
- name: api_key
title: API Key
vars:
- api_key
- type: aws-s3
title: Collect from S3
description: Collecting logs from AWS S3 bucket
Expand Down
1 change: 1 addition & 0 deletions test/packages/good_var_groups_input/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Apache License 2.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
data_stream:
dataset: {{data_stream.dataset}}
paths:
{{#each paths as |path i|}}
- {{path}}
{{/each}}
exclude_files: [".gz$"]
processors:
- add_locale: ~
6 changes: 6 additions & 0 deletions test/packages/good_var_groups_input/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# newer versions go on top
- version: "0.0.1"
changes:
- description: Initial draft of the package
type: enhancement
link: https://github.com/elastic/integrations/pull/1
3 changes: 3 additions & 0 deletions test/packages/good_var_groups_input/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Good Var Groups Input Package

This is a test package demonstrating valid `var_groups` usage in an input package at the package root and policy template levels.
12 changes: 12 additions & 0 deletions test/packages/good_var_groups_input/fields/base-fields.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
- name: data_stream.type
type: constant_keyword
description: Data stream type.
- name: data_stream.dataset
type: constant_keyword
description: Data stream dataset.
- name: data_stream.namespace
type: constant_keyword
description: Data stream namespace.
- name: '@timestamp'
type: date
description: Event timestamp.
1 change: 1 addition & 0 deletions test/packages/good_var_groups_input/img/sample-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
86 changes: 86 additions & 0 deletions test/packages/good_var_groups_input/manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
format_version: 3.6.0
name: good_var_groups_input
title: Good Var Groups Input Package
description: This package demonstrates valid var_groups usage in an input package.
version: 0.0.1
type: input
source:
license: "Apache-2.0"
conditions:
kibana:
version: "^8.10.0"
elastic:
subscription: "basic"
icons:
- src: /img/sample-logo.svg
title: Sample logo
size: 32x32
type: image/svg+xml
vars:
- name: access_key
type: text
title: Access Key
show_user: true
secret: false
- name: secret_key
type: password
title: Secret Key
show_user: true
secret: true
- name: iam_role
type: text
title: IAM Role ARN
show_user: true
var_groups:
- name: credential_type
title: Credential Type
selector_title: Preferred method
options:
- name: access_key
title: Access Key
vars:
- access_key
- secret_key
- name: iam_role
title: IAM Role
vars:
- iam_role
policy_templates:
- name: logs
type: logs
title: Logs
description: Collect logs.
input: logfile
template_path: input.yml.hbs
vars:
- name: username
type: text
title: Username
show_user: true
- name: password
type: password
title: Password
show_user: true
secret: true
- name: token
type: password
title: API Token
show_user: true
secret: true
var_groups:
- name: auth_method
title: Authentication Method
selector_title: Authentication method
options:
- name: basic
title: Basic Auth
vars:
- username
- password
- name: token
title: Token Auth
vars:
- token
owner:
github: elastic/ecosystem
type: elastic