Options
All
  • Public
  • Public/Protected
  • All
Menu

permission-guard

A zero-dependency, minimal permission guard for Deno to prevent overly permissive execution of your applications.

Test deno doc

import { guard } from "https://deno.land/x/permissionGuard@master/mod.ts";

Installation

This is a Deno module available to import direct from this repo and via the Deno Registry.

Before importing, download and install Deno.

You can then import permission-guard straight into your project:

import { guard } from "https://deno.land/x/permissionGuard@master/mod.ts";

If you want to use a specific version of permission-guard, just modify the import url to contain the version:

import { guard } from "https://deno.land/x/permissionGuard@0.3.0/mod.ts";

Or if you want to use a specific commit of permission-guard, just modify the import url to contain the commit hash:

import { guard } from "https://deno.land/x/permissionGuard@c21f8d6/mod.ts";

Note: permission-guard makes use of the unstable Deno Permissions API which requires --unstable to be passed in the Deno run command. You can use permission-guard in applications and not provide the --unstable flag, permission-guard will simply return as a no-op and not provide any defenses.

Features

  • Protection against unnecessary top-level permissions.
  • Protection against missing required permissions.
  • Recommendations where permissions could be better scoped (if log: true provided).
  • Useful logs detailing the missing or insecure permissions (if log: true provided).

Docs

Examples

To run the examples, you have two choices:

  1. Clone the permission-guard repo locally:

    git clone git://github.com/asos-craigmorten/permission-guard.git --depth 1
    cd permission-guard

    Then run the example you want:

    deno run --unstable ./examples/defaults/index.ts

All the examples contain example commands in their READMEs to help get you started.

Contributing

Contributing guide

Developing

Run Tests

make test

Format Code

make fmt

Generate Documentation

make typedoc

Generated using TypeDoc