This project is not covered by Drupal’s security advisory policy.

The aim of this module is to provide a bridge so that users can more easily put together API connections when wiring together decoupled applications. The solution, in Drupal-speak, is to use some different plugin types.

Defines a connection type plugin - e.g. a Drupal JSON API connection or any external connection. Any API, in reality, could be used. Connection plugins wrap Guzzle and when defining them, one can extend or override the request and response methods to add whatever is necessary for processing and returning the data recieved.

Also defines a connection_bridge yaml plugin, where a developer can sanely define things like the url and endpoint as well as the connection type that these connections use. This is done by creating a my_module.connections.yml file in the project root of my_module. This is similar to how custom menu links are defined in core. An example might look like this:

articles:
  label: 'Articles JSON API Demo'
  base_url: 'https://my.local.site.dd:8083'
  endpoint: '/jsonapi/node/article'
custom_data:
  label: 'External Data'
  base_url: 'https://other.external-site.com'
  endpoint: '/data/collection'
  type: external_example

Above we see the usage of the 'Drupal' connection type is set by default for the "Articles.." connection. However, a custom connection plugin called external_example is used for the "External Data".

This module caters to two different developer personas.

a) The connection user - this is the typical use case. They already know what kind of connection types they want to use. They define these connections using the YML file in their module.

b) The connection owner - a slightly more advanced use case. These people are extending the connection type plugin for their own benefit. For example, if I worked at an e-commerce company, I'd want to make connecting to Drupal easier. Instead of writing my own custom code, I'd provide a connection type that worked with my system's authentication routines and expected response data. I would provide the plugin as part of my Drupal integration module. This could lower the total cost-of-ownership in maintaining such a module, but more importantly, it will ensure that I am following a best practice among 3rd party integrators. This helps greatly when working with partners (such as Acquia) and new team members that have already used Connection Plugins in the past.

Supporting organizations: 
Funded Development

Project information

  • caution Seeking new maintainer
    The current maintainers are looking for new people to take ownership.
  • Module categories: Decoupled
  • Created by saltednut on , updated
  • shield alertThis project is not covered by the security advisory policy.
    Use at your own risk! It may have publicly disclosed vulnerabilities.

Releases