feat(secure): allow 'path' parameter for trust action 'allow' (#38001)

This commit is contained in:
anondeveg
2026-02-26 04:55:05 +02:00
committed by GitHub
parent e86ccdbeae
commit 6ba32713ad
5 changed files with 32 additions and 10 deletions

View File

@@ -168,7 +168,6 @@ end
--- @field action 'allow'|'deny'|'remove'
---
--- Path to a file to update. Mutually exclusive with {bufnr}.
--- Cannot be used when {action} is "allow".
--- @field path? string
--- Buffer number to update. Mutually exclusive with {path}.
--- @field bufnr? integer
@@ -195,10 +194,6 @@ function M.trust(opts)
assert(not path or not bufnr, '"path" and "bufnr" are mutually exclusive')
if action == 'allow' then
assert(not path, '"path" is not valid when action is "allow"')
end
local fullpath ---@type string?
if path then
fullpath = vim.uv.fs_realpath(vim.fs.normalize(path))