GitClub: Developing an end-to-end example for working with OpenFGA in .NET #287
Replies: 3 comments 1 reply
-
Hey @bytefish 👋🏻 Thanks for showing your demo! It looks like your on the right way, doing the Authorization checks as early as possible for each action. While I currently don't have an example repo with a .NET project available, I recently published a Google Drive style demo written in Next.js. The readme contains some more information about which OpenFGA checks are performed, and when we write new tuples to the OpenFGA Store. If there are some specific questions you might have, we'de be happy to answer them :) |
Beta Was this translation helpful? Give feedback.
-
@Sambego That’s a great showcase for OpenFGA! What a great project, it looks so clean in TypeScript. 👍 |
Beta Was this translation helpful? Give feedback.
-
@Sambego I have added an Outbox Pattern to show how to reach Eventual Consistency between OpenFGA and the Database. It is based on Postgres Logical Replication, because I want to avoid using Debezium (Kafka) as long as possible: I've also added Integration Tests to the application, where I am basically spinning up Docker Containers (manually) and create an OpenFGA Store using a fixed Store ID. Whenever a new tests starts, I am creating a fresh Store with the latest AuthorizationModel... so every tests runs with a new set of tuples: I would be really interested to understand, how I could improve the integration test setup, so tests could run in parallel for example. |
Beta Was this translation helpful? Give feedback.
-
I am currently in the process of writing an end-to-end example for using OpenFGA in .NET at:
The application should be something similar to the Oso "GitClub" example (https://github.com/osohq/gitclub), that is being a non-trivial showcase for modelling a more advanced scenario with OpenFGA. The idea is to have something of a blueprint for OpenFGA and .NET, that I could rip out code from... and maybe it helps OpenFGA getting some traction.
The project uses the "GitHub Permission model" shared by the OpenFGA team at https://github.com/openfga/sample-stores.
It is not finished yet, but I would love to get some feedback or throw ideas around. There isn't much sample code out there, and I am not sure, what's the best practices in the area. Most of the abstractions I came up with look similar to what Oso does in the "GitCloud" example, so I think I am not too far off the track:
That said, Feedback is very welcome.
I think OpenFGA could benefit from end-to-end example in various languages, that show best practices or how to approach problems.
Beta Was this translation helpful? Give feedback.
All reactions