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

@ -255,11 +255,11 @@ declare namespace Deno {
* console.log(Deno.loadavg()); // e.g. [ 0.71, 0.44, 0.44 ]
* ```
*
* Requires `allow-env` permission.
* Requires `allow-sys` permission.
* There are questions around which permission this needs. And maybe should be
* renamed (loadAverage?).
*
* @tags allow-env
* @tags allow-sys
* @category Observability
*/
export function loadavg(): number[];
@ -272,11 +272,11 @@ declare namespace Deno {
* console.log(Deno.osRelease());
* ```
*
* Requires `allow-env` permission.
* Requires `allow-sys` permission.
* Under consideration to possibly move to Deno.build or Deno.versions and if
* it should depend sys-info, which may not be desirable.
*
* @tags allow-env
* @tags allow-sys
* @category Runtime Environment
*/
export function osRelease(): string;
@ -292,9 +292,9 @@ declare namespace Deno {
* console.log(Deno.systemMemoryInfo());
* ```
*
* Requires `allow-env` permission.
* Requires `allow-sys` permission.
*
* @tags allow-env
* @tags allow-sys
* @category Runtime Environment
*/
export function systemMemoryInfo(): SystemMemoryInfo;
@ -355,9 +355,9 @@ declare namespace Deno {
* console.log(Deno.networkInterfaces());
* ```
*
* Requires `allow-env` permission.
* Requires `allow-sys` permission.
*
* @tags allow-env
* @tags allow-sys
* @category Network
*/
export function networkInterfaces(): NetworkInterfaceInfo[];
@ -370,9 +370,9 @@ declare namespace Deno {
* console.log(Deno.getUid());
* ```
*
* Requires `allow-env` permission.
* Requires `allow-sys` permission.
*
* @tags allow-env
* @tags allow-sys
* @category Runtime Environment
*/
export function getUid(): number | null;
@ -385,9 +385,9 @@ declare namespace Deno {
* console.log(Deno.getGid());
* ```
*
* Requires `allow-env` permission.
* Requires `allow-sys` permission.
*
* @tags allow-env
* @tags allow-sys
* @category Runtime Environment
*/
export function getGid(): number | null;
@ -980,11 +980,11 @@ declare namespace Deno {
* console.log(Deno.hostname());
* ```
*
* Requires `allow-env` permission.
* Requires `allow-sys` permission.
* Additional consideration is still necessary around the permissions
* required.
*
* @tags allow-env
* @tags allow-sys
* @category Runtime Environment
*/
export function hostname(): string;