Commit graph

69 commits

Author SHA1 Message Date
Paul Norman
2d5df687fc Make the node controller return the modified time for deleted nodes
Fixes #384
2013-07-29 21:17:53 +01:00
Tom Hughes
071c3581e9 Disable CSRF token verification for API methods 2011-11-14 09:42:55 +00:00
Tom Hughes
986f1c61fa Use last_modified method instead of setting the header manually 2011-11-14 09:42:44 +00:00
Matt Amos
0d5be22cb5 Merging 16820:16891 from trunk. 2009-08-06 16:24:39 +00:00
Matt Amos
e93becd304 Node controller wasn't using the right name for an exception class. 2009-08-05 11:28:49 +00:00
Tom Hughes
f4571eeb7c Revert r16046.
DO NOT COMMIT MAJOR ENHANCEMENTS TO TRUNK WITHOUT TALKING TO ME FIRST.
2009-06-23 02:48:38 +00:00
Matt Amos
b8f6dbd403 Adding initial version of the OAuth token authentication method. This adds basic OAuth support for registering apps, getting and revoking keys, etc... The tokens come with 6 separate permissions bits; read/write user preferences, write diaries, write API and read/write GPS traces. Needs more tests. 2009-06-22 16:54:37 +00:00
Shaun McDonald
e3693d487a More unit tests for the parsing of the Node.from_xml. Some code clean up to ensure that a node that cannot be parsed will always throw an exception, to be handled by the arround handler. 2009-06-08 18:53:19 +00:00
Tom Hughes
2f3e23f6eb Move to version 2.3.2 of rails. 2009-06-04 08:08:24 +00:00
Tom Hughes
b38684e59e Add a global timeout that is applied to most API requests. 2009-05-20 22:18:36 +00:00
Matt Amos
3d0ca940d2 Using an around_handler for catching and rendering errors in most of the API controller methods. This simplifies the code and makes errors and error messages a bit more consistent. Also added a utility method for checking the HTTP method. 2009-05-20 17:39:59 +00:00
Tom Hughes
4eafa04ff8 Reject uploads unless the user has made their edits pubic. 2009-04-16 21:50:20 +00:00
Tom Hughes
5449cf4adc Merge 14394:14533 from trunk. 2009-04-16 21:11:12 +00:00
Tom Hughes
45dfd0f05f Fix spelling mistake. 2009-04-15 08:03:26 +00:00
Tom Hughes
09fdee5493 Add a "database readonly" state that allows all writes to the database
to be suppressed.
2009-04-14 14:27:30 +00:00
Frederik Ramm
ad9e48120a replaced "wtf does this do" comment by something explaining what it does. 2008-11-12 00:11:57 +00:00
Matt Amos
45a9d94337 Cleaned up some unreachable code. Added first test on the 'old' node controller. 2008-10-14 16:40:17 +00:00
Matt Amos
b56f57ec43 Fixed up delete methods on nodes, ways and relations to return the new version number and added some more tests. 2008-10-14 14:27:12 +00:00
Matt Amos
cf24a5a3ee Added a bunch more tests on the API 0.6. Fixed node/way/relation from_xml code to disallow duplicate tag keys. 2008-10-13 17:50:15 +00:00
Shaun McDonald
fb5f39f19a Creating consistency check for creation of nodes, way and relations. Moving some creation code from the controller to the model, and adding error handling on create errors. 2008-10-13 15:39:21 +00:00
Matt Amos
a2498928e4 Fixed node functional tests. A couple of changes to the old_node model and node controller for changesets. 2008-10-13 14:08:31 +00:00
Shaun McDonald
3d24694add moving the conistency checks for updates and deletes to library, hopefully got the updates and deletes working now. 2008-10-09 16:22:05 +00:00
Shaun McDonald
e1b205913c Fix the data config, so that the development database is not the same as the test database. Make a good stab at getting the creates and updates for relations working, adding some new error exceptions. Some code indentation cleanup. 2008-10-08 15:42:42 +00:00
Shaun McDonald
2347761266 some useful notes in code for ideas that require implementing. 2008-10-07 23:49:53 +00:00
Shaun McDonald
328d47e506 Fixing a bug in my foreign keys. I can now upload and download nodes and ways using JOSM in the new API. 2008-10-03 17:09:58 +00:00
Shaun McDonald
0ec26f14a0 adding some version reading for the nodes 2008-09-29 16:28:51 +00:00
Tom Hughes
a0545ba4e5 Render nothing on a successful delete. 2008-07-22 14:16:07 +00:00
Gabriel Ebner
7151fa05e4 api06: simplify exception handling and add exception handling to the diff
upload.
2008-05-13 12:15:06 +00:00
Gabriel Ebner
cddded9569 api06: Fix typo. 2008-05-12 21:11:51 +00:00
Gabriel Ebner
86b4d1bc2c api06: Move version-checking into the models, raising an exception on mismatch
(still not implemented for delete requests though.)
2008-05-12 21:05:11 +00:00
Christopher Schmidt
618908319c prevent update of any object without providing the correct/current
version as part of the XML. This affects update-only at this time: 
DELETE doesn't work the same way because we don't provide the data as 
part of a DELETE
2008-05-11 21:49:33 +00:00
Christopher Schmidt
7a216c0ce6 Make edits return version numbers as plain text strings 2008-05-11 19:47:19 +00:00
Gabriel Ebner
6ebb7045fe api06: Fix diff uploading (still doesn't give a useful response):
Modification and deletion works fine now.  Rollback also works apparently.
Just auto increment doesn't get reset.
2008-05-04 15:16:58 +00:00
Gabriel Ebner
3d6e1c67fb api06: Preliminary support for diff uploading. This will not return anything
useful and the code will need some heavy refactoring.
2008-05-04 13:52:43 +00:00
Gabriel Ebner
6ae23bed90 split_node_tags:
- Use InnoDB.
  - Put version column on the current_* tables.
  - Use transactions (untested).
2008-05-03 16:27:49 +00:00
Steve Coast
9328e84ba1 Some node documentation 2008-01-24 13:04:04 +00:00
Steve Coast
3e355d7dc0 emit last-modified headers on nodes and ways 2008-01-21 17:41:57 +00:00
Tom Hughes
e4df9a8219 Allow objects to be resurrected. 2007-10-31 15:52:36 +00:00
Tom Hughes
0fd29dc003 Render an empty text string instead of nothing (which actually generate a
single space character) for 410 and 412 responses as there is a bug in
lighttpd (http://trac.lighttpd.net/trac/ticket/1055) that prevents it
passing on the response body for these codes, leading to the client blocking
waiting for the data until it times out. Closes #537.
2007-10-17 23:22:51 +00:00
Gabriel Ebner
e03ea17a22 rails_port_0.5: Merge rails_port r4643 2007-09-22 19:55:33 +00:00
Tom Hughes
9c01c4cb63 Allow the API to be taken offline completely as well as being put into
readonly mode,
2007-09-20 23:51:11 +00:00
Gabriel Ebner
cfbdd3f7e1 Merge rails_port as of r4613 & fix tests. 2007-09-20 14:37:29 +00:00
Tom Hughes
0975858cdb Allow exceptions processing node and segment requests to propagate and
be handled by the default handler so they are logged.
2007-08-31 10:11:15 +00:00
Gabriel Ebner
37cfb17809 Merge commit 'git-svn' 2007-08-30 09:29:34 +00:00
Frederik Ramm
78b440ffc1 preliminary commit 0.5 API with relations / untested after entity-relation rename, some changes still in queue 2007-08-29 22:00:26 +00:00
Tom Hughes
e70d94c54a Don't create sessions for API calls. 2007-08-14 13:59:07 +00:00
Tom Hughes
9dbe1a497a Add a flag to allow the API to be placed in read-only mode. 2007-07-26 17:15:23 +00:00
Tom Hughes
7901811752 Make sure we clear the tags and segments for a way when it is deleted.
Also remove some redundant setting of timestamps that will be overwritten
by the model when saving.
2007-06-27 23:44:40 +00:00
Tom Hughes
dcad29dad0 Split the rest action into sparate read, update and delete actions thus
allowing authorization to be done on a per-action basis without worring
about the method. This should make the user API work.

Also do a lot of cleanup of the controllers.
2007-06-27 17:27:10 +00:00
Tom Hughes
0c198107af Correctly record which user deleted an object. 2007-06-22 15:37:57 +00:00