Browse Source

No longer forcing REST config, README updates (#79)

* Readme update, removing config cruft

* Added screenshot
pull/756/head
dannylamb 7 years ago committed by Jared Whiklo
parent
commit
ff66f63915
  1. 16
      README.md
  2. 26
      islandora.module

16
README.md

@ -10,8 +10,20 @@ CLAW's core Islandora module for Drupal 8.x
## Installation ## Installation
For a fully automated install, see [claw-playbook](https://github.com/Islandora-Devops/claw-playbook). If you're installing For a fully automated install, see [claw-playbook](https://github.com/Islandora-Devops/claw-playbook). If you're installing
manually, the REST configuration for both Nodes and Media need to be enabled with `jwt_auth` for authentication and both manually, then _at a minimum_, the REST configuration for Nodes, Media, and Files need to be enabled with `jwt_auth` for
`json` and `jsonld` formats. authentication on all methods. The `json` and `jsonld` formats need to be enabled for for GET requests. Only the `json` fomat
is required for POST, PATCH, and DELETE requests.
This can be done using the Rest UI module by setting granularity to 'Method'. If you want to use GET requests through a browser,
you'll want to enable `cookie` authentication. And if you want to use a username/password with cURL, you'll want to enable `basic
authentication`.
![screenshot from 2018-03-09 10-09-57](https://user-images.githubusercontent.com/20773151/37212586-caf31dc8-2385-11e8-8122-1608dacbfb5f.png)
If you want to import the configuration through Drupal's configuration synchronization tools, you can use these yaml files
from claw-playbook for [Nodes](https://github.com/Islandora-Devops/claw-playbook/blob/master/roles/internal/webserver-app/files/rest.resource.entity.node.yml),
[Media](https://github.com/Islandora-Devops/claw-playbook/blob/master/roles/internal/webserver-app/files/rest.resource.entity.media.yml),
and [Files](https://github.com/Islandora-Devops/claw-playbook/blob/master/roles/internal/webserver-app/files/rest.resource.entity.file.yml).
## REST API ## REST API

26
islandora.module

@ -36,32 +36,6 @@ function islandora_help($route_name, RouteMatchInterface $route_match) {
} }
} }
/**
* Implements hook_modules_installed().
*/
function islandora_modules_installed($modules) {
// Ensure the auth and serialization formats we need are available.
if (in_array('rest', $modules)) {
$rest_resource_config_storage = \Drupal::service('entity_type.manager')->getStorage('rest_resource_config');
$rest_resource_config = $rest_resource_config_storage->load('entity.node');
if ($rest_resource_config) {
$configuration = $rest_resource_config->get('configuration');
if (!in_array('jsonld', $configuration['formats'])) {
$configuration['formats'][] = 'jsonld';
}
if (!in_array('jwt_auth', $configuration['authentication'])) {
$configuration['authentication'][] = 'jwt_auth';
}
$rest_resource_config->set('configuration', $configuration);
$rest_resource_config->save(TRUE);
}
}
}
/** /**
* Implements hook_rdf_namespaces(). * Implements hook_rdf_namespaces().
*/ */

Loading…
Cancel
Save