Repository navigation
Conversation
📖 Docs Site Preview DeployedPreview URL: https://a2ui.org/pr-preview/pr-4102/ Built from commit |
There was a problem hiding this comment.
Code Review
This pull request introduces a proposal and conformance test suite for a new URL security policy (tracking issue #4045). It adds a detailed specification proposal document, updates the conformance JSON schema, and introduces a comprehensive YAML test suite covering baseline, allowlist, and resolution behaviors. Additionally, it marks these new tests as skipped or unimplemented across the Dart, Python, Swift, and TypeScript SDK test harnesses since the policy is not yet implemented. I have no feedback to provide as there are no review comments.
…mance suite (#4045) Adds specification/proposals/url_security_policy.md, which defines the media, navigation and iframe URL contexts, the x-a2ui-url-context catalog annotation, the baseline every policy runs, and the permissive and allowlist policies. Adds conformance/core/url_security_policy.yaml with two actions: url_policy_check checks URLs directly against a policy, and url_policy_resolution checks how URL props resolve on a v1.0 surface and how openUrl behaves. The Python, TypeScript, Dart and Swift core harnesses record the suite as skipped until each SDK implements the policy.
… URLs (#4045) An allowlist entry such as host:443 limits the port even though it is the scheme's default, and an allowed host hidden in the userinfo, query, or fragment of a URL doesn't match.
53f8e27 to
183e38e
Compare
Summary
Adds the shared, language-agnostic contract for the URL security policy proposed in #4045: a proposal doc and a conformance suite that every core SDK will run. No SDK behavior changes in this PR. The TypeScript implementation follows in a stacked PR, and the Python, Dart and Swift implementations follow after the TypeScript API has been reviewed.
Changes
specification/proposals/url_security_policy.mddefines:media,navigation,iframe)x-a2ui-url-contextcatalog annotation (set by catalog authors, never sent by agents, ignored by validators)openUrlchecks the policy before the host handler and fails withURL_BLOCKEDconformance/core/url_security_policy.yamladds 28 cases in two actions:url_policy_check(20 cases) checks a policy directly: scheme smuggling,data:URLs, relative URLs, host and wildcard lists, ports, and rewrites.url_policy_resolution(8 cases) checks resolved component props andopenUrlon a surface, covering data-bound values,formatString, a custom catalog with nested annotated props, check-once with a rewrite, andopenUrlblocked versus allowed.conformance/conformance_schema.jsonandconformance/README.mddescribe the two new case shapes.URL security policy not implemented yet (#4045), following each harness's existing convention, so CI stays green until each SDK implements the policy.The shared basic catalog (
catalogs/basic/v1/catalog.json) is not annotated in this PR. Annotating it would break each SDK's catalogto_jsonand round-trip conformance until every SDK can emit the keyword. Until a later cross-SDK change annotates it, SDKs treatImage.url,Video.url,Video.posterUrlandAudioPlayer.urlasmediathrough a built-in list.Verification
uv run --all-packages pytest -q python/a2ui_core/tests conformance/tests: 2321 passed, 60 skipped, 3 xfailed.node typescript/core/web_core/tests/conformance/conformance_test.mjs: passes, with the 28 new cases skipped.dart test test/conformanceindart/a2ui_core: all passed.conformance/scripts/check_executed_cases.py --corpus corepasses for the Python and web_core harnesses, andcheck_feature_coverage.py --staticreports no findings.mediaon a permissive policy, an unknownrewritekey,allowRelative: [iframe]).unsupportedCoreSuitesentries; it was not compiled locally.Part of #4045.
🤖 Agent-generated