27 Commits

Author SHA1 Message Date
Bharat Mediratta
d45a737779 Update copyright to 2013. Fixes #1953. 2013-01-21 01:22:01 -05:00
Bharat Mediratta
bf2bb3e1ea Update copyright to 2012. #1822 2012-02-27 09:48:23 -08:00
Bharat Mediratta
423daa52d5 Update copyright to 2011. 2011-01-21 23:01:06 -08:00
Bharat Mediratta
2e52bcedcd Update the mock so that all responses return arrays, not stdClass(). 2010-07-27 10:14:52 -07:00
Bharat Mediratta
9b78867427 Simplify rest::get_access_key($user) to rest::access_key() that
returns just the access key string for the active user.  That's how we
use the API, so keep it simple.
2010-06-18 20:43:14 -07:00
Bharat Mediratta
af71df3d0f Update tests to reflect recent changes to the REST API. 2010-04-17 15:35:09 -07:00
Bharat Mediratta
ca977dce51 Rename "access_token" to "access_key" in the code for consistency. 2010-03-30 14:01:40 -07:00
Bharat Mediratta
59b6cd30e6 Rename "user_access_tokens" table to "user_access_keys" as step 1 of a
multi step process to refer to REST access keys as "access_key"
everywhere.  Bump the rest module to version 2.
2010-03-30 13:53:14 -07:00
Bharat Mediratta
be580c9554 Update tests to reflect the fact that you have to be logged in to do anything. 2010-03-05 21:42:39 -08:00
Bharat Mediratta
c3c2b45280 Update the copyright to 2010. It's only 3 months into the year :-) 2010-03-03 10:15:34 -08:00
Bharat Mediratta
c050acf30a Fix lots of warnings that pop up when we're in E_STRICT mode. They're
mostly issues around uninitialized variables, calling non-static
functions in a static context, calling Session functions directly
instead of on its singleton, passing non-variables by reference, and
subclasses not using the same interface as the parent class.
2010-01-31 16:07:41 -08:00
Bharat Mediratta
a609694018 Update tests for recent REST changes. 2010-01-23 12:13:14 -08:00
Bharat Mediratta
5f83da41e4 Rewrite the tests to be simpler and more direct. 2010-01-20 00:08:13 -08:00
Bharat Mediratta
b09450cf5d Let the Rest_Controller functions throw a Rest_Exception since
the Kohana framework will handle it properly.
2010-01-19 23:30:22 -08:00
Bharat Mediratta
76da85a1a0 Extend Gallery_Unit_Test_Case instead of Unit_Test_Case. 2010-01-19 22:38:19 -08:00
Bharat Mediratta
0e3327bca7 Simplify the REST API code. Here's what I did:
1) Simplify gallery_rest to return flat models, no children and do no
   validation for now.
2) Flatten the REST replies and use HTTP codes to indicate
   success/failure instead of additional status messages.
3) Use the message and error code support in the base Exception class,
   instead of brewing our own in Rest_Exception.
4) Get rid of rest::success() and rest::fail() -- we only need
   rest::reply() since all failures are covered by throwing an
   exception.
5) Get rid of /rest/access_key and just use /rest for authentication.
6) Inline and simplify rest::normalize_request since we only use it once
7) Change rest::set_active_user to succeed or throw an exception
8) Extract Rest_Exception::sendHeaders into rest::send_headers()

Here's what's currently broken:
1) Data validation.  There currently is none
2) Logging.  That's gone too
3) image block and tag code is broken
4) Tests are broken
5) No movie support
2010-01-03 20:30:35 -08:00
Tim Almdal
28597ba533 Correct file structure tests, Have the tests delete the userid they create so as not to impact other tests. 2010-01-02 14:31:59 -08:00
Tim Almdal
af10f0abcf Only create the user or the target photo in the tests that require it. 2009-12-31 12:24:46 -08:00
Tim Almdal
1a12a5e3c8 Create a Rest_Exception class and use it to convey status to the client instead of calling rest::forbidden and other rest helper error messages. 2009-12-31 11:51:51 -08:00
Tim Almdal
bccb6fc021 Clean up validation the check for duplicate names or slugs, finish converting the rest API to Kohana 2.4 2009-12-27 08:32:12 -08:00
Tim Almdal
d0dd6650be When normalizing the rest request don't assume that the additional arguments are acutall a path. Leave it up to the handler to determine. 2009-12-23 13:13:03 -08:00
Tim Almdal
d622d1aa4f Updated the unit tests to match the current API
Corrected a problem identified with the unit tests... failed if the path was empty on PUT.
2009-12-23 09:32:32 -08:00
Tim Almdal
367f2218f6 Use the relative url cache to look up resources instead of the relative path. This allows us to forego the extension as part of the REST url. As well, urls are consistent between normal usage and rest usage. 2009-12-09 08:41:38 -08:00
Tim Almdal
3c30d595ae Add the REST get handler for albums/photos/movies 2009-12-08 23:28:50 -08:00
Tim Almdal
837396ca28 Change the url mapping so that path to the is part of the url
The request key is put in the X-Gallery-Request-Key header
The HTTP method can be override by using the X-Gallery-Request-Method header
Normalize the request data so that it doesn't matter where it comes from (HTTP get or HTTP post request)
2009-12-08 18:06:16 -08:00
Tim Almdal
fa0663d7df Rename the backing table from rest_keys to user_access_tokens
Implement an api to format the errors and success messages
Removed the custom routing... urls are now /rest/<module_name>/<resource>
2009-12-08 09:19:48 -08:00
Tim Almdal
71be6cf239 The rest framework that the new gallery3 remote interface will be built on. At the moment, there are no handlers to perform any functionality. 2009-12-07 18:11:26 -08:00