Skip to content

[LFXV2-712] Add handlers for meeting and past meeting attachment access messages#13

Merged
andrest50 merged 2 commits intomainfrom
andrest50/meeting-attachments
Nov 7, 2025
Merged

[LFXV2-712] Add handlers for meeting and past meeting attachment access messages#13
andrest50 merged 2 commits intomainfrom
andrest50/meeting-attachments

Conversation

@andrest50
Copy link
Contributor

@andrest50 andrest50 commented Nov 7, 2025

Summary

Implement NATS message handlers for meeting attachment and past meeting attachment access control synchronization.

Changes

  • Add handlers for lfx.update_access.meeting_attachment and lfx.delete_access.meeting_attachment
  • Add handlers for lfx.update_access.past_meeting_attachment and lfx.delete_access.past_meeting_attachment
  • Meeting attachments are linked to their parent meeting via meeting relation
  • Past meeting attachments are linked to their parent past meeting via past_meeting relation
  • Authorization is inherited through the OpenFGA authorization model

Message Formats

Meeting Attachment Update

{
  "uid": "attachment-123",
  "meeting_uid": "meeting-456"
}

Meeting Attachment Delete

attachment-123

Past Meeting Attachment Update

{
  "uid": "attachment-123",
  "past_meeting_uid": "past-meeting-456"
}

Past Meeting Attachment Delete

attachment-123

Test plan

  • All existing tests pass
  • Code builds successfully
  • Linter passes with no issues
  • Handlers follow existing patterns in the codebase
  • Manual testing with NATS messages (to be done in integration environment)

Authorization model changes

linuxfoundation/lfx-v2-helm#77

Ticket

https://jira.linuxfoundation.org/browse/LFXV2-712

🤖 Generated with Claude Code

Implement NATS message handlers for meeting attachment access control:
- Add lfx.update_access.meeting_attachment handler to sync attachment permissions
- Add lfx.delete_access.meeting_attachment handler to remove attachment permissions
- Meeting attachments are linked to their parent meeting via meeting relation
- Update documentation with new message formats

Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: Andres Tobon <andrest2455@gmail.com>
Implement NATS message handlers for past meeting attachment access control:
- Add lfx.update_access.past_meeting_attachment handler to sync attachment permissions
- Add lfx.delete_access.past_meeting_attachment handler to remove attachment permissions
- Past meeting attachments are linked to their parent past meeting via past_meeting relation
- Update documentation with new message formats

Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: Andres Tobon <andrest2455@gmail.com>
@andrest50 andrest50 requested a review from a team as a code owner November 7, 2025 16:22
Copilot AI review requested due to automatic review settings November 7, 2025 16:22
@coderabbitai
Copy link

coderabbitai bot commented Nov 7, 2025

Walkthrough

This PR extends attachment access control support by introducing handlers for managing meeting and past meeting attachments. New NATS message subjects and FGA object types enable update and delete operations on attachment permissions. Documentation is updated to describe the new message types and JSON payloads.

Changes

Cohort / File(s) Summary
Documentation
CLAUDE.md
Added documentation for four new attachment-related message types with example payloads: meeting attachment update/delete and past meeting attachment update/delete messages.
Constants: NATS Subjects
pkg/constants/nats.go
Added four new NATS subject constants: MeetingAttachmentUpdateAccessSubject, MeetingAttachmentDeleteAccessSubject, PastMeetingAttachmentUpdateAccessSubject, and PastMeetingAttachmentDeleteAccessSubject.
Constants: FGA Object Types
pkg/constants/fga.go
Added two new FGA object type constants: ObjectTypeMeetingAttachment and ObjectTypePastMeetingAttachment.
Meeting Attachment Handlers
handler_meeting.go
Introduced meetingAttachmentStub type, buildMeetingAttachmentTuples method, and handlers for update and delete access operations on meeting attachments via FGA tuple synchronization.
Past Meeting Attachment Handlers
handler_past_meeting.go
Introduced pastMeetingAttachmentStub type, buildPastMeetingAttachmentTuples method, and handlers for update and delete access operations on past meeting attachments via FGA tuple synchronization.
Message Queue Registration
main.go
Registered four new queue subscriptions in createQueueSubscriptions mapping the new NATS subjects to their respective handlers.

Sequence Diagram(s)

sequenceDiagram
    participant Queue as NATS Queue
    participant Handler as Attachment Handler
    participant FGA as FGA Sync
    participant Logger as Logger

    Queue->>Handler: Update/Delete Message<br/>(attachment event)
    Handler->>Handler: Parse & Validate<br/>Message Fields
    alt Update Access
        Handler->>Handler: Build Tuples<br/>(attachment ↔ meeting)
        Handler->>FGA: SyncObjectTuples
        FGA->>FGA: Apply Changes
    else Delete Access
        Handler->>Handler: Delete All Tuples<br/>for Attachment
    end
    FGA-->>Handler: Sync Result
    Handler->>Logger: Log Result
    Handler->>Queue: Reply (Optional)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Focus areas:
    • Handler implementation patterns in handler_meeting.go and handler_past_meeting.go follow established conventions but introduce new logic for tuple building and validation—verify field mapping and error handling align with existing code
    • Duplicate logic across meeting and past meeting handlers—confirm both implement identical patterns correctly
    • FGA tuple construction and synchronization logic—verify tuple relationships properly link attachments to their parent entities via UID and meeting/past_meeting UID fields
    • NATS message routing in main.go—confirm subject mappings and handler function names match their implementations

Possibly related PRs

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and specifically describes the main change: adding handlers for meeting and past meeting attachment access messages, directly matching the changeset content.
Linked Issues check ✅ Passed The PR fully implements the objectives from LFXV2-712: handling inbound messages for meeting and past meeting attachments, synchronizing access changes into OpenFGA, and ensuring permissions are set on attachment objects LFXV2-712.
Out of Scope Changes check ✅ Passed All changes are directly related to the objective of adding attachment access handlers; no out-of-scope modifications were introduced in the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description check ✅ Passed The pull request description clearly relates to the changeset, detailing the implementation of NATS message handlers for meeting and past meeting attachment access control synchronization.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch andrest50/meeting-attachments

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for meeting and past meeting attachments in the Fine-Grained Access (FGA) control system by introducing new NATS message handlers and object types.

  • Added NATS subjects for managing attachment access control (create, update, and delete operations)
  • Introduced new FGA object types for meeting and past meeting attachments
  • Implemented handlers to sync attachment permissions with their parent meeting objects

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/constants/nats.go Added four new NATS subject constants for meeting and past meeting attachment access control (update and delete operations)
pkg/constants/fga.go Added two new FGA object type constants: ObjectTypeMeetingAttachment and ObjectTypePastMeetingAttachment
main.go Registered four new queue subscriptions to handle meeting and past meeting attachment access control messages
handler_meeting.go Implemented handlers for meeting attachment access control including struct definition, tuple building, update, and delete operations
handler_past_meeting.go Implemented handlers for past meeting attachment access control including struct definition, tuple building, update, and delete operations
CLAUDE.md Added documentation for the new message formats and schemas for both meeting and past meeting attachments

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@andrest50 andrest50 merged commit 4fd87d9 into main Nov 7, 2025
13 checks passed
@andrest50 andrest50 deleted the andrest50/meeting-attachments branch November 7, 2025 17:27
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