mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
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:
parent
c0f9aa0592
commit
76ce7768ab
17 changed files with 742 additions and 588 deletions
|
@ -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)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue