Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cmorten/permission-guard
A zero-dependency, minimal permission guard for Deno.
https://github.com/cmorten/permission-guard
deno deno-doc deno-module denojs denoland permission-guard permission-manager permissions protection security security-hardening
Last synced: 4 months ago
JSON representation
A zero-dependency, minimal permission guard for Deno.
- Host: GitHub
- URL: https://github.com/cmorten/permission-guard
- Owner: cmorten
- License: mit
- Created: 2020-05-27T08:33:53.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-01-28T09:45:54.000Z (about 1 year ago)
- Last Synced: 2024-10-17T03:17:59.120Z (4 months ago)
- Topics: deno, deno-doc, deno-module, denojs, denoland, permission-guard, permission-manager, permissions, protection, security, security-hardening
- Language: TypeScript
- Homepage: https://asos-craigmorten.github.io/permission-guard/
- Size: 213 KB
- Stars: 4
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
- Codeowners: .github/CODEOWNERS.md
- Security: SECURITY.md
Awesome Lists containing this project
README
Permission Guard
A zero-dependency, minimal permission guard for Deno to prevent overly permissive execution of your applications.
---
## Table of Contents
- [Getting Started](#getting-started)
- [Installation](#installation)
- [Features](#features)
- [Documentation](#documentation)
- [Examples](#examples)
- [Contributing](#contributing)
- [License](#license)## Getting Started
```ts
import { guard } from "https://deno.land/x/[email protected]/mod.ts";await guard();
console.log("Execute my code...!");
```## Installation
This is a [Deno](https://deno.land/) module available to import direct from this repo and via the [Deno Registry](https://deno.land/x).
Before importing, [download and install Deno](https://deno.land/#installation).
You can then import Permission Guard straight into your project:
```ts
import { guard } from "https://deno.land/x/[email protected]/mod.ts";
```Permission Guard is also available on [nest.land](https://nest.land/package/permissionGuard), a package registry for Deno on the Blockchain.
```ts
import { guard } from "https://x.nest.land/[email protected]/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. Including ability to revoke undesired 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).## Documentation
- [Permission Guard Docs](https://asos-craigmorten.github.io/permission-guard/) - usually the best place when getting started ✨
- [Permission Guard Deno Docs](https://doc.deno.land/https/deno.land/x/permissionGuard/mod.ts)
- [License](https://github.com/asos-craigmorten/permission-guard/blob/main/LICENSE.md)
- [Changelog](https://github.com/asos-craigmorten/permission-guard/blob/main/.github/CHANGELOG.md)## Examples
To run the [examples](./examples), you have two choices:
1. Clone the Permission Guard repo locally:
```bash
git clone git://github.com/asos-craigmorten/permission-guard.git --depth 1
cd permission-guard
```Then run the example you want:
```bash
deno run --unstable ./examples/defaults/index.ts
```All the [examples](./examples) contain example commands in their READMEs to help get you started.
## Contributing
[Contributing guide](https://github.com/asos-craigmorten/permission-guard/blob/main/.github/CONTRIBUTING.md)
---
## License
Permission Guard is licensed under the [MIT License](./LICENSE.md).