You are here

function shib_auth_schema in Shibboleth Authentication 6.4

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

Implementation of hook_schema().

This is how the schema of the module will look like

1 call to shib_auth_schema()
shib_auth_update_6400 in ./shib_auth.install
Implementation of hook_update().

File

./shib_auth.install, line 197
This is the install file of the Shibboleth authentication module for Drupal system

Code

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