opencadc / reg

client and server implementation of IVOA Registry specifications
GNU Affero General Public License v3.0
1 stars 11 forks source link

reg service: add a simple mechanism to update OAI content #192

Open pdowler opened 4 hours ago

pdowler commented 4 hours ago

Currently, the OAI content is a set of xml files that are mounted into the container at deployment time.

The editor of those files has to maintain the timestamps (OAI datestamp and VOResource updated attr) manually and make new versions live at about the same time as the manually entered timestamps.

There is currently no back end database and for most uses that would be an unnecessary dependency/burden.

pdowler commented 4 hours ago

Simple quick and dirty proposal: add support for an authorized user to update a record through the REST API. The workflow would be roughly:

  1. GET /reg/oai?verb=GetRecord&metadataPrefix=ivo_vor\&identifier=ivo://example.net/record
  2. manually edit the OAI-PMH document
  3. PUT /reg/oai

The PutAction would check authorization, validate the input document, set the OAI-PMH datestamp and the VOResource updated attribute to the current time, and write the record back to the underlying filesystem. PUT could both create new and overwrite existing records.

aside: Tools to help with (2) edit could be created, but the value-to-effort ration seems low to me...

For a persistent registry, the deployer is responsible for mounting a writable external filesystem into the container; if they deploy multiple instances the fs has to be shared between all instances.

This feature would be enabled by an optional configuration of an admin user with permission to put records. If an admin is not configured, the content is immutable (as it is now).