dev.openfga.openfga-language v0.2.0-beta.1
Install 1/2: Add this to pom.xml:
Learn more about Maven or Gradle
<dependency>
<groupId>dev.openfga</groupId>
<artifactId>openfga-language</artifactId>
<version>v0.2.0-beta.1</version>
</dependency>
Install 2/2: Run via command line
$ mvn install
About this package
ANTLR Grammar for the OpenFGA DSL and parser from and to the OpenFGA JSON Syntax
- About OpenFGA
- Resources
- Packages
- About This Repo
- Installation
- Usage
- CLI
- Community Parsers
- Contributing
- License
OpenFGA is an open source Fine-Grained Authorization solution inspired by Google's Zanzibar paper. It was created by the FGA team at Auth0 based on Auth0 Fine-Grained Authorization (FGA), available under a permissive license (Apache-2) and welcomes community contributions.
OpenFGA is designed to make it easy for application builders to model their permission layer, and to add and integrate fine-grained authorization into their applications. OpenFGA’s design is optimized for reliability and low latency at a high scale.
- OpenFGA Documentation
- OpenFGA API Documentation
- OpenFGA Community
- Zanzibar Academy
- Google's Zanzibar Paper (2019)
Packages | Package Manager |
---|---|
JS | |
Go | |
Java |
This repo contains everything needed to interact with the OpenFGA Authorization Models schema versions 1.1+, in multiple languages (currently, Go and JS are supported).
Feature | Implemented in ANTLR |
---|---|
Basic DSL | ✅ |
Nesting | ✅ (partial, see #113) |
Conditions | ✅ |
Feature | Go | JS | Java |
---|---|---|---|
Transformer from the DSL to JSON and from JSON to DSL | ✅ | ✅ | ✅ |
Syntactic Model Validations | ✅ | ✅ | ✅ |
Schema 1.0 | ❌ | ❌ (supported in v0.1.6 and below) | ❌ |
Schema 1.1 | ✅ | ✅ (supported in v0.2.0 and above) | ✅ |
Schema 1.2 (Modular Models) | ✅ | ✅ | ✅ |
Semantic Model Validations | ❌ (planned, see #99) | ✅ | ✅ |
Graphing & Utility Methods | ❌ (planned) | ❌ (planned) | ❌ (planned) |
go get github.com/openfga/language/pkg/go
npm install @openfga/syntax-transformer
From dev.openfga/openfga-language on MavenCentral
import "github.com/openfga/language/pkg/go/transformer"
dslString := `model
schema 1.1
type user
type folder
relations
define viewer: [user]`
// Transform from DSL to a JSON string
generatedJsonString, err := transformer.TransformDSLToJSONString(dslString)
// Transform from a JSON string to DSL
generatedDsl, err := transformer.TransformJSONStringToDSL(generatedJsonString)
import { transformer } from "@openfga/syntax-transformer"
let dslString = `model
schema 1.1
type user
type folder
relations
define viewer: [user]`;
// Transform from DSL to a JSON string
const generatedJsonString = transformer.transformDSLToJSONString(dslString)
// Transform from a JSON string to DSL
const generatedDsl = transformer.transformJSONStringToDSL(generatedJsonString)
import dev.openfga.language.DslToJsonTransformer;
import dev.openfga.language.JsonToDslTransformer;
var dslString = """model
schema 1.1
type user
type folder
relations
define viewer: [user]""";
// Transform from DSL to a JSON string
var generatedJsonString = new DslToJsonTransformer().transform(dslString);
// Transform from a JSON string to DSL
var generatedDsl = new JsonToDslTransformer().transform(generatedJsonString);
Use the FGA CLI
Repo | License | Maintainers | Language | Schema v1.0 | Schema v1.1 | Package Managers | Other Links |
---|---|---|---|---|---|---|---|
openfga language (syntax-transformer) | Apache-2.0 | @openfga | ANTLR (Go and Typescript implementations) | <0.1.5 | Yes (v0.0.8+) | - | |
openfga-dsl-parser | Apache-2.0 | @maxmindlin - @dblclik | Rust | Yes | No | WASM - Python | |
openfga-rs | Apache-2.0 | @iammathew | Rust | Yes | No | ||
openfga-dsl-parser | Apache-2.0 | @craigpastro | ANTLR & Go | Yes | Partial (requires self). Supports nesting |
Repo | License | Maintainers | Language | Schema v1.0 | Schema v1.1 | Package Managers | Other Links |
---|---|---|---|---|---|---|---|
fga cli | Apache-2.0 | @openfga | Go | No | Yes | ||
fga-transformer-cli | MIT | @ozee-io | Javascript | Yes | Yes |
See CONTRIBUTING.
This project is licensed under the Apache-2.0 license. See the LICENSE file for more info.
Details
- openfga
- June 14, 2024
- 4 dependencies
- Apache License 2.0
Assets
- openfga-language-v0.2.0-beta.1.pom.asc.sha512
- openfga-language-v0.2.0-beta.1.pom.asc.sha256
- openfga-language-v0.2.0-beta.1.pom.asc.md5
- openfga-language-v0.2.0-beta.1.pom.asc.sha1
- openfga-language-v0.2.0-beta.1.pom.asc
- openfga-language-v0.2.0-beta.1.module.sha512
- openfga-language-v0.2.0-beta.1.module.sha256
- openfga-language-v0.2.0-beta.1.module.md5
- openfga-language-v0.2.0-beta.1.module.sha1
- openfga-language-v0.2.0-beta.1.module
- openfga-language-v0.2.0-beta.1.jar.asc.sha512
- openfga-language-v0.2.0-beta.1.jar.asc.sha256
- openfga-language-v0.2.0-beta.1.jar.asc.md5
- openfga-language-v0.2.0-beta.1.jar.asc.sha1
- openfga-language-v0.2.0-beta.1.jar.asc
- openfga-language-v0.2.0-beta.1.module.asc.sha512
- openfga-language-v0.2.0-beta.1.module.asc.sha256
- openfga-language-v0.2.0-beta.1.module.asc.md5
- openfga-language-v0.2.0-beta.1.module.asc.sha1
- openfga-language-v0.2.0-beta.1.module.asc
- openfga-language-v0.2.0-beta.1.pom.sha512
- openfga-language-v0.2.0-beta.1.pom.sha256
- openfga-language-v0.2.0-beta.1.pom.md5
- openfga-language-v0.2.0-beta.1.pom.sha1
- openfga-language-v0.2.0-beta.1.pom
- openfga-language-v0.2.0-beta.1.jar.sha512
- openfga-language-v0.2.0-beta.1.jar.sha256
- openfga-language-v0.2.0-beta.1.jar.md5
- openfga-language-v0.2.0-beta.1.jar.sha1
- openfga-language-v0.2.0-beta.1.jar
Download activity
- Total downloads 0
- Last 30 days 0
- Last week 0
- Today 0
Topics
Recent versions
-
v0.2.0-beta.2
Sep 6, 2024 -
v0.2.0-beta.1
Jun 14, 2024