@genobank/biofs 2.4.1 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/LICENSE +37 -0
- package/README.md +2 -1
- package/bin/biofs.js +2 -1
- package/contracts/ClaraJobNFT.sol +101 -0
- package/dist/commands/agent/health.js +1 -1
- package/dist/commands/agent/health.js.map +1 -1
- package/dist/commands/agent/list.d.ts +14 -0
- package/dist/commands/agent/list.d.ts.map +1 -0
- package/dist/commands/agent/list.js +101 -0
- package/dist/commands/agent/list.js.map +1 -0
- package/dist/commands/agent/register.d.ts +18 -0
- package/dist/commands/agent/register.d.ts.map +1 -0
- package/dist/commands/agent/register.js +120 -0
- package/dist/commands/agent/register.js.map +1 -0
- package/dist/commands/agent/status.d.ts +14 -0
- package/dist/commands/agent/status.d.ts.map +1 -0
- package/dist/commands/agent/status.js +151 -0
- package/dist/commands/agent/status.js.map +1 -0
- package/dist/commands/annotate/status.d.ts +11 -0
- package/dist/commands/annotate/status.d.ts.map +1 -0
- package/dist/commands/annotate/status.js +123 -0
- package/dist/commands/annotate/status.js.map +1 -0
- package/dist/commands/annotate/submit.d.ts +23 -0
- package/dist/commands/annotate/submit.d.ts.map +1 -0
- package/dist/commands/annotate/submit.js +296 -0
- package/dist/commands/annotate/submit.js.map +1 -0
- package/dist/commands/family-status.d.ts +12 -0
- package/dist/commands/family-status.d.ts.map +1 -0
- package/dist/commands/family-status.js +220 -0
- package/dist/commands/family-status.js.map +1 -0
- package/dist/commands/job/status.d.ts +1 -0
- package/dist/commands/job/status.d.ts.map +1 -1
- package/dist/commands/job/status.js.map +1 -1
- package/dist/commands/link-clara.d.ts +20 -0
- package/dist/commands/link-clara.d.ts.map +1 -0
- package/dist/commands/link-clara.js +234 -0
- package/dist/commands/link-clara.js.map +1 -0
- package/dist/commands/mount-remote.d.ts +1 -1
- package/dist/commands/mount-remote.js +1 -1
- package/dist/commands/payment/balance.d.ts +12 -0
- package/dist/commands/payment/balance.d.ts.map +1 -0
- package/dist/commands/payment/balance.js +101 -0
- package/dist/commands/payment/balance.js.map +1 -0
- package/dist/commands/payment/faucet.d.ts +11 -0
- package/dist/commands/payment/faucet.d.ts.map +1 -0
- package/dist/commands/payment/faucet.js +92 -0
- package/dist/commands/payment/faucet.js.map +1 -0
- package/dist/commands/payment/history.d.ts +27 -0
- package/dist/commands/payment/history.d.ts.map +1 -0
- package/dist/commands/payment/history.js +162 -0
- package/dist/commands/payment/history.js.map +1 -0
- package/dist/commands/payment/pricing.d.ts +12 -0
- package/dist/commands/payment/pricing.d.ts.map +1 -0
- package/dist/commands/payment/pricing.js +65 -0
- package/dist/commands/payment/pricing.js.map +1 -0
- package/dist/commands/payment/setup.d.ts +25 -0
- package/dist/commands/payment/setup.d.ts.map +1 -0
- package/dist/commands/payment/setup.js +155 -0
- package/dist/commands/payment/setup.js.map +1 -0
- package/dist/commands/tokenize-biosample.d.ts +19 -0
- package/dist/commands/tokenize-biosample.d.ts.map +1 -0
- package/dist/commands/tokenize-biosample.js +253 -0
- package/dist/commands/tokenize-biosample.js.map +1 -0
- package/dist/index.js +281 -13
- package/dist/index.js.map +1 -1
- package/dist/lib/api/bionft-client.d.ts +35 -7
- package/dist/lib/api/bionft-client.d.ts.map +1 -1
- package/dist/lib/api/bionft-client.js +106 -16
- package/dist/lib/api/bionft-client.js.map +1 -1
- package/dist/lib/kite/agent.d.ts +85 -0
- package/dist/lib/kite/agent.d.ts.map +1 -0
- package/dist/lib/kite/agent.js +332 -0
- package/dist/lib/kite/agent.js.map +1 -0
- package/dist/lib/kite/index.d.ts +9 -0
- package/dist/lib/kite/index.d.ts.map +1 -0
- package/dist/lib/kite/index.js +25 -0
- package/dist/lib/kite/index.js.map +1 -0
- package/dist/lib/kite/passport.d.ts +69 -0
- package/dist/lib/kite/passport.d.ts.map +1 -0
- package/dist/lib/kite/passport.js +312 -0
- package/dist/lib/kite/passport.js.map +1 -0
- package/dist/lib/x402/client.d.ts +78 -0
- package/dist/lib/x402/client.d.ts.map +1 -0
- package/dist/lib/x402/client.js +298 -0
- package/dist/lib/x402/client.js.map +1 -0
- package/dist/lib/x402/index.d.ts +9 -0
- package/dist/lib/x402/index.d.ts.map +1 -0
- package/dist/lib/x402/index.js +37 -0
- package/dist/lib/x402/index.js.map +1 -0
- package/dist/lib/x402/middleware.d.ts +37 -0
- package/dist/lib/x402/middleware.d.ts.map +1 -0
- package/dist/lib/x402/middleware.js +220 -0
- package/dist/lib/x402/middleware.js.map +1 -0
- package/dist/types/kite.d.ts +157 -0
- package/dist/types/kite.d.ts.map +1 -0
- package/dist/types/kite.js +107 -0
- package/dist/types/kite.js.map +1 -0
- package/dist/types/x402.d.ts +78 -0
- package/dist/types/x402.d.ts.map +1 -0
- package/dist/types/x402.js +79 -0
- package/dist/types/x402.js.map +1 -0
- package/docs/AI_AGENT_MCP_MANUAL.md +1029 -0
- package/docs/USER_MANUAL.md +603 -0
- package/docs/technical-details.html +555 -0
- package/lib/bionfs-client.js +2 -0
- package/lib/consent-manager.js +2 -0
- package/lib/consent-prompt.js +2 -0
- package/package.json +9 -3
- package/presentation/biofs-x402-kite-presentation.html +813 -0
- package/scripts/build_annotator_dictionary.py +1 -0
- package/scripts/deploy-clara-nft.js +37 -0
- package/test-complete-flow.sh +1 -1
- package/test.vcf +1 -0
- package/test_23andme.txt +1 -0
- package/ADMIN_REGISTER_LAB.md +0 -252
- package/ANNOTATOR_RECOMMENDATIONS_API.md +0 -490
- package/BIOFS_QUICK_START.md +0 -200
- package/BIOFS_TOKENIZE_COMPLETE.md +0 -541
- package/BIOFS_V1.2.7_PUBLISHED.md +0 -317
- package/BIOFS_V1.2.9_FIXES.md +0 -306
- package/BIOFS_V1.3.0_DIRECT_GRANT.md +0 -381
- package/BIOFS_V1.3.1_GRANTED_FILES.md +0 -328
- package/BIONFS_DEPLOYMENT_GUIDE.md +0 -408
- package/BIONFS_MOUNT_INTEGRATION_PLAN.md +0 -415
- package/BIONFS_PROTOCOL_SPECIFICATION.md +0 -688
- package/BIONFS_SEQUENTIAS_INTEGRATION.md +0 -457
- package/BIONFT_GATED_REMOTE_MOUNTING.md +0 -1260
- package/BIONFT_NFS_PROTOCOL_ARCHITECTURE.md +0 -583
- package/BIOOS_CLI_IMPLEMENTATION_COMPLETE.md +0 -422
- package/BIOOS_JOB_MANAGEMENT.md +0 -681
- package/BUGFIX_V2.1.3.md +0 -72
- package/CHANGELOG_V2.1.0.md +0 -386
- package/CHANGELOG_V2.2.0.md +0 -284
- package/ENHANCEMENT_DOCUMENTATION.md +0 -218
- package/GDPR_BIONFS_CONSENT_ARCHITECTURE.md +0 -798
- package/GDPR_BIONFS_IMPLEMENTATION_STATUS.md +0 -462
- package/INSTALL_V1.2.7_ON_MAC.md +0 -306
- package/LABNFT_BIOFS_INTEGRATION.md +0 -396
- package/OPENCRAVAT_ANNOTATORS_REFERENCE.md +0 -340
- package/OPENCRAVAT_ANNOTATOR_INTELLIGENCE_COMPLETE.md +0 -479
- package/QUICK_START_V2.1.0.md +0 -116
- package/RELEASE_SUMMARY_V1.2.7.md +0 -479
- package/RELEASE_SUMMARY_V1.3.0.md +0 -324
- package/SEQUENTIAS_PROTOCOL_ARCHITECTURE.md +0 -880
- package/SEQUENTIA_MIGRATION_GUIDE.md +0 -337
- package/SESSION_SUMMARY_DIRECT_GRANT.md +0 -321
- package/ULTRATHINK_BIONFS_COMPLETE.md +0 -458
- package/WEB3FUSE_LICENSE_TOKEN_ANALYSIS.md +0 -494
- package/WHERE_PERMISSIONS_LIVE.md +0 -165
- package/config.json +0 -21
- package/opencravat_annotators_dictionary.json +0 -2356
- package/package.json.working.v1.9.2.20251105_023952 +0 -48
|
@@ -1,408 +0,0 @@
|
|
|
1
|
-
# 🚀 BioNFS GDPR-Compliant Deployment Guide
|
|
2
|
-
|
|
3
|
-
## ✅ COMPLETED: Core Implementation
|
|
4
|
-
|
|
5
|
-
### 1. Consent Management Libraries (TypeScript)
|
|
6
|
-
- ✅ `src/lib/consent/consent-manager.ts` - Consent record management
|
|
7
|
-
- ✅ `src/lib/consent/consent-prompt.ts` - Interactive GDPR consent notice
|
|
8
|
-
- ✅ `lib/consent-manager.js` - JavaScript version (backup)
|
|
9
|
-
- ✅ `lib/consent-prompt.js` - JavaScript version (backup)
|
|
10
|
-
- ✅ `lib/bionfs-client.js` - BioNFS streaming client
|
|
11
|
-
|
|
12
|
-
### 2. CLI Commands (TypeScript)
|
|
13
|
-
- ✅ `src/commands/download-with-consent.ts` - Download with GDPR consent
|
|
14
|
-
- ✅ `src/commands/mount.ts` - Mount all files with consent
|
|
15
|
-
- ✅ `src/commands/access/revoke-consent.ts` - Revoke user's own consent
|
|
16
|
-
|
|
17
|
-
### 3. API Endpoints (Python)
|
|
18
|
-
- ✅ `production_api/plugins/bioip/api_bionfs_consent.py` - Full BioNFS API
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
## 🔧 DEPLOYMENT STEPS
|
|
23
|
-
|
|
24
|
-
### Step 1: Integrate Consent into Main CLI
|
|
25
|
-
|
|
26
|
-
**File:** `/home/ubuntu/genobank-cli/src/index.ts`
|
|
27
|
-
|
|
28
|
-
Add imports and replace download command:
|
|
29
|
-
|
|
30
|
-
```typescript
|
|
31
|
-
// Add imports
|
|
32
|
-
import { downloadCommandWithConsent } from './commands/download-with-consent';
|
|
33
|
-
import { mountCommand } from './commands/mount';
|
|
34
|
-
import { revokeConsentCommand } from './commands/access/revoke-consent';
|
|
35
|
-
|
|
36
|
-
// Replace existing download command with:
|
|
37
|
-
program
|
|
38
|
-
.command('download')
|
|
39
|
-
.alias('get')
|
|
40
|
-
.argument('<biocid-or-filename>', 'BioCID or filename to download')
|
|
41
|
-
.argument('[destination]', 'Download destination')
|
|
42
|
-
.option('-o, --output <path>', 'Output path')
|
|
43
|
-
.option('--quiet', 'Suppress output')
|
|
44
|
-
.option('--skip-consent', 'Skip GDPR consent (for automation)')
|
|
45
|
-
.description('Download a file (with GDPR consent for genomic data)')
|
|
46
|
-
.action(downloadCommandWithConsent);
|
|
47
|
-
|
|
48
|
-
// Add mount command:
|
|
49
|
-
program
|
|
50
|
-
.command('mount')
|
|
51
|
-
.argument('<mount-point>', 'Directory to mount files')
|
|
52
|
-
.option('--read-only', 'Mount as read-only')
|
|
53
|
-
.option('--quiet', 'Suppress output')
|
|
54
|
-
.option('--skip-consent', 'Skip GDPR consent (for automation)')
|
|
55
|
-
.description('Mount all granted BioFiles to local directory')
|
|
56
|
-
.action(mountCommand);
|
|
57
|
-
|
|
58
|
-
// Add revoke-consent under access subcommand:
|
|
59
|
-
const accessCmd = program.command('access').description('Manage BioNFT access control and permissions');
|
|
60
|
-
|
|
61
|
-
accessCmd
|
|
62
|
-
.command('revoke-consent [ip-id]')
|
|
63
|
-
.option('--all', 'Revoke all consents')
|
|
64
|
-
.option('--force', 'Skip confirmation')
|
|
65
|
-
.description('Revoke your consent for genomic data access (GDPR)')
|
|
66
|
-
.action(revokeConsentCommand);
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
---
|
|
70
|
-
|
|
71
|
-
### Step 2: Update BioCIDResolver to Include IP Asset Info
|
|
72
|
-
|
|
73
|
-
**File:** `/home/ubuntu/genobank-cli/src/lib/biofiles/resolver.ts`
|
|
74
|
-
|
|
75
|
-
Update FileLocation interface to include IP asset metadata:
|
|
76
|
-
|
|
77
|
-
```typescript
|
|
78
|
-
export interface FileLocation {
|
|
79
|
-
type: 'S3' | 'IPFS' | 'Story';
|
|
80
|
-
presigned_url?: string;
|
|
81
|
-
ipfs_hash?: string;
|
|
82
|
-
filename?: string;
|
|
83
|
-
|
|
84
|
-
// Add these fields for GDPR consent
|
|
85
|
-
ip_id?: string;
|
|
86
|
-
owner?: string;
|
|
87
|
-
license_type?: string;
|
|
88
|
-
license_token_id?: number;
|
|
89
|
-
}
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
Update resolver to populate these fields when resolving granted BioIP files.
|
|
93
|
-
|
|
94
|
-
---
|
|
95
|
-
|
|
96
|
-
### Step 3: Deploy API Endpoints
|
|
97
|
-
|
|
98
|
-
**File:** `/home/ubuntu/Genobank_APIs/production_api/run/runweb.py`
|
|
99
|
-
|
|
100
|
-
Register the BioNFS consent blueprint:
|
|
101
|
-
|
|
102
|
-
```python
|
|
103
|
-
# At top of file, add import:
|
|
104
|
-
from plugins.bioip.api_bionfs_consent import bionfs_consent_bp, init_consent_collections
|
|
105
|
-
|
|
106
|
-
# After creating the Flask app, register blueprint:
|
|
107
|
-
app.register_blueprint(bionfs_consent_bp)
|
|
108
|
-
|
|
109
|
-
# Initialize MongoDB collections (run once)
|
|
110
|
-
with app.app_context():
|
|
111
|
-
init_consent_collections()
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
---
|
|
115
|
-
|
|
116
|
-
### Step 4: Create MongoDB Collections
|
|
117
|
-
|
|
118
|
-
**Run this once:**
|
|
119
|
-
|
|
120
|
-
```bash
|
|
121
|
-
# SSH into production server
|
|
122
|
-
ssh ubuntu@genobank.app
|
|
123
|
-
|
|
124
|
-
# Run Python script
|
|
125
|
-
python3.12 << 'EOF'
|
|
126
|
-
from pymongo import MongoClient
|
|
127
|
-
import os
|
|
128
|
-
from dotenv import load_dotenv
|
|
129
|
-
|
|
130
|
-
load_dotenv('/home/ubuntu/Genobank_APIs/production_api/.env')
|
|
131
|
-
|
|
132
|
-
client = MongoClient(os.environ['MONGO_DB_HOST'])
|
|
133
|
-
db = client.get_default_database()
|
|
134
|
-
|
|
135
|
-
# Create consent collection indexes
|
|
136
|
-
db.bioip_access_consents.create_index([
|
|
137
|
-
('wallet_address', 1),
|
|
138
|
-
('ip_id', 1),
|
|
139
|
-
('action', 1)
|
|
140
|
-
])
|
|
141
|
-
|
|
142
|
-
db.bioip_access_consents.create_index([('ip_id', 1)])
|
|
143
|
-
db.bioip_access_consents.create_index([('wallet_address', 1)])
|
|
144
|
-
db.bioip_access_consents.create_index([('revoked', 1)])
|
|
145
|
-
|
|
146
|
-
# Create audit log indexes
|
|
147
|
-
db.audit_log.create_index([('wallet', 1)])
|
|
148
|
-
db.audit_log.create_index([('event_type', 1)])
|
|
149
|
-
db.audit_log.create_index([('timestamp', -1)])
|
|
150
|
-
|
|
151
|
-
print("✅ MongoDB collections created")
|
|
152
|
-
EOF
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
---
|
|
156
|
-
|
|
157
|
-
### Step 5: Build and Test CLI
|
|
158
|
-
|
|
159
|
-
**On development machine:**
|
|
160
|
-
|
|
161
|
-
```bash
|
|
162
|
-
cd /home/ubuntu/genobank-cli
|
|
163
|
-
|
|
164
|
-
# Install dependencies (if needed)
|
|
165
|
-
npm install inquirer axios ora chalk
|
|
166
|
-
|
|
167
|
-
# Build TypeScript
|
|
168
|
-
npm run build
|
|
169
|
-
|
|
170
|
-
# Test with Dr. Claudia's file
|
|
171
|
-
./bin/biofs.js download "biocid://0x5f5a60EaEf242c0D51A21c703f520347b96Ed19a/bioip/0xCCe14315eE3D6a41596EeB4a2839eE50A8ec59f7"
|
|
172
|
-
|
|
173
|
-
# Should show GDPR consent notice and download file
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
---
|
|
177
|
-
|
|
178
|
-
### Step 6: Restart Production API
|
|
179
|
-
|
|
180
|
-
```bash
|
|
181
|
-
# On production server
|
|
182
|
-
sudo systemctl restart api_genobank_prod
|
|
183
|
-
|
|
184
|
-
# Verify endpoints
|
|
185
|
-
curl -X POST https://genobank.app/bionfs/v1/verify_consent \
|
|
186
|
-
-H "Content-Type: application/json" \
|
|
187
|
-
-d '{"user_signature":"0x...","ip_id":"0x...","action":"download"}'
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
---
|
|
191
|
-
|
|
192
|
-
## 📝 Testing Checklist for Dr. Claudia
|
|
193
|
-
|
|
194
|
-
### Test 1: First Download (Shows Consent) ✅
|
|
195
|
-
|
|
196
|
-
```bash
|
|
197
|
-
biofs download "55052008714000.deepvariant.vcf"
|
|
198
|
-
|
|
199
|
-
# Expected output:
|
|
200
|
-
# ═══════════════════════════════════════════
|
|
201
|
-
# 🔒 GENOMIC DATA ACCESS CONSENT
|
|
202
|
-
# ═══════════════════════════════════════════
|
|
203
|
-
#
|
|
204
|
-
# FILE INFORMATION:
|
|
205
|
-
# Filename: 55052008714000.deepvariant.vcf
|
|
206
|
-
# Owner: 0x5f5a...d19a
|
|
207
|
-
# License Type: non-commercial
|
|
208
|
-
#
|
|
209
|
-
# YOU ARE ABOUT TO ACCESS:
|
|
210
|
-
# • Genomic variants (VCF format)
|
|
211
|
-
# • Protected under GDPR Article 9
|
|
212
|
-
#
|
|
213
|
-
# YOUR RIGHTS:
|
|
214
|
-
# ✓ Revoke access anytime
|
|
215
|
-
#
|
|
216
|
-
# > Type "I AGREE" to proceed: I AGREE
|
|
217
|
-
#
|
|
218
|
-
# ✅ Consent recorded
|
|
219
|
-
# ✅ Downloaded: ./55052008714000.deepvariant.vcf
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
### Test 2: Second Download (Uses Existing Consent) ✅
|
|
223
|
-
|
|
224
|
-
```bash
|
|
225
|
-
biofs download "55052008714000.deepvariant.vcf" ~/second-copy.vcf
|
|
226
|
-
|
|
227
|
-
# Expected output:
|
|
228
|
-
# ✓ Using existing consent
|
|
229
|
-
# ✅ Downloaded: ~/second-copy.vcf
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
### Test 3: Mount All Files ✅
|
|
233
|
-
|
|
234
|
-
```bash
|
|
235
|
-
biofs mount ~/dr-claudia-genomic-data
|
|
236
|
-
|
|
237
|
-
# Expected output:
|
|
238
|
-
# ✅ Mounted 1 file(s) to ~/dr-claudia-genomic-data
|
|
239
|
-
#
|
|
240
|
-
# Your Files:
|
|
241
|
-
# ✓ 55052008714000.deepvariant.vcf
|
|
242
|
-
#
|
|
243
|
-
# Usage Examples:
|
|
244
|
-
# bcftools view ~/dr-claudia-genomic-data/55052008714000.deepvariant.vcf
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
### Test 4: Revoke Consent ✅
|
|
248
|
-
|
|
249
|
-
```bash
|
|
250
|
-
biofs access revoke-consent 0xCCe14315eE3D6a41596EeB4a2839eE50A8ec59f7
|
|
251
|
-
|
|
252
|
-
# Expected output:
|
|
253
|
-
# ✅ Revoked consent for IP asset
|
|
254
|
-
# You will need to provide consent again to access this file.
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
### Test 5: Revoke All Consents ✅
|
|
258
|
-
|
|
259
|
-
```bash
|
|
260
|
-
biofs access revoke-consent --all
|
|
261
|
-
|
|
262
|
-
# Expected output:
|
|
263
|
-
# ⚠️ You are about to revoke consent for ALL genomic files
|
|
264
|
-
# Revoke consent for 1 file(s)? Yes
|
|
265
|
-
# ✅ Revoked consent for 1 file(s)
|
|
266
|
-
```
|
|
267
|
-
|
|
268
|
-
---
|
|
269
|
-
|
|
270
|
-
## 🔒 GDPR Compliance Verification
|
|
271
|
-
|
|
272
|
-
### Article 6 - Lawfulness of Processing ✅
|
|
273
|
-
- **Basis**: Explicit consent (Article 6(1)(a))
|
|
274
|
-
- **Implementation**: User must type "I AGREE" explicitly
|
|
275
|
-
|
|
276
|
-
### Article 7 - Conditions for Consent ✅
|
|
277
|
-
- **Requirement**: Consent must be freely given, specific, informed, and unambiguous
|
|
278
|
-
- **Implementation**:
|
|
279
|
-
- Shows exactly what data is being accessed
|
|
280
|
-
- Shows who owns it
|
|
281
|
-
- Shows license terms
|
|
282
|
-
- Requires explicit affirmative action
|
|
283
|
-
|
|
284
|
-
### Article 9 - Special Categories of Data ✅
|
|
285
|
-
- **Requirement**: Genetic data requires explicit consent
|
|
286
|
-
- **Implementation**:
|
|
287
|
-
- Clearly states "genomic data protected under GDPR Article 9"
|
|
288
|
-
- Explains it's "potentially identifying genetic information"
|
|
289
|
-
|
|
290
|
-
### Article 13 - Information to be Provided ✅
|
|
291
|
-
- **Requirements**:
|
|
292
|
-
- Identity of controller (✅ Shows data owner)
|
|
293
|
-
- Purposes of processing (✅ "research and clinical analysis")
|
|
294
|
-
- Right to withdraw (✅ Shows revoke command)
|
|
295
|
-
- Recipients of data (✅ Shows license type)
|
|
296
|
-
|
|
297
|
-
### Article 17 - Right to Erasure ✅
|
|
298
|
-
- **Requirement**: User can withdraw consent
|
|
299
|
-
- **Implementation**: `biofs access revoke-consent` command
|
|
300
|
-
|
|
301
|
-
### Article 30 - Records of Processing ✅
|
|
302
|
-
- **Requirement**: Maintain audit trail
|
|
303
|
-
- **Implementation**:
|
|
304
|
-
- MongoDB consent records with timestamps
|
|
305
|
-
- IP addresses logged
|
|
306
|
-
- All actions in audit_log collection
|
|
307
|
-
|
|
308
|
-
---
|
|
309
|
-
|
|
310
|
-
## 📊 MongoDB Data Model
|
|
311
|
-
|
|
312
|
-
### Collection: `bioip_access_consents`
|
|
313
|
-
|
|
314
|
-
```javascript
|
|
315
|
-
{
|
|
316
|
-
"_id": ObjectId("..."),
|
|
317
|
-
"wallet_address": "0xb3c3...192d", // Dr. Claudia
|
|
318
|
-
"ip_id": "0xCCe1...59f7", // VCF IP Asset
|
|
319
|
-
"filename": "55052008714000.deepvariant.vcf",
|
|
320
|
-
"data_owner": "0x5f5a...d19a", // Daniel
|
|
321
|
-
"license_token_id": 40249,
|
|
322
|
-
"license_type": "non-commercial",
|
|
323
|
-
|
|
324
|
-
"action": "download", // or "mount"
|
|
325
|
-
"purpose": "research_and_clinical_analysis",
|
|
326
|
-
|
|
327
|
-
"consent_text_version": "v1.0",
|
|
328
|
-
"consent_given_at": ISODate("2025-10-07T06:00:00Z"),
|
|
329
|
-
"consent_ip_address": "192.168.1.100",
|
|
330
|
-
"consent_user_agent": "BioFS CLI v1.0.0",
|
|
331
|
-
|
|
332
|
-
"gdpr_rights_acknowledged": true,
|
|
333
|
-
"license_terms_acknowledged": true,
|
|
334
|
-
|
|
335
|
-
"access_count": 1,
|
|
336
|
-
"last_accessed_at": ISODate("2025-10-07T06:00:00Z"),
|
|
337
|
-
|
|
338
|
-
"revoked": false,
|
|
339
|
-
"revoked_at": null,
|
|
340
|
-
"revoked_reason": null
|
|
341
|
-
}
|
|
342
|
-
```
|
|
343
|
-
|
|
344
|
-
### Collection: `audit_log`
|
|
345
|
-
|
|
346
|
-
```javascript
|
|
347
|
-
{
|
|
348
|
-
"_id": ObjectId("..."),
|
|
349
|
-
"event_type": "consent_granted", // or "consent_revoked"
|
|
350
|
-
"wallet": "0xb3c3...192d",
|
|
351
|
-
"ip_id": "0xCCe1...59f7",
|
|
352
|
-
"action": "download",
|
|
353
|
-
"timestamp": ISODate("2025-10-07T06:00:00Z"),
|
|
354
|
-
"ip_address": "192.168.1.100"
|
|
355
|
-
}
|
|
356
|
-
```
|
|
357
|
-
|
|
358
|
-
---
|
|
359
|
-
|
|
360
|
-
## 🎯 Success Criteria
|
|
361
|
-
|
|
362
|
-
✅ **Dr. Claudia runs:** `biofs download "55052008714000.deepvariant.vcf"`
|
|
363
|
-
✅ **Consent notice shows** with all GDPR-required information
|
|
364
|
-
✅ **She types "I AGREE"** and file downloads
|
|
365
|
-
✅ **Consent is recorded** in MongoDB with timestamp + IP
|
|
366
|
-
✅ **Second download** uses existing consent (no prompt)
|
|
367
|
-
✅ **She can mount files** with `biofs mount ~/genomic-data`
|
|
368
|
-
✅ **She can revoke** with `biofs access revoke-consent 0xCCe...`
|
|
369
|
-
✅ **All actions logged** in audit trail
|
|
370
|
-
|
|
371
|
-
---
|
|
372
|
-
|
|
373
|
-
## 📚 API Endpoint Summary
|
|
374
|
-
|
|
375
|
-
| Endpoint | Method | Purpose |
|
|
376
|
-
|----------|--------|---------|
|
|
377
|
-
| `/bionfs/v1/verify_consent` | POST | Check if consent exists |
|
|
378
|
-
| `/bionfs/v1/record_consent` | POST | Record new consent |
|
|
379
|
-
| `/bionfs/v1/revoke_consent` | POST | Revoke consent (GDPR) |
|
|
380
|
-
| `/bionfs/v1/my_consents` | GET | List user's consents |
|
|
381
|
-
| `/api_bioip/download_granted_file` | GET/POST | Download with license check |
|
|
382
|
-
|
|
383
|
-
---
|
|
384
|
-
|
|
385
|
-
## 🚀 Deployment Timeline
|
|
386
|
-
|
|
387
|
-
1. **Integrate into index.ts** (5 min)
|
|
388
|
-
2. **Update BioCIDResolver** (10 min)
|
|
389
|
-
3. **Deploy API endpoints** (5 min)
|
|
390
|
-
4. **Create MongoDB collections** (2 min)
|
|
391
|
-
5. **Build CLI** (3 min)
|
|
392
|
-
6. **Restart production API** (2 min)
|
|
393
|
-
7. **Test with Dr. Claudia** (10 min)
|
|
394
|
-
|
|
395
|
-
**Total: ~40 minutes**
|
|
396
|
-
|
|
397
|
-
---
|
|
398
|
-
|
|
399
|
-
## 🎉 What This Achieves
|
|
400
|
-
|
|
401
|
-
1. **First GDPR-compliant genomic data CLI** in the world
|
|
402
|
-
2. **Blockchain-verified access control** (Story Protocol licenses)
|
|
403
|
-
3. **Full audit trail** for regulatory compliance
|
|
404
|
-
4. **User-friendly consent flow** (not just legalese)
|
|
405
|
-
5. **Revocable access** (GDPR right to withdraw)
|
|
406
|
-
6. **Dr. Claudia has full transparency** over her data access
|
|
407
|
-
|
|
408
|
-
This is ready for production deployment! 🚀
|