0
0
Fork 0
mirror of https://github.com/nextcloud/server.git synced 2025-05-12 09:32:30 +00:00
Commit graph

52 commits

Author SHA1 Message Date
Joas Schilling
c24f5fb256
test: Finish migrating tests/Core/ to PHPUnit 10 compatible code
Signed-off-by: Joas Schilling <coding@schilljs.com>
2025-05-02 16:47:42 +02:00
georglauterbach
387cd8b771
fix: do not query CNAME if A succeeded already
Signed-off-by: georglauterbach <44545919+georglauterbach@users.noreply.github.com>
2024-11-06 20:21:38 +01:00
Daniel Kesselberg
6be00432b7
chore: always execute parse_url in preventLocalAddress
This change should make it easier to spot wrong uses of the HTTP client on development setups where allow_local_remote_servers is usually true.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2024-10-01 18:00:47 +02:00
provokateurin
9836e9b164
chore(deps): Update nextcloud/coding-standard to v1.3.1
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-09-19 14:21:20 +02:00
Christoph Wurst
49dd79eabb
refactor: Add void return type to PHPUnit test methods
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2024-09-15 22:32:31 +02:00
Daniel Kesselberg
af6de04e9e
style: update codestyle for coding-standard 1.2.3
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2024-08-25 19:34:58 +02:00
Andy Scherzinger
1f7e2ba599
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-13 17:41:36 +02:00
Robin Kluth
51739ad1ac Adjust tests to match new expected exception
Signed-off-by: Robin Kluth <Commifreak@users.noreply.github.com>
2024-02-24 11:34:34 +01:00
Joas Schilling
33e1c8b236
fix(security): Handle idn_to_utf8 returning false
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-12-04 10:38:46 +01:00
Daniel Kesselberg
f8f985602b
test: add tests for dns pin middleware
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2023-09-12 14:04:23 +02:00
Daniel Kesselberg
eab46bdfe6
feat: add switch to disable dns pinning
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2023-08-29 18:03:54 +02:00
Côme Chilliet
f57c12b14e
Fix various deprecation warnings in tests on PHP 8.3
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-08-14 18:13:12 +02:00
Joas Schilling
ec6728d710
feat(HTTPClient): Provide wrapped access to Guzzle's asyncRequest()
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-06-27 15:53:57 +02:00
Robin Appelman
e7ab30f5d8
log performance events for http requests
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-04-28 15:37:57 +02:00
Côme Chilliet
8d5165e8dc
Adapt tests to config value typing
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-04-05 17:42:14 +02:00
Côme Chilliet
f5c361cf44
composer run cs:fix
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-01-20 11:45:08 +01:00
Christoph Wurst
8aea25b5b9
Add remote host validation API
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2022-10-31 16:13:28 +01:00
Christoph Wurst
d4b9b010b0
Rename LocalAddressChecker methods to lower case
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2022-10-27 13:24:28 +02:00
Simon L
11108e8032 Revert "fix external storages access"
Signed-off-by: szaimen <szaimen@e.mail.de>
2022-10-23 22:36:34 +02:00
John Molakvoæ
304c1b9b61
Merge pull request from nextcloud/fix/30282/external-storages
fix external storages access
2022-10-23 10:42:46 +02:00
Côme Chilliet
31117fa7c7
Fix tests for nested v4 in v6
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-09-20 12:46:22 +02:00
Côme Chilliet
c083f77e4e
Harden tests for local IP detection in URLs
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-09-20 12:14:33 +02:00
Côme Chilliet
c5ffd7ce32
Use Symfony IpUtils to check for local IP ranges
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-07-12 12:09:05 +02:00
szaimen
2ad53742f2 fix external storages access
Signed-off-by: szaimen <szaimen@e.mail.de>
2022-07-01 22:52:10 +02:00
Côme Chilliet
6a1510f8ee
Remove some more at matchers in tests/lib
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-06-20 10:53:06 +02:00
Côme Chilliet
61f7f13bd8
Migrate from ILogger to LoggerInterface where needed in the tests
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-24 16:21:26 +01:00
Côme Chilliet
66bdda568a
Fix Guzzle function calls
Since 1.7.0 and 2.0 these functions are turned into static methods.
See https://github.com/guzzle/psr7#upgrading-from-function-api

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-11-23 09:28:57 +01:00
Lukas Reschke
9dab851931 Adjust test
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2021-04-06 11:37:47 +00:00
Lukas Reschke
5f3abffe6f Improve networking checks
Whilst we currently state that SSRF is generally outside of our threat model, this is something where we should invest to improve this.

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2021-04-06 11:37:47 +00:00
Christoph Wurst
aabd73912e
Type the service registration
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-02-10 09:44:24 +01:00
Christoph Wurst
6995223b1e
Add well known handlers API
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-12-16 13:13:05 +01:00
Morris Jobke
dc479aae2d
Improve CertificateManager to not be user context dependent
* removes the ability for users to import their own certificates (for external storage)
* reliably returns the same certificate bundles system wide (and not depending on the user context and available sessions)

The user specific certificates were broken in some cases anyways, as they are only loaded if the specific user is logged in and thus causing unexpected behavior for background jobs and other non-user triggered code paths.

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-11-03 00:13:01 +01:00
Morris Jobke
18b0d753f2
Do not read certificate bundle from data dir by default
Before the resources/config/ca-bundle.crt was only used when the list of custom
certificates was empty and the instance was not installed. But it should also
be used when the list is empty and the instance is installed.

This is inverting the logic to stop if the instance is not installed to use the
default bundle. And it also does this when the list is empty.

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-05-25 16:57:56 +02:00
Morris Jobke
8bcd1c31da
Allow gzip encoded requests by default
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-05-20 13:37:28 +02:00
Joas Schilling
fd0c1a3bb2
Fix unit tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-04-15 08:06:51 +02:00
Joas Schilling
5e402f8aae
Check all remotes for local access
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-04-14 18:56:06 +02:00
Mohammed Abdellatif
98d6415264 Add support for GuzzleHTTP 'no' proxy
The custom config allows to setup a proxy URI that is passed to
GuzzleHTTP client as request options. Guzzle has the option to receive
an array of proxies for each URI scheme as well as 'no' key value pair
to provide a list of host names that should not be proxied to.

Guzzle would automatically populate these options with HTTPS_PROXY
and NO_PROXY environment variables. However, when providing a 'proxy'
request option, default values will be overriden and it is required to
explicitly provide the 'no' value if needed.

More info:
http://docs.guzzlephp.org/en/stable/request-options.html#proxy

This commit will add support for a new config 'proxyexclude', which
takes a list of host names to be excluded.

It will also provide 'proxy' request option as an array instead of a
string to Guzzle, and populate 'http' and 'https' URI schemes with
proxy URI, and 'no' with 'proxyexclude' list.

Also, if no 'proxy' is configured, it will leave out 'proxy' request
option, so it won't override Guzzle default values.

Sample config file includes a hint on how to explicitly sync
'proxyexclude' with NO_PROXY, and a note about default values.

Signed-off-by: Mohammed Abdellatif <m.latief@gmail.com>
2020-02-29 19:19:23 +02:00
John Molakvoæ (skjnldsv)
0687b9ed8a
[3rdparty] Bump guzzlehttp/guzzle from 6.3.3 to 6.5.2
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2020-02-11 20:49:27 +01:00
Roeland Jago Douma
3a7cf40aaa
Mode to modern phpunit
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-27 15:27:18 +01:00
Roeland Jago Douma
c007ca624f
Make phpunit8 compatible
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-27 13:34:41 +01:00
Roeland Jago Douma
68748d4f85
Some php-cs fixes
* Order the imports
* No leading slash on imports
* Empty line before namespace
* One line per import
* Empty after imports
* Emmpty line at bottom of file

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-22 20:52:10 +01:00
Daniel Kesselberg
773778dd8c
Add default timeout to expected request options
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2019-09-03 14:59:09 +02:00
Scott Shambarger
edf946dfc7
Correctly handle emtpy string in proxyuserpwd config
As documented, the default value for config value proxyuserpwd is ''.
However, that value results in the error:
 "cURL error 5: Unsupported proxy syntax in '@'".
This patch handles the values of '' and null (the default in the code)
the same for config values proxyuserpwd and proxy.

Signed-off-by: Scott Shambarger <devel@shambarger.net>
2019-08-11 21:07:30 +02:00
Daniel Kesselberg
6c156d81ed
Fix testGetProxyUri
Changed the implementation for getProxyUri with
fd1d85365c

If proxy is already null then we don't ask for proxyuserpwd. Test
failed because we expected getSystemValue to be called once with
proxyuserpwd

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2019-04-16 21:33:56 +02:00
Daniel Kesselberg
2708d26407
Set User-Agent as header without middleware
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2019-04-16 21:13:29 +02:00
Daniel Calviño Sánchez
00c3a7eb4c Fix HTTP client given options being overriden by default options
According to the array_merge documentation, "If the input arrays have
the same string keys, then the later value for that key will overwrite
the previous one." Thus, the default options must be the first parameter
passed to array_merge.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-06-14 21:36:04 +02:00
Robin Appelman
9b25ff9fcb
adjust httpclient to guzzle6
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-02-09 17:13:21 +01:00
Lukas Reschke
1b8aae837c Merge pull request from nextcloud/increase-coverage-response.php
Add 100% coverage for response.php
2017-01-02 16:01:47 +01:00
Lukas Reschke
746fc3d3bf
Add 100% coverage for response.php
While already at https://github.com/nextcloud/server/pull/2911 I thought I can as well finish that one as well...

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2017-01-02 15:16:35 +01:00
Lukas Reschke
5679f04cb1
Rebrand to "Nextcloud" and add 100% coverage
Noticed while debugging https://github.com/nextcloud/server/issues/2910

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2017-01-02 14:51:16 +01:00