t('Consumer keys for users that can consume services.'), 'fields' => array( 'uid' => array( 'description' => t('User ID from {user}.uid.'), 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE ), 'consumer_key' => array( 'description' => t('Consumer key allow the user to contact the services API as an external application.'), 'type' => 'varchar', 'length' => 32, 'not null' => TRUE ), 'consumer_secret' => array( 'description' => t('Consumer key "password".'), 'type' => 'varchar', 'length' => 32, 'not null' => TRUE ), ), 'primary key' => array('uid'), 'unique keys' => array( 'consumer_key' => array('consumer_key') ), ); $schema['oauth_token'] = array( 'description' => t('Tokens for request and services accesses.'), 'fields' => array( 'token_key' => array( 'description' => t('Tokens for request and services accesses.'), 'type' => 'varchar', 'length' => 32, 'not null' => TRUE ), 'token_secret' => array( 'description' => t('Token "password".'), 'type' => 'varchar', 'length' => 32, 'not null' => TRUE ), 'type' => array( 'description' => t('Type of the token: request or access.'), 'type' => 'varchar', 'length' => 7, 'not null' => TRUE ), 'uid' => array( 'description' => t('User ID from {user}.uid.'), 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE ), 'consumer_key' => array( 'description' => t('Consumer key from {oauth_consumer}.consumer_key.'), 'type' => 'varchar', 'length' => 32, 'not null' => TRUE ), 'webservices' => array( 'description' => t('An array of services that the use allowed the consumer to do.'), 'type' => 'text', ), 'authorized' => array( 'description' => t('In case its a request token, it checks if the user already authorized him to get an access token.'), 'type' => 'int', 'size' => 'tiny', 'default' => 0 ), ), 'primary key' => array('token_key'), 'indexes' => array( 'token_key_type' => array('token_key', 'type'), ), ); $schema['oauth_nonce'] = array( 'description' => t('Stores timestamp against nonce for repeat attacks.'), 'fields' => array( 'nonce' => array( 'description' => t('The random 32 characters long string used on each request.'), 'type' => 'varchar', 'length' => 32, 'not null' => TRUE ), 'timestamp' => array( 'description' => t('The timestamp of the request.'), 'type' => 'int', 'not null' => TRUE ), 'token' => array( 'description' => t('Tokens for request and services accesses.'), 'type' => 'varchar', 'length' => 32 ), ), 'primary key' => array('nonce'), 'indexes' => array( 'timestamp' => array('timestamp'), ), ); return $schema; } /** * Implementation of hook_uninstall(). */ function oauth_uninstall() { drupal_uninstall_schema('oauth'); variable_del('oauth_crypt'); }