Open aaguiarz opened 2 years ago
This is great news! Currently, the playground unfortunately cannot be put behind a reverse proxy at a domain other than localhost (e.g. playground.localhost
), due to its restrictive CSP.
Content Security Policy directive: "frame-ancestors http://localhost:*"
Hi @aaguiarz
Thanks for reaching out! I'll try out your suggestion next weeks, sounds fantastic!
An alternative workaround is to forward both ports via ssh to the local machine.
services:
openfga:
...
ports:
- "127.0.0.1:8080:8080"
- "127.0.0.1:3000:3000"
ssh user@your-server.com -L 3000:127.0.0.1:3000 -L 8080:127.0.0.1:8080
After that you can open the playground on http://localhost:3000/playground
We haven't open sourced the FGA Playground. We believe it should be part of the OpenFGA project and we'll open source it.
Is it possible that I can work on this task so that OpenFGA bundles everything locally without reaching to play.fga.dev?
@SamTV12345 it's hard, as we'll need to rewrite most of it to make it open source as it's using internal libraries :(
@SamTV12345 it's hard, as we'll need to rewrite most of it to make it open source as it's using internal libraries :(
Oh okay. I'm currently introducing OpenFGA at our company but we use OAuth2.0 as our auth type. I could put some time into this and come up with a solution. I guess moving from Next to Client side React shouldn't be hopefully too hard.
How do you envision using the Playground? We've seen most companies ending up using VS Code/Jetbrains IDE + CLI for development purposes
How do you envision using the Playground? We've seen most companies ending up using VS Code/Jetbrains IDE + CLI for development purposes
The idea was that I can login to the Playground, check the auth model, change it etc. Just like you can do it in development mode. How would you edit the model once it's deployed on a production system and there is no plaground available?
The model can be stored in your source control system. You can see some examples of production models in Github here.
You can edit models/tests files with any editor, but OpenFGA has coloring/validation for VSCode and JetBrains IDEs.
You can use the CLI / https://openfga.dev/docs/getting-started/cli, or the Github action to deploy the model to production.
Does that help?
The model can be stored in your source control system. You can see some examples of production models in Github here.
You can edit models/tests files with any editor, but OpenFGA has coloring/validation for VSCode and JetBrains IDEs.
You can use the CLI / https://openfga.dev/docs/getting-started/cli, or the Github action to deploy the model to production.
Does that help?
Thanks. That really helps. A web UI would be easier but for the time being that is enough to get started :)
You can actually use the test files / CLI for the same purpose of the Playground without requiring an OpenFGA server, as the CLI can evaluate model/queries without calling the server. That's the way I test models myself.
The test files have support for list-objects, list-users and conditions, which the Playground does not have yet.
We haven't open sourced the FGA Playground. We believe it should be part of the OpenFGA project and we'll open source it.