FGA Contract

April 7, 2026 · View on GitHub

This document is the authoritative reference for all messages the project service sends to the fga-sync service, which writes and deletes OpenFGA relationship tuples to enforce access control.

The full OpenFGA type definitions (relations, schema) for all object types are defined in the platform model.

Update this document in the same PR as any change to FGA message construction.


Object Types


Message Format

All messages use the generic FGA message format on the following NATS subjects:

SubjectUsed for
lfx.fga-sync.update_accessCreate and update operations
lfx.fga-sync.delete_accessDelete operations

Each message carries object_type, operation, and a data map. The sections below describe the data contents for each object type.


Project

Source structs: internal/domain/models/project.goProjectBase and ProjectSettings

Synced on: create, update of project base, update of project settings, delete of a project.

Access Config

FieldValue
object_typeproject
publicProjectBase.Public (passed through directly)

Relations

RelationValueCondition
writerUsernames from ProjectSettings.WritersOnly when Writers is non-empty
auditorUsernames from ProjectSettings.AuditorsOnly when Auditors is non-empty
meeting_coordinatorUsernames from ProjectSettings.MeetingCoordinatorsOnly when MeetingCoordinators is non-empty

Usernames are the Username field of each UserInfo entry (Auth0 sub values).

References

ReferenceValueCondition
parent"project:{ParentUID}"Only when ProjectBase.ParentUID is non-empty

Delete

On delete, only uid is sent — all FGA tuples for project:{uid} are removed by the fga-sync service.


Triggers

OperationObject TypeSubjectNotes
Create projectprojectlfx.fga-sync.update_accessAlways sent
Update project baseprojectlfx.fga-sync.update_accessAlways sent
Update project settingsprojectlfx.fga-sync.update_accessAlways sent
Delete projectprojectlfx.fga-sync.delete_accessAlways sent