feat: add --allow-sys permission flag (#16028)

This commit is contained in:
Yoshiya Hinosawa 2022-09-28 21:46:50 +09:00 committed by GitHub
parent b312279e58
commit fa9e7aab6d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 527 additions and 51 deletions

View file

@ -183,6 +183,15 @@ declare namespace Deno {
*/
env?: "inherit" | boolean | string[];
/** Specifies if the `sys` permission should be requested or revoked.
* If set to `"inherit"`, the current `sys` permission will be inherited.
* If set to `true`, the global `sys` permission will be requested.
* If set to `false`, the global `sys` permission will be revoked.
*
* Defaults to `false`.
*/
sys?: "inherit" | boolean | string[];
/** Specifies if the `hrtime` permission should be requested or revoked.
* If set to `"inherit"`, the current `hrtime` permission will be inherited.
* If set to `true`, the global `hrtime` permission will be requested.
@ -2913,6 +2922,7 @@ declare namespace Deno {
| "write"
| "net"
| "env"
| "sys"
| "ffi"
| "hrtime";
@ -2957,6 +2967,19 @@ declare namespace Deno {
variable?: string;
}
/** @category Permissions */
export interface SysPermissionDescriptor {
name: "sys";
kind?:
| "loadavg"
| "hostname"
| "systemMemoryInfo"
| "networkInterfaces"
| "osRelease"
| "getUid"
| "getGid";
}
/** @category Permissions */
export interface FfiPermissionDescriptor {
name: "ffi";
@ -2979,6 +3002,7 @@ declare namespace Deno {
| WritePermissionDescriptor
| NetPermissionDescriptor
| EnvPermissionDescriptor
| SysPermissionDescriptor
| FfiPermissionDescriptor
| HrtimePermissionDescriptor;