Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dolevf/open-policy-agent-alfred
Reasonably Usable Self-hosted Version of OPA's Playground
https://github.com/dolevf/open-policy-agent-alfred
Last synced: about 2 months ago
JSON representation
Reasonably Usable Self-hosted Version of OPA's Playground
- Host: GitHub
- URL: https://github.com/dolevf/open-policy-agent-alfred
- Owner: dolevf
- License: mit
- Created: 2022-06-09T14:11:27.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-14T02:26:37.000Z (12 months ago)
- Last Synced: 2024-08-03T21:01:47.894Z (5 months ago)
- Language: CSS
- Size: 19.1 MB
- Stars: 22
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Table of Contents
* [About](#about)
* [Features](#features)
* [Screenshot](#screenshot)
* [Install](#how-to-install)
* [Installation - Docker](#docker)
* [Installation - Docker Registry](#docker-registry)
* [Installation - Server](#server)
* [Maintainers](#maintainers)
* [License](#license)# OPA Alfred
Reasonably usable self-hosted version of OPA's Playground# About
Ever wanted to have your own version of [OPA's Playground](https://play.openpolicyagent.org)? now it's possible with a reasonably usable version of the original Playground, called Alfred!# Features
- Syntax Highlighting
- Policy Publishing
- Coverage Highlighting
- Data / Input / Policy Editor
- Restrict Execution of Builtins, such as: `http.send` or `opa.runtime`
- Download Policy as File / Copy to Clipboard# Screenshot
# Configuration
There is not a whole lot of configurations required for Alfred. If you want to restrict certain builtins from running in policies, you can do so in `config.py`:```
RESTRICTED_BUILTINS = [
'http.send',
'opa.runtime'
]
```By default, all builtins are allowed.
# How to Install
## Clone repository
`git clone https://github.com/dolevf/Open-Policy-Agent-Alfred``cd Open-Policy-Agent-Alfred`
## Docker
### Build Docker Image
`docker build -t alfred .`### Run Alfred Container
`docker run -d -p 5000:5000 alfred`## Docker Registry
### Pull Alfred from Registry
`docker pull dolevf/alfred`### Run Alfred Container
`docker run -d -p 5000:5000 dolevf/alfred`## Server
### Install requirements`pip3 install -r requirements.txt`
### Download OPA binary
For Linux:`curl -L -o bin/opa https://openpolicyagent.org/downloads/latest/opa_linux_amd64_static`
For MacOSX:
`curl -L -o bin/opa https://openpolicyagent.org/downloads/latest/opa_darwin_amd64`
### Set permissions
`chmod u+x bin/opa`### Run Alfred
`python3 alfred.py`# Open Alfred
[http://localhost:5000](http://localhost:5000)# Maintainers
- Dolev Farhi# License
It is distributed under the MIT License. See LICENSE for more information.