summaryrefslogtreecommitdiff
path: root/lib/api/helpers.rb
diff options
context:
space:
mode:
authorTimothy Andrew <mail@timothyandrew.net>2017-07-04 12:19:48 +0000
committerTimothy Andrew <mail@timothyandrew.net>2017-07-04 12:19:48 +0000
commitd1488268b2e31b8f3549c6e1e46955619535cd98 (patch)
tree649bce69f61984ae85205e340b54f1d6bc121f17 /lib/api/helpers.rb
parent96e986327c4dad9248f9013f191119ffafe4a6d8 (diff)
downloadgitlab-ce-d1488268b2e31b8f3549c6e1e46955619535cd98.tar.gz
Simplify authentication logic in the v4 users API for !12445.
- Rather than using an explicit check to turn off authentication for the `/users` endpoint, simply call `authenticate_non_get!`. - All `GET` endpoints we wish to restrict already call `authenticated_as_admin!`, and so remain inacessible to anonymous users. - This _does_ open up the `/users/:id` endpoint to anonymous access. It contains the same access check that `/users` users, and so is safe for use here. - More context: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/12445#note_34031323
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r--lib/api/helpers.rb6
1 files changed, 0 insertions, 6 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index a3aec8889d7..2c73a6fdc4e 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -407,11 +407,5 @@ module API
exception.status == 500
end
-
- # Does the current route match the route identified by
- # `description`?
- def request_matches_route?(method, route)
- request.request_method == method && request.path == route
- end
end
end