Commit graph

21 commits

Author SHA1 Message Date
Nick Thomas
69645389e9
Prevent a path traversal attack on global file templates
The API permits path traversal characters like '../' to be passed down
to the template finder. Detect these requests and cause them to fail
with a 500 response code.
2018-12-05 14:12:35 +00:00
Nick Thomas
25bd49e4f5
Backport project template API to CE 2018-10-05 11:34:43 +01:00
gfyoung
3836d69119 Enable frozen string in lib/api and lib/backup
Partially addresses #47424.

Had to make changes to spec files because
stubbing methods on frozen objects is a mess
in RSpec and leads to failures:

https://github.com/rspec/rspec-mocks/issues/1190
2018-09-29 21:04:50 -07:00
Nick Thomas
ca92fcd9de
Allow the TemplateFinder to handle licenses as well 2018-09-05 15:10:39 +01:00
Nick Thomas
03c733849c
Convert global templates to vendored templates via a ::TemplateFinder 2018-09-05 15:10:39 +01:00
Nick Thomas
f6f6295027
Convert the license template API to use the new LicenseTemplateFinder 2018-08-15 07:38:18 +01:00
Takuya Noguchi
2b6307f6ad Enable RuboCop Style/RegexpLiteral 2018-02-01 02:06:07 +09:00
Vitaliy @blackst0ne Klachkov
c55a9ac4ae Remove 'Repo' prefix from API entites 2017-10-05 19:48:05 +11:00
Zeger-Jan van de Weg
dc8e1676cd
Upgrade grape to 1.0
Main feature was the deprication of the Hashie stuff, so the access by
calling keys as method is gone now.
2017-08-16 22:06:31 +02:00
Robert Schilling
ce54a801fe Backport API to v3 2017-02-17 09:05:24 +01:00
Robert Schilling
01ea65e0e9 Paginate all endpoints that return an array 2017-02-16 15:32:01 +01:00
Oswaldo Ferreira
8adc356902 Remove deprecated templates endpoints in V4 2017-02-13 13:59:17 -02:00
Kamil Trzciński
8b26ff58e1 Update templates.rb 2016-12-16 09:17:15 +00:00
Luke "Jared" Bennett
dcd20236ec
Refactored JS
Added spec
2016-11-08 13:54:58 +00:00
Kamil Trzcinski
6970c1f331
Allow to use Dockerfile templates 2016-11-08 13:54:58 +00:00
Thomas Balthazar
b9b13ea801 Create a new /templates API namespace
The /licenses, /gitignores and /gitlab_ci_ymls endpoints are now also
available under a new /templates namespace. Old endpoints will be
deprecated when GitLab 9.0.0 is released.
2016-10-12 11:09:41 +02:00
Felipe Artur
2872672945 Load issues and merge requests templates from repository 2016-08-16 15:50:17 -03:00
Z.J. van de Weg
bbfd62bc34 fixup! override content method 2016-06-20 14:48:28 -05:00
Z.J. van de Weg
483dc62eaa Incorporate review 2016-06-20 14:48:28 -05:00
Z.J. van de Weg
620d014aef Implement backend gitlab ci dropdown
This commit builds on the groundwork in
ee008e300b1ec0abcc90e6a30816ec0754cea0dd, which refactored the backend
so the same code could be used for new dropdowns. In this commit its
used for templates for the `.gitlab-ci.yml` files.
2016-06-20 14:48:28 -05:00
ZJ van de Weg
27bf7ae59e Refactor Gitlab::Gitignores 2016-06-20 14:48:28 -05:00