refactor(permissions): remove access check callback (#30050)

1. Removes the access check callback, which was kind of confusing.
1. Requires `CheckedPath` for everything in the `FileSystem` trait to
ensure we're always checking permissions.
This commit is contained in:
David Sherret 2025-07-10 21:40:20 -04:00 committed by GitHub
parent c0f9aa0592
commit 76ce7768ab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 742 additions and 588 deletions

View file

@ -32,12 +32,10 @@ use deno_npm::NpmPackageId;
use deno_npm::resolution::SerializedNpmResolutionSnapshot;
use deno_npm::resolution::SerializedNpmResolutionSnapshotPackage;
use deno_npm::resolution::ValidSerializedNpmResolutionSnapshot;
use deno_runtime::deno_fs::FileSystem;
use deno_runtime::deno_fs::RealFs;
use deno_runtime::deno_io::fs::FsError;
use deno_semver::StackString;
use deno_semver::package::PackageReq;
use indexmap::IndexMap;
use sys_traits::FsRead;
use thiserror::Error;
use crate::file_system::FileBackedVfs;
@ -369,9 +367,11 @@ impl StandaloneModules {
bytes
}
Err(err) if err.kind() == ErrorKind::NotFound => {
match RealFs.read_file_sync(&path, None) {
// actually use the real file system here
#[allow(clippy::disallowed_types)]
match sys_traits::impls::RealSys.fs_read(&path) {
Ok(bytes) => bytes,
Err(FsError::Io(err)) if err.kind() == ErrorKind::NotFound => {
Err(err) if err.kind() == ErrorKind::NotFound => {
return Ok(None);
}
Err(err) => return Err(JsErrorBox::from_err(err)),