diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-11-05 13:32:50 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-11-05 13:32:50 +0000 |
| commit | 5f137994850773114d8a4f8ba70f34aaf2eb1992 (patch) | |
| tree | aec84ac0536412896826e47de563213c26276988 /grasp-audit/README.md | |
| parent | 64a86de9fc5ded51a1b5405223fc5dce16839fef (diff) | |
tag test events with audit-grasp-test-event
Diffstat (limited to 'grasp-audit/README.md')
| -rw-r--r-- | grasp-audit/README.md | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/grasp-audit/README.md b/grasp-audit/README.md index b1dcb15..62f1f03 100644 --- a/grasp-audit/README.md +++ b/grasp-audit/README.md | |||
| @@ -94,23 +94,35 @@ Basic Nostr relay functionality: | |||
| 94 | 94 | ||
| 95 | ## Audit Event Strategy | 95 | ## Audit Event Strategy |
| 96 | 96 | ||
| 97 | All audit events include special tags: | 97 | All audit events automatically include special tags for isolation and cleanup: |
| 98 | 98 | ||
| 99 | ```json | 99 | ```json |
| 100 | { | 100 | { |
| 101 | "tags": [ | 101 | "tags": [ |
| 102 | ["t", "grasp-audit"], | 102 | ["t", "grasp-audit-test-event"], |
| 103 | ["r", "audit-run-id-ci-a1b2c3d4-e5f6-7890-abcd-ef1234567890"], | 103 | ["t", "audit-ci-a1b2c3d4-e5f6-7890-abcd-ef1234567890"], |
| 104 | ["r", "audit-cleanup-2025-11-03T12:00:00Z"] | 104 | ["t", "audit-cleanup-after-1730822334"] |
| 105 | ] | 105 | ] |
| 106 | } | 106 | } |
| 107 | ``` | 107 | ``` |
| 108 | 108 | ||
| 109 | This allows: | 109 | **Tag Format:** |
| 110 | 110 | ||
| 111 | - **Isolation**: Each test run has unique ID | 111 | - `["t", "grasp-audit-test-event"]` - Identifies all audit-related events |
| 112 | - **Cleanup**: Events marked for cleanup after timestamp | 112 | - `["t", "audit-{run_id}"]` - Unique identifier for each audit run |
| 113 | - **No deletion trails**: Direct database cleanup (no NIP-09 deletion events) | 113 | - CI mode: `audit-ci-{uuid}` |
| 114 | - Production mode: `audit-prod-audit-{timestamp}` | ||
| 115 | - `["t", "audit-cleanup-after-{unix_timestamp}"]` - Cleanup scheduling | ||
| 116 | - CI mode: Current time + 3600 seconds (1 hour) | ||
| 117 | - Production mode: Current time + 300 seconds (5 minutes) | ||
| 118 | |||
| 119 | **Benefits:** | ||
| 120 | |||
| 121 | - **Automatic**: Tags added automatically to all events via `AuditEventBuilder` | ||
| 122 | - **Isolation**: Each test run has unique ID for event filtering | ||
| 123 | - **Cleanup**: Events marked for cleanup after timestamp (direct database cleanup) | ||
| 124 | - **No deletion trails**: No NIP-09 deletion events needed | ||
| 125 | - **Discovery**: Easy to query all audit events via hashtag | ||
| 114 | 126 | ||
| 115 | ## Modes | 127 | ## Modes |
| 116 | 128 | ||