/vscode-ext

An OpenFGA extension for VS Code

Primary LanguageTypeScriptApache License 2.0Apache-2.0

OpenFGA Extension for VS Code

VS Code extension that provides syntax highlighting for the OpenFGA language for authorization models.

Release License Discord Server Twitter

About

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.

Resources

Installation

Installing from VSIX file

Usage

The extension currently offers 3 core features, with more to come.

  • Syntax Highlighting for OpenFGA files
  • A unique theme for OpenFGA for VS Code
    • Once installed, go to your extensions
    • Click on OpenFGA and click Set Color Scheme
    • Click on OpenFGA Dark in the prompt

Prompt to set OpenFGA Dark color scheme

  • A command to transform OpenFGA files to JSON
    • Open an OpenFGA file in the editor
    • Open the Command Pallette using Ctrl+Shift+P (Windows) or Command+Shift+P (OSX)
    • Select OpenFGA: Transform DSL to JSON
    • A new tab will open with the transformed code

Prompt to execute OpenFGA: Transform DSL to JSON command

Development

  • Run npm install in the root directory. This installs all necessary npm modules.
  • Run npm run compile && npm test to execute the client test suite.

Distribution (Optional)

To generate an installable build of this extension, you can do the following:

  • Run npm install --global @vscode/vsce to get the latest version of vsce for packaging
  • Run vsce package to generate an installable VISX artifact for testing or distribution

Structure

.
├── package.json // The extension manifest
├── client // Language client
│   ├── src
│   │   ├── test // End to end tests for language client / server
│   │   └── extension.ts // Language client entry point

Running the Client

  • Run npm install in the root directory. This installs all necessary npm modules.
  • Open the root directory in VS Code.
  • Press Ctrl+Shift+B (Windows) or Command+Shift+B (OSX) to start compiling the client and server in watch mode.
  • Switch to the Run and Debug View in the Sidebar (Ctrl+Shift+D on Windows, Command+Shift+D on OSX).
  • Select Launch Client from the drop down (if it is not already).
  • Press ▷ to run the launch config (F5).

Testing

  • Run npm install in the root directory. This installs all necessary npm modules.
  • Run npm run compile to compile the code & client for testing.
  • Run npm test to execute the client test suite.

Roadmap

A rough roadmap for development priorities.

Contributing

See CONTRIBUTING.

Author

OpenFGA

License

This project is licensed under the Apache-2.0 license. See the LICENSE file for more info.