Skip to content

permission: support URL and Uint8Array as has()/drop() reference - #65492

Open
nhjbest22 wants to merge 1 commit into
nodejs:mainfrom
nhjbest22:permission-reference-types
Open

permission: support URL and Uint8Array as has()/drop() reference#65492
nhjbest22 wants to merge 1 commit into
nodejs:mainfrom
nhjbest22:permission-reference-types

Conversation

@nhjbest22

Copy link
Copy Markdown

process.permission.has()/drop() only accepted a string or Buffer for
the reference argument. This adds support for a WHATWG URL, resolved
via fileURLToPath() for fs.* scopes since those are the only scopes
that actually use the reference value, and a plain Uint8Array.

Also switches permission.cc from Utf8Value to BufferValue when reading
a Buffer/TypedArray reference, since Utf8Value forces a UTF-8 string
conversion that can silently corrupt a path that isn't valid UTF-8.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/security-wg

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. process Issues and PRs related to the process subsystem. labels Aug 22, 2026
@codecov

codecov Bot commented Aug 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.69767% with 4 lines in your changes missing coverage. Please review.
βœ… Project coverage is 90.14%. Comparing base (cf30b2e) to head (42241f8).
⚠️ Report is 128 commits behind head on main.

Files with missing lines Patch % Lines
src/permission/permission.cc 72.72% 0 Missing and 3 partials ⚠️
lib/internal/process/permission.js 96.87% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65492      +/-   ##
==========================================
+ Coverage   90.11%   90.14%   +0.03%     
==========================================
  Files         752      751       -1     
  Lines      251861   252647     +786     
  Branches    47365    47549     +184     
==========================================
+ Hits       226955   227745     +790     
+ Misses      16238    16192      -46     
- Partials     8668     8710      +42     
Files with missing lines Coverage Ξ”
lib/internal/process/permission.js 92.39% <96.87%> (+10.68%) ⬆️
src/permission/permission.cc 75.98% <72.72%> (+0.76%) ⬆️

... and 108 files with indirect coverage changes

πŸš€ New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • πŸ“¦ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nhjbest22
nhjbest22 force-pushed the permission-reference-types branch from 6d518fc to 72717a5 Compare August 23, 2026 12:59
normalizeReference() adds URL and Uint8Array support to has()/drop();
the existing string/Buffer behavior is unchanged. BufferValue replaces
Utf8Value so a Buffer/TypedArray reference is copied as raw bytes
instead of a lossy UTF-8 conversion.

Signed-off-by: seungmin Nam <nhjbest22@g.skku.edu>
@nhjbest22
nhjbest22 force-pushed the permission-reference-types branch from 72717a5 to 42241f8 Compare August 23, 2026 13:09
@RafaelGSS RafaelGSS added request-ci Add this label to start a Jenkins CI on a PR. author ready PRs that have at least one approval, no outstanding review comments, and a CI started. permission Issues and PRs related to the Permission Model labels Aug 24, 2026
@github-actions github-actions Bot added request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. and removed request-ci Add this label to start a Jenkins CI on a PR. labels Aug 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor
Failed to start CI
- Validating Jenkins credentials
βœ”  Jenkins credentials valid
- Starting PR CI job
✘  Failed to start PR CI: 400 Bad Request
https://github.com/nodejs/node/actions/runs/32766200455

@RafaelGSS RafaelGSS added request-ci Add this label to start a Jenkins CI on a PR. and removed request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. labels Aug 24, 2026
@github-actions github-actions Bot added request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. and removed request-ci Add this label to start a Jenkins CI on a PR. labels Aug 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor
Failed to start CI
- Validating Jenkins credentials
βœ”  Jenkins credentials valid
- Starting PR CI job
✘  Failed to start PR CI: 400 Bad Request
https://github.com/nodejs/node/actions/runs/32769291770

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. permission Issues and PRs related to the Permission Model process Issues and PRs related to the process subsystem. request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants