Invalid Key API error for multiple keys

skyredwang - October 3, 2009 - 04:12
Project:Services
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:minor
Assigned:Unassigned
Status:active
Description

It seems that if there are many keys, clients get "Invalid Key API" error for all the keys except the first created one.

To reproduce this error,
Fresh install latest Drupal+Service.6.x-2.x
Create 2 keys with the same configuration.
test node.get() with the first key=> works
test node.get() with the second key=>Invalid Key API

#1

marcingy - October 3, 2009 - 04:15

Is this using the browser?

#2

skyredwang - October 3, 2009 - 04:17

"test" means testing in a remote client.

#3

marcingy - October 3, 2009 - 04:25

what are the parameters you are passing into each call? Because that error is only thrown when the hash is invalid.

#4

marcingy - October 3, 2009 - 04:28

I see one case when this could happen, does same configuration equal the same domain?

#5

skyredwang - October 3, 2009 - 12:59

RE:#3
In the simple testing case above,
hash, api_key_1, domain_name, domain_time_stamp, nonce, sessid, node.get(), nid are passed ===> then it works.
hash, api_key_2, domain_name, domain_time_stamp, nonce, sessid, node.get(), nid are passed ===> Invalid Key API

RE:#4
Yes. if the two keys have the same domain, then the error occurs. If different domains, then no error.

#6

marcingy - October 3, 2009 - 16:07
Priority:critical» minor

The isuse is that we should validate to see if the domain already exists in the table on the key creation screen. If it does we need to throw an error. The intent is that only one key is supported per domain.

#7

skyredwang - October 5, 2009 - 02:53

#6

The intent is that only one key is supported per domain.

I have one use case: Android and iPhone applications for the same domain. Using two keys allows different permission configurations and can turn off one application at a time. This could be done with two domains, but I feel one domain is better.

What do you think?

#8

marcingy - October 5, 2009 - 02:55

A single key per domain is the how the solution is designed this won't be changed - in a sense domain is the wrong name for the field in reality it is a unique identifier to allow the key to be retrieved.

 
 

Drupal is a registered trademark of Dries Buytaert.