Skip to content

Commit

Permalink
Merge pull request #104 from RockefellerArchiveCenter/development
Browse files Browse the repository at this point in the history
Version 0.4
  • Loading branch information
helrond authored Jan 20, 2021
2 parents 0066f36 + c7ca9ee commit ff30db4
Show file tree
Hide file tree
Showing 22 changed files with 185 additions and 120 deletions.
12 changes: 0 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,6 @@ Or, if you want to remove all data
|POST|/api/process-request/email| |200|Processes data in preparation for sending an email|
|POST|/api/download-csv/| |200|Downloads a CSV file of items|

### Authorization

This application uses the [Django REST Framework API Key](https://florimondmanca.github.io/djangorestframework-api-key/) library to limit which external applications are able to use its endpoints. All requests must include a `X-Request-Broker-Key` header key with the value of a valid API Key.

API Keys can be be generated in the Django shell:
```
>>> from rest_framework_api_key.models import APIKey
>>> api_key, key = APIKey.objects.create_key(name="remote-service")
```

For further details on usage, look at Request Broker's tests or [Django REST Framework API Key documentation](https://florimondmanca.github.io/djangorestframework-api-key/).

## Requirements

Using this repo requires having [Docker](https://store.docker.com/search?type=edition&offering=community) installed.
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '2.4'

services:
request-broker-web:
image: rockarch/request_broker:0.3
image: rockarch/request_broker:0.4
command: apachectl -D FOREGROUND
ports:
- "8001:8000"
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ services:
- DEBUG=1
- SECRET_KEY=obop2gifqn6wncaha^dt!w3an-%vkj_&1a@(w-2ci0))^o%#f4
- DJANGO_ALLOWED_HOSTS=request-broker-web localhost 192.168.1.5
- CORS_ALLOWED_ORIGINS=http://localhost:3000 http://rac-vch.ad.rockarchive.org:3001
- SQL_ENGINE=django.db.backends.postgresql
- SQL_DATABASE=postgres
- SQL_USER=postgres
Expand Down
3 changes: 2 additions & 1 deletion fixtures/as_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
"preferred_instance": {
"barcode": "A0000000037985",
"container": "Reel C-1138",
"subcontainer": "",
"format": "microfilm",
"location": "Rockefeller Archive Center, Blue Level, Vault 106 [Cabinet: 11a, Drawer: 2]",
"location": "106.11a.2",
"uri": "/top_containers/3314"
},
"size": "1 microfilm reel",
Expand Down
18 changes: 3 additions & 15 deletions fixtures/digital_object_instance.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,21 @@
{
"lock_version": 0,
"created_by": "admin",
"last_modified_by": "admin",
"create_time": "2020-07-28T14:16:54Z",
"system_mtime": "2020-07-28T14:16:54Z",
"user_mtime": "2020-07-28T14:16:54Z",
"instance_type": "digital_object",
"jsonmodel_type": "instance",
"is_representative": false,
"digital_object": {
"ref": "/repositories/2/digital_objects/3367",
"_resolved": {
"digital_object_id": "238475",
"title": "digital object",
"file_versions": [
{
"lock_version": 0,
"file_uri": "http://google.com",
"publish": true,
"created_by": "admin",
"last_modified_by": "admin",
"create_time": "2020-07-28T19:44:16Z",
"system_mtime": "2020-07-28T19:44:16Z",
"user_mtime": "2020-07-28T19:44:16Z",
"jsonmodel_type": "file_version",
"is_representative": false,
"identifier": "8475"
}
]
],
"uri": "/repositories/2/digital_objects/3367"
}
}
}
}
5 changes: 4 additions & 1 deletion fixtures/instances_multiple.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
"container_locations": [
{
"_resolved": {
"title": "Rockefeller Archive Center, Blue Level, Vault 106 [Unit: 66, Shelf: 7]"
"title": "Rockefeller Archive Center, Blue Level, Vault 106 [Unit: 66, Shelf: 7]",
"room": "Vault 106",
"coordinate_1_indicator": "66",
"coordinate_2_indicator": "7"
}
}
]
Expand Down
5 changes: 4 additions & 1 deletion fixtures/instances_plural.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
"container_locations": [
{
"_resolved": {
"title": "Rockefeller Archive Center, Blue Level, Vault 106 [Unit: 66, Shelf: 7]"
"title": "Rockefeller Archive Center, Blue Level, Vault 106 [Unit: 66, Shelf: 7]",
"room": "Vault 106",
"coordinate_1_indicator": "66",
"coordinate_2_indicator": "7"
}
}
]
Expand Down
5 changes: 4 additions & 1 deletion fixtures/instances_singular.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
"container_locations": [
{
"_resolved": {
"title": "Rockefeller Archive Center, Blue Level, Vault 106 [Unit: 66, Shelf: 7]"
"title": "Rockefeller Archive Center, Blue Level, Vault 106 [Unit: 66, Shelf: 7]",
"room": "Vault 106",
"coordinate_1_indicator": "66",
"coordinate_2_indicator": "7"
}
}
]
Expand Down
5 changes: 4 additions & 1 deletion fixtures/locations.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
"container_locations": [
{
"_resolved": {
"title": "Rockefeller Archive Center, Blue Level, Vault 106 [Unit: 66, Shelf: 7]"
"title": "Rockefeller Archive Center, Blue Level, Vault 106 [Unit: 66, Shelf: 7]",
"room": "Vault 106",
"coordinate_1_indicator": "66",
"coordinate_2_indicator": "7"
}
}
]
Expand Down
23 changes: 8 additions & 15 deletions fixtures/mixed_materials_instance.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,27 @@
{
"lock_version": 0,
"created_by": "admin",
"last_modified_by": "admin",
"create_time": "2020-07-28T14:16:54Z",
"system_mtime": "2020-07-28T14:16:54Z",
"user_mtime": "2020-07-28T14:16:54Z",
"instance_type": "mixed materials",
"jsonmodel_type": "instance",
"is_representative": false,
"sub_container": {
"lock_version": 0,
"created_by": "admin",
"last_modified_by": "admin",
"create_time": "2020-07-28T14:16:54Z",
"system_mtime": "2020-07-28T14:16:54Z",
"user_mtime": "2020-07-28T14:16:54Z",
"type_2": "folder",
"indicator_2": "12",
"jsonmodel_type": "sub_container",
"top_container": {
"ref": "/repositories/2/top_containers/191161",
"_resolved": {
"type": "box",
"indicator": "2",
"barcode": "A12345",
"container_locations": [
{
"_resolved": {
"title": "Rockefeller Archive Center, Blue Level, Vault 106 [Unit: 66, Shelf: 7]"
"title": "Rockefeller Archive Center, Blue Level, Vault 106 [Unit: 66, Shelf: 7]",
"room": "Vault 106",
"coordinate_1_indicator": "66",
"coordinate_2_indicator": "7"
}
}
]
],
"uri": "/repositories/2/top_containers/191161"
}
}
}
Expand Down
17 changes: 10 additions & 7 deletions fixtures/object_digital.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"jsonmodel_type": "instance",
"is_representative": false,
"digital_object": {
"ref": "/repositories/2/digital_objects/3367",
"_resolved": {
"digital_object_id": "238475",
"title": "digital object",
Expand All @@ -54,7 +53,8 @@
"is_representative": false,
"identifier": "8475"
}
]
],
"uri": "/repositories/2/digital_objects/3367"
}
}
},
Expand All @@ -69,7 +69,6 @@
"jsonmodel_type": "instance",
"is_representative": false,
"digital_object": {
"ref": "/repositories/2/digital_objects/3368",
"_resolved": {
"digital_object_id": "238476",
"title": "digital object 2",
Expand All @@ -87,7 +86,8 @@
"is_representative": false,
"identifier": "8475"
}
]
],
"uri": "/repositories/2/digital_objects/3368"
}
}
},
Expand All @@ -110,18 +110,21 @@
"user_mtime": "2020-07-28T14:16:54Z",
"jsonmodel_type": "sub_container",
"top_container": {
"ref": "/repositories/2/top_containers/191161",
"_resolved": {
"type": "box",
"indicator": "2",
"barcode": "A12345",
"container_locations": [
{
"_resolved": {
"title": "Rockefeller Archive Center, Blue Level, Vault 106 [Unit: 66, Shelf: 7]"
"title": "Rockefeller Archive Center, Blue Level, Vault 106 [Unit: 66, Shelf: 7]",
"room": "Vault 106",
"coordinate_1_indicator": "66",
"coordinate_2_indicator": "7"
}
}
]
],
"uri": "/repositories/2/top_containers/191161"
}
}
}
Expand Down
18 changes: 12 additions & 6 deletions fixtures/object_microform.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"sub_container": {
"jsonmodel_type": "sub_container",
"top_container": {
"ref": "/repositories/2/top_containers/191157",
"_resolved": {
"barcode": "A12345",
"indicator": "1",
Expand All @@ -25,10 +24,14 @@
"container_locations": [
{
"_resolved": {
"title": "Rockefeller Archive Center, Blue Level, Vault 106 [Unit: 66, Shelf: 7]"
"title": "Rockefeller Archive Center, Blue Level, Vault 106 [Unit: 66, Shelf: 7]",
"room": "Vault 106",
"coordinate_1_indicator": "66",
"coordinate_2_indicator": "7"
}
}
]
],
"uri": "/repositories/2/top_containers/191157"
}
}
}
Expand All @@ -38,7 +41,6 @@
"sub_container": {
"jsonmodel_type": "sub_container",
"top_container": {
"ref": "/repositories/2/top_containers/191158",
"_resolved": {
"barcode": "A123456",
"indicator": "2",
Expand All @@ -48,10 +50,14 @@
"container_locations": [
{
"_resolved": {
"title": "Rockefeller Archive Center, Blue Level, Vault 106 [Unit: 66, Shelf: 8]"
"title": "Rockefeller Archive Center, Blue Level, Vault 106 [Unit: 66, Shelf: 8]",
"room": "Vault 106",
"coordinate_1_indicator": "66",
"coordinate_2_indicator": "8"
}
}
]
],
"uri": "/repositories/2/top_containers/191158"
}
}
}
Expand Down
27 changes: 16 additions & 11 deletions fixtures/object_mixed.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,16 @@
"ref_id": "421d180c96c333c196091b797617208c",
"title": "test1",
"display_string": "test1",
"created_by": "k.martin",
"last_modified_by": "admin",
"create_time": "2019-12-12T15:52:52Z",
"system_mtime": "2020-04-14T15:36:25Z",
"user_mtime": "2020-04-14T15:36:25Z",
"level": "subseries",
"jsonmodel_type": "archival_object",
"instances": [
{
"instance_type": "mixed materials",
"sub_container": {
"jsonmodel_type": "sub_container",
"type_2": "folder",
"indicator_2": "22",
"top_container": {
"ref": "/repositories/2/top_containers/191157",
"_resolved": {
"barcode": "A12345",
"indicator": "1",
Expand All @@ -25,10 +21,14 @@
"container_locations": [
{
"_resolved": {
"title": "Rockefeller Archive Center, Blue Level, Vault 106 [Unit: 66, Shelf: 7]"
"title": "Rockefeller Archive Center, Blue Level, Vault 106 [Unit: 66, Shelf: 7]",
"room": "Vault 106",
"coordinate_1_indicator": "66",
"coordinate_2_indicator": "7"
}
}
]
],
"uri": "/repositories/2/top_containers/191157"
}
}
}
Expand All @@ -37,8 +37,9 @@
"instance_type": "mixed materials",
"sub_container": {
"jsonmodel_type": "sub_container",
"type_2": "folder",
"indicator_2": "11-22",
"top_container": {
"ref": "/repositories/2/top_containers/191158",
"_resolved": {
"barcode": "A123456",
"indicator": "2",
Expand All @@ -48,10 +49,14 @@
"container_locations": [
{
"_resolved": {
"title": "Rockefeller Archive Center, Blue Level, Vault 106 [Unit: 66, Shelf: 8]"
"title": "Rockefeller Archive Center, Blue Level, Vault 106 [Unit: 66, Shelf: 8]",
"room": "Vault 106",
"coordinate_1_indicator": "66",
"coordinate_2_indicator": "8"
}
}
]
],
"uri": "/repositories/2/top_containers/191158"
}
}
}
Expand Down
13 changes: 13 additions & 0 deletions fixtures/object_restricted_note_long_open.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"notes": [{
"jsonmodel_type": "note_multipart",
"persistent_id": "0322d44b863ca218398f207f55a074cc",
"type": "accessrestrict",
"subnotes": [{
"jsonmodel_type": "note_text",
"content": "Open for research. Brittle or damaged items are available at the discretion of RAC. Researchers interested in accessing digital media (floppy disks, CDs, DVDs, etc.) or audiovisual material (audio cassettes, VHS, etc.) in this collection must use an access surrogate. The original items may not be accessed because of preservation concerns. To request an access surrogate be made, or if you are unsure if there is an access surrogate, please contact an archivist.",
"publish": true
}],
"publish": true
}]
}
13 changes: 13 additions & 0 deletions fixtures/object_restricted_note_longer_open.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"notes": [{
"jsonmodel_type": "note_multipart",
"persistent_id": "0322d44b863ca218398f207f55a074cc",
"type": "accessrestrict",
"subnotes": [{
"jsonmodel_type": "note_text",
"content": "Records more than 20 years old are open for research with select materials restricted as noted. Brittle or damaged items are available at the discretion of RAC. Researchers interested in accessing digital media (floppy disks, CDs, DVDs, etc.) or audiovisual material (audio cassettes, VHS, etc.) in this collection must use an access surrogate. The original items may not be accessed because of preservation concerns. To request an access surrogate be made, or if you are unsure if there is an access surrogate, please contact an archivist.\nThe General Correspondence 1952-1990 has been reformatted to microfilm. User copies are available for research.",
"publish": true
}],
"publish": true
}]
}
13 changes: 13 additions & 0 deletions fixtures/object_restricted_note_scholarly_open.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"notes": [{
"jsonmodel_type": "note_multipart",
"persistent_id": "0322d44b863ca218398f207f55a074cc",
"type": "accessrestrict",
"subnotes": [{
"jsonmodel_type": "note_text",
"content": "Open for scholarly research. Brittle or damaged items are available at the discretion of RAC.",
"publish": true
}],
"publish": true
}]
}
Loading

0 comments on commit ff30db4

Please sign in to comment.