Skip to content

feat(fleet): add support for url variable type#231062

Merged
andrewkroh merged 2 commits intoelastic:mainfrom
andrewkroh:feat/fleet-url-var-type
Aug 19, 2025
Merged

feat(fleet): add support for url variable type#231062
andrewkroh merged 2 commits intoelastic:mainfrom
andrewkroh:feat/fleet-url-var-type

Conversation

@andrewkroh
Copy link
Member

@andrewkroh andrewkroh commented Aug 8, 2025

Summary

Adds a new 'url' variable type to package policies, allowing for specific URL input and validation. This implements a feature that was added to package-spec 1.3.0 (Nov 16, 2021).

This change introduces validation for the URL format using the standard URL constructor and adds an optional 'url_allowed_schemes' property to restrict which URL schemes are permissible.

Relates: elastic/package-spec#241
Relates: #116914

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list
  • This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The release_note:breaking label should be applied in these situations.
  • Flaky Test Runner was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.

Screenshots

Screenshot 2025-08-07 at 21 25 48
Screenshot 2025-08-07 at 21 26 29
Screenshot 2025-08-07 at 22 03 02

Release note

Adds support for a new url type variable in Fleet packages which provides better input validation of URLs in configurations.

Adds a new 'url' variable type to package policies, allowing for
specific URL input and validation. This implements a feature that
was added to package-spec 1.3.0 (Nov 16, 2021).

This change introduces validation for the URL format using the standard
URL constructor and adds an optional 'url_allowed_schemes' property to
restrict which URL schemes are permissible.

Relates: elastic/package-spec#241
Relates: elastic#116914
@andrewkroh andrewkroh added enhancement New value added to drive a business result backport:skip This PR does not require backporting Team:Fleet Team label for Observability Data Collection Fleet team labels Aug 8, 2025
@andrewkroh andrewkroh changed the title feat(fleet): add url type for package policy variables Aug 8, 2025
@andrewkroh andrewkroh marked this pull request as ready for review August 8, 2025 03:06
@andrewkroh andrewkroh requested a review from a team as a code owner August 8, 2025 03:06
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

Copy link
Contributor

@juliaElastic juliaElastic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@andrewkroh andrewkroh enabled auto-merge (squash) August 19, 2025 21:50
@andrewkroh andrewkroh merged commit 2f6a6f6 into elastic:main Aug 19, 2025
13 checks passed
@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Fleet Cypress Tests #2 / View agents list Agent status filter should filter on healthy and unhealthy
  • [job] [logs] Fleet Cypress Tests #2 / View agents list Bulk actions should allow to bulk upgrade agents and cancel that upgrade

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
fleet 1464 1465 +1

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
fleet 171.9KB 172.5KB +581.0B
Unknown metric groups

API count

id before after diff
fleet 1596 1597 +1

History

qn895 pushed a commit to qn895/kibana that referenced this pull request Aug 26, 2025
Adds a new 'url' variable type to package policies, allowing for
specific URL input and validation. This implements a feature that
was added to package-spec 1.3.0 (Nov 16, 2021).

This change introduces validation for the URL format using the standard
URL constructor and adds an optional 'url_allowed_schemes' property to
restrict which URL schemes are permissible.

Relates: elastic/package-spec#241
Relates: elastic#116914
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting enhancement New value added to drive a business result release_note:enhancement Team:Fleet Team label for Observability Data Collection Fleet team v9.2.0

4 participants