Ensure devtoolsOptionsUri points to a served extension (#10088)

* Ensure devtoolsOptionsUri points to a served extension and prevent
recursive directory creation.

This ensures that `handleExtensionEnabledState` checks that
`devtools_options.yaml` matches the actual path of an extension that
is currently served by `ExtensionsManager`, resolving symbolic links on
the parent directory and rejecting `devtools_options.yaml` if it is a
symbolic link.

This also ensures that `DevToolsOptions._lookupOptionsFile` does not
recursively create directories or follow symbolic links if the parent
directory does not exist or `devtools_options.yaml` is a symbolic link,
preventing `api/extensionEnabledState` from creating directories or
writing files outside served extension package roots.

* Address code review comments

* Iterate over extensionsManager.devtoolsExtensions.
* Return `true` immediately to avoid extra calls to
  `_resolveOptionsFilePath`.
8 files changed
tree: 180264ad093e30aa83ba5b0092b5f32c31bb50c6
  1. .agents/
  2. .gemini/
  3. .github/
  4. .vscode/
  5. _markdown_images/
  6. docs/
  7. packages/
  8. third_party/
  9. tool/
  10. .gitattributes
  11. .gitignore
  12. AGENTS.md
  13. analysis_options.yaml
  14. AUTHORS
  15. BETA_TESTING.md
  16. CLAUDE.md
  17. CODE_OF_CONDUCT.md
  18. CODEOWNERS
  19. CONTRIBUTING.md
  20. DEBUGGING.md
  21. devtools_options.yaml
  22. DOCUMENTATION.md
  23. flutter-candidate.txt
  24. LICENSE
  25. pubspec.lock
  26. pubspec.yaml
  27. README.md
  28. STYLE.md
  29. TESTING.md
  30. TRIAGE.md
README.md

Dart & Flutter DevTools

Build Status OpenSSF Scorecard

What is this?

Dart & Flutter DevTools is a suite of performance tools for Dart and Flutter.

Getting started

For documentation on installing and trying out DevTools, please see our docs.

Contributing and development

Contributions welcome! See our contributing page for an overview of how to build and contribute to the project.

Terms and Privacy

By using Dart DevTools, you agree to the Google Terms of Service. To understand how we use data collected from this service, see the Google Privacy Policy.