Commit graph

75 commits

Author SHA1 Message Date
Marcin Kuzminski
7781eabe94 auth: use cache_ttl from a plugin to also cache permissions.
- this gives a 30% speed increase in operations like svn commit
- generally uses the same mechanismy like auth cache to cache permissions for faster
access to vcs commands
2017-10-07 10:02:39 +02:00
Marcin Kuzminski
f445addfdd vcs: reduce sql queries used during pull/push operations. 2017-09-28 21:45:19 +02:00
Marcin Kuzminski
3f0ff6b65b vcs: report 404 for shadow repos that are not existing anymore. Before we got 500 exception in this case. 2017-09-01 13:10:52 +02:00
Marcin Kuzminski
858b640885 http-app: adds some logging. 2017-07-28 02:42:52 +02:00
Daniel Dourvaris
93b6dfba9a gists: migrated gists controller to pyramid view. 2017-07-07 12:05:30 +02:00
Marcin Kuzminski
175cd5d4db audit-logs: log user agent for push/pull. 2017-04-28 21:03:00 +02:00
Marcin Kuzminski
479c786358 http-app: simplify detection of chunked encoding.
- since we now properly use chunked requests git client reports this in nicer way.
we no longer need to rely on hacks to detect chunked streams.
2017-04-18 09:31:49 +02:00
Marcin Kuzminski
93bb2a8b36 svn: escape special chars to allow interactions with non-standard svn paths.
- fixes #4306
2017-04-03 13:40:39 +02:00
Marcin Kuzminski
e7fd657687 git-lfs: push settings to git-lfs backend stored inside our rhodecode settings
- fixes #4235
2017-03-21 11:58:56 +01:00
Marcin Kuzminski
f7aa78c7e1 git-lfs: streaming support for file upload.
- ref #4235
2017-03-21 14:37:47 +01:00
Marcin Kuzminski
1e7801cf57 git-lfs: enable support for detection of git-lfs requests type
- fixes #4235
2017-03-18 12:22:37 +01:00
Marcin Kuzminski
58fe679096 http-app: prevent httplib3 logs to spawn our rhodecode logs.
- it often happens that there are odd logs, and it confuses people looking at those.
2017-03-15 17:30:14 +01:00
Marcin Kuzminski
8732733a54 authentication: enabled authentication with auth_token and repository scope.
- fixes #3932
- vcs type tokens now with repo scope narrows the usage to a repository.
2017-03-03 20:48:23 +01:00
Marcin Kuzminski
cfa10105b7 core: properly handle new redirections set in decorators.
- Allows easier full pyramid migration
2017-03-02 16:10:47 +01:00
Marcin Kuzminski
886cc7d28b http-proto: in case incoming requests come in as chunked stream the data to VCSServer.
This should solve a problem of uploading large files to rhodecode. In case of
git with small postBuffers GIT client streams data to the server. In such
case we want to stream the data back again to vcsserver without reading it fully
inside RhodeCode.
2017-02-10 16:25:06 +01:00
Marcin Kuzminski
3d3f2db34a core: removed pyro4 from Enterprise code. Fixes #5198 2017-02-07 15:58:49 +01:00
Marcin Kuzminski
4c2c087cf8 core: let pyramid handle tracebacks for all exceptions.
Otherwise we'll miss exception caused in pure pyramid view.
2017-01-12 23:36:07 +01:00
Marcin Kuzminski
584bd214ae vcs: do an early detection of vcs-type request.
We we to know to detect vcs type request as early as possible. IF we know
we're handling an VCS request, we can skip some of the pylons stack initialization.

- This fixes issues with leaking sessions and other object from pylons into
a purely VCS type request.
2017-01-12 01:20:31 +01:00
Marcin Kuzminski
fcc027c282 license: updated copyright year to 2017 2017-01-02 09:30:39 +01:00
Marcin Kuzminski
90deb7d32c vcs-server: expose remote tracebacks from http backend using the Pyro4AwareFormatter. 2016-12-21 12:43:47 +01:00
Marcin Kuzminski
fab9234763 svn-support: enable better logging of handled SVN commands. 2016-12-12 18:24:43 +01:00
Marcin Kuzminski
d5210dfe63 simplevcs: fix a typo when running detection of vcs backend.
- the flag should be explicit_scm which skips detection of VCS systems.
This improves the speed of calls by not trying to look for a valid vcs.
2016-11-17 18:48:31 +01:00
Martin Bornhold
10181aa8e6 vcs: Send custom repo-locked status code to the VCSServer. 2016-10-10 16:07:15 +02:00
Martin Bornhold
add98db605 vcs: Add a comment about removing some code when dropping Pyro4 support. 2016-10-10 14:06:26 +02:00
Martin Bornhold
d3b91c664e vcs: Include reason phrase from VCSServer into HTTP status string. 2016-10-10 13:58:52 +02:00
Martin Bornhold
dff5dd52e0 http: Allow http, pyro and custom implementations for scm app. 2016-10-04 12:01:10 +02:00
Martin Bornhold
ecc24326d7 vcs: Do not pass the backend key into the scm app instances.
We used the key as a value for a response header. Since this header is removed there
is no need to pass the backend key araound.
2016-10-06 16:25:27 +02:00
Martin Bornhold
c6466346b4 vcs: Remove custom response header which contains backend key.
We used this custom header to skip the error handling.
This is no linger needed since the VCS middleware is moved above of the error handling.
2016-10-06 16:10:40 +02:00
Martin Bornhold
1a3f93ca85 error-handling: Remove if condition to check if the response is a vcs response.
We moved the VCS middleware out of the error handling. Therefore we don't need to skip the error handling anymore.
2016-10-06 16:08:34 +02:00
Martin Bornhold
861adffd82 tests: Add a way to deactivate exception re-raising in tests. 2016-10-07 09:15:43 +02:00
Martin Bornhold
b213d2244c wsgi-stack: Refactor the error handling view into a middleware class. 2016-10-06 12:01:57 +02:00
Martin Bornhold
acc2367ab9 shadow: Simplyfy the regular expression for detecting shadow repository URLs 2016-09-28 13:25:57 +02:00
Martin Bornhold
5eeb75edac shadow: Fix an error in the regex to detect shadow repository URLs. 2016-09-26 14:54:21 +02:00
Martin Bornhold
9efcbadac8 vcs: Explicit use one of the repo names (acl, url, vcs) 2016-09-23 13:23:32 +02:00
Martin Bornhold
2cd4d08392 vcs: Clean up the shadow-repo-expose code and make some nicer comments. 2016-09-23 12:52:24 +02:00
Martin Bornhold
9ad3d9992f vcs: Move logging from vcs to simplevcs 2016-09-22 16:12:37 +02:00
Martin Bornhold
930ac34f74 vcs: Move shadow repo regex up to class level. 2016-09-22 16:02:35 +02:00
Martin Bornhold
9dca5e1637 shadow: Use only a single regular expression to generate and match repo/group slugs. 2016-09-22 15:33:11 +02:00
Martin Bornhold
01b5812099 vcs: Add flag to indicate if repository is a shadow repository. 2016-09-21 13:07:20 +02:00
Martin Bornhold
8d288b7c5f vcs: Use correct repo name attribute and remove workaround. 2016-09-21 09:58:11 +02:00
Martin Bornhold
a385c08a46 pr: Unify clone url generation of shadow repository. 2016-09-21 09:34:47 +02:00
Martin Bornhold
bad396a7d6 vcs: Fix missing import. 2016-09-20 15:14:42 +02:00
Martin Bornhold
31721213be api: Add an entry for pr shadow repositories to api functions. 2016-09-20 15:14:00 +02:00
Martin Bornhold
d65ffadc6c vcs: Get shadow repository file system path by using already existing functions.
We want to have the code that generates the shadow repo file system path at a single place.
2016-09-20 14:28:25 +02:00
Martin Bornhold
b23afad92e vcs: Only allow 'pull' actions on shadow repositories.
We are exposing the shadow repositories of pull requests to allow easy CI integration
or users to access the pull request shadow repo for investigating on it. But we don't
want someone/something to push changes to a shadow repository.
2016-09-19 15:33:46 +02:00
Martin Bornhold
d21d0a537f vcs: Use key lookup to explode if key is not available.
The key has to be in the dictionary, otherwise something changed in the code
and expoding here is better than hiding the error.
2016-09-19 15:31:57 +02:00
Martin Bornhold
a5e4564b0b vcs: Move code for parsing the repository names (url, vcs, acl) from vcs to simplevcs. 2016-09-19 15:21:44 +02:00
Martin Bornhold
3dbe3e4b2e vcs: Use regular expression to recognize requests to shadow repositories. 2016-09-19 14:24:36 +02:00
Johannes Bornhold
08a2b45999 vcs: Minimal change to expose the shadow repository
Based on my original research, this was the "minimal" starting point. It shows
that three concepts are needed for the "repo_name":

* From the security standpoint we think of the shadow repository having the same
  ACL as the target repository of the pull request. This is because the pull
  request itself is considered to be a part of the target repository.

  Out of this thought, the variable "acl_repo_name" is used whenever we want to
  check permissions or when we need the database configuration of the
  repository. An alternative name would have been "db_repo_name", but the usage
  for ACL checking is the most important one.

* From the web interaction perspective, we need the URL which was originally
  used to get to the repository. This is because based on this base URL commands
  can be identified. Especially for Git this is important, so that the commands
  are correctly recognized.

  Since the URL is in the focus, this is called "url_repo_name".

* Finally we have to deal with the repository on the file system. This is what
  the VCS layer deal with normally, so this name is called "vcs_repo_name".


The original repository interaction is a special case where all three names are
the same.

When interacting with a pull request, these three names are typically all
different.

This change is minimal in a sense that it just makes the interaction with a
shadow repository barely work, without checking any special constraints yet.
This was the starting point for further work on this topic.
2016-09-18 20:01:19 +02:00
Martin Bornhold
8e531005da pyro4: Add the custom header X-RhodeCode-Backend to the pyro4 backend responses.
This custom header sets the SCM backend which is in use. It is used to identify
VCS responses in the error handler. VCS responses are skipped during error handling.
2016-09-26 14:52:06 +02:00