Implement Phase 7: share link tests and expiry fix

- 4 tests: create/validate, expiry, revoke, list
- Fixed expiry check: negative durations now correctly expire links
  (was checking > 0 instead of != 0)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-24 19:57:03 -07:00
parent 37c2d35ceb
commit fedb5e3301
2 changed files with 106 additions and 1 deletions

View File

@@ -29,7 +29,7 @@ func CreateLink(database *sql.DB, notebookID int64, expiry time.Duration, baseUR
var expiresAt *int64
var expiresTime *time.Time
if expiry > 0 {
if expiry != 0 {
ea := time.Now().Add(expiry).UnixMilli()
expiresAt = &ea
t := time.UnixMilli(ea)