From 6c7f51ce57648ba3d57e03fe6603154628b9087c Mon Sep 17 00:00:00 2001 From: Jo Franchetti Date: Tue, 30 Apr 2024 14:57:50 +0100 Subject: [PATCH] put permissions into accordion --- runtime/manual/tools/test.md | 221 ++++++++++++++++++----------------- 1 file changed, 112 insertions(+), 109 deletions(-) diff --git a/runtime/manual/tools/test.md b/runtime/manual/tools/test.md index 73d41dc00..632fc9606 100644 --- a/runtime/manual/tools/test.md +++ b/runtime/manual/tools/test.md @@ -57,33 +57,33 @@ Arguments passed to script files ## Options -- `--no-check[=]` +- `--no-check[=]`\ Skip type-checking. If the value of '--no-check=remote' is supplied, diagnostic errors from remote modules will be ignored. -- `--import-map ` +- `--import-map `\ Load [import map](https://docs.deno.com/runtime/manual/basics/import_maps) file from local file or remote URL. - `-q, --quiet` Suppress diagnostic output -- `--no-remote` +- `--no-remote`\ Do not resolve remote modules -- `--no-npm` +- `--no-npm`\ Do not resolve npm modules -- `--node-modules-dir[=]` +- `--node-modules-dir[=]`\ Enables or disables the use of a local node_modules folder for npm packages. [possible values: true, false] -- `--vendor[=]` +- `--vendor[=]`\ UNSTABLE: Enables or disables the use of a local vendor folder for remote modules and node_modules folder for npm packages. [possible values: true, false] - `-c, --config ` The [configuration file](https://deno.land/manual/getting_started/configuration_file) can be used to configure different aspects of deno including TypeScript, linting, and code formatting. Typically the configuration file will be called `deno.json` or `deno.jsonc` and automatically detected; in that case this flag is not necessary. -- `--no-config` +- `--no-config`\ Disable automatic loading of the configuration file. - `-r, --reload[=...]` @@ -100,169 +100,172 @@ Arguments passed to script files `--reload=npm:chalk` Reload specific npm module -- `--lock []` +- `--lock []`\ Check the specified lock file. If value is not provided, defaults to "deno.lock" in the current working directory. -- `--lock-write` +- `--lock-write`\ Force overwriting the lock file. -- `--no-lock` +- `--no-lock`\ Disable auto discovery of the lock file. -- `--cert ` +- `--cert `\ Load certificate authority from PEM encoded file -- `--allow-read[=...]` - Allow [file system read access](https://deno.land/manual/basics/permissions). Optionally specify allowed paths. - Examples: `--allow-read`, `--allow-read="/etc,/var/log.txt"` - -- `--deny-read[=...]` - Deny [file system read access](https://deno.land/manual/basics/permissions). Optionally specify denied paths. - Examples: `--deny-read`, `--deny-read="/etc,/var/log.txt"` - -- `--allow-write[=...]` - Allow [file system write access](https://deno.land/manual/basics/permissions). Optionally specify allowed paths. - Examples: `--allow-write`, `--allow-write="/etc,/var/log.txt"` - -- `--deny-write[=...]` - Deny [file system write access](https://deno.land/manual/basics/permissions). Optionally specify denied paths. - Examples: `--deny-write`, `--deny-write="/etc,/var/log.txt"` - -- `--allow-net[=...]` - Allow [network access](https://deno.land/manual/basics/permissions). Optionally specify allowed IP addresses and host names, with ports as necessary. - Examples: `--allow-net`, `--allow-net="localhost:8080,deno.land"` - -- `--deny-net[=...]` - Deny [network access](https://deno.land/manual/basics/permissions). Optionally specify denied IP addresses and host names, with ports as necessary. - Examples: `--deny-net`, `--deny-net="localhost:8080,deno.land"` - -- `--unsafely-ignore-certificate-errors[=...]` - DANGER: Disables verification of TLS certificates - -- `--allow-env[=...]` - Allow [access to system environment information](https://deno.land/manual/basics/permissions). Optionally specify accessible environment variables. - Examples: `--allow-env`, `--allow-env="PORT,HOME,PATH"` - -- `--deny-env[=...]` - Deny [access to system environment information](https://deno.land/manual/basics/permissions). Optionally specify accessible environment variables. - Examples: `--deny-env`, `--deny-env="PORT,HOME,PATH"` - -- `--allow-sys[=...]` - Allow [access to OS information](https://deno.land/manual/basics/permissions). Optionally allow - specific APIs by function name. - Examples: `--allow-sys`, `--allow-sys="systemMemoryInfo,osRelease"` - -- `--deny-sys[=...]` - Deny [access to OS information](https://deno.land/manual/basics/permissions). Optionally deny - specific APIs by function name. - Examples: `--deny-sys`, `--deny-sys="systemMemoryInfo,osRelease"` - -- `--allow-run[=...]` - Allow [running subprocesses](https://deno.land/manual/basics/permissions). Optionally - specify allowed runnable program names. - Examples: `--allow-run`, `--allow-run="whoami,ps"` - -- `--deny-run[=...]` - Deny [running subprocesses](https://deno.land/manual/basics/permissions). Optionally specify denied runnable program names. - Examples: `--deny-run`, `--deny-run="whoami,ps"` - -- `--allow-ffi[=...]` - (Unstable) Allow loading dynamic libraries. Optionally specify [allowed directories or files](https://deno.land/manual/basics/permissions). - Examples: `--allow-ffi`, `--allow-ffi="./libfoo.so"` - -- `--deny-ffi[=...]` - (Unstable) Deny [loading dynamic libraries](https://deno.land/manual/basics/permissions). Optionally specify denied directories or files. - Examples: `--deny-ffi`, `--deny-ffi="./libfoo.so"` - -- `--allow-hrtime` - Allow [high-resolution time measurement](https://deno.land/manual/basics/permissions). Note: this can enable timing attacks and fingerprinting. - -- `--deny-hrtime` - Deny [high-resolution time measurement](https://deno.land/manual/basics/permissions). Note: this can prevent - timing attacks and fingerprinting. - -- `-A, --allow-all` - Allow [all permissions](https://deno.land/manual/basics/permissions). - -- `--no-prompt` +- `--no-prompt`\ Always throw if required permission wasn't passed -- `--inspect[=]` +- `--inspect[=]`\ Activate inspector on host:port (default: 127.0.0.1:9229) -- `--inspect-brk[=]` +- `--inspect-brk[=]`\ Activate inspector on host:port, wait for debugger to connect and break at the start of user script -- `--inspect-wait[=]` +- `--inspect-wait[=]`\ Activate inspector on host:port and wait for debugger to connect before running user code -- `--cached-only` +- `--cached-only`\ Require that remote dependencies are already cached -- `--location ` +- `--location `\ Value of `globalThis.location` used by some web APIs -- `--v8-flags[=...]` +- `--v8-flags[=...]`\ To see a list of all available flags use `--v8-flags=--help`. Any flags set with this flag are appended after the `DENO_V8_FLAGS` environmental variable -- `--seed ` +- `--seed `\ Set the random number generator seed -- `--check[=]` +- `--check[=]`\ Set type-checking behavior. This subcommand type-checks local modules by default, so adding `--check` is redundant. If the value of '--check=all' is supplied, diagnostic errors from remote modules will be included. Alternatively, the 'deno check' subcommand can be used. -- `--ignore=...` +- `--ignore=...`\ Ignore files -- `--no-run` +- `--no-run`\ Cache test modules, but don't run tests -- `--trace-leaks` +- `--trace-leaks`\ Enable tracing of leaks. Useful when debugging leaking ops in test, but impacts test execution time. -- `--doc` +- `--doc`\ Type-check code blocks in JSDoc and Markdown -- `--fail-fast[=]` +- `--fail-fast[=]`\ Stop after N errors. Defaults to stopping after first failure. -- `--allow-none` +- `--allow-none`\ Don't return error code if no test files are found -- `--filter ` +- `--filter `\ Run tests with this string or pattern in the test name -- `--shuffle[=]` +- `--shuffle[=]`\ Shuffle the order in which the tests are run -- `--coverage[=]` +- `--coverage[=]`\ Collect coverage profile data into DIR. If DIR is not specified, it uses `coverage/`. -- `--parallel` +- `--parallel`\ Run test modules in parallel. Parallelism defaults to the number of available CPUs or the value in the DENO_JOBS environment variable. -- `--watch` +- `--watch`\ Watch for file changes and restart process automatically. Only local files from entry point module graph are watched. -- `--watch-exclude[=...]` +- `--watch-exclude[=...]`\ Exclude provided files/patterns from watch mode -- `--no-clear-screen` +- `--no-clear-screen`\ Do not clear terminal screen when under watch mode -- `--junit-path ` +- `--junit-path `\ Write a JUnit XML test report to PATH. Use `-` to write to stdout which is the default when PATH is not provided. -- `--reporter ` +- `--reporter `\ Select reporter to use. Default to 'pretty'. [possible values: pretty, dot, junit, tap] -- `--env[=]` +- `--env[=]`\ UNSTABLE: Load environment variables from local file. Only the first environment variable with a given key is used. Existing process environment variables are not overwritten. -- `-h, --help` +- `-h, --help`\ Prints help information +
+ Permissions Options + - `--allow-read[=...]`\ + Allow [file system read access](https://deno.land/manual/basics/permissions). Optionally specify allowed paths. + Examples: `--allow-read`, `--allow-read="/etc,/var/log.txt"` + + - `--deny-read[=...]`\ + Deny [file system read access](https://deno.land/manual/basics/permissions). Optionally specify denied paths. + Examples: `--deny-read`, `--deny-read="/etc,/var/log.txt"` + + - `--allow-write[=...]`\ + Allow [file system write access](https://deno.land/manual/basics/permissions). Optionally specify allowed paths. + Examples: `--allow-write`, `--allow-write="/etc,/var/log.txt"` + + - `--deny-write[=...]`\ + Deny [file system write access](https://deno.land/manual/basics/permissions). Optionally specify denied paths. + Examples: `--deny-write`, `--deny-write="/etc,/var/log.txt"` + + - `--allow-net[=...]` \ + Allow [network access](https://deno.land/manual/basics/permissions). Optionally specify allowed IP addresses and host names, with ports as necessary. + Examples: `--allow-net`, `--allow-net="localhost:8080,deno.land"` + + - `--deny-net[=...]`\ + Deny [network access](https://deno.land/manual/basics/permissions). Optionally specify denied IP addresses and host names, with ports as necessary. + Examples: `--deny-net`, `--deny-net="localhost:8080,deno.land"` + + - `--unsafely-ignore-certificate-errors[=...]`\ + DANGER: Disables verification of TLS certificates + + - `--allow-env[=...]`\ + Allow [access to system environment information](https://deno.land/manual/basics/permissions). Optionally specify accessible environment variables. + Examples: `--allow-env`, `--allow-env="PORT,HOME,PATH"` + + - `--deny-env[=...]`\ + Deny [access to system environment information](https://deno.land/manual/basics/permissions). Optionally specify accessible environment variables. + Examples: `--deny-env`, `--deny-env="PORT,HOME,PATH"` + + - `--allow-sys[=...]`\ + Allow [access to OS information](https://deno.land/manual/basics/permissions). Optionally allow + specific APIs by function name. + Examples: `--allow-sys`, `--allow-sys="systemMemoryInfo,osRelease"` + + - `--deny-sys[=...]`\ + Deny [access to OS information](https://deno.land/manual/basics/permissions). Optionally deny + specific APIs by function name. + Examples: `--deny-sys`, `--deny-sys="systemMemoryInfo,osRelease"` + + - `--allow-run[=...]`\ + Allow [running subprocesses](https://deno.land/manual/basics/permissions). Optionally + specify allowed runnable program names. + Examples: `--allow-run`, `--allow-run="whoami,ps"` + + - `--deny-run[=...]`\ + Deny [running subprocesses](https://deno.land/manual/basics/permissions). Optionally specify denied runnable program names. + Examples: `--deny-run`, `--deny-run="whoami,ps"` + + - `--allow-ffi[=...]`\ + (Unstable) Allow loading dynamic libraries. Optionally specify [allowed directories or files](https://deno.land/manual/basics/permissions). + Examples: `--allow-ffi`, `--allow-ffi="./libfoo.so"` + + - `--deny-ffi[=...]`\ + (Unstable) Deny [loading dynamic libraries](https://deno.land/manual/basics/permissions). Optionally specify denied directories or files. + Examples: `--deny-ffi`, `--deny-ffi="./libfoo.so"` + + - `--allow-hrtime`\ + Allow [high-resolution time measurement](https://deno.land/manual/basics/permissions). Note: this can enable timing attacks and fingerprinting. + + - `--deny-hrtime`\ + Deny [high-resolution time measurement](https://deno.land/manual/basics/permissions). Note: this can prevent + timing attacks and fingerprinting. + + - `-A, --allow-all`\ + Allow [all permissions](https://deno.land/manual/basics/permissions). +
+ ## Examples - Run tests