https://github.com/openfga/language
Grammar for the OpenFGA modeling language
https://github.com/openfga/language
fga hacktoberfest openfga
Last synced: 2 months ago
JSON representation
Grammar for the OpenFGA modeling language
- Host: GitHub
- URL: https://github.com/openfga/language
- Owner: openfga
- License: apache-2.0
- Created: 2023-07-20T15:58:56.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2026-02-11T18:09:41.000Z (2 months ago)
- Last Synced: 2026-02-11T19:19:20.573Z (2 months ago)
- Topics: fga, hacktoberfest, openfga
- Language: Go
- Homepage: https://openfga.dev
- Size: 3.07 MB
- Stars: 32
- Watchers: 12
- Forks: 14
- Open Issues: 31
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
- Security: .github/SECURITY-INSIGHTS.yml
- Notice: NOTICE.txt
- Agents: AGENTS.md
Awesome Lists containing this project
- awesome - openfga/language - Grammar for the OpenFGA modeling language (<a name="Go"></a>Go)
README
# OpenFGA Language
ANTLR Grammar for the OpenFGA DSL and parser from and to the OpenFGA JSON Syntax
[](https://www.npmjs.com/package/@openfga/syntax-transformer)
[](https://github.com/openfga/language/tree/main/pkg/go)
[](https://central.sonatype.com/artifact/dev.openfga/openfga-language)
[](./LICENSE)
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fopenfga%2Flanguage?ref=badge_shield)
[](https://openfga.dev/community)
[](https://twitter.com/openfga)
## Table of Contents
- [About OpenFGA](#about)
- [Resources](#resources)
- [Packages](#packages)
- [About This Repo](#about-this-repo)
- [CLI](#cli)
- [Community Parsers](#community-parsers)
- [Contributing](#contributing)
- [License](#license)
## About
[OpenFGA](https://openfga.dev) is an open source Fine-Grained Authorization solution inspired by [Google's Zanzibar paper](https://research.google/pubs/pub48190/). It was created by the FGA team at [Auth0](https://auth0.com) based on [Auth0 Fine-Grained Authorization (FGA)](https://fga.dev), available under [a permissive license (Apache-2)](https://github.com/openfga/rfcs/blob/main/LICENSE) 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.
## Resources
- [OpenFGA Documentation](https://openfga.dev/docs)
- [OpenFGA API Documentation](https://openfga.dev/api/service)
- [Twitter](https://twitter.com/openfga)
- [OpenFGA Community](https://openfga.dev/community)
- [Zanzibar Academy](https://zanzibar.academy)
- [Google's Zanzibar Paper (2019)](https://research.google/pubs/pub48190/)
## Packages
| Packages | Package Manager | Docs |
| -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- |
| JS | [](https://www.npmjs.com/package/@openfga/syntax-transformer) | [README](/pkg/js/README.md) |
| Go | [](https://github.com/openfga/language/tree/main/pkg/go) | [README](/pkg/go/README.md) |
| Java | [](https://central.sonatype.com/artifact/dev.openfga/openfga-language) | [README](/pkg/java/README.md) |
## About This Repo
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](https://github.com/openfga/language/issues/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](https://www.npmjs.com/package/@openfga/syntax-transformer/v/0.1.6) and below) | ❌ |
| Schema 1.1 | ✅ | ✅ (supported in [v0.2.0](https://www.npmjs.com/package/@openfga/syntax-transformer) and above) | ✅ |
| Schema 1.2 (Modular Models) | ✅ | ✅ | ✅ |
| Semantic Model Validations | ❌ (planned, see [#99](https://github.com/openfga/language/issues/99)) | ✅ | ✅ |
| Graphing & Utility Methods | ❌ (planned) | ❌ (planned) | ❌ (planned) |
## CLI
Use the [FGA CLI](https://github.com/openfga/cli)
## Community Parsers
| Repo | License | Maintainers | Language | Schema v1.0 | Schema v1.1 | Package Managers | Other Links |
| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ----------------------------------------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| [openfga language (syntax-transformer)](https://github.com/openfga/language) | [Apache-2.0](https://github.com/openfga/language/blob/main/LICENSE) | [@openfga](https://github.com/orgs/openfga/people) | ANTLR (Go and Typescript implementations) | <[0.1.5](https://www.npmjs.com/package/@openfga/syntax-transformer/v/0.1.5) | Yes (v0.0.8+) | [](https://www.npmjs.com/package/@openfga/syntax-transformer) -  | |
| [openfga-dsl-parser](https://github.com/maxmindlin/openfga-dsl-parser) | [Apache-2.0](https://github.com/maxmindlin/openfga-dsl-parser/blob/master/LICENSE) | [@maxmindlin](https://github.com/maxmindlin) - [@dblclik](https://github.com/dblclik) | Rust | Yes | No | [](https://crates.io/crates/openfga-dsl-parser)[](https://pypi.org/project/openfga-dsl-parser-python/) | [WASM](https://github.com/dblclik/openfga-dsl-parser-wasm) - [Python](https://github.com/maxmindlin/openfga-dsl-parser-python) |
| [openfga-rs](https://github.com/iammathew/openfga-rs) | [Apache-2.0](https://github.com/iammathew/openfga-rs/blob/main/LICENSE.md) | [@iammathew](https://github.com/iammathew) | Rust | Yes | No | | |
| [openfga-dsl-parser](https://github.com/craigpastro/openfga-dsl-parser) | [Apache-2.0](https://github.com/craigpastro/openfga-dsl-parser/blob/main/LICENSE) | [@craigpastro](https://github.com/craigpastro) | ANTLR & Go | Yes | Partial (requires self). [Supports nesting](https://github.com/openfga/syntax-transformer/issues/34) |  | |
## Community Wrapper
| Repo | License | Maintainers | Language | Schema v1.0 | Schema v1.1 | Package Managers | Other Links |
| --------------------------------------------------------------------- | ----------------------------------------------------------------------- | -------------------------------------------------- | ---------- | ----------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
| [fga cli](https://github.com/openfga/cli) | [Apache-2.0](https://github.com/openfga/cli/blob/main/LICENSE) | [@openfga](https://github.com/orgs/openfga/people) | Go | No | Yes |  | |
| [fga-transformer-cli](https://github.com/ozee-io/fga-transformer-cli) | [MIT](https://github.com/ozee-io/fga-transformer-cli/blob/main/LICENSE) | [@ozee-io](https://github.com/orgs/ozee-io/people) | Javascript | Yes | Yes | [](https://www.npmjs.com/package/@ozee-io/fga-transformer-cli) | |
## Contributing
See [CONTRIBUTING](https://github.com/openfga/.github/blob/main/CONTRIBUTING.md).
## Author
[OpenFGA](https://github.com/openfga)
## License
This project is licensed under the Apache-2.0 license. See the [LICENSE](https://github.com/openfga/language/blob/main/LICENSE) file for more info.