Lock-Key-Weight Model
The lock-key-weight model is the heart of Docyard’s access control. It’s simple, flexible, and powerful.The Core Concept
Every artifact in the lake has:- Locks: Metadata fields that define access requirements
- Keys: Values for those metadata fields
- Weights: Scores assigned to each lock type
- Threshold: Minimum combined score required for access
How It Works
Step 1: Distributor Uploads Artifact
When uploading, the distributor:- Selects an artifact type template
- Provides values (keys) for each lock
- Assigns weights to each lock type
- Sets a threshold score
Step 2: Collector Attempts Retrieval
When a collector wants the artifact, they:- Search for artifacts
- Present their keys
- System calculates total score
Step 3: Access Decision
The system calculates:| Presented Key | Weight | Match? |
|---|---|---|
| policy_number: POL-12345678 | 20 | ✅ Yes |
| effective_date: (not provided) | 10 | ❌ No |
| mortgagee_name: (not provided) | 5 | ❌ No |
Threshold: 20
Decision: ✅ Access Granted (20 ≥ 20)
Score Calculation Examples
Example 1: Full Match
Collector has the policy number:| Key | Weight | Provided? |
|---|---|---|
| policy_number | 20 | ✅ |
| effective_date | 10 | ❌ |
| mortgagee_name | 5 | ❌ |
Threshold: 20
Result: ✅ Access Granted
Example 2: Partial Match (Enough)
Collector has mortgagee name AND effective date:| Key | Weight | Provided? |
|---|---|---|
| policy_number | 20 | ❌ |
| effective_date | 10 | ✅ |
| mortgagee_name | 5 | ✅ |
Threshold: 20
Result: ❌ Access Denied (15 < 20)
Example 3: Multiple Partial Matches
Collector has all three keys:| Key | Weight | Provided? |
|---|---|---|
| policy_number | 20 | ✅ |
| effective_date | 10 | ✅ |
| mortgagee_name | 5 | ✅ |
Threshold: 20
Result: ✅ Access Granted (35 ≥ 20)
Why Weights Matter
Weights allow fine-grained access control:High-Security Artifact
- Requires combining multiple strong keys
- A single key isn’t enough
- Higher security
Low-Security Artifact
- Single key grants access
- Easier for collectors
- Lower security
Lock Types
Each lock type has:| Property | Description | Example |
|---|---|---|
| Name | Unique identifier | policy_number |
| Data Type | Value type | string, number, date |
| Validation | Format rules | regex pattern |
| Weight | Score contribution | 20 |
Common Lock Types
| Lock Type | Data Type | Description | Typical Weight |
|---|---|---|---|
policy_number | string | Insurance policy ID | 15-25 |
loan_number | string | Loan identifier | 15-25 |
effective_date | date | Effective date | 5-10 |
mortgagee_name | string | Lender name | 5-10 |
document_type | string | Category of document | 5-10 |
address | string | Property address | 5-10 |
insured_name | string | Insured person | 5-10 |
System vs Custom Lock Types
System Lock Types
Mandatory for all artifacts:| Lock Type | Description | Required? |
|---|---|---|
document_type | Category of document | ✅ Yes |
Custom Lock Types
Defined by distributors in their artifact type templates:Matching Logic
Exact Match
For string locks, values must match exactly:Partial Match (Optional)
For string locks, you can enable partial matching:Date Range (Optional)
For date locks, you can match ranges:Access Denied Scenarios
Score Too Low
Missing Required Keys
Benefits of Lock-Key-Weight
- Flexible: Combine any keys to meet threshold
- Fine-grained: Weights allow security tuning
- Simple: No complex permission matrices
- Open: Any collector can attempt access
- Secure: Only those with real keys succeed
Next Steps
- Learn about Distributors
- Learn about Collectors
- See the API Reference