Commit Graph

56 Commits

Author SHA1 Message Date
Ben Konyi e698eed7c7 [DTD] Fix relative path preservation in symbolic link resolution
_resolveNearestExistingPath safely resolves symbolic links by traversing up the tree until an ancestor exists, but it previously dropped the components of the path that were skipped. This causes non-existent dummy paths used in tests to incorrectly resolve to filesystem roots (like C:\ on Windows or / on POSIX), causing permission check failures.

This fix computes the relative path suffix between the original path and the closest existing ancestor using path.relative, and appends it back to the resolved path with path.join. POSIX dummy path coverage has also been added to verify identical behavior across platforms.

Fixes: https://github.com/dart-lang/sdk/issues/63147
Change-Id: Iac908998f052ad9054e8213ba059156a5982a301
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/495000
Reviewed-by: Jessy Yameogo <yjessy@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Jessy Yameogo <yjessy@google.com>
2026-04-13 16:12:47 -07:00
Jinho Seo 046fc17e53 This change hardens DTD FileSystemService workspace-root enforcement against symlink escapes.
Previously, FileSystem.readFileAsString, writeFileAsString, and
listDirectoryContents only validated the requested path textually against the
configured IDE workspace roots. A symlink inside the workspace could
therefore resolve to a location outside the workspace and still be accessed.

This patch resolves workspace roots and requested filesystem targets before
performing the authorization check, and resolves the nearest existing ancestor
for write targets so new files inside a workspace continue to work.

It also adds a source-backed regression test in pkg/dtd_impl/test/dtd_test.dart
that verifies read, write, and directory listing requests through a symlink
escaping the workspace all fail with permission denied.

R=bquinlan@google.com

Tested:
- HOME=/tmp XDG_CONFIG_HOME=/tmp DART_SUPPRESS_ANALYTICS=1 /tmp/dart-sdk-3.12.0-221.0.dev/dart-sdk/bin/dart test pkg/dtd_impl/test/dtd_test.dart
Change-Id: I7abf00f6220bff42b352e2942f396167af53adb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493420
Reviewed-by: Jessy Yameogo <yjessy@google.com>
Auto-Submit: 진호 <orangemush777@gmail.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2026-04-08 10:13:43 -07:00
Jake Macdonald 44b700e9f2 add IDE information from env vars to DTDConnectionInfo
See https://github.com/Dart-Code/Dart-Code/issues/5561 for info on these environment variables.

Bug: https://github.com/dart-lang/sdk/issues/62985
Change-Id: Ic65a3cc64bacfe7c13bbf512d3ed3f8a6b2e5ba9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/492940
Commit-Queue: Jake Macdonald <jakemac@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
2026-04-03 14:42:03 -07:00
Lasse R.H. Nielsen 56505e0575 Stop using Match.group.
The `Match.operator[]` does the same thing and is
generally recommended (and shorter).
(I want to deprecate `group` and `groups`)

Tested: Refactoring.
CoreLibraryReviewExempt: Calling equivalent function.
Change-Id: I4c758968ae622fe16b7322be1b29b05b91e7fcd9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/489021
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2026-03-20 09:09:46 -07:00
Jaime Wren 3846e59caf Enable stricter lints in dtd_impl using dart_flutter_team_lints
Change-Id: Ic630f00e1c608467f9c15b3a35f0ce28b8d8c94c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/488880
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2026-03-18 13:27:49 -07:00
Jaime Wren f0e91e80cf [dtd] Moved
dtd._recordDtdConnectionInfo() call.

Moved dtd._recordDtdConnectionInfo() to be called immediately after service startup (_startService), ensuring it executes before any console log announces that the daemon is listening.

Change-Id: I41c9b2dac6df54489bcaf9894fb7c3b222775aab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/488860
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2026-03-18 10:22:29 -07:00
Jaime Wren 7278245213 [dtd_impl] Fix race condition in pid_file_discovery_test
Increase the wait loop iteration count from 20 to 100 iterations (up to 5 seconds) inside `startDtdProcess()` to give the daemon ample time to create the PID file on slower bots.

Also: dart format changes.

Bug: https://github.com/dart-lang/sdk/issues/62872
Change-Id: I55ff087108fbae1f05491894b79ebc8d36030422
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/488660
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2026-03-18 07:39:12 -07:00
Jaime Wren 13e2321be3 [dtd_impl] Update PID file logic to use dart_data_home logic
See https://dart-review.googlesource.com/c/sdk/+/487000

Change-Id: I37d3ccc911041e56b5e3eeabc2aeaf4cde1785f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487543
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2026-03-17 11:19:11 -07:00
Paul Berry 63dc645f6e Bump VM packages to language version 3.12.
This CL is part of an effort to bump the SDK requirement to `3.12.0-0`
for all the packages in `pkg` that are not published to `pub`, so that
we can get better testing of the "private named parameters" feature.

(Packages that *are* published to `pub` can't be safely bumped yet,
because SDK 3.12 hasn't been released, and I don't want to block those
packages' ability to publish useful updates to customers.)

This change covers the following packages, which are owned by
OWNERS_VM:
- pkg/dart2bytecode
- pkg/dart2native
- pkg/dtd_impl (jointly owned with OWNERS_DEVTOOLS)
- pkg/mmap
- pkg/observatory
- pkg/vm

Changes to `pubspec.yaml` files were made manually.

Changes to `.dart` files were made automatically, using `dart
fix`. Two kinds of changes were made:

- Migrate to using private named parameters where it is possible to do
  so without changing semantics. Note that this migration is
  conservative; see https://github.com/dart-lang/sdk/issues/58607 for
  details.

- Migrate to using null aware elements.

Tested: Standard trybots
Change-Id: I1666e5771a34ef3c30ceeadced3d505d6a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487942
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2026-03-16 07:59:07 -07:00
Jaime Wren 049778a5b2 [dtd_impl] Replace dynamic type usages with strict types
Change-Id: Icf31ea11d50ffbb704214f6dbc17602e6777e0c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/486861
Commit-Queue: Jaime Wren <jwren@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2026-03-10 14:32:41 -07:00
Jaime Wren 4a144e9969 [dtd] Verify DTD connection info contains correct workspace root
Change-Id: I7bc5302614f886217630d6206bc4ab289c421b43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/486860
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2026-03-10 11:28:31 -07:00
Jaime Wren 526d8bcf22 [dtd] Add @visibleForTesting annotation to this library
Change-Id: I5a5efc1506a488fe9c50a3fb6407f86c16cf9b5c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/486825
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2026-03-10 10:56:50 -07:00
Jaime Wren ab678e0a24 [dtd] Implement PID-file based DTD instance discovery
See parent issue https://github.com/flutter/flutter/issues/182155

- Adds `dart run bin/dtd.dart --list` to discover and print active instances.
- Adds `--machine` flag to output the discovered instances as a JSON array.
- Adds integration tests verifying the file creation, discovery, `--machine` JSON output, and stale process cleanup.

Bug: https://github.com/flutter/flutter/issues/183421

Change-Id: I07f8c079ec0959cc0a292d7049e1cbb4d8280f41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/486541
Commit-Queue: Jaime Wren <jwren@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2026-03-10 09:43:00 -07:00
Danny Tuppeny 4f377da9e3 Disable DTD WebSocket ping by default, making it opt-in
The WebSocket client that IntelliJ is using does not handle pings (despite them being part of the spec), so this change resulted in connections being dropped after 15s.

This changes pings to be opt-in, which unfortunately means other clients that don't opt-in won't get the behaviour (and therefore might see issues with Norton and other antivirus programs that proxy and drop idle connections), but this is better than all IJ users being broken.

See https://github.com/flutter/dart-intellij-third-party/issues/205

Change-Id: I7d5f5225cb9d04c15552970a821f5441c45ace18
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/472580
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2026-01-14 08:58:43 -08:00
Danny Tuppeny 5d3a0c2f3c [dtd] Enable web socket ping to avoid dropped idle connections
This enables the web socket ping by default at an interval of 15s. Having ping enables can prevent proxies/antivirus from dropping the web connections if they have no traffic for some period.

Having Norton 360 installed results in idle DTD connections dropping after 60s even if every feature is disabled, because the connections still go through it and it still drops idle connections.

I implemented this in the server because it applies to all uses of DTD regardless of client and it was easier to do here because pingInterval isn't exposed everywhere (but pkg:shelf does have a pass-through).

See https://github.com/Dart-Code/Dart-Code/issues/5794

Fixes https://github.com/dart-lang/sdk/issues/62148

Change-Id: If9df674b061b397cef1aa321602b563f44b9525d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/465680
Reviewed-by: Jessy Yameogo <yjessy@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2025-12-09 10:42:23 -08:00
Danny Tuppeny 127f15e9e1 [dtd] Add a common service definition for getActiveLocation()
This allows other services (like the Widget Previewer) to get an initial active location rather than only being able to update if there is a location change after they start up.

See https://github.com/dart-lang/sdk/issues/61538

Change-Id: I66e1e12c5d8f085049751ba07a1f768b802d805e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/450920
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2025-09-22 10:08:12 -07:00
Kenzie Davisson 0010cc416f Use constants instead of raw strings throughout package:dtd
Change-Id: Ie4b0dfb115a820fb3f0741ce193c70f6b7d560cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/432725
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
2025-06-04 08:52:33 -07:00
Kenzie Davisson 0787d1eeec Use a more structured response type for ConnectedApp.getVmServices API
This CL:
- changes the name of the `ConnectedApp.getVmServiceUris` service method to `ConnectedApp.getVmServices` since the response includes more than just the URI for each VM service object.
- Adds a new response type `VmServicesResponse`
- Enhances test coverage for existing response types

Work towards https://github.com/dart-lang/sdk/issues/60540.

Change-Id: Id4a1c05dde28c9b23975ad1d2ca68cb9e2bddb22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430545
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
2025-05-28 11:59:56 -07:00
Kenzie Davisson 10dd59c039 Add a DTD method to get all registered services.
This CL contains breaking changes for package:dtd and prepares both package:dart_service_protocol_shared and package:dtd for publish.

This CL also fixes https://github.com/dart-lang/sdk/issues/60757 so that DTD-registered services are sent over the `Service` stream upon initial subscription like what is done for client-registered services.

Change-Id: I619af816e64af01864c7ed9b98743c6691bf7e0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429161
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
2025-05-22 13:52:54 -07:00
Kenzie Davisson 943f4c6945 Add ConnectedAppService to DTD to store the connections to Dart and Flutter applications that DTD is aware of.
This service contains three methods and sends events over a stream:

Methods:
- `registerVmService(String uri, String secret)`
- `unregisterVmService(String uri, String secret)`
- `getVmServiceUris()`

Stream events:
- Sends `VmServiceRegistered` and `VmServiceUnregistered` events over the `ConnectedApp` stream.

Bug: https://github.com/dart-lang/sdk/issues/60540

Change-Id: Ica90d1d14ea83b38f24b4229313effb628cf2d94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427568
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2025-05-20 09:46:50 -07:00
Danny Tuppeny ee62e577dd [dtd] Add a common definition for an editor event for tracking active position changes
Allows other tools to know where the user is currently active.

Change-Id: If32fa9514d79730a2e41763c529c5fdeacaa0127
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/392908
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Elliott Brooks <elliottbrooks@google.com>
2025-04-07 09:44:19 -07:00
Sigurd Meldgaard 2fe05bd568 Reland "Migrate to use pub workspace"
This is a reland of commit b9b77058a9

Original change's description:
> Migrate to use pub workspace
>
> Use `pub get` to generate `.dart_tool/package_config.json` on gclient sync.
>
> All pkg/ (and a few third_party) packages that are developed inside the sdk repo are included in the workspace from the root `pubspec.yaml`.
>
> All dependencies that are pulled in via DEPS are added as path dependencies via `dependency_overrides` in the root `pubspec.yaml`.
>
> Bug: https://github.com/dart-lang/sdk/issues/56220
> Change-Id: I38c12b608c68da54c57821116cf9aa6696936746
> Tested: relies on CQ of existing tests. Should have no effect on functionality
> CoreLibraryReviewExempt: only core library change is adding a `// ignore:` comment. Should have no influence on functionality
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397164
> Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
> Reviewed-by: Alexander Thomas <athom@google.com>

Bug: https://github.com/dart-lang/sdk/issues/56220
Change-Id: I29afabade2d2447dea05121cb87ff50bb21a4b76
Cq-Include-Trybots: luci.dart.try:flutter-linux-try,flutter-web-try
Tested: relies on CQ of existing tests. Should have no effect on functionality
CoreLibraryReviewExempt: only core library change is adding a `//
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415561
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2025-03-20 06:19:16 -07:00
Sigurd Meldgaard 6c4de1ab7e Revert "Migrate to use pub workspace"
This reverts commit b9b77058a9.


Revert "Add missing sample pubspec to workspace"

This reverts commit 892ea15ac7.


These seem to break the engine.

Change-Id: Ieee26deb7928c3869a1b6265326c3ce568ffe731
Tested: this is a revert.
CoreLibraryReviewExempt: this is a revert
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415582
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2025-03-14 09:08:20 -07:00
Sigurd Meldgaard b9b77058a9 Migrate to use pub workspace
Use `pub get` to generate `.dart_tool/package_config.json` on gclient sync.

All pkg/ (and a few third_party) packages that are developed inside the sdk repo are included in the workspace from the root `pubspec.yaml`.

All dependencies that are pulled in via DEPS are added as path dependencies via `dependency_overrides` in the root `pubspec.yaml`.

Bug: https://github.com/dart-lang/sdk/issues/56220
Change-Id: I38c12b608c68da54c57821116cf9aa6696936746
Tested: relies on CQ of existing tests. Should have no effect on functionality
CoreLibraryReviewExempt: only core library change is adding a `// ignore:` comment. Should have no influence on functionality
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397164
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2025-03-14 05:21:40 -07:00
Sigurd Meldgaard a9ab52bcbb Language version bumps for publish_to: none pkgs
Also a separate pubspec for the tools/ folder

Extracted from https://dart-review.googlesource.com/c/sdk/+/397164

Change-Id: If49a6ede07e4864d0c0fcb210c04c18c804849df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/412041
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2025-02-27 00:48:40 -08:00
Mohamed Abdelaal 9b7bb9df90 Fix "the the" typo
Closes https://github.com/dart-lang/sdk/pull/59926

GitOrigin-RevId: cb37bca473b0c177b876a0f4e75858cd1862e699
Change-Id: I6827241b22e99db455945afcdfbaee0450999ce9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404923
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2025-01-21 14:08:20 -08:00
Mohamed Abdelaal de2131cc4e Fix missing success-responses anchor
Closes https://github.com/dart-lang/sdk/pull/59916

GitOrigin-RevId: c76f0db514e00cfb781dd4b1ab7833295afa2865
Change-Id: I6db3edff877ab1807509394c45272f6f8a9c7267
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404802
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2025-01-16 11:03:10 -08:00
Devon Carew abb17bc59d [dds] update dds and dtd to be forward compatible with an upcoming release of package:shelf_web_socket
Change-Id: I7bcbacaad44358759d8856b0bcf0b99120e79e89
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/398584
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2024-12-03 20:41:53 +00:00
Jessy Yameogo ef5295d050 [dtd] Use secure random number generator to generate URI auth code (path) and secret
Change-Id: Ibde6afaaf5d3f83f8f8aea1bca38bffc75a20e36
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386280
Reviewed-by: Jessy Yameogo <yjessy@google.com>
Commit-Queue: Jessy Yameogo <yjessy@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-09-25 15:41:52 +00:00
Helin Shiah aa08d0643e Add theme change event
Change-Id: Ie64b1181a87361dc10426d2941dfcac5e334c7b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384322
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Commit-Queue: Helin Shiah <helinx@google.com>
2024-09-10 18:34:14 +00:00
Danny Tuppeny 516b6b23a6 [dtd] Fix permission checks to handle differences in file URI escaping
Fixes https://github.com/Dart-Code/Dart-Code/issues/5210
Fixes https://github.com/dart-lang/sdk/issues/54917
Fixes https://github.com/dart-lang/sdk/issues/55476

Change-Id: I492a4f876ea75972e9971f61d67d2ecf84e7b4c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/378461
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-08-28 15:30:07 +00:00
Danny Tuppeny 44cc865f7d [dtd] Improve the error thrown when trying to call a service method without a complete name
This now behaves the same as for any other method that doesn't exist, rather than throwing a generic RPC error with a `RangeError` inside.

Fixes https://github.com/dart-lang/sdk/issues/56540

Change-Id: I1171fe1c0c2a4a6f56d7a653af87b17a76af9d68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381643
Reviewed-by: Elliott Brooks <elliottbrooks@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-08-22 18:03:50 +00:00
Danny Tuppeny 74bd539d4d [dtd] Add editor service definitions as used by sidebar
This adds additional "Editor" service method definitions as used by the new DTD sidebar. I moved the Editor service definitions into a new file (because they're now quite large and dtd_common_services seems better as an intro and list of the common specified services).

I also split the existing info about `navigateToCode` into a more terse definition (in the new file) and a general example. I also updated the error example as I believe it was incorrectly wrapped in `result`.

Change-Id: I6136eb550cce0dab86d535db02f9f06ee42892e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/378141
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-08-08 20:02:55 +00:00
Helin Shiah e7017f4fd9 Add section for standard service methods and navigate to code
This is a proposal for a standardized service method for IDEs to register for navigating to code. This is intended to replace the `navigate` `ToolEvent` since there isn't a way for an IDE to respond to that notification and verify that the DevTools-IDE interaction was successful.

Change-Id: I92c0ad36b3f0557ffb80b868b466808ef3c3563d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/375080
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Helin Shiah <helinx@google.com>
2024-07-30 19:55:52 +00:00
Danny Tuppeny 15356d576d [dtd] Add a test a disconnecting DTD client results in error responses for any in-progress requests to them
This question came up in another change, about whether a client would have hanging requests if the other DTD client providing the service disconnected.

This adds a test to ensure that any pending requests are terminated with an error.

It also tidies up some other tests to give better errors if they fail.

Change-Id: I77e04ee59f757498af090878da542d6ed1d152b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/374946
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
2024-07-16 18:45:53 +00:00
Danny Tuppeny 214088a7a0 [dtd] Prevent clients from using internal service names or dots in service names
See https://github.com/dart-lang/sdk/issues/56177

Change-Id: I9765f232e71026a0ae6ee2ce95248472fb69ba3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/374980
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-07-11 15:59:23 +00:00
Danny Tuppeny 3c66c16122 [dtd] Move DTD implementation classes from lib/ to lib/src/ to avoid src/ files importing from lib/
Fixes https://github.com/dart-lang/sdk/issues/56178

Change-Id: I1f461e0f9c787e69eade7a5e4806c0a85bb23c23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/374981
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
2024-07-09 19:55:17 +00:00
Danny Tuppeny 23de3198fa Add support for notifying DTD clients of registered services
Fixes https://github.com/dart-lang/sdk/issues/56057

Change-Id: I57144297b8cb68b1c8b35d7bdcc619ad293fb4ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372940
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2024-07-08 16:12:21 +00:00
Danny Tuppeny 499277c690 [dtd] Add support for '--disable-service-auth-codes'
See https://github.com/dart-lang/sdk/issues/54932

Change-Id: Ie85eb76eb5e8c01dda957d038286ae498748ca70
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373340
Reviewed-by: Dan Chevalier <danchevalier@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-07-03 14:51:43 +00:00
Danny Tuppeny d209ea9333 [dtd] Allow passing an explicit port to DTD
Removes the port from `startService()` (which as far as I can see is unused) and parses it from `args` instead.

I had to add support for "options" in the argument classes and switched from a bool flag `isFlag` to an enum to be a bit more descriptive (and be easier to support multi-options in future if required).

Fixes https://github.com/dart-lang/sdk/issues/56000

Change-Id: Ib08513139f58e8845a7c2cbbeeea06787dbc2df1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371840
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Dan Chevalier <danchevalier@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-06-17 14:58:19 +00:00
Dan Chevalier ba8306735d Ensure that dtd handles relative paths correctly.
Change-Id: I1ebf22a9ae258741580660a8eaf77aa286e9affa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362400
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Commit-Queue: Dan Chevalier <danchevalier@google.com>
2024-04-15 14:29:03 +00:00
Kenzie Schmoll c042924d0d Add UnifiedAnalytics service to the Dart Tooling Daemon.
This CL also removes unified analytics code from DDS and DevTools server.

Bug: https://github.com/dart-lang/sdk/issues/55280
Change-Id: I6f1c56cb8dce6f611ee73de7081c0a9cd43187c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360221
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
Reviewed-by: Elias Yishak <eliasyishak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-04-04 00:20:32 +00:00
Kenzie Schmoll cfe3217378 Add getProjectRoots API to DTD
Bug: https://github.com/flutter/devtools/issues/7366
Change-Id: If0631f387306312655bdcbefe961692b00a7b4dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359320
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
Reviewed-by: Dan Chevalier <danchevalier@google.com>
Reviewed-by: Polina Cherkasova <polinach@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-03-25 19:52:21 +00:00
Dan Chevalier b626c255eb Updating DTD docs to ensure they are ready for the consumption.
Change-Id: Iccbf88959bbd68bac897e3f5b05dbf5fe2a0a4bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/355460
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Commit-Queue: Dan Chevalier <danchevalier@google.com>
2024-03-22 01:28:39 +00:00
Dan Chevalier 8f995c27f2 Turn off default logging for dtd daemon
Change-Id: Iddb386017b91024aea51d546f7d729b38d870352
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358502
Commit-Queue: Dan Chevalier <danchevalier@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-03-19 17:03:20 +00:00
Kenzie Schmoll 408918d6f5 [dds] Start DTD from DevTools server if it is not already started.
Fixes https://github.com/dart-lang/sdk/issues/54937.

Tested: pkg/dartdev test for `dart devtools` command, and new `dtd_test.dart` in pkg/dds.
Change-Id: I530ba2fe4d5809082378b61c282ba7856974e21e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/354460
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Dan Chevalier <danchevalier@google.com>
2024-03-18 21:50:09 +00:00
Dan Chevalier 68c74e2a97 Add obfuscation token to DTD uri
Adding this token adds a small layer of security since the caller needs to have gathered the uri in some way rather than just stumbling on the DTD port.

Change-Id: I0665f4718d162daf94cb49fa1c6f4206c83d77cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/355220
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Commit-Queue: Dan Chevalier <danchevalier@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-03-07 19:33:19 +00:00
Dan Chevalier 952e3b718f Add --unrestricted to DTD command.
NOTE: the tests view better if you turn off whitespaces on the diff.

This command will start a DTD instance that has the FileSystem service restrictions disabled. Which can be used in development environments.

Bug: https://github.com/dart-lang/sdk/issues/54762
Change-Id: I829f83d7c7afc7dd83732fc8a600cb41ffe36f63
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352921
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Commit-Queue: Dan Chevalier <danchevalier@google.com>
2024-02-20 20:08:57 +00:00
Dan Chevalier 03f797a85a Solidify dtd lifecycle
- devtools server can now take the dtd uri as a parameter on startup
   - dtdUri is passed to the server handler so that devtools can request it.
- FileService is implemented inside the Dart Tooling Daemon (dtd_impl)
    - Added FileService.setProjectRoots
    - Added unit tests and rpc exceptions
- on startup dtd now prints { uri, secret } so that the caller has the secret that allows them to call FileService.setProjectRoots

Fixes: https://github.com/dart-lang/sdk/issues/54790

Change-Id: I7a66aca2f8f06f6a611a46c727a9d5c2485fbe3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346922
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Dan Chevalier <danchevalier@google.com>
2024-02-13 16:17:18 +00:00
Dan Chevalier a995f7930b Solidify, test and document DTD errors
Change-Id: Ied0f1af43954e47a2c51837bd2fc8d7ce0e03fa7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345800
Commit-Queue: Dan Chevalier <danchevalier@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-01-18 16:07:31 +00:00