From 1e3c65bd01b31dbae78a901cb30554c4bdec52ba Mon Sep 17 00:00:00 2001 From: criamico Date: Thu, 12 Dec 2024 09:48:06 +0100 Subject: [PATCH 01/14] Expand configuration_links to support internal/external links --- spec/changelog.yml | 3 +++ spec/integration/manifest.spec.yml | 8 ++++++ .../bad_configuration_links/manifest.yml | 11 ++++++++ test/packages/good_v3/manifest.yml | 14 ++++++++++- .../kibana_configuration_links/changelog.yml | 5 ++++ .../kibana_configuration_links/manifest.yml | 25 ++++++++++++++++--- 6 files changed, 61 insertions(+), 5 deletions(-) diff --git a/spec/changelog.yml b/spec/changelog.yml index c646e179..ac6ce79d 100644 --- a/spec/changelog.yml +++ b/spec/changelog.yml @@ -21,6 +21,9 @@ - description: Add support for configuration links to kibana manifest. type: enhancement link: https://github.com/elastic/package-spec/pull/834 + - description: Expand support to internal and external configuration_links defined in kibana manifest. + type: enhancement + link: https://github.com/elastic/package-spec/pull/ - version: 3.3.0 changes: - description: Add support for content packages. diff --git a/spec/integration/manifest.spec.yml b/spec/integration/manifest.spec.yml index ded75c23..cf39a4f9 100644 --- a/spec/integration/manifest.spec.yml +++ b/spec/integration/manifest.spec.yml @@ -225,13 +225,21 @@ spec: enum: - action - next_step + appId: + description: The identifier of the Kibana app to navigate to. Set this field when `internal` is true. + type: string content: description: Link description type: string + internal: + description: Set to true for internal kibana links, false for external links. Defaults to false. + type: boolean + default: false required: - title - url - type + - internal icons: description: List of icons for by this package. type: array diff --git a/test/packages/bad_configuration_links/manifest.yml b/test/packages/bad_configuration_links/manifest.yml index 484c23d9..b27047d3 100644 --- a/test/packages/bad_configuration_links/manifest.yml +++ b/test/packages/bad_configuration_links/manifest.yml @@ -83,6 +83,17 @@ policy_templates: configuration_links: - title: Security overview type: next_step + # bad format: missing field `internal` + - title: View Agents + url: "/agents" + type: next_step + content: "Check your agents in Fleet" + appId: "fleet" + # bad format: `internal: false` should match http or https format + - title: View Agents + url: "/agents" + type: next_step + internal: false inputs: - type: apache/metrics title: Collect metrics in agentless diff --git a/test/packages/good_v3/manifest.yml b/test/packages/good_v3/manifest.yml index 14519231..95d0e09d 100644 --- a/test/packages/good_v3/manifest.yml +++ b/test/packages/good_v3/manifest.yml @@ -41,9 +41,21 @@ policy_templates: team: obs-infraobs-integrations configuration_links: - title: Security overview - url: "/security/overview" + url: "/overview" type: next_step content: "View security overview" + appId: "security" + internal: true + - title: Elastic website + url: "https://www.elastic.co/" + type: action + content: "See more" + internal: false + - title: Configure fleet + url: "https://www.elastic.co/guide/en/fleet/master/fleet-overview.html" + type: next_step + content: "See docs" + internal: false inputs: - type: apache/metrics title: Collect metrics from Apache instances diff --git a/test/packages/kibana_configuration_links/changelog.yml b/test/packages/kibana_configuration_links/changelog.yml index b87e1020..55b9948c 100644 --- a/test/packages/kibana_configuration_links/changelog.yml +++ b/test/packages/kibana_configuration_links/changelog.yml @@ -1,3 +1,8 @@ +- version: 1.0.2 + changes: + - description: Expand kibana configuration links + type: enhancement + link: https://github.com/elastic/package-spec/pull/ - version: 1.0.1 changes: - description: Add kibana configuration links diff --git a/test/packages/kibana_configuration_links/manifest.yml b/test/packages/kibana_configuration_links/manifest.yml index 11703ad7..1112587d 100644 --- a/test/packages/kibana_configuration_links/manifest.yml +++ b/test/packages/kibana_configuration_links/manifest.yml @@ -2,7 +2,7 @@ format_version: 3.3.1 name: kibana_configuration_links title: Kibana Configuration Links description: Kibana configuration links examples -version: 1.0.1 +version: 1.0.2 type: integration source: license: "Apache-2.0" @@ -40,10 +40,27 @@ policy_templates: division: observability team: obs-infraobs-integrations configuration_links: - - title: Security overview - url: "/security/overview" + - title: View Agents + url: "/agents" type: next_step - content: "View security overview" + content: "Check your agents in Fleet" + appId: "fleet" + internal: true + - title: Fleet + url: "/browse" + type: action + appId: "integrations" + internal: true + - title: Elastic website + url: "https://www.elastic.co/" + type: action + content: "See more" + internal: false + - title: Configure fleet + url: "https://www.elastic.co/guide/en/fleet/master/fleet-overview.html" + type: next_step + content: "See docs" + internal: false inputs: - type: apache/metrics title: Collect metrics from Apache instances From 54ff32bfe6389a28188084261fb4c92c232dcfbd Mon Sep 17 00:00:00 2001 From: criamico Date: Thu, 12 Dec 2024 09:58:30 +0100 Subject: [PATCH 02/14] Fix changelogs and improve tests --- spec/changelog.yml | 2 +- test/packages/good_v3/manifest.yml | 8 ++++---- test/packages/kibana_configuration_links/changelog.yml | 2 +- test/packages/kibana_configuration_links/manifest.yml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spec/changelog.yml b/spec/changelog.yml index ac6ce79d..9bf744a9 100644 --- a/spec/changelog.yml +++ b/spec/changelog.yml @@ -23,7 +23,7 @@ link: https://github.com/elastic/package-spec/pull/834 - description: Expand support to internal and external configuration_links defined in kibana manifest. type: enhancement - link: https://github.com/elastic/package-spec/pull/ + link: https://github.com/elastic/package-spec/pull/844 - version: 3.3.0 changes: - description: Add support for content packages. diff --git a/test/packages/good_v3/manifest.yml b/test/packages/good_v3/manifest.yml index 95d0e09d..62d4ac54 100644 --- a/test/packages/good_v3/manifest.yml +++ b/test/packages/good_v3/manifest.yml @@ -40,11 +40,11 @@ policy_templates: division: observability team: obs-infraobs-integrations configuration_links: - - title: Security overview - url: "/overview" + - title: View Agents + url: "/agents" type: next_step - content: "View security overview" - appId: "security" + content: "Check your agents in Fleet" + appId: "fleet" internal: true - title: Elastic website url: "https://www.elastic.co/" diff --git a/test/packages/kibana_configuration_links/changelog.yml b/test/packages/kibana_configuration_links/changelog.yml index 55b9948c..91ac5a3f 100644 --- a/test/packages/kibana_configuration_links/changelog.yml +++ b/test/packages/kibana_configuration_links/changelog.yml @@ -2,7 +2,7 @@ changes: - description: Expand kibana configuration links type: enhancement - link: https://github.com/elastic/package-spec/pull/ + link: https://github.com/elastic/package-spec/pull/844 - version: 1.0.1 changes: - description: Add kibana configuration links diff --git a/test/packages/kibana_configuration_links/manifest.yml b/test/packages/kibana_configuration_links/manifest.yml index 1112587d..e54d13b3 100644 --- a/test/packages/kibana_configuration_links/manifest.yml +++ b/test/packages/kibana_configuration_links/manifest.yml @@ -46,7 +46,7 @@ policy_templates: content: "Check your agents in Fleet" appId: "fleet" internal: true - - title: Fleet + - title: Browse integrations url: "/browse" type: action appId: "integrations" From 03267288fddfe03e29f873301571f7af3e164d61 Mon Sep 17 00:00:00 2001 From: criamico Date: Thu, 12 Dec 2024 10:12:55 +0100 Subject: [PATCH 03/14] Fix tests --- code/go/pkg/validator/validator_test.go | 1 + test/packages/bad_configuration_links/manifest.yml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/code/go/pkg/validator/validator_test.go b/code/go/pkg/validator/validator_test.go index ad100e1f..a8fb81a0 100644 --- a/code/go/pkg/validator/validator_test.go +++ b/code/go/pkg/validator/validator_test.go @@ -245,6 +245,7 @@ func TestValidateFile(t *testing.T) { []string{ "field policy_templates.0.configuration_links: Array must have at least 1 items", "field policy_templates.1.configuration_links.0: url is required", + "field policy_templates.1.configuration_links.0: internal is required", }, }, } diff --git a/test/packages/bad_configuration_links/manifest.yml b/test/packages/bad_configuration_links/manifest.yml index b27047d3..528be3fe 100644 --- a/test/packages/bad_configuration_links/manifest.yml +++ b/test/packages/bad_configuration_links/manifest.yml @@ -79,10 +79,11 @@ policy_templates: organization: security division: engineering team: cloud-security - # bad format: missing fields configuration_links: + # bad format: missing field url - title: Security overview type: next_step + internal: true # bad format: missing field `internal` - title: View Agents url: "/agents" From e258a248451cf710c5c019b83499d18c2d5d4775 Mon Sep 17 00:00:00 2001 From: criamico Date: Thu, 12 Dec 2024 10:44:36 +0100 Subject: [PATCH 04/14] Fix test again --- code/go/pkg/validator/validator_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/go/pkg/validator/validator_test.go b/code/go/pkg/validator/validator_test.go index a8fb81a0..23691bb2 100644 --- a/code/go/pkg/validator/validator_test.go +++ b/code/go/pkg/validator/validator_test.go @@ -245,7 +245,7 @@ func TestValidateFile(t *testing.T) { []string{ "field policy_templates.0.configuration_links: Array must have at least 1 items", "field policy_templates.1.configuration_links.0: url is required", - "field policy_templates.1.configuration_links.0: internal is required", + "field policy_templates.1.configuration_links.1: internal is required", }, }, } From 678fa4b6f9499d178893531a196fba5aeb7608cc Mon Sep 17 00:00:00 2001 From: criamico Date: Thu, 12 Dec 2024 15:17:05 +0100 Subject: [PATCH 05/14] Use kbn: format instead of additional fields --- code/go/pkg/validator/validator_test.go | 1 - spec/integration/manifest.spec.yml | 15 ++++++--------- .../packages/bad_configuration_links/manifest.yml | 11 ++++------- test/packages/good_v3/manifest.yml | 12 ++++-------- 4 files changed, 14 insertions(+), 25 deletions(-) diff --git a/code/go/pkg/validator/validator_test.go b/code/go/pkg/validator/validator_test.go index 23691bb2..ad100e1f 100644 --- a/code/go/pkg/validator/validator_test.go +++ b/code/go/pkg/validator/validator_test.go @@ -245,7 +245,6 @@ func TestValidateFile(t *testing.T) { []string{ "field policy_templates.0.configuration_links: Array must have at least 1 items", "field policy_templates.1.configuration_links.0: url is required", - "field policy_templates.1.configuration_links.1: internal is required", }, }, } diff --git a/spec/integration/manifest.spec.yml b/spec/integration/manifest.spec.yml index cf39a4f9..c89a1b01 100644 --- a/spec/integration/manifest.spec.yml +++ b/spec/integration/manifest.spec.yml @@ -217,29 +217,26 @@ spec: description: Link title type: string url: - description: Link url + description: Link url. Format is `http://...` or `https://...` for external links, `kbn:app/...` for links internal to Kibana. type: string + oneOf: + - type: string + pattern: '^http(s)?://' + - type: string + pattern: '^kbn:' type: description: Type of link. `next_steps` for links to locations that can be relevant right after configuring the policy. `action` for actions that can be performed while the policy is in use. type: string enum: - action - next_step - appId: - description: The identifier of the Kibana app to navigate to. Set this field when `internal` is true. - type: string content: description: Link description type: string - internal: - description: Set to true for internal kibana links, false for external links. Defaults to false. - type: boolean - default: false required: - title - url - type - - internal icons: description: List of icons for by this package. type: array diff --git a/test/packages/bad_configuration_links/manifest.yml b/test/packages/bad_configuration_links/manifest.yml index 528be3fe..6c43845d 100644 --- a/test/packages/bad_configuration_links/manifest.yml +++ b/test/packages/bad_configuration_links/manifest.yml @@ -84,17 +84,14 @@ policy_templates: - title: Security overview type: next_step internal: true - # bad format: missing field `internal` + # bad format: doesn't match format kbn:/.. - title: View Agents - url: "/agents" + url: "app/fleet/agents" type: next_step - content: "Check your agents in Fleet" - appId: "fleet" - # bad format: `internal: false` should match http or https format + # bad format: it should match either http/https format or kbn: format - title: View Agents - url: "/agents" + url: "elastic.co" type: next_step - internal: false inputs: - type: apache/metrics title: Collect metrics in agentless diff --git a/test/packages/good_v3/manifest.yml b/test/packages/good_v3/manifest.yml index 62d4ac54..42997c25 100644 --- a/test/packages/good_v3/manifest.yml +++ b/test/packages/good_v3/manifest.yml @@ -41,21 +41,17 @@ policy_templates: team: obs-infraobs-integrations configuration_links: - title: View Agents - url: "/agents" + url: "kbn:app/fleet/agents" type: next_step content: "Check your agents in Fleet" - appId: "fleet" - internal: true - title: Elastic website url: "https://www.elastic.co/" type: action content: "See more" - internal: false - - title: Configure fleet - url: "https://www.elastic.co/guide/en/fleet/master/fleet-overview.html" + - title: See agents + url: "http://localhost:5601/app/fleet/agents" type: next_step - content: "See docs" - internal: false + description: Example of http link inputs: - type: apache/metrics title: Collect metrics from Apache instances From d1ee4b14e8017018f6ad01bd042643c6c0accd8a Mon Sep 17 00:00:00 2001 From: criamico Date: Thu, 12 Dec 2024 15:27:09 +0100 Subject: [PATCH 06/14] fix tests --- code/go/pkg/validator/validator_test.go | 2 ++ .../packages/bad_configuration_links/manifest.yml | 1 - test/packages/good_v3/manifest.yml | 1 - .../kibana_configuration_links/manifest.yml | 15 ++++----------- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/code/go/pkg/validator/validator_test.go b/code/go/pkg/validator/validator_test.go index ad100e1f..8f614111 100644 --- a/code/go/pkg/validator/validator_test.go +++ b/code/go/pkg/validator/validator_test.go @@ -245,6 +245,8 @@ func TestValidateFile(t *testing.T) { []string{ "field policy_templates.0.configuration_links: Array must have at least 1 items", "field policy_templates.1.configuration_links.0: url is required", + "field policy_templates.1.configuration_links.1.url: Does not match pattern '^http(s)?://'", + "field policy_templates.1.configuration_links.2.url: Does not match pattern '^http(s)?://" }, }, } diff --git a/test/packages/bad_configuration_links/manifest.yml b/test/packages/bad_configuration_links/manifest.yml index 6c43845d..961db010 100644 --- a/test/packages/bad_configuration_links/manifest.yml +++ b/test/packages/bad_configuration_links/manifest.yml @@ -83,7 +83,6 @@ policy_templates: # bad format: missing field url - title: Security overview type: next_step - internal: true # bad format: doesn't match format kbn:/.. - title: View Agents url: "app/fleet/agents" diff --git a/test/packages/good_v3/manifest.yml b/test/packages/good_v3/manifest.yml index 42997c25..263f02b7 100644 --- a/test/packages/good_v3/manifest.yml +++ b/test/packages/good_v3/manifest.yml @@ -51,7 +51,6 @@ policy_templates: - title: See agents url: "http://localhost:5601/app/fleet/agents" type: next_step - description: Example of http link inputs: - type: apache/metrics title: Collect metrics from Apache instances diff --git a/test/packages/kibana_configuration_links/manifest.yml b/test/packages/kibana_configuration_links/manifest.yml index e54d13b3..2358c382 100644 --- a/test/packages/kibana_configuration_links/manifest.yml +++ b/test/packages/kibana_configuration_links/manifest.yml @@ -41,26 +41,19 @@ policy_templates: team: obs-infraobs-integrations configuration_links: - title: View Agents - url: "/agents" + url: "kbn:app/fleet/agents" type: next_step content: "Check your agents in Fleet" - appId: "fleet" - internal: true - title: Browse integrations - url: "/browse" + url: "kbn:app/integrations/browse" type: action - appId: "integrations" - internal: true - title: Elastic website url: "https://www.elastic.co/" type: action content: "See more" - internal: false - - title: Configure fleet - url: "https://www.elastic.co/guide/en/fleet/master/fleet-overview.html" + - title: See agents + url: "http://localhost:5601/app/fleet/agents" type: next_step - content: "See docs" - internal: false inputs: - type: apache/metrics title: Collect metrics from Apache instances From f5cc7b1e03a3cab4157ee43a94f93311d1481e74 Mon Sep 17 00:00:00 2001 From: criamico Date: Thu, 12 Dec 2024 15:43:55 +0100 Subject: [PATCH 07/14] fix missing comma --- code/go/pkg/validator/validator_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/go/pkg/validator/validator_test.go b/code/go/pkg/validator/validator_test.go index 8f614111..2add0381 100644 --- a/code/go/pkg/validator/validator_test.go +++ b/code/go/pkg/validator/validator_test.go @@ -246,7 +246,7 @@ func TestValidateFile(t *testing.T) { "field policy_templates.0.configuration_links: Array must have at least 1 items", "field policy_templates.1.configuration_links.0: url is required", "field policy_templates.1.configuration_links.1.url: Does not match pattern '^http(s)?://'", - "field policy_templates.1.configuration_links.2.url: Does not match pattern '^http(s)?://" + "field policy_templates.1.configuration_links.2.url: Does not match pattern '^http(s)?://", }, }, } From fa998137188e1fdd8fde92cd767340daa701ba18 Mon Sep 17 00:00:00 2001 From: criamico Date: Thu, 12 Dec 2024 16:05:49 +0100 Subject: [PATCH 08/14] Remove uncorrect test --- code/go/pkg/validator/validator_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/code/go/pkg/validator/validator_test.go b/code/go/pkg/validator/validator_test.go index 2add0381..f4cdebe4 100644 --- a/code/go/pkg/validator/validator_test.go +++ b/code/go/pkg/validator/validator_test.go @@ -246,7 +246,6 @@ func TestValidateFile(t *testing.T) { "field policy_templates.0.configuration_links: Array must have at least 1 items", "field policy_templates.1.configuration_links.0: url is required", "field policy_templates.1.configuration_links.1.url: Does not match pattern '^http(s)?://'", - "field policy_templates.1.configuration_links.2.url: Does not match pattern '^http(s)?://", }, }, } From e941595d08f03dd99474201151c1e7cfb5b46afe Mon Sep 17 00:00:00 2001 From: criamico Date: Thu, 12 Dec 2024 16:48:23 +0100 Subject: [PATCH 09/14] Address code review --- spec/integration/manifest.spec.yml | 4 +--- test/packages/bad_configuration_links/manifest.yml | 2 +- test/packages/good_v3/manifest.yml | 2 +- test/packages/kibana_configuration_links/manifest.yml | 4 ++-- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/spec/integration/manifest.spec.yml b/spec/integration/manifest.spec.yml index c89a1b01..a2c70333 100644 --- a/spec/integration/manifest.spec.yml +++ b/spec/integration/manifest.spec.yml @@ -221,9 +221,7 @@ spec: type: string oneOf: - type: string - pattern: '^http(s)?://' - - type: string - pattern: '^kbn:' + pattern: '^(http(s)?://|kbn:)' type: description: Type of link. `next_steps` for links to locations that can be relevant right after configuring the policy. `action` for actions that can be performed while the policy is in use. type: string diff --git a/test/packages/bad_configuration_links/manifest.yml b/test/packages/bad_configuration_links/manifest.yml index 961db010..4d0facb5 100644 --- a/test/packages/bad_configuration_links/manifest.yml +++ b/test/packages/bad_configuration_links/manifest.yml @@ -87,7 +87,7 @@ policy_templates: - title: View Agents url: "app/fleet/agents" type: next_step - # bad format: it should match either http/https format or kbn: format + # bad format: it should match either http/https format or kbn:/ format - title: View Agents url: "elastic.co" type: next_step diff --git a/test/packages/good_v3/manifest.yml b/test/packages/good_v3/manifest.yml index 263f02b7..63092235 100644 --- a/test/packages/good_v3/manifest.yml +++ b/test/packages/good_v3/manifest.yml @@ -41,7 +41,7 @@ policy_templates: team: obs-infraobs-integrations configuration_links: - title: View Agents - url: "kbn:app/fleet/agents" + url: "kbn:/app/fleet/agents" type: next_step content: "Check your agents in Fleet" - title: Elastic website diff --git a/test/packages/kibana_configuration_links/manifest.yml b/test/packages/kibana_configuration_links/manifest.yml index 2358c382..19c3d688 100644 --- a/test/packages/kibana_configuration_links/manifest.yml +++ b/test/packages/kibana_configuration_links/manifest.yml @@ -41,11 +41,11 @@ policy_templates: team: obs-infraobs-integrations configuration_links: - title: View Agents - url: "kbn:app/fleet/agents" + url: "kbn:/app/fleet/agents" type: next_step content: "Check your agents in Fleet" - title: Browse integrations - url: "kbn:app/integrations/browse" + url: "kbn:/app/integrations/browse" type: action - title: Elastic website url: "https://www.elastic.co/" From ae17e94141b7f1ff5b1bb6cc9b876b6f2647fa45 Mon Sep 17 00:00:00 2001 From: criamico Date: Thu, 12 Dec 2024 16:53:50 +0100 Subject: [PATCH 10/14] fix tests again --- code/go/pkg/validator/validator_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/go/pkg/validator/validator_test.go b/code/go/pkg/validator/validator_test.go index f4cdebe4..28853d6d 100644 --- a/code/go/pkg/validator/validator_test.go +++ b/code/go/pkg/validator/validator_test.go @@ -245,7 +245,8 @@ func TestValidateFile(t *testing.T) { []string{ "field policy_templates.0.configuration_links: Array must have at least 1 items", "field policy_templates.1.configuration_links.0: url is required", - "field policy_templates.1.configuration_links.1.url: Does not match pattern '^http(s)?://'", + "field policy_templates.1.configuration_links.1.url: Does not match pattern '^(http(s)?://|kbn:)", + "field policy_templates.1.configuration_links.2.url: Does not match pattern '^(http(s)?://|kbn:)", }, }, } From e4a8259f2af4cbd15d5fec419368975292a4881a Mon Sep 17 00:00:00 2001 From: criamico Date: Thu, 12 Dec 2024 17:10:23 +0100 Subject: [PATCH 11/14] update pattern --- spec/integration/manifest.spec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/integration/manifest.spec.yml b/spec/integration/manifest.spec.yml index a2c70333..6d8d8987 100644 --- a/spec/integration/manifest.spec.yml +++ b/spec/integration/manifest.spec.yml @@ -221,7 +221,7 @@ spec: type: string oneOf: - type: string - pattern: '^(http(s)?://|kbn:)' + pattern: '^(http(s)?://|kbn:/)' type: description: Type of link. `next_steps` for links to locations that can be relevant right after configuring the policy. `action` for actions that can be performed while the policy is in use. type: string From 611248204a721b31d972ac972efe68c93325c83a Mon Sep 17 00:00:00 2001 From: criamico Date: Thu, 12 Dec 2024 17:16:52 +0100 Subject: [PATCH 12/14] fix pattern in tests --- code/go/pkg/validator/validator_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/go/pkg/validator/validator_test.go b/code/go/pkg/validator/validator_test.go index 28853d6d..ffc3f40d 100644 --- a/code/go/pkg/validator/validator_test.go +++ b/code/go/pkg/validator/validator_test.go @@ -245,8 +245,8 @@ func TestValidateFile(t *testing.T) { []string{ "field policy_templates.0.configuration_links: Array must have at least 1 items", "field policy_templates.1.configuration_links.0: url is required", - "field policy_templates.1.configuration_links.1.url: Does not match pattern '^(http(s)?://|kbn:)", - "field policy_templates.1.configuration_links.2.url: Does not match pattern '^(http(s)?://|kbn:)", + "field policy_templates.1.configuration_links.1.url: Does not match pattern '^(http(s)?://|kbn:/)'", + "field policy_templates.1.configuration_links.2.url: Does not match pattern '^(http(s)?://|kbn:/)'", }, }, } From cf1cb937e256b30ca91cf5ea49b8221929098ddc Mon Sep 17 00:00:00 2001 From: criamico Date: Fri, 13 Dec 2024 10:28:21 +0100 Subject: [PATCH 13/14] remove oneOf --- spec/integration/manifest.spec.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/spec/integration/manifest.spec.yml b/spec/integration/manifest.spec.yml index 6d8d8987..ffbd1483 100644 --- a/spec/integration/manifest.spec.yml +++ b/spec/integration/manifest.spec.yml @@ -219,9 +219,7 @@ spec: url: description: Link url. Format is `http://...` or `https://...` for external links, `kbn:app/...` for links internal to Kibana. type: string - oneOf: - - type: string - pattern: '^(http(s)?://|kbn:/)' + pattern: '^(http(s)?://|kbn:/)' type: description: Type of link. `next_steps` for links to locations that can be relevant right after configuring the policy. `action` for actions that can be performed while the policy is in use. type: string From 12d648c4e12bfd4c6868dc4f1664f72b6227aafc Mon Sep 17 00:00:00 2001 From: criamico Date: Fri, 13 Dec 2024 10:29:44 +0100 Subject: [PATCH 14/14] Fix description --- spec/integration/manifest.spec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/integration/manifest.spec.yml b/spec/integration/manifest.spec.yml index ffbd1483..0f7586b3 100644 --- a/spec/integration/manifest.spec.yml +++ b/spec/integration/manifest.spec.yml @@ -217,7 +217,7 @@ spec: description: Link title type: string url: - description: Link url. Format is `http://...` or `https://...` for external links, `kbn:app/...` for links internal to Kibana. + description: Link url. Format is `http://...` or `https://...` for external links, `kbn:/app/...` for links internal to Kibana. type: string pattern: '^(http(s)?://|kbn:/)' type: