opal icon indicating copy to clipboard operation
opal copied to clipboard

OpenFGA Integration

Open daveads opened this issue 1 year ago • 16 comments

Feature: Add OpenFGA Policy Store to OPAL

This PR addresses issue #661 by integrating OpenFGA Policy Store into OPAL.

/claim #661

daveads avatar Sep 30 '24 01:09 daveads

Deploy Preview for opal-docs ready!

Name Link
Latest commit d1421cc4c0b2ddb794bd744767eeabc4c81ab680
Latest deploy log https://app.netlify.com/sites/opal-docs/deploys/67a411b59c01f200080a96cc
Deploy Preview https://deploy-preview-673--opal-docs.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Sep 30 '24 01:09 netlify[bot]

OpenFGA OPAL Integration Project Checklist

Week 1: Setup and Core Implementation

Days 1-2: Project Setup and Research

  • [x] Set up development environment
  • [x] Review OpenFGA documentation and API
  • [x] Analyze OPAL's existing policy store implementations

Days 3-5: Core Implementation

  • [x] Implement OpenFGA configuration in OPAL
  • [x] Develop basic OpenFGA policy store interface
  • [x] Begin implementation of auto-sync from git for OpenFGA models/policies

Week 2: Feature Completion and Demo Preparation

Days 1-3: Feature Implementation

  • [x] Complete auto-sync from git for OpenFGA models/policies
  • [x] Implement data fetching pattern and syncing from external data sources
  • [x] Start working on Docker-compose examples

Days 4-5: Demo Preparation

  • [x] Develop end-to-end demo with example ReBAC policies and mock data
  • [ ] Finalize Docker-compose examples for single and multiple OpenFGA clients
  • [x] Prepare demonstration environment

Key Milestones:

  1. End of Week 1: Basic OpenFGA policy store implementation
  2. End of Week 2: Working end-to-end demo
  3. End of Week 3: update later*
  4. End of Week 4: update later*

daveads avatar Sep 30 '24 03:09 daveads

Updates ::

Integration into Opal has already begun but is currently on hold. I'm working on the components in isolation from Opal, using the OpenFGA SDK first. it's been interesting so far.

daveads avatar Oct 01 '24 16:10 daveads

I've completed the isolation test and also simulated integration with OPAL in isolation. At some point, I had to mix the Python SDK with the raw API, but I'll likely find a fix for that later.

The test that involved missing the Python SDK and accessing via the raw API and stimulating opal integration was successful.

Going start core implementation asap

daveads avatar Oct 02 '24 21:10 daveads

I've completed the isolation test and also simulated integration with OPAL in isolation. At some point, I had to mix the Python SDK with the raw API, but I'll likely find a fix for that later.

The test that involved missing the Python SDK and accessing via the raw API and stimulating opal integration was successful.

Going start core implementation asap

https://github.com/user-attachments/assets/f0fca7f7-683c-44cd-b7c1-7adb96c79ce6

daveads avatar Oct 02 '24 21:10 daveads

@garnerp just push that to show what have been working on locally....

to show my current progress...

daveads avatar Oct 04 '24 06:10 daveads

@daveads I bet you meant to tag me. Any updates on this?

gemanor avatar Oct 11 '24 06:10 gemanor

@daveads I bet you meant to tag me. Any updates on this?

oh oh... yea i meant to tag... lol

still on it... will give you an update on it soon

daveads avatar Oct 11 '24 06:10 daveads

currently having issues with the config... buh i should fix it soon.

daveads avatar Oct 19 '24 13:10 daveads

Demo ready...

just fixing bugs...

opening pr for now...

daveads avatar Oct 24 '24 14:10 daveads

Based on my discussion with @gemanor, Decided to drop the use of openfga_sdk and use API calls instead, similar to the OPA implementation.

daveads avatar Oct 25 '24 13:10 daveads

@gemanor Done with implementation and fixing bugs... Just need to get docker-compose to work properly

daveads avatar Oct 30 '24 17:10 daveads

https://github.com/daveads/opal-example-policy-openfga

daveads avatar Oct 30 '24 19:10 daveads

Sure @iwphonedo i will check them out today.

daveads avatar Nov 11 '24 13:11 daveads

working on the failing pytests...

daveads avatar Nov 17 '24 21:11 daveads

https://github.com/user-attachments/assets/e8c06938-46b2-4c4a-af80-93aec4cf7014

daveads avatar Nov 27 '24 10:11 daveads