Download & Extend

Services CVS Access for Sumit K? - patch for services to work with OAuth

Project:Services
Version:6.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:sumitk
Status:closed (fixed)

Issue Summary

Sumit Kataria is a Google of Code student working on implementing a OAuth Server for the Services module. For some information about what he's working on and how OAuth works, visit OAuth General Information.

He has done a fantastic job so far in integrating OAuth into Drupal and needs to make some small modifications to Services core. He will create patches and upload them here, if you think they are good, feel free to give him commit access.

Comments

#1

Assigned to:Anonymous» sumitk

patch coming very soon for services to work with OAuth -
OAuth module is to work with Services only, you can checkout a copy from CVS to make a test

#2

Hi all

OAuth and Services (to work with OAuth) are now ready for a release

I am attaching a tar containing both modules here

AttachmentSizeStatusTest resultOperations
services+oauth_08_08_08.tar_.gz40.76 KBIgnored: Check issue status.NoneNone

#3

Status:active» needs work

Mind sticking it in a patch?

#4

Title:Services CVS Access for Sumit K?» Services CVS Access for Sumit K? - patch for services to work with OAuth

Hi
here is patch for services to work with OAuth module
Please download latest oauth module from cvs to work with - a video coming soon showing how to use this module in detail
Basic details of OAuth module is on http://sumitk.net and soc-2008 project wiki page

AttachmentSizeStatusTest resultOperations
services.patch8.88 KBIgnored: Check issue status.NoneNone

#5

Component:Miscellaneous» Code
Priority:normal» critical
Status:needs work» needs review

HI guys
summer of code is ending we need to review this patch for services - to work with OAuth system and oauth module in drupal

#6

Status:needs review» needs work

Hi Sumit

I have just done a quick review of your patch.

By my understanding the idea is that a service uses the existing API keys or the Oauth keys. As a result selecting to use Oauth should be implemented as a radio button, with the other option being the key api, rather than a checkbox.

What version of code was this patch generated against? It looks as if the patch was done on code retrieved from 6 head but then the patch itself was generated against the current release version of services.

The functions check_nonce and lookup_nonce code be tidied up. They could indeed be combined into one function e.g

function check_nonce($nonce, $timestamp) {/*{{{*/
    // verify that the nonce is uniqueish
    $found = lookup_nonce($nonce, $timestamp);
    if (db_result(db_query("SELECT count(*) FROM {oauth_nonce} WHERE nonce_timestamp='%s'", $timestamp))) {
      return FALSE;
    }
    else{
      db_query("INSERT INTO {oauth_nonce} (nonce, nonce_timestamp) VALUES ('%s', %d)", $nonce, $timestamp);
      return TRUE;
    }
}

Also shouldn't nonce be included in DB query as there could be muiltiple timestamps the same?

Your code also has tabs within in it when it should be spaces and there are some other style errors in the code. Using the coder module will help you quickly correct style errors.

Otherwise looks good

Marc

#7

Status:needs work» closed (duplicate)

Guys,

i will mantain the OAuth discussion on http://drupal.org/node/238814, right?

regards,

massa

#8

Status:closed (duplicate)» active

nice #238814 is right place for it now

#9

Priority:critical» normal

#10

Status:active» closed (fixed)

As seperate ticket exists

nobody click here