View Issue Details

IDProjectCategoryView StatusLast Update
0007400GNUnetnamestore servicepublic2022-10-31 03:22
Reporterschanzen Assigned Toschanzen  
PrioritynormalSeveritytweakReproducibilityhave not tried
Status closedResolutionfixed 
Target Version0.18.0Fixed in Version0.18.0 
Summary0007400: Improve namestore REST API
DescriptionGET /namestore/$ZNAME

would likely benefit from some filters that could be applied, like query
parameters "record-type=A", "is_private=false", etc., just to enable efficient
searching of the data. We should also have a GET /namestore/$ZNAME/$LABEL to
just get the record set under that label. GET /namestore/$ZNAME/$LABEL should
then also return an ETag set to the hash of the record set (see below).

POST /namestore/$ZNAME

is not ideal, as it doesn't allow the client to ensure that it didn't
accidentally (!) change an existing record. I would use POST only to create a
new resource (and fail with 409 conflict if the given name already exists).
You could also just use POST /namestore/$ZONE/$LABEL for this and not have the
label in the record set. Then, for updates, we should use PATCH
/namestore/$ZONE/$LABEL. PATCH should use If-not-modified with the ETag from
the GET to make the operation atomic: if someone else did a PATCH since the
GET, the PATCH would fail. A client could then set the If-not-modified header
to ensure atomic updates, or omit it to override whatever record is there
without worrying about atomicity. PATCH without If-not-modified would then
also give you UPSERT (update and if not exists insert).

DELETE /namestore/$ZNAME?record_name=$RNAME

Modify the path to be /namestore/$ZNAME/$LABEL (or $RNAME if you
like). W may want to permit DELETE /namestore/$ZONE as well, to delete the
entire zone.

TagsNo tags attached.



2022-10-19 09:27

administrator   ~0019245

Most of the comments were already in the API split remaining task into new issues.

Issue History

Date Modified Username Field Change
2022-10-18 13:55 schanzen New Issue
2022-10-19 09:07 schanzen Issue cloned: 0007403
2022-10-19 09:09 schanzen Issue cloned: 0007404
2022-10-19 09:27 schanzen Assigned To => schanzen
2022-10-19 09:27 schanzen Status new => resolved
2022-10-19 09:27 schanzen Resolution open => fixed
2022-10-19 09:27 schanzen Fixed in Version => 0.18.0
2022-10-19 09:27 schanzen Note Added: 0019245
2022-10-31 03:22 schanzen Status resolved => closed