Skip to content

feat(BREAKING): support checksums on extends and only configure process plugins from trusted configuration - #1396

Merged
dsherret merged 8 commits into
mainfrom
fix/remote-process-plugin-config
Oct 23, 2026
Merged

dsherret merged 8 commits into
mainfrom
fix/remote-process-plugin-config

Conversation

@dsherret

@dsherret dsherret commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Stacked on #1393, so merge that first.

  • Process plugins are now only configured by trusted configuration: local configuration files, and remote configuration that trusted configuration extended with a checksum. A note is shown once per process plugin when remote configuration specified something for one that was ignored.
  • extends entries can now end with an @ followed by the SHA-256 checksum of the configuration file (ex. https://example.com/dprint.json@<sha256>). This works for URLs, relative paths, and npm specifiers with a version, where it's the checksum of the package's tarball the same as for npm plugins. dprint errors when the file doesn't match, checking the server for a newer file first when the cached one doesn't match.
  • Everything a configuration file extended with a checksum extends must also have a checksum.
  • Like local configuration, remote configuration extended with a checksum may specify process plugins, negated excludes, and associations reaching a parent directory.

This is a breaking change for anyone sharing process plugin configuration (ex. exec commands) via remote configuration. They can move it into a local configuration file or extend the remote configuration with a checksum.

@dsherret
dsherret added this pull request to stack #1399 October 23, 2026 14:29
Base automatically changed from fix/remote-config-gitignore to main October 23, 2026 14:29
Remote configuration can't specify process plugins because they don't
run sandboxed, but it could still configure process plugins specified
in local configuration. For a plugin like dprint-plugin-exec, that means
remote configuration could choose the commands that get run.

Process plugins are now only configured by local configuration files,
with a note when remote configuration specified something for one.
… plugins

An extends entry can now end with an @ followed by the SHA-256 checksum of
the configuration file (ex. https://example.com/dprint.json@<sha256>),
which errors when the file doesn't match.

Remote configuration extended with a checksum by trusted configuration is
trusted to configure process plugins. Everything it extends must also
have a checksum.
- check the server for a newer file when a cached extended config doesn't
  match its checksum
- verify the tarball checksum for npm specifiers the same as for npm
  plugins, which also pins the files in the package that the config extends
- compare checksums case insensitively and error for a checksum on an npm
  specifier without a version
- only warn once per process plugin about untrusted configuration, and not
  when the remote configuration only locks it
- clarify the docs on which configuration is trusted and how to get the
  checksum
- add tests for inheriting process plugin config, longer checksum chains,
  and npm registry config extended with a checksum
…udes and parent associations

Remote configuration that trusted configuration extended with a checksum
can't change without the checksum changing, so like local configuration
it can now specify negated excludes (ex. !**/*.txt) and associations
reaching a parent directory, which are removed from other remote
configuration.
@dsherret
dsherret force-pushed the fix/remote-process-plugin-config branch from 278b052 to b0de256 Compare October 23, 2026 14:29
@dsherret dsherret changed the title feat!: support checksums on extends and only configure process plugins from trusted configuration feat(BREAKING): support checksums on extends and only configure process plugins from trusted configuration Oct 23, 2026
Remote configuration that trusted configuration extended with a checksum
can't change without the checksum changing and process plugins require a
checksum, so it can now specify non-Wasm plugins like local configuration.
…emote configuration

The notes now show what to extend the remote configuration with to allow
what's ignored (ex. https://dprint.dev/dprint.json@<sha256>), using the
checksum of the package's tarball for an npm specifier. They show an
example instead when the configuration is extended by untrusted
configuration, since a checksum there wouldn't make it trusted.
@dsherret
dsherret merged commit 7e7c90a into main Oct 23, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant