-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…64666) # Backport This will backport the following commits from `main` to `8.10`: - [[Fleet] Add secrets package API integration test (#164583)](#164583) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Jill Guyonnet","email":"jill.guyonnet@elastic.co"},"sourceCommit":{"committedDate":"2023-08-24T07:37:34Z","message":"[Fleet] Add secrets package API integration test (#164583)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/162045\r\n\r\nThis PR adds an API integration test for the following scenario:\r\n- Given an integration with some non secret (plain text) vars that\r\nbecome secret in a newer version;\r\n- When Fleet has an agent policy with this integration and upgrades from\r\nthe old to the newer version;\r\n- Then the vars that have become secrets should correctly be stored as\r\nsecret values.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com>","sha":"766ff8fa614d6b62b750c0eef9c1d129b2187e4f","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v8.10.0","v8.11.0"],"number":164583,"url":"https://github.com/elastic/kibana/pull/164583","mergeCommit":{"message":"[Fleet] Add secrets package API integration test (#164583)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/162045\r\n\r\nThis PR adds an API integration test for the following scenario:\r\n- Given an integration with some non secret (plain text) vars that\r\nbecome secret in a newer version;\r\n- When Fleet has an agent policy with this integration and upgrades from\r\nthe old to the newer version;\r\n- Then the vars that have become secrets should correctly be stored as\r\nsecret values.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com>","sha":"766ff8fa614d6b62b750c0eef9c1d129b2187e4f"}},"sourceBranch":"main","suggestedTargetBranches":["8.10"],"targetPullRequestStates":[{"branch":"8.10","label":"v8.10.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/164583","number":164583,"mergeCommit":{"message":"[Fleet] Add secrets package API integration test (#164583)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/162045\r\n\r\nThis PR adds an API integration test for the following scenario:\r\n- Given an integration with some non secret (plain text) vars that\r\nbecome secret in a newer version;\r\n- When Fleet has an agent policy with this integration and upgrades from\r\nthe old to the newer version;\r\n- Then the vars that have become secrets should correctly be stored as\r\nsecret values.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com>","sha":"766ff8fa614d6b62b750c0eef9c1d129b2187e4f"}}]}] BACKPORT--> Co-authored-by: Jill Guyonnet <jill.guyonnet@elastic.co>
- Loading branch information
1 parent
834fde2
commit 1b81bfb
Showing
12 changed files
with
237 additions
and
12 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
...ation/apis/fixtures/test_packages/secrets/1.0.0/data_stream/log/agent/input/input.yml.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
package_var_secret: {{package_var_secret}} | ||
package_var_non_secret: {{package_var_non_secret}} | ||
input_var_secret: {{input_var_secret}} | ||
input_var_non_secret: {{input_var_non_secret}} |
3 changes: 3 additions & 0 deletions
3
...ion/apis/fixtures/test_packages/secrets/1.0.0/data_stream/log/agent/stream/stream.yml.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
config.version: "2" | ||
package_var_secret: {{package_var_secret}} | ||
package_var_non_secret: {{package_var_non_secret}} | ||
input_var_secret: {{input_var_secret}} | ||
input_var_non_secret: {{input_var_non_secret}} | ||
stream_var_secret: {{stream_var_secret}} | ||
stream_var_non_secret: {{stream_var_non_secret}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...ation/apis/fixtures/test_packages/secrets/1.1.0/data_stream/log/agent/input/input.yml.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package_var_secret: {{package_var_secret}} | ||
package_var_non_secret: {{package_var_non_secret}} | ||
input_var_secret: {{input_var_secret}} | ||
input_var_non_secret: {{input_var_non_secret}} |
7 changes: 7 additions & 0 deletions
7
...ion/apis/fixtures/test_packages/secrets/1.1.0/data_stream/log/agent/stream/stream.yml.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
config.version: "2" | ||
package_var_secret: {{package_var_secret}} | ||
package_var_non_secret: {{package_var_non_secret}} | ||
input_var_secret: {{input_var_secret}} | ||
input_var_non_secret: {{input_var_non_secret}} | ||
stream_var_secret: {{stream_var_secret}} | ||
stream_var_non_secret: {{stream_var_non_secret}} |
16 changes: 16 additions & 0 deletions
16
...i_integration/apis/fixtures/test_packages/secrets/1.1.0/data_stream/log/fields/fields.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
- 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. |
18 changes: 18 additions & 0 deletions
18
...et_api_integration/apis/fixtures/test_packages/secrets/1.1.0/data_stream/log/manifest.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
title: Test stream | ||
type: logs | ||
streams: | ||
- input: test_input | ||
title: test input | ||
vars: | ||
- name: stream_var_secret | ||
type: text | ||
title: Stream Var Secret | ||
multi: false | ||
show_user: true | ||
secret: true | ||
- name: stream_var_non_secret | ||
type: text | ||
title: Stream Var Non Secret | ||
multi: false | ||
show_user: true | ||
secret: true |
3 changes: 3 additions & 0 deletions
3
.../fleet_api_integration/apis/fixtures/test_packages/secrets/1.1.0/docs/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# secrets | ||
|
||
This package has secrets |
7 changes: 7 additions & 0 deletions
7
...st/fleet_api_integration/apis/fixtures/test_packages/secrets/1.1.0/img/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions
64
x-pack/test/fleet_api_integration/apis/fixtures/test_packages/secrets/1.1.0/manifest.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
format_version: 1.0.0 | ||
name: secrets | ||
title: Package with secrets | ||
description: This integration package has 3 secret and 3 non secret vars. | ||
version: 1.1.0 | ||
categories: [] | ||
# Options are experimental, beta, ga | ||
release: beta | ||
# The package type. The options for now are [integration, solution], more type might be added in the future. | ||
# The default type is integration and will be set if empty. | ||
type: integration | ||
license: basic | ||
owner: | ||
github: elastic/fleet | ||
|
||
requirement: | ||
elasticsearch: | ||
versions: ">7.7.0" | ||
kibana: | ||
versions: ">7.7.0" | ||
|
||
icons: | ||
- src: "/img/logo.svg" | ||
size: "16x16" | ||
type: "image/svg+xml" | ||
|
||
vars: | ||
- name: package_var_secret | ||
type: password | ||
title: Package Var Secret | ||
multi: false | ||
required: true | ||
show_user: true | ||
secret: true | ||
- name: package_var_non_secret | ||
type: text | ||
title: Package Var Non Secret | ||
multi: false | ||
required: true | ||
show_user: true | ||
secret: true | ||
policy_templates: | ||
- name: secrets | ||
title: This | ||
description: Test Package for Upgrading Package Policies | ||
inputs: | ||
- type: test_input | ||
title: Test Input | ||
description: Test Input | ||
enabled: true | ||
template_path: input.yml.hbs | ||
vars: | ||
- name: input_var_secret | ||
type: text | ||
title: Input Var Secret | ||
multi: false | ||
show_user: true | ||
secret: true | ||
- name: input_var_non_secret | ||
type: text | ||
title: Input Var Non Secret | ||
multi: false | ||
show_user: true | ||
secret: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters