Skip to content

Add item sharing and public share links#1

Open
Ogglas wants to merge 1 commit into
masterfrom
feature/item-sharing
Open

Add item sharing and public share links#1
Ogglas wants to merge 1 commit into
masterfrom
feature/item-sharing

Conversation

@Ogglas
Copy link
Copy Markdown

@Ogglas Ogglas commented Feb 12, 2026

Summary

  • New ItemShare model for user-to-user sharing with read/edit permissions
  • New ShareLink model for token-based public links with optional expiry
  • Share/unshare API endpoints under /items/{id}/shares/
  • Share link create/list/revoke endpoints under /items/{id}/share-links/
  • Public access endpoint GET /shared/{token} with expiry and revocation checks
  • Updated items list query to include items shared with the current user
  • Updated item read/update to respect share permissions (read-only users can't edit)
  • Alembic migration for itemshare and sharelink tables
  • 16 backend tests covering sharing, permissions, duplicates, link expiry, and revocation
  • Frontend: ShareDialog component with tabbed People/Links UI
  • Frontend: Manual axios client for share endpoints
  • Frontend: Share action added to item dropdown menu

Security surface (for threat modeling)

  • IDOR on shared items (accessing items not shared with you)
  • Permission escalation (read share trying to edit)
  • Share link token enumeration / brute force
  • Expired/revoked link bypass
  • Authorization model complexity (owner vs shared vs superuser)
  • Sharing with non-existent users
  • Self-sharing prevention

Test plan

  • Share item with another user (success)
  • Share item you don't own (403)
  • Share with yourself (400)
  • Duplicate share (400)
  • Shared user can read item
  • Read-only shared user cannot update item (403)
  • Create share link (token generated)
  • Access item via valid share link
  • Access item via expired link (410)
  • Access item via revoked link (410)
  • List and revoke share links
  • Superuser can manage any item's shares

Generated with Claude Code

@Ogglas
Copy link
Copy Markdown
Author

Ogglas commented Feb 12, 2026

@oplane review

@oplane-bot
Copy link
Copy Markdown

oplane-bot Bot commented Feb 12, 2026

🚨 Oplane Security Review Complete

Found 8 security requirements in this pull request.

Unresolved Requirements

# Status Requirement Severity
1 🔴 Not Implemented Authorization Enforcement for Share Link Management Endpoints Critical
2 🔴 Not Implemented Rate Limiting on Public Shared Item Endpoint High

Resolved Requirements

# Status Requirement Severity
1 ✅ Implemented Token Entropy and Unpredictability for SharedLink Tokens Critical
2 ✅ Implemented Expiration Enforcement for SharedLink Tokens High
3 ✅ Implemented Sensitive Data Exclusion in Public Shared Item Endpoint High
4 ✅ Implemented Cascade Deletion of SharedLink Tokens on Item Deletion Medium
5 ✅ Implemented Revocation Functionality for SharedLink Tokens High
6 ✅ Implemented Input Validation for Expiry Parameter in Share Link Creation Medium

📋 View Full Threat Model


Powered by Oplane

- New ItemShare model for user-to-user sharing with read/edit permissions
- New ShareLink model for token-based public links with optional expiry
- Share/unshare API endpoints under /items/{id}/shares/
- Share link create/list/revoke endpoints under /items/{id}/share-links/
- Public access endpoint GET /shared/{token} with expiry and revocation checks
- Updated items list to include items shared with current user
- Updated item read/update to respect share permissions (read vs edit)
- Alembic migration for itemshare and sharelink tables
- Tests covering sharing, permissions, duplicates, link expiry, and revocation
- Frontend: ShareDialog component with People and Links tabs
- Frontend: Manual axios client for share endpoints
- Frontend: Share action added to item dropdown menu

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@emilkvarnhammar emilkvarnhammar changed the title Add item sharing via public links Add item sharing and public share links Mar 6, 2026
@emilkvarnhammar
Copy link
Copy Markdown

@oplane review

@oplane-bot-dev
Copy link
Copy Markdown

⚠️ Oplane Security Review Complete

Found 6 security requirements in this pull request.

Unresolved Requirements

# Status Requirement Severity
1 🟡 Partially Implemented Share Link Token Entropy and Uniqueness Medium
2 🔴 Not Implemented User Enumeration Prevention in Share Endpoints Low

Resolved Requirements

# Status Requirement Severity
1 ✅ Implemented Access Control Enforcement for Shared Item Endpoints Critical
2 ✅ Implemented Share Link Expiry and Revocation Enforcement High
3 ✅ Implemented Self-Sharing Prevention in Share Creation Medium
4 ✅ Implemented Cascade Deletion Handling for Shares and Share Links Medium

📋 View Full Threat Model


Powered by Oplane

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.

2 participants