You are here

function shib_auth_schema in Shibboleth Authentication 7.4

Same name and namespace in other branches
  1. 8 shib_auth.install \shib_auth_schema()
  2. 6.4 shib_auth.install \shib_auth_schema()
  3. 6.3 shib_auth.install \shib_auth_schema()

Implements hook_schema().

This is how the schema of the module will look like.

File

./shib_auth.install, line 53
Install file of the Shibboleth authentication module for Drupal system.

Code

function shib_auth_schema() {
  $schema = array();
  $schema['shib_authmap'] = array(
    'description' => 'Stores shibboleth authentication mapping from persistent IDs to drupal users.',
    'fields' => array(
      'id' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => 'The id of the authentication mapping rule',
      ),
      'uid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The {users}.uid, which the persistent ID will be mapped to',
      ),
      'targeted_id' => array(
        'type' => 'varchar',
        'length' => 255,
        'default' => '',
        'not null' => TRUE,
        'description' => 'The persistent ID, which will be mapped to a drupal uid',
      ),
      'idp' => array(
        'type' => 'varchar',
        'length' => 255,
        'default' => '',
        'description' => 'The IdP, the user got her credentials',
      ),
      'consentver' => array(
        'type' => 'varchar',
        'length' => 16,
        'default' => '',
        'description' => 'The version of terms and conditions, which was accepted by the user',
      ),
      'created' => array(
        'type' => 'int',
        'default' => 0,
        'not null' => TRUE,
        'description' => 'Timestamp the mapping was created',
      ),
    ),
    'primary key' => array(
      'id',
    ),
    'unique keys' => array(
      'targeted_id' => array(
        'targeted_id',
      ),
    ),
  );
  $schema['shib_auth'] = array(
    'description' => 'Stores shibboleth authentication rules',
    'fields' => array(
      'id' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => 'The id of the Shibboleth role assignment rule',
      ),
      'field' => array(
        'type' => 'varchar',
        'length' => 128,
        'default' => '',
        'description' => 'The observed server variable.',
      ),
      'regexpression' => array(
        'type' => 'varchar',
        'length' => 128,
        'default' => '',
        'description' => 'The joint regular expression.',
      ),
      'role' => array(
        'type' => 'varchar',
        'length' => 128,
        'default' => '',
        'description' => 'The assigned role.',
      ),
      'sticky' => array(
        'type' => 'int',
        'default' => 0,
        'description' => 'Sticky status',
      ),
    ),
    'primary key' => array(
      'id',
    ),
  );
  return $schema;
}