Fileshare Token
This token represents the sharing of a file with another user.
The fileshare token must contain a subject (sub) field which contains the fileId of the shared file.
Content-Addressing
This token is content-addressed using SHA-256:
- The entire JWT token (header + payload + signature) is hashed
- Action ID format:
a1~{base64_hash} - See Content-Addressing & Merkle Trees for details
Database Key
The database key for a fileshare token is [iss, t, sub]
Purpose: This key ensures that a user can only have one active fileshare for a given file. The key components are:
iss: Issuer identity (who is sharing)t: Token type (“FSHR”)sub: Subject (the file being shared)
Example:
- Alice shares file with Bob → Stored with key
[alice.example.com, "FSHR", f1~file123] - Alice updates the share → New token with same key, previous one is marked deleted
- Only ONE fileshare of the same file from the same user
Example
User @alice.cloudillo.net shares a file with @bob.cloudillo.net:
| Field | Value |
|---|---|
| iss | alice.cloudillo.net |
| aud | bob.cloudillo.net |
| iat | 2024-04-13T00:01:10.000Z |
| k | 20240101 |
| t | FSHR |
| sub | 7NtuTab_K4FwYmARMNuk4 |