You are here

function services_update_6300 in Services 6.3

Update 6300 adds the concept of endpoints which is a way to expose a specific server using a specific authentication method, with the full set or a subset of the installed services.

This is a major change from the way services worked before: then all installed servers exposed all installed services and only one authentication method could be used for all servers. The endpoint was also non-configurable and was always 'services/[server path]'.

As with most major changes, this is a _breaking_ update, in the sense that you will need to reconfigure services. If you have clients that expect the endpoint to remain the same you can easily set up a endpoint that exposes your server/authentication method/services set on the old 'services/[server path]' path.

File

./services.install, line 235
Install, uninstall and update the Services module.

Code

function services_update_6300() {
  $ret = array();
  db_create_table($ret, 'services_endpoint', array(
    'description' => 'Stores endpoint information for services',
    'export' => array(
      'identifier' => 'endpoint',
      'export callback' => 'services_endpoint_export',
      'list callback' => 'services_endpoint_list',
    ),
    'fields' => array(
      'eid' => array(
        'type' => 'serial',
        'description' => 'Primary ID field for the table. Not used for anything except internal lookups.',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'no export' => TRUE,
      ),
      'name' => array(
        'description' => 'The name of the endpoint.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'title' => array(
        'description' => 'The title of the endpoint.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'server' => array(
        'description' => 'The name of the server used in this endpoint.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
      ),
      'path' => array(
        'description' => 'The path to the endpoint for this server.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'authentication' => array(
        'description' => 'The authentication modules used in this endpoint.',
        'type' => 'text',
        'size' => 'big',
        'not null' => TRUE,
        'serialize' => TRUE,
        'object default' => array(),
      ),
      'resources' => array(
        'description' => 'Information about the resources exposed in this endpoint.',
        'type' => 'text',
        'size' => 'big',
        'not null' => TRUE,
        'serialize' => TRUE,
        'object default' => array(),
      ),
    ),
    'primary key' => array(
      'eid',
    ),
    'unique keys' => array(
      'name' => array(
        'name',
      ),
    ),
  ));

  // Remove the auth_module variable as this won't be handled on a global basis anymore
  variable_del('services_auth_module');
  return $ret;
}