Commit graph

122 commits

Author SHA1 Message Date
Andy Allan
3bb07e29ec Refactor api controllers to inherit from a common ApiController 2019-03-20 14:16:15 +01:00
Andy Allan
f4e2990526 Move map method to its own controller 2019-02-24 11:44:10 +01:00
Andy Allan
d887252eeb Move the changes api to its own controller 2019-02-24 11:00:28 +01:00
Andy Allan
8383fd0928 Move the permissions call out of api_controller 2019-02-24 11:00:28 +01:00
Andy Allan
317b8f9d45 Move the trackpoints call into its own controller (and rename to tracepoints) 2019-02-24 11:00:28 +01:00
Andy Allan
6a4092bc16 Move the capabilities call out of api_controller 2019-02-24 11:00:20 +01:00
Andy Allan
e7f943c715 Use CanCanCan for nodes, ways, relations, old and api controllers 2019-01-16 10:12:19 +01:00
Andy Allan
58c101762e Use a builder view for the capabilities call
This is easier to work with than building the XML document by hand
in the controller.
2019-01-09 14:30:18 +01:00
Tom Hughes
cdb42d2a6c Avoid ordering points from public and private traces
Closes #2046
2018-11-07 08:57:14 +00:00
Andy Allan
16fef14b61 Rename traces#view to traces#show 2018-08-29 17:43:38 +08:00
Andy Allan
b446138aef Rename trace_controller to traces_controller 2018-05-09 12:38:09 +08:00
Tom Hughes
a83030dab7 Fix new rubocop warnings 2018-01-22 18:55:45 +00:00
Andy Allan
15b104f4ff Merge branch 'p' of https://github.com/jfirebaugh/openstreetmap-website into jfirebaugh-p
Refs #139
2017-11-22 10:47:18 +00:00
Andy Allan
6f89da05d1 Use current_user to represent the currently logged in user.
This is already used by the oauth plugin, and is a general rails convention.
2017-07-12 16:10:50 +01:00
Tom Hughes
ff97501ed0 Remove all use of the :text option to render
It doesn't actually do what it says, as it sets the content type
to text/html not text/plain so is just confusing and as a result
has been deprecated in newer rails versions.
2017-06-02 19:12:05 +01:00
Simon Poole
9606e440bc Return maximum size of bounding box for note retrieval 2017-03-13 08:53:49 +01:00
Tom Hughes
72e71b9972 Fix rubocop warnings 2016-06-09 22:18:28 +01:00
Tom Hughes
5d3ecffa28 Fix new rubocop warnings 2016-02-05 13:35:26 +00:00
Tom Hughes
8fe1899596 Fix rubocop warnings 2016-01-19 09:51:24 +00:00
Tom Hughes
c0e4394a48 Add extra tests for API and redaction controllers 2015-03-03 00:55:19 +00:00
Tom Hughes
9fb8f5a84b Drop the old output_compression plugin
The production servers all have mod_deflate enabled anyway, which
almost certainly does a better job of compression than this.
2015-03-01 10:52:28 +00:00
Tom Hughes
dbe165bbb3 Fix some rubocop rails style issues 2015-02-26 00:12:54 +00:00
Tom Hughes
dc2a2c8ebd Standardise on double quoted strings 2015-02-20 19:47:26 +00:00
Tom Hughes
baf10cd392 Fix rubocop lint issues 2015-02-20 08:56:16 +00:00
Tom Hughes
ef7f3d800c Fix most auto-correctable rubocop issues 2015-02-20 08:56:16 +00:00
Tom Hughes
34e3e51456 Cleanup trailing whitespace 2015-02-20 08:56:16 +00:00
Paul Norman
2d26d1f764 Add an imagery blacklist to capabilities
This blacklist is for imagery which is of an incompatible license or ToS
but is incorrectly used with some frequency.

This adds a <policy> element to the capabilities XML which contains the
blacklist information within it
2014-08-31 18:41:12 +01:00
Tom Hughes
e341ef5673 Remove never actually used code from five years ago 2013-10-11 20:03:06 +01:00
Tom Hughes
6c51b3cc0a Replace deprecated finder methods 2013-09-21 11:35:46 +01:00
Matt Amos
3822e8de77 Added database, API and GPX status to capabilities. 2013-04-02 15:05:20 +01:00
John Firebaugh
ee6e0d5c0b Remove unused parameter 2012-11-25 15:14:47 -04:00
Enno Brehm
6a09f49e71 Implement API endpoint to query permissions. 2012-05-05 15:28:45 +01:00
Tom Hughes
b255a333c5 Specify the username when generating a URL for a trace 2012-03-10 13:05:39 +00:00
Peter Gray
95d899786a Refactor bounding box code
Moved duplicated code into the BoundingBox class, and pass around
BoundingBox objects instead of lists of bounds.
2011-11-14 09:42:57 +00:00
Tom Hughes
071c3581e9 Disable CSRF token verification for API methods 2011-11-14 09:42:55 +00:00
Tom Hughes
226c41be69 Update ActiveRecord queries to use arel 2011-11-14 09:42:44 +00:00
Tom Hughes
7369b7427c Remove bogus trailing slash from GPX namespace URL 2010-12-02 19:23:38 +00:00
Tom Hughes
f07819d81a Rework application configuration
Use a preinitializer to load the settings from application.yml so
that they are available as early as possible. All settings can also
be overridden using environment variables.

The ad-hoc settins in environment.rb are then moved to this new
system so we have one consistent location for settings.
2010-08-04 22:06:05 +01:00
Tom Hughes
1e6bcb6c2d Made the trackpoints call return a more sensible filename. 2010-01-27 13:51:15 +00:00
Tom Hughes
5451310d3c Revert half baked attempt at poi api call - this needs much more
thought before it's ready.
2009-12-14 22:19:51 +00:00
Frederik Ramm
fb912fba71 this is kind of a "suggested change" for the API controller to
support an additional "restriction" parameter for the "map" 
call (only value currently supported: nodes_only to return only
nodes). i would have liked to implement "tagged_nodes_only" as
well but was unsure how to do that best. feel free to make up 
some other way instead to improve node access for POI editors,
or drop this altogether if you have some other grand plan.
2009-12-14 21:29:00 +00:00
Tom Hughes
565171486f Add extra visibility options for GPS traces, and enhance the API call
that returns trace data to return more information if the owner of the
trace has allowed it. Based on a patch from Matt Amos.
2009-08-13 17:06:11 +00:00
Tom Hughes
2f3e23f6eb Move to version 2.3.2 of rails. 2009-06-04 08:08:24 +00:00
Shaun McDonald
d4954bc7b1 Raising an exception in Ruby requires a .new. Add a timeout line to the capabilities call. 2009-05-21 14:05:09 +00:00
Tom Hughes
b38684e59e Add a global timeout that is applied to most API requests. 2009-05-20 22:18:36 +00:00
Tom Hughes
fa13a11a94 Optimise retrieval of full relations. 2009-05-15 09:10:50 +00:00
Shaun McDonald
a41f1b297b No need to define a constand for the appconfig var. Removes a warning when running under rails 2.2.2 2009-05-08 14:20:26 +00:00
Tom Hughes
9acc6d3288 Eager load node and way details when processing a map call. 2009-04-28 16:26:06 +00:00
Tom Hughes
bf31791f65 Add a changeset cache to stop us looking up the same changeset over
and over again when processing a map call.
2009-04-28 13:40:30 +00:00
Tom Hughes
a7ea614dd0 Finish removing old request counting logic. 2009-04-26 23:27:40 +00:00