Repository navigation
Conversation
… schemas The URL fields of the plugins were plain strings, so a dashboard could store a javascript:, data: or vbscript: URL in a Table data link, a TraceTable or TracingGanttChart link, the ScatterChart link or a Canvas node URL. The UI doesn't follow these URLs, but the API accepted and stored them, while it rejects them in the dashboard and panel links. These fields now use the #linkURL definition of perses/shared, which only accepts relative URLs, URLs whose scheme comes from a variable and the schemes allowed by the Perses API. A dashboard using any other scheme is rejected when it's saved. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Augustin Husson <augustin.husson@amadeus.com>
3 of 7 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Important
Draft: blocked by perses/shared#440, which adds
common.#linkURL. Until it's released, the CI can't resolve it.Once released:
github.com/perses/shared/cueto the release intable,tracetable,tracingganttchartandcanvas, and add it toscatterchart(cue mod get github.com/perses/shared/cue@<version>in each of them).Since perses/perses#4696, the Perses API rejects the dashboard and panel links whose URL uses a scheme that could run a script in the Perses origin (
javascript:,data:,vbscript:, ...). The URL fields of the plugins are still plain strings, so the API accepts and stores these URLs in:columnSettings[].dataLink.urllinks.tracelinks.traceandlinks.attributes[].linklinknodes[].urlThe UI doesn't follow them (
sanitizeUrlsince #910 / #912, #925 for Canvas, and ScatterChart only navigates within the app), but the guarantee only lives in the UI. These fields now usecommon.#linkURL, so a dashboard using a disallowed scheme is rejected when it's saved. A URL whose scheme comes from a variable is still accepted: only the UI can verify it, once the variables are interpolated.Compatibility: a dashboard that already stores such a URL can't be saved until the URL is fixed. That includes Canvas node URLs using a scheme outside the list (e.g.
ssh://), which Canvas opened until #925.Docs: the model docs of Table and TraceTable describe the rule. The TracingGanttChart links and the ScatterChart link weren't documented, they are now.
Tests:
javascript:, also obfuscated with mixed case, a leading space or a tab, anddata:). Table data links and Canvas node URLs get a valid fixture, the other fields already had one.percli plugin test-schemas(persesmain) passes on each plugin with the CUE of [ENHANCEMENT] Add the #linkURL CUE definition to validate the URL of links shared#440 vendored the waypercli plugin builddoes: table 27, tracetable 2, tracingganttchart 4, scatterchart 2, canvas 2 tests. Replacingcommon.#linkURLwithstringmakes each new invalid fixture fail.make checkformat-cue,make checklicenseandoxfmt --checkon the fixtures pass.mdox fmt --checkpasses on the updated docs, exceptdocs/table/model.mdwhich already fails onmain(unrelated to this change).Screenshots
N/A
Checklist
[<catalog_entry>] <commit message>naming convention using one of thefollowing
catalog_entryvalues:FEATURE,ENHANCEMENT,BUGFIX,BREAKINGCHANGE,DOC,IGNORE.UI Changes
No UI change.