docuteam:bridge
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
docuteam:bridge [2019/09/13 13:30] – [1 - depositions API] jan | docuteam:bridge [2023/02/06 14:33] (aktuell) – gelöscht Administrator | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
- | ====== docuteam bridge ====== | ||
- | ===== documentation for client applications ===== | ||
- | |||
- | Documentation for docuteam bridge v.1.0.0 | ||
- | |||
- | ===== goal ===== | ||
- | |||
- | Client applications should be able to submit a deposition (data and metadata) to our ingest platform. Depositions are picked up by docuteam feeder workflows, usually processing and storing the information in a repository. After a successful ingest, feeder (and subsequently bridge) return PIDs for every object (file, folder) within the deposition. Using these PIDs, clients are able to access (read and change) the | ||
- | deposited objects. | ||
- | |||
- | In the [[https:// | ||
- | * the bridge deposition API recieves Submission Information Package (SIP) | ||
- | * after preservation actions, the SIP are ingested into the repository by feeder and become Archival Information Package (AIP) | ||
- | * the bridge access API enables client application to retrieve Dissemination Information Package (DIP) | ||
- | |||
- | {{ : | ||
- | |||
- | |||
- | ===== key points ===== | ||
- | |||
- | * Bridge is a set of rest APIs that respond in JSON (and binary data) | ||
- | * Bridge is agnostic to package format | ||
- | * Use the simple, bagit-based format docuteam dublin core 1.0 (see [[docuteam: | ||
- | * Use Matterhorn METS (see [[https:// | ||
- | * Use other formats like e. g. eCH-0160 or SEDA. | ||
- | * Bridge is composed of 3 APIs: | ||
- | * **depositions**: | ||
- | * **access**: read data successfully deposited in the repository | ||
- | * **changes**: | ||
- | ===== bridge APIs ===== | ||
- | |||
- | For security reasons, bridge enforces HTTPS. Access is restricted via tokens that must be transmitted with each request via using the “token” parameter (regardless the HTTP method: GET, POST, PUT, PATCH, DELETE). Roles are associated to tokens and limit their scope of operation. | ||
- | |||
- | * **depositions** | ||
- | * new depositions are temporarily stored by bridge. They are made available to feeder, which in turn processes and stores them into the repository, | ||
- | * depositions are identified by bridge IDs, that are returned with the HTTP response to a deposition creation request, | ||
- | * upon successful archiving in the repository, | ||
- | * the status of the deposition is set to " | ||
- | * PIDs, which are the repository’s Persistent IDs are made available by bridge. PIDs are required to access (read, modify, purge) repository objects. | ||
- | * Each digital object in the repository (folder, file) gets its own PID and relations between the customer' | ||
- | * the SIP is deleted from bridge as the information is preserved by the repository | ||
- | * **changes** target (for update or purge) one single object in the repository identified by its PID. They can be limited to: | ||
- | * metadata only (data is unchanged, only for updates) | ||
- | * data only (metadata is unchanged) | ||
- | * object (metadata+data are modified) | ||
- | * **access** | ||
- | * gives access to the full DIP corresponding to a deposited SIP, | ||
- | * or gives access to metadata, data or on-the-fly converted formats of specific repository objects, | ||
- | * this API is a proxy to docuteam rservices (a component offering high level access to Fedora objects, such as DIP and preview generation) | ||
- | |||
- | ==== 0 - authentication and roles ==== | ||
- | |||
- | Bridge relies solely on tokens for authentication an authorization. Tokens are bound to institutions and roles and restrict the API usage on that basis. | ||
- | |||
- | * An authentication token must be at least 15 characters long. | ||
- | * Tokens are passed via the “token” HTTP parameter, for example when using GET, this results in urls of the form: | ||
- | |||
- | < | ||
- | |||
- | === roles == | ||
- | There are 5 roles: | ||
- | * The 3 first roles are limited to the organization they are bound to: | ||
- | * **read**: is restricted to the access API | ||
- | * **create**: has the same authorizations as read, and can in addition list and create depositions via the deposition API | ||
- | * **manage**: has the same authorizations as read, and can in addition update or purge repository objects via the nodes API | ||
- | * The 2 last roles are not limited to any organization | ||
- | * **admin**: authentication and authorization management, i.e. token administration via the API or the GUI | ||
- | * **feeder**: super user, can do anything except token administration, | ||
- | |||
- | === recommendation === | ||
- | * use only one token with read roles in applications that do not require to create nor update depositions, | ||
- | * use only one token with create role in application that make use of the deposition API but not the changes API, | ||
- | * use only one token with manage role in applications that make use the changes API. | ||
- | |||
- | ==== 1 - depositions API ==== | ||
- | |||
- | === deposition statuses === | ||
- | * // | ||
- | * //queued//: the deposition has been attributed to a queue in feeder | ||
- | * // | ||
- | * // | ||
- | * //error//: something went wrong during the deposition' | ||
- | * // | ||
- | |||
- | The deposition status can be managed by the role “feeder”. Other non-reader roles may only delete depositions (set the status to deleted), except when status is set to “processing”. | ||
- | |||
- | {{ : | ||
- | |||
- | |||
- | === deposition responses === | ||
- | |||
- | Responses are given in JSON or a binary format. Each JSON response is a list of depositions metadata matching the query. Generic structure: | ||
- | |||
- | < | ||
- | { " | ||
- | { " | ||
- | " | ||
- | " | ||
- | [ | ||
- | { " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | ] | ||
- | " | ||
- | { " | ||
- | " | ||
- | " | ||
- | } | ||
- | </ | ||
- | |||
- | Key elements include: | ||
- | |||
- | * “id” is the deposition identificater, | ||
- | * “status” is the deposition status, as described above, | ||
- | * “feeder_response” is also formatted in JSON. It is a black box from bridge' | ||
- | |||
- | < | ||
- | { " | ||
- | [ | ||
- | { " | ||
- | { " | ||
- | | ||
- | ], | ||
- | " | ||
- | } | ||
- | </ | ||
- | |||
- | It must be noted that: | ||
- | * the " | ||
- | * the " | ||
- | |||
- | === deposition routes === | ||
- | |||
- | == deposition routes overview == | ||
- | |||
- | < | ||
- | GET / | ||
- | POST / | ||
- | GET / | ||
- | PATCH / | ||
- | PUT / | ||
- | </ | ||
- | |||
- | == deposition routes detailed == | ||
- | ^ Action | ||
- | |||
- | | **create** | ||
- | | | parameter: `package_format`, | ||
- | | **list** / **show** | **HTTP GET** on / | ||
- | | **retrieve binary data** | **HTTP GET** on / | ||
- | | **update** | ||
- | |||
- | ==== 2 - access API ==== | ||
- | |||
- | This API is a of proxy to docuteam rservices. Rservices is offers high level access to Fedora objects. For example, it is able to generate DIP starting from the top level object of an archival package and assembling it recursively. Another notable feature is the the on-the-fly generation of thumbnails and, more generally, format migrations. | ||
- | |||
- | Bridge adds an authentication and authorization layer on top of rservices. | ||
- | |||
- | This API retrieves data from the archive, hence expects PIDs (and not bridge internal IDs, as it is the case for the depositions API). | ||
- | |||
- | In version 1.0.x, bridge is limited to synchronous requests, meaning that the required object is prepared and returned at once. In other words, it is not yet possible to ask for the generation of a DIP and to come back later to download it. | ||
- | |||
- | == access routes overview == | ||
- | |||
- | < | ||
- | GET / | ||
- | GET / | ||
- | GET / | ||
- | GET / | ||
- | </ | ||
- | |||
- | == access routes detailed == | ||
- | ^ Action | ||
- | | **dip** | ||
- | | **original** | ||
- | | **preview / file migration** | ||
- | | **metadata** | ||
- | |||
- | |||
- | |||
- | ==== 3 - changes API ==== | ||
- | |||
- | Changes are similar to depositions, | ||
- | |||
- | === changes statuses === | ||
- | * // | ||
- | * //queued//: the change has been attributed to a queue in feeder | ||
- | * // | ||
- | * //archived: the change was successfully processed, meaning the object in the repository was updated (depending on the repository setting this may create a new version of the object or replace it) | ||
- | * //purged//: the object was successfully purged from the repository | ||
- | * //error//: something went wrong, see the “message” field itself located in " | ||
- | * // | ||
- | |||
- | {{ : | ||
- | |||
- | === changes responses === | ||
- | |||
- | The changes JSON responses are similar to the deposition responses, but have two additional fields: | ||
- | * “pid” that relates to the repository targeted id in the archive | ||
- | * “task” that describes the action performed (update, purge) | ||
- | |||
- | Practically, | ||
- | |||
- | < | ||
- | { " | ||
- | { " | ||
- | " | ||
- | " | ||
- | [ | ||
- | { " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | ] | ||
- | " | ||
- | { " | ||
- | " | ||
- | " | ||
- | } | ||
- | </ | ||
- | |||
- | === changes routes === | ||
- | |||
- | == changes routes overview == | ||
- | |||
- | < | ||
- | POST / | ||
- | GET / | ||
- | GET / | ||
- | PUT / | ||
- | </ | ||
- | |||
- | == changes routes detailed == | ||
- | ^ Action | ||
- | | **create** | ||
- | ? | ||
- | | **list** / **show** | **HTTP GET** on /changes,\\ **parameters: | ||
- | ? | ||
- | ? | ||
- | | **retrieve binary data** | **HTTP GET** on / | ||
- | ? | ||
- | | **update** | ||
- | ? | ||
- | ? | ||
- | |||
docuteam/bridge.1568374203.txt.gz · Zuletzt geändert: 2019/09/13 13:30 von jan