summaryrefslogtreecommitdiff
path: root/modules/rest/controllers
AgeCommit message (Collapse)Author
2013-03-02#2031 - Add class_exists() before method_exists() if class existence is unknown.shadlaws
- fixed all instances of this in core code - deleted previous Zend Guard Loader workaround in MY_Kohana.php - updated Bootstrap.php to reflect deleted MY_Kohana.php
2013-02-17#2006 - Add system::mark_file_for_delete API to delete files at shutdown.shadlaws
- added system::mark_file_for_delete to be called to mark a file - added system::delete_marked_files to be called at shutdown to delete the list - amended system::temp_filename to, by default, add the temp name to the list - updated a few other places in code where this should be used
2013-01-21Update copyright to 2013. Fixes #1953.Bharat Mediratta
2012-02-27Update copyright to 2012. #1822Bharat Mediratta
2011-10-03Fix the standard and REST uploaders to use a callback function toBharat Mediratta
delete temporary files during shutdown. Fixes #1788.
2011-01-21Update copyright to 2011.Bharat Mediratta
2010-12-23Create a way for controllers to exempty themselves from maintenanceBharat Mediratta
mode and private gallery mode by setting the following constants in the controller to true. ALLOW_MAINTENANCE_MODE ALLOW_PRIVATE_GALLERY Fixes #1411 and the subsequent refactoring fixes #1551 as well.
2010-11-22Take into account the core.url_suffix configuration setting whenBharat Mediratta
parsing REST urls. This fixes the problem that setting the url suffix breaks REST. Fixes #1500.
2010-08-08Add a button to the user profile page to let you reset your REST APIBharat Mediratta
key. This is useful if you think it's been compromised in some way. Fixes ticket #1226.
2010-07-16POST requests create a new entity and should result in a 201 CreatedBharat Mediratta
reply with a Location field that matches the URL of the newly created resource. Fixes ticket #1178.
2010-07-16Trap 404s and return Rest_Exception instead. Fixes ticket #1213.Bharat Mediratta
2010-06-19Throw exceptions as appropriate, but allow the Kohana exceptionBharat Mediratta
handling framework to handle the exception and delegate to our template, which will JSON encode the response.
2010-06-18Simplify rest::get_access_key($user) to rest::access_key() thatBharat Mediratta
returns just the access key string for the active user. That's how we use the API, so keep it simple.
2010-06-18change single to double quotes.Bharat Mediratta
2010-06-10Tweak the error response for rest requests to make it easier for the client ↵Tim Almdal
to extract error information.
2010-06-08Don't use the standard error formatting for exceptions that have occurred as ↵Tim Almdal
part of a REST request. Format the exception as a json encoded text string so the client can extract the fault information if they so choose.
2010-04-07Merge bharat_dev rest implementationTim Almdal
2010-03-31Merge branch 'master' into talmdal_devTim Almdal
Conflicts: modules/rest/controllers/rest.php
2010-03-30Rename "access_token" to "access_key" in the code for consistency.Bharat Mediratta
2010-03-21If the access token is not set, then look in the post data.Tim Almdal
2010-03-13Merge branch 'master' into talmdal_devTim Almdal
2010-03-13Whitespace correctionTim Almdal
2010-03-13Changes to support updating the child elements within an album. In this ↵Tim Almdal
change the urls of the children are sent up asan array of post fields children[0].... children[n]. If an existing child is not included it is deleted. Including a url to an child in another album will move the child. Changing the order of the children will respect the order of the children, if the sort column is 'weight'
2010-03-03Update the copyright to 2010. It's only 3 months into the year :-)Bharat Mediratta
2010-02-24Remove redundant print statement. rest::reply() does the print so having the ↵Tim Almdal
extra print statement could lead to problems.
2010-02-07Create the concept of a "failed authentication" as semanticallyBharat Mediratta
separate from a successful or failed login. 1) Rename user_login_failed event to user_authenticate_failed 2) Rename failed_logins table to failed_auth (bump Gallery module to v27 to rename the table) 3) auth::too_many_failed_logins -> auth::too_many_failures 4) auth::record_failed_auth_attempts -> auth::record_failed_attempts auth::clear_failed_auth_attempts -> auth::clear_failed_attempts
2010-01-31Fix lots of warnings that pop up when we're in E_STRICT mode. They'reBharat Mediratta
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-30Refactory auth::too_many_failed_logins() out ofBharat Mediratta
auth::validate_too_many_failed_logins() to conceptually separate the two.
2010-01-30Protect REST login controller from brute force attacks too.Andy Staudacher
And make the REST auth token less predictable by using a better source for randomness.
2010-01-22Reshape the rest code to be more consistent with regards toBharat Mediratta
relationships. Now when you view a resource, it has 4 top level elements: url: the url of this resource resource: array of key value pairs describing the resource members: array of urls to members of this collection relationships: array of array of members. Relationships are a special type of collection that links two different resources together. To remove a relationship, just DELETE its url. To create a relationship, POST to its collection. Individual modules can add their own relationships to any resource via a callback mechanism. Example: Array( [url] => http://g3.com/rest/item/1 [resource] => Array ( [id] => 1 [album_cover_item_id] => 4 [captured] => [created] => 1264056417 [description] => [height] => ... ) [members] => Array( [0] => http://g3.com/rest/item/2 [1] => http://g3.com/rest/item/3 [2] => http://g3.com/rest/item/4 [3] => http://g3.com/rest/item/5 ... ) [relationships] => Array( [tags] => Array ( [0] => http://g3.com/rest/tag_item/2,1 [1] => http://g3.com/rest/tag_item/23,1 ) ) )
2010-01-20Move access key creation into a helper function.Bharat Mediratta
2010-01-19Let the Rest_Controller functions throw a Rest_Exception sinceBharat Mediratta
the Kohana framework will handle it properly.
2010-01-19Use $input instead of Input::instance()Bharat Mediratta
2010-01-19Have the rest calls return an array and print it out in theBharat Mediratta
controller. This is a clearer workflow; controllers generate output, not helpers. It's also easier to test.
2010-01-17Catch ORM_Validation_Exception and turn it into a 400 Bad Request withBharat Mediratta
appropriate error output.
2010-01-04Further progress on refining the REST server side code.Bharat Mediratta
1) Deal in fully qualified URL resources through the rest interface. All rest methods are now passed the complete url in request->url. 2) Create rest::resolve() which lets individual resource definition code convert a full url into the appropriate matching resource. Implement gallery_rest::resolve() and tag_rest::resolve() 3) Reimplement tag_rest's get() and post() methods. They're much simpler now. 4) Implement the tags_rest helper which supports working with the entire tags collection.
2010-01-03Simplify the REST API code. Here's what I did:Bharat Mediratta
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-02Remove the Rest_Exception::trigger method.Tim Almdal
2010-01-02Correct file structure tests, Have the tests delete the userid they create ↵Tim Almdal
so as not to impact other tests.
2009-12-31Remove extra debug statement in rest_controller::access_key() and ↵Tim Almdal
restructure the Rest_Tag_Helper_Test to only create items as required for test in each test.
2009-12-31Move the set_active_user and normalize_request methods to rest.php helperTim Almdal
2009-12-31Create a Rest_Exception class and use it to convey status to the client ↵Tim Almdal
instead of calling rest::forbidden and other rest helper error messages.
2009-12-27Clean up validation the check for duplicate names or slugs, finish ↵Tim Almdal
converting the rest API to Kohana 2.4
2009-12-23When normalizing the rest request don't assume that the additional arguments ↵Tim Almdal
are acutall a path. Leave it up to the handler to determine.
2009-12-22Update the api so it allows images to be uploaded.Tim Almdal
2009-12-21Added validation to the edit functionality, since we can't trust any inputTim Almdal
2009-12-18Change how request input is processed.First the input is no longer json ↵Tim Almdal
encode, All the get variables are loaded, then the post variables if the request is a post, and then the path is extracted from the uri.
2009-12-15Updates the the interface based on actually using it.Tim Almdal
2009-12-09Use the relative url cache to look up resources instead of the relative ↵Tim Almdal
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-08Correct the error message when the item is not found; remove the check for ↵Tim Almdal
no request_key (access_token) as athat is treated as public permissions