Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/northone-inc/local-spicedb

Local SpiceDB instance for testing
https://github.com/northone-inc/local-spicedb

Last synced: about 2 months ago
JSON representation

Local SpiceDB instance for testing

Awesome Lists containing this project

README

        

# Local SpiceDB

[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/northone-inc/local-spicedb/ci.yml?label=ci)](https://github.com/northone-inc/local-spicedb/actions/workflows/ci.yml)

> **Warning**
> This project is still experimental, not for production use - FEATURES MAY CHANGE WITHOUT WARNING
> THIS Project doesn't work in CircleCI!

Local SpiceDB instance for testing

- [Local SpiceDB](#local-spicedb)
- [Features](#features)
- [Install](#install)
- [Usage](#usage)
- [Attributions](#attributions)

## Features

- Interacts with `spicedb` in your local `$PATH`
- provides start and start server functionality
- users in-memory to easily throw-away for integration testing

## Install

```bash
brew bundle # installs spicedb locally
npm install -D local-spicedb
```

## Usage

```typescript
import { describe, it } from 'vitest'
import { SpiceDBServer } from 'local-spicedb'

describe('My SpiceDB Application', () => {
it('can start and stop server', async () => {
const server = SpiceDBServer({ 'grpc-preshared-key': 'test' })
await server.start()
// ...
// 1. make requests to spicedb server, default port using pre-shared key above
// 2....
// 3. great profit
// ...
await server.stop() # sends SIGINT to running process
})
})

```

## Attributions

- [shelljs](https://www.npmjs.com/package/shelljs)
- [spicedb](https://github.com/authzed/spicedb) by [AuthZed](https://authzed.com/)