reTHINK-project / dev-registry-global

Global Registry
Apache License 2.0
4 stars 0 forks source link

Global Registry Interfaces #1

Closed sgoendoer closed 8 years ago

sgoendoer commented 9 years ago

Which interfaces do we need / want for the global registry to have?

First off, we need an interface for users to resolve a GUID Second, we need an interface for a user to upload a new set of data to the DHT Finally, we need an interface for a user to update his data in the DHT

Question: do we want to have an interface for deleting data?

Proposal:

Build the interface REST-style, i.e.:

HTTP GET /:guid

will resolve the data.

HTTP POST /

will create a new entry in the DHT where the (signed) data needs to be specified in the request body

HTTP PUT /:guid

will update a dataset (by overwriting it). the (signed) data is again passed in the request body

HTTP DELETE /:guid

will delete the dataset for the id :guid. not sure whether we should allow this. problem: no body can be passed via delete. alternative: use PUT to upload a version which is signed and marked as "inactive".

rjflp commented 9 years ago

Why do we need to "HTTP POST /"? Would the "HTTP PUT /:guid" be enough for both creating and updating? This does match the definition of the verb: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html

sgoendoer commented 8 years ago

The idea was to have a more logical separation. Only using PUT would mean "create or update", while POST would mean "create only if it does not exist". Of course just using PUT (and GET and DELETE) would be sufficient

sgoendoer commented 8 years ago

Do we need to discuss this further?

ruimangas commented 8 years ago

We were discussing it earlier and we're still thinking that PUT would be sufficient because the GUID is not generated, you have to explicitly declare it. That is, in the POST method you would have to send the GUID in the message to create the object.

Using the PUT method to "create and update" you define the GUID in the resource URL, i.e:

PUT /:guid
rjflp commented 8 years ago

I would further add that the URLs should not start only with /. We are taking the whole address space, leaving none free for the future. Instead I would prefer to use the following URLs:

/guid/<guid>

@sgoendoer Regarding the DELETE, I like your alternative: use PUT to upload a version which is signed and marked as "inactive". It MUST BE impossible to change something that as been marked as "inactive". Eventually marking something as inactive could also remove the content. It would no longer map to anything.

Basically, I believe we should only have PUT and GET.

sgoendoer commented 8 years ago

I guess we can close this?