-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added schemas that will be used by the FileSystem DAC
- Loading branch information
Showing
3 changed files
with
150 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
"$id": "https://skystandards.hns.siasky.net/draft-01/directoryFile.schema.json", | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"description": "Metadata of a file, can contain multiple versions", | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"type": "string", | ||
"description": "Name of this file" | ||
}, | ||
"created": { | ||
"type": "integer", | ||
"description": "Unix timestamp (in milliseconds) when this file was created", | ||
"minimum": 0 | ||
}, | ||
"modified": { | ||
"type": "integer", | ||
"description": "Unix timestamp (in milliseconds) when this file was last modified", | ||
"minimum": 0 | ||
}, | ||
"mimeType": { | ||
"type": "string", | ||
"description": "MIME Type of the file, optional" | ||
}, | ||
"version": { | ||
"type": "integer", | ||
"description": "Current version of the file. When this file was already modified 9 times, this value is 9", | ||
"minimum": 0 | ||
}, | ||
"size": { | ||
"type": "integer", | ||
"description": "Unencrypted size of the file, in bytes", | ||
"minimum": 0 | ||
}, | ||
"file": { | ||
"$ref": "https://skystandards.hns.siasky.net/draft-01/fileData.schema.json", | ||
"description": "The current version of a file" | ||
}, | ||
"history": { | ||
"type": "object", | ||
"patternProperties": { | ||
"^[0-9]+$": { | ||
"$ref": "https://skystandards.hns.siasky.net/draft-01/fileData.schema.json", | ||
"description": "A file version" | ||
} | ||
}, | ||
"description": "Historic versions of a file", | ||
"additionalProperties": false | ||
} | ||
}, | ||
"required": [ | ||
"name", | ||
"created", | ||
"modified", | ||
"version", | ||
"size", | ||
"file" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"$id": "https://skystandards.hns.siasky.net/draft-01/directoryIndex.schema.json", | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"description": "Index file of a directory, contains all directories and files in this specific directory", | ||
"type": "object", | ||
"properties": { | ||
"directories": { | ||
"type": "object", | ||
"patternProperties": { | ||
"^.+$": { | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"type": "string", | ||
"description": "Name of this directory" | ||
}, | ||
"created": { | ||
"type": "integer", | ||
"description": "Unix timestamp (in milliseconds) when this directory was created", | ||
"minimum": 0 | ||
} | ||
} | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"description": "A subdirectory in this directory" | ||
}, | ||
"files": { | ||
"type": "object", | ||
"patternProperties": { | ||
"^.+$": { | ||
"$ref": "https://skystandards.hns.siasky.net/draft-01/directoryFile.schema.json" | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"description": "A file in this directory" | ||
} | ||
}, | ||
"required": [ | ||
"directories", | ||
"files" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"$id": "https://skystandards.hns.siasky.net/draft-01/fileData.schema.json", | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"description": "Specific version of a file. Immutable.", | ||
"type": "object", | ||
"properties": { | ||
"url": { | ||
"type": "string", | ||
"description": "URL where the encrypted file blob can be downloaded, usually a skylink (sia://)" | ||
}, | ||
"key": { | ||
"type": "string", | ||
"description": "The secret key used to encrypt this file, base64Url-encoded" | ||
}, | ||
"encryptionType": { | ||
"type": "string", | ||
"description": "Which algorithm is used to encrypt and decrypt this file", | ||
"examples": [ | ||
"AEAD_XCHACHA20_POLY1305" | ||
] | ||
}, | ||
"chunkSize": { | ||
"type": "integer", | ||
"description": "maxiumum size of every unencrypted file chunk in bytes", | ||
"exclusiveMinimum": 0, | ||
"examples": [ | ||
16777216 | ||
] | ||
}, | ||
"hash": { | ||
"$ref": "https://skystandards.hns.siasky.net/draft-01/hash.schema.json", | ||
"description": "Multihash of the unencrypted file, starts with 1220 for sha256" | ||
}, | ||
"ts": { | ||
"type": "integer", | ||
"description": "Unix timestamp (in milliseconds) when this version was added to the FileSystem DAC", | ||
"minimum": 0 | ||
} | ||
}, | ||
"required": [ | ||
"url", | ||
"key", | ||
"encryptionType", | ||
"chunkSize", | ||
"hash", | ||
"ts" | ||
] | ||
} |