more updates
File: hellnet/protocols/http/index [Diff]
-- a/hellnet/protocols/http/index++ b/hellnet/protocols/http/index
@@ -6,7 +6,7 @@
|_. Query |_. Path |_. Static/dynamic |_. Description |
| GET | @/chunks/([0-9a-f]+)@ | static | [[/hellnet/tech/chunk|Chunk]] with hash $1 |
| GET | @/meta/([0-9a-f]+)/([^/]+){,\.key,\.sign}@ | static | [[../tech/metatrees|Metatrees]] with friends [[../tech/metatrees|Metatree]] of key $1 and name $2, and its signature & date |
| GET, HEAD | @/hello@ | static | Check whether node is up |
| POST | @/handshake@ | dynamic | Establish a link to node |
-- /dev/null++ b/hellnet/protocols/http/meta
@@ -1 +1,47 @@
h1. meta resource
h2. Brief description
Download metatrees
h2. Requests
h3. GET @/meta/([0-9a-f]+)/([^/]+){,\.key,\.sign}@
h4. Parameters
None
h4. Description
This resource provides metatrees, its dates and signatures
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. If these are ok, then it replaces its own metatree with downloaded one.
h4. Response
Metatree, its date and signature. Example:
h5. GET /meta/7c657811658adf5d5f77bf571270a8ad242ed454fb353ff90f6ad6248edcba14fd155b8a78ad9af53fc4a58dd10464295322655ade5264598a7b5e537032d539/test
bc. {
"updated" : 1258639915,
"key" : "22fea70fde222e2463b1dd716fa9f7faf75d90ebc6517333643826348c05950021fd2a2b31dcb23c1971149adf952bd1f38763b2338708acd12e97823a5017d2",
"name" : "test",
"content" : {
"helloworld" : "18895861928ce6793b3386d0fccacfcca35b2aa845fc895f06013fbac50ef9cbf1f77352f041b3f82fbce109b209cd09ff763d2a95c0eba2a21967dbe32f39e5.35abcdef",
"hellodir" : {
"file1" : "7c657811658adf5d5f77bf571270a8ad242ed454fb353ff90f6ad6248edcba14fd155b8a78ad9af53fc4a58dd10464295322655ade5264598a7b5e537032d539",
"file2" : "2fc800b58bf1903d8b98a007f301d4e59baf69f9e60609e00e4cfa0c6f8307ff8abb2155c8ff2642eb687b296c99ca95ae49e322ef3f95eadddada011149e737"
}
}
}
h5. GET /meta/7c657811658adf5d5f77bf571270a8ad242ed454fb353ff90f6ad6248edcba14fd155b8a78ad9af53fc4a58dd10464295322655ade5264598a7b5e537032d539/test.date
bc. 1258639915
h5. GET /meta/7c657811658adf5d5f77bf571270a8ad242ed454fb353ff90f6ad6248edcba14fd155b8a78ad9af53fc4a58dd10464295322655ade5264598a7b5e537032d539/test.key
<binary RSA signature data>
-- a/hellnet/protocols/http/metamail/sync++ /dev/null
@@ -1,30 +1 @@
h1. @metamail/sync@ resource
h2. Brief description
Get all the metamail bundles from your last sync.
h2. Requests
h3. GET
h4. Parameters
None
h4. Description
This request is used to check for new metamail since last contact. Results in newline-separated list of numbers like 1250968044, which are UNIX timestamps for metamail bundles. Client then can retrieve that bundle by path like @/metamail/1250968044@. After retrieval of all those, client can @POST /metamail/synced@ for server to reset the last contact time ([[synced|more info]]).
h4. Response
Newline-separated list of bundles' names. Example:
bc. 1250968044
1250968046
1250968047
1250968048
1250968049
1250968050
1250968051
-- a/hellnet/protocols/http/metamail/synced++ /dev/null
@@ -1,18 +1 @@
h1. @metamail/synced@ resource
h2. Brief description
Report successfully downloaded metamail bundles to node.
h2. Requests
h3. POST
h4. Parameters
* lastBundle - name of last (sorted by value in ascending order) bundle downloaded.
h4. Description
This resource is requested when client had downloaded all the bundles. Server recalculates last contact time based on lastBundle and returns list of remaining bundles (acts as [[metamail/sync]]). If the list is empty, transaction can be finished, otherwise client should download all the bundles and request this resource again.
-- a/hellnet/tech/metatrees++ b/hellnet/tech/metatrees
@@ -28,5 +28,7 @@
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)
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 the signature validity. If it's ok, then it replaces its own metatree with downloaded one.
h3. See also
[[../protocols/http/meta|Metatrees transfer|]]