Skip to content

Conversation

@nathanwhit
Copy link
Member

I also moved the RuntimePermissionDescriptorParser struct from deno_runtime into deno_permissions, so that extension crates can use it in tests and stuff like that

Copilot AI review requested due to automatic review settings November 13, 2025 22:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the Deno codebase by removing generic permission traits from extension crates and consolidating permission handling. The RuntimePermissionDescriptorParser struct is moved from deno_runtime into deno_permissions to enable extension crates to use it in tests.

Key changes:

  • Removed generic type parameters for permissions from all extension crates (deno_web, deno_fetch, deno_net, deno_fs, deno_ffi, deno_napi, deno_node, deno_websocket)
  • Replaced trait-based permission abstractions with direct usage of PermissionsContainer
  • Moved RuntimePermissionDescriptorParser from runtime/permissions.rs to runtime/permissions/runtime_descriptor_parser.rs and re-exported it

Reviewed Changes

Copilot reviewed 38 out of 39 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
runtime/worker.rs Removed generic permission parameters from extension initialization
runtime/web_worker.rs Removed generic permission parameters from extension initialization
runtime/snapshot_info.rs Removed unused permission trait implementations for snapshot creation
runtime/snapshot.rs Removed generic permission parameters from snapshot extensions
runtime/permissions/runtime_descriptor_parser.rs New file containing moved RuntimePermissionDescriptorParser implementation
runtime/permissions/lib.rs Added export for RuntimePermissionDescriptorParser
runtime/permissions.rs Reduced to single re-export line
ext/websocket/lib.rs Removed generic parameters and used PermissionsContainer directly
ext/web/timers.rs Removed TimersPermission trait and always allow high-resolution time
ext/web/lib.rs Removed generic permission parameter
ext/web/benches/* Updated tests to remove custom permission implementations
ext/node/ops/* Removed generic permission parameters from ops
ext/node/lib.rs Removed permission generic parameter from extension
ext/net/* Removed NetPermissions trait and used PermissionsContainer directly
ext/napi/lib.rs Removed NapiPermissions trait
ext/fs/* Removed FsPermissions trait
ext/ffi/* Removed FfiPermissions trait
ext/fetch/lib.rs Removed FetchPermissions trait
ext/net/Cargo.toml Added sys_traits dev-dependency for tests

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nathanwhit nathanwhit force-pushed the remove-permission-traits branch from cc199b6 to 329d9fa Compare November 13, 2025 22:37
pub fn ensure_read_permission<'a>(
&self,
permissions: &mut dyn NodePermissions,
permissions: &mut PermissionsContainer,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these traits are necessary for deploy?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh maybe not. I remember now that a bunch of code was using PermissionsContainer anyway

Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@littledivy littledivy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@nathanwhit nathanwhit merged commit 5421a29 into denoland:main Nov 17, 2025
19 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.

3 participants