Meta update
File: hellnet/protocols/http/meta [Diff]
-- a/hellnet/protocols/http/meta++ b/hellnet/protocols/http/meta
@@ -6,7 +6,7 @@
h2. Requests
h3. GET @/meta/([0-9a-f]+)/([^/]+){,\.key,\.sign}@ @/meta/([0-9a-f]+)/([^/]+)@
h4. Parameters
@@ -14,32 +14,20 @@
h4. Description
This resource provides metatrees, metatrees' links, its dates and signatures
h4. Response
Metatree,
Metatree link, its date and signature. Example:
h5. GET /meta/7c6578116..32d539/test
bc. {
"updated" : 1258639915,
"key" : "hell://file/22fea70fde222e2463b1dd716fa9f7faf75d90ebc6517333643826348c05950021fd2a2b31dcb23c1971149adf952bd1f38763b2338708acd12e97823a5017d2?key=a1234567", "hell://chunk/22fea70fde222e2463b1dd716fa9f7faf75d90ebc6517333643826348c05950021fd2a2b31dcb23c1971149adf952bd1f38763b2338708acd12e97823a5017d2?key=a1234567",
"name" : "test", "test"
"content" : {
"helloworld" : "hell://file/18895861928ce6793b3386d0fccacfcca35b2aa845fc895f06013fbac50ef9cbf1f77352f041b3f82fbce109b209cd09ff763d2a95c0eba2a21967dbe32f39e5.35abcdef",
"hellodir" : {
"file1" : "hell://file/7c657811658adf5d5f77bf571270a8ad242ed454fb353ff90f6ad6248edcba14fd155b8a78ad9af53fc4a58dd10464295322655ade5264598a7b5e537032d539",
"file2" : "hell://file/2fc800b58bf1903d8b98a007f301d4e59baf69f9e60609e00e4cfa0c6f8307ff8abb2155c8ff2642eb687b296c99ca95ae49e322ef3f95eadddada011149e737"
} "hell://chunk/e4dfde12d6612f9816d1e924c274689e5236af74db23d14cf76bee0fc49690398f1c32bce9db951305a62906c4344c04a5682b1c6bdf64e219c2dde2810b44da"
}
}
h5. GET /meta/7c6578116..32d539/test.date
bc. 1258639915
h5. GET /meta/7c6578116..32d539/test.key
<binary RSA
<empty line>
<RSA binary signature data>
-- a/hellnet/tech/URIs/meta++ b/hellnet/tech/URIs/meta
@@ -14,7 +14,7 @@
h2. How it works
When updating, client should first check the date; if it's bigger than his current metatree, then client downloads the tree and signature, optionally decrypts both using supplied encryption key and checks if server's announced date, key and name match ones in metatree itself and the signature validity. is valid. If these are it's ok, then it replaces its own metatree with downloaded one. one available under given link.
h2. See also
-- a/hellnet/tech/metatrees++ b/hellnet/tech/metatrees
@@ -8,25 +8,32 @@
bc. {
"updated" : 1258639915,
"key" : "hell://file/22fea70fde222e2463b1dd716fa9f7faf75d90ebc6517333643826348c05950021fd2a2b31dcb23c1971149adf952bd1f38763b2338708acd12e97823a5017d2?key=a1234567", "hell://chunk/22fea70fde222e2463b1dd716fa9f7faf75d90ebc6517333643826348c05950021fd2a2b31dcb23c1971149adf952bd1f38763b2338708acd12e97823a5017d2?key=a1234567",
"name" : "test", "test"
"content" : {
"helloworld" : "hell://file/18895861928ce6793b3386d0fccacfcca35b2aa845fc895f06013fbac50ef9cbf1f77352f041b3f82fbce109b209cd09ff763d2a95c0eba2a21967dbe32f39e5.35abcdef",
"hellodir" : {
"file1" : "hell://file/7c657811658adf5d5f77bf571270a8ad242ed454fb353ff90f6ad6248edcba14fd155b8a78ad9af53fc4a58dd10464295322655ade5264598a7b5e537032d539",
"file2" : "hell://file/2fc800b58bf1903d8b98a007f301d4e59baf69f9e60609e00e4cfa0c6f8307ff8abb2155c8ff2642eb687b296c99ca95ae49e322ef3f95eadddada011149e737"
}
} "hell://chunk/e4dfde12d6612f9816d1e924c274689e5236af74db23d14cf76bee0fc49690398f1c32bce9db951305a62906c4344c04a5682b1c6bdf64e219c2dde2810b44da"
}
<empty line>
<binary RSA signature>
Description of top-level fields:
"updated" : UNIX timestamp of last update
"key" : hash of link to public key
"name" : name of this meta
"content" : link to meta tree
That would be stored under URI hell://chunk/e4dfde12d6612f9816d1e924c274689e5236af74db23d14cf76bee0fc49690398f1c32bce9db951305a62906c4344c04a5682b1c6bdf64e219c2dde2810b44da:
bc. {
"helloworld" : "hell://file/18895861928ce6793b3386d0fccacfcca35b2aa845fc895f06013fbac50ef9cbf1f77352f041b3f82fbce109b209cd09ff763d2a95c0eba2a21967dbe32f39e5",
"hellodir" : {
"file1" : "hell://file/7c657811658adf5d5f77bf571270a8ad242ed454fb353ff90f6ad6248edcba14fd155b8a78ad9af53fc4a58dd10464295322655ade5264598a7b5e537032d539",
"file2" : "hell://file/2fc800b58bf1903d8b98a007f301d4e59baf69f9e60609e00e4cfa0c6f8307ff8abb2155c8ff2642eb687b296c99ca95ae49e322ef3f95eadddada011149e737"
}
}
This JSON represents a filesystem with unlimited subdirectories, keys are filenames, values are hell:// links (only /chunk or /file)
Metatrees are stored in ./meta/$public_key_hash/$name (metatree itself), /meta/$public_key_hash/$name.date (value of "updated" field), /meta/$public_key_hash/$name.sign (detached signature)
h3. See also