Giter VIP home page Giter VIP logo

authzed / playground Goto Github PK

View Code? Open in Web Editor NEW
28.0 3.0 4.0 679 KB

Playground for SpiceDB, the open source, Google Zanzibar-inspired permissions database to enable fine-grained access control for customer applications

Home Page: https://play.authzed.com

License: Apache License 2.0

Dockerfile 0.08% TypeScript 64.03% Shell 0.15% JavaScript 35.66% HTML 0.04% CSS 0.04%
docker fine-grained-access-control permissions playground react spicedb vercel zanzibar

playground's Introduction

spicedb logo spicedb Logo

Playground

The SpiceDB Playground is an interactive app for building a SpiceDB schema, interacting with test relationships, and quickly iterating with test assertions.

Whether you're just getting started learning SpiceDB concepts or need to develop a new permissions system schema for your application, the SpiceDB playground has functionality to help.

SpiceDB Playground features include:

  • Rich text editor with syntax highlighting and tooltips
  • Visual relationship editor with support for defining caveat context data
  • Developer system that detects and presents schema and data errors
  • Real-time check requests against a full SpiceDB instance running client side via WASM
  • Fully functional zed CLI instance running client side via WASM
  • Schema and relationship graph visualization
  • Import and export schema and workspace data as a YAML file

What is SpiceDB?

SpiceDB is a graph database purpose-built for storing and evaluating access control data.

As of 2021, broken access control became the #1 threat to the web. With SpiceDB, developers finally have the solution to stopping this threat the same way as the hyperscalers.

Learn more about SpiceDB

Getting Started

Deploying

Docker

Run the latest Docker container

docker run -it -p 3000:3000 ghcr.io/authzed/spicedb-playground:latest

Connect to the running container.

http://<container>:3000

Vercel

Deploy an instance hosted on Vercel

Deploy with Vercel

or using the Vercel CLI

NODE_OPTIONS=--openssl-legacy-provider vercel build
vercel deploy --prebuilt

ℹ️ Git Large File Storage (LFS) must be enabled in your Vercel project settings.

NodeJS

The build directory in the project root directory after running yarn build will contain an optimized production React application that can be served using your preferred NodeJS hosting method.

ℹ️ Node v18.x is required.

For example:

NODE_OPTIONS=--openssl-legacy-provider yarn global install serve
cd build
serve

Installing dependencies

Setup git submodules: git submodule update --init --recursive

Run yarn install in the root project directory.

Updating wasm dependencies

The project contains prebuilt WASM files for versions of both SpiceDB and zed. To update the versions, edit the wasm-config.json file with the desired tag/commit hash and then run from the project root:

yarn run update:spicedb

yarn run update:zed

ℹ️ jq is required and must be installed.

Developing your own schema

You can try both SpiceDB and zed entirely in your browser on a SpiceDB Playground deployment thanks to the power of WebAssembly.

If you don't want to start with the examples loadable from a Playground, you can follow a guide for developing a schema or review the the schema language design documentation.

Watch the SpiceDB primer video to get started with schema development:

SpiceDB Primer YouTube Thumbnail

Contribute

CONTRIBUTING.md documents communication, contribution flow, legal requirements, and common tasks when contributing to the project.

You can find issues by priority: Urgent, High, Medium, Low, Maybe. There are also good first issues.

Our documentation website is also open source if you'd like to clarify anything you find confusing.

Joining the SpiceDB Community

SpiceDB is a community project where everyone is invited to participate and feel welcomed. While the project has a technical goal, participation is not restricted to those with code contributions. Join our Community Discord to ask questions and meet other users.

playground's People

Contributors

corkrean avatar samkim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

playground's Issues

Can't run Docker Image

Attempting to run the official Docker image (sha256:6d0bea9c40d8e5837a7c2e907045341d7be13be8101801661e03f558c7c3a878) as described in the README fails with

docker run -it -p 3001:3000 ghcr.io/authzed/spicedb-playground:latest
WARNING: The requested image's platform (linux/arm64/v8) does not match the detected host platform (linux/amd64/v4) and no specific platform was requested
exec ./docker-entrypoint-wrapper.sh: exec format error

An image build from the main branch (ref 769c8ec) works, this might just be about publishing a new Docker image.

wasm isn't effectively being cached

Despite having a max-age header, the wasm bundles are given a random query parameter that busts the cache each load.

I think the intention was originally to have this parameter be a SHA of the contents of the bundle.

Could not start the Development System. Please make sure you have WebAssembly enabled.

Precondition: Playground Docker image build from main branch, tagged spicedb-playground:master

  1. run container via docker run -it -p 3000:3000 spicedb-playground:master
  2. load <host>:3000 in browser FF (based on 115.6.0esr) or Edge (123.0.2420.81)

Expected: Playground environment with validation support
Observed: Playground environment with non-working validation support and error "Could not start the Development System. Please make sure you have WebAssembly enabled."

The feature works on https://play.authzed.com/schema, meaning the browsers apparently support the required features

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.