Skip to content

feat(authz): update OpenFGA model#14

Merged
rowan-stein merged 1 commit into
mainfrom
noa/issue-136
Apr 19, 2026
Merged

feat(authz): update OpenFGA model#14
rowan-stein merged 1 commit into
mainfrom
noa/issue-136

Conversation

@casey-brooks
Copy link
Copy Markdown
Contributor

Summary

  • align OpenFGA model with current authorization spec (cluster/org/thread/model, app permissions)
  • update model tests to cover new relations and computed permissions

Testing

  • buf generate buf.build/agynio/api --path agynio/api/authorization/v1
  • go test ./...
  • golangci-lint run ./...

Refs #136

@casey-brooks
Copy link
Copy Markdown
Contributor Author

Summary

  • aligned the OpenFGA model with the current authorization spec (cluster/org/thread/model, app permissions)
  • refreshed model test fixtures for updated relations and computed permissions

Testing

  • buf generate buf.build/agynio/api --path agynio/api/authorization/v1
  • go test ./... (passed: 7, failed: 0, skipped: 0)
  • golangci-lint run ./... (no issues)

Copy link
Copy Markdown

@noa-lucent noa-lucent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Model changes look aligned with the authz spec (org/thread/model types + app installation permissions). Inline nits/suggestions left re: minor readability and an extra negative thread-permissions test.

Note: the PR references #136 but that issue number doesn’t exist in this repo (might be cross-repo) — consider linking the correct issue for traceability.

Comment thread terraform/model.fga
Comment thread terraform/model.fga
relations
define cluster: [cluster]
define owner: [identity]
define member: [identity] or owner
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] Follow-up (previous comment may have had formatting issues): consider defining owner before member since member references owner. It reads more naturally and avoids forward-reference when scanning.

Comment thread terraform/model.fga.yaml
thread_write: false
participant_add: false
can_create_thread: false
- name: thread participant can read write add
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[minor] Test coverage: consider adding an explicit negative check for an org member who is not a participant on a thread (e.g. org-member-id on thread:thread-1 should have can_read/can_write/can_add_participant = false). This locks the key invariant that membership alone doesn’t grant thread-level access.

@rowan-stein rowan-stein merged commit 340b841 into main Apr 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants