An event listener for Keycloak, creating spiceDB relationship data for keycloak users and groups by listening on the events in keycloak and using the spiceDB java client.
Inspired by this implementation for openFGA
- mvn clean install
- docker compose up
- wait until the custom entrypoint script runs (users are automatically provisioned using kcadm.sh) - watch the logs :)
- use e.g. zed (the spicedb command line tool) to connect to the spiceDB instance and see that relations are written containing the username (form: userid_username) ->
zed context set first-dev-context :50051 "abcdefgh" --insecure
followed byzed relationship read tenant
should output 3 members of 2 tenants (12345, 23456), andzed relationship read group
should show a _ pair with parent tenant 12345 (derived from the creating user inside keycloak, added an org_id to the admin account as part of the script) as defined ininitialize-poc.sh
.
read CHATGPT_GENERATOR.md
much more. as said highly experimental, dunno where to go with this, but it's fun ;)
- extended to (experimentally) handle "add group" events
- extended to (experimentally) handle "group membership" events
- using ChatGPT to create myself a user generation script for keycloak. More about that here
- refactor initial schema creation, use spicedb and schema.yml directly instead of doing it codewise.