1
0
Fork 0
Commit Graph

257 Commits (bb96b04f4a2a21b7546a1b2374028911cd862606)

Author SHA1 Message Date
Simon Berger f3936b82cd Added test to cancel ProcessExecutor::asyncExecute 2020-09-08 11:33:41 +02:00
Nils Adermann 1385412748 Merge branch 'master' into filter-packages
* master:
  Add tests for edge cases of packages providing names which exist as real packages
  Add another test verifying that a package may provide an incompatible version of sth that actually exists
  Fix provider coexistence test, needs another requirement to install both
  Fix test filename to end with .test extension so it gets run
  Update config section to note required scope for GitLab tokens
  Fix pre/post-package-install/update/uninstall events receiving a partial list of operations, fixes #9079
  Also remove credentials from cache dirs in git/svn drivers, fixes #7439, refs #9155
  AuthHelper: Allow fall-through GitLab-specific HTTP headers for auth
  Sanitize repo URLs to mask HTTP auth passwords from cache directory
  Util/Zip: fix strpos args order
2020-08-28 14:52:58 +02:00
Ayesh Karunaratne 931a1ff1f8
AuthHelper: Allow fall-through GitLab-specific HTTP headers for auth
Previously, `AuthHelper` consumed the authentication credentials for GitLab domains and added access tokens as GitLab-specific headers.
[Composer repositories now supported in GitLab](https://php.watch/articles/composer-gitlab-repositories) require standard Authorization headers with a personal access to function, which failed to work due to out GitLab-specific headers.

With this commit, AuthHelper checks if the password is an access token, and falls through to HTTP basic authentication even if the domain name is a GitLab domain name.
2020-08-27 12:13:28 +07:00
Jordi Boggiano 9a04ecefbf
Merge branch 'master' into filter-packages 2020-08-25 16:51:28 +02:00
Jordi Boggiano 4d20e6f5d6
Move Version util to Platform namespace, fix CS nitpicks, make regexes case insensitive for robustness, refs #9093 2020-08-13 15:48:41 +02:00
Jordi Boggiano 7e1ef19a5a
Expand library version checking capabilities (closes #9093) 2020-08-13 15:48:41 +02:00
Wissem Riahi 657ae5519e
Add support for TAR in Artifact packages (#9105) 2020-08-12 20:30:58 +02:00
Wissem Riahi c353ac835c
Add exception for multiple composer.json files (#3) 2020-07-21 17:10:26 +02:00
Jordi Boggiano 942562c382
Clean up Zip Util to be more strict about what is a valid package archive, fixes #8931 2020-07-16 17:36:46 +02:00
Yanick Witschi ea0ce9dd7d Merge branch 'master' into filter-packages 2020-06-22 18:38:16 +02:00
Michael Chekin 6d9bf42655
Additional Util\RemoteFileSystem tests (#8960)
* RemoteFilesystemTest: simplifying some mock expectations calls

- will($this->returnValue()) to willReturn()
- will($this->returnCallBack()) to willReturnCallback()

* RemoteFilesystemTest: extracting identical mocks for IOInterface into a separate getIOInterfaceMock() method

* RemoteFilesystemTest: converting protected helper methods to private.

* RemoteFilesystemTest: moving getConfigMock() private method after the public methods (with other private methods)

* adding RemoteFileSystemTest::testCopyWithRetryAuthFailureFalse() unit test.

* Allow optional injecting of AuthHelper into RemoteFilesystem constructor.

* adding RemoteFileSystemTest::testCopyWithSuccessOnRetry() unit test.

* using backward compatible @expectedException in RemoteFilesystemTest.php

* RemoteFilesystemTest: extracting RemoteFilesystem with mocked method creation into a separate method.

* RemoteFilesystemTest: extracting AuthHelper with mocked method creation into a separate method.
2020-06-16 09:35:33 +02:00
Jordi Boggiano 67a88880ec
Get rid of EmptyConstraint 2020-06-05 16:52:24 +02:00
Jordi Boggiano 4e1f8cf89d
Build tweaks 2020-05-20 16:20:54 +02:00
Jordi Boggiano dd0c8b4278
Merge pull request #8723 from helhum/fix-package-sorting
Fix package sorting
2020-05-06 10:47:01 +02:00
Michael Chekin c23670c3ec
Add Util\AuthHelper unit test coverage (#8863)
* Add AuthHelper::addAuthenticationHeader() test on missing authentication credentials.

* Add AuthHelper::addAuthenticationHeader() test on bearer password.

* Add AuthHelper::addAuthenticationHeader() test on Github token.

* Add AuthHelper::addAuthenticationHeader() test on Gitlab Oauth token.

* Add $authenticationDisplayMessage write expectation to AuthHelper::addAuthenticationHeader() tests.

* Add AuthHelper::addAuthenticationHeader() test on Gitlab private token.

* Add AuthHelper::addAuthenticationHeader() test on Bitbucket Oauth token.

* Add AuthHelper::addAuthenticationHeader() test on Bitbucket public urls.

* Add AuthHelper::addAuthenticationHeader() test on Basic Http Authentication.

* Add AuthHelper::isPublicBitBucketDownload() tests.

* Rename AuthHelperTest $credentials variable to $auth.

* Add AuthHelper::storeAuth() test for auto-store option.

* Add AuthHelper::storeAuth() test for user prompt and y(es) answer.

* Add AuthHelper::storeAuth() test for user prompt and n(o) answer.

* Add AuthHelper::storeAuth() test for user prompt with invalid answer.

* Add AuthHelper::promptAuthIfNeeded() test for Github authentication failure.

- add GitHub hard dependency mock (new GitHub(...) mock)

* Run AuthHelper::promptAuthIfNeeded() tests only with PHP > 5.3

* Run AuthHelper::promptAuthIfNeeded() tests only with PHP >= 5.4

* Run AuthHelper::promptAuthIfNeeded() tests only with PHP 5.4

* Exclude PHPStan analyses of '../tests/Composer/Test/Util/Mocks/*'

* Exclude AuthHelper::promptAuthIfNeeded() tests from current pull request.

* Extract repetitive AuthHelperTest authentication expectation into a method.
2020-05-04 09:48:23 +02:00
Helmut Hummel 7c891701e6 Fix package sorting
PackageSorter weighs the importance of a package
by counting how many times it is required by other packages.
This works by calculating the weight for each package name.

However currently the package index of the package array
is currently passed the weigh function, which basically
disables package sorting.

The reason for that is, that a package repository previously
returned the package list as associative array with  package name as keys,
but currently just as an array with integer keys.

Therefore we must extract the package name from the package
before passing it to the weigh function.
2020-05-03 16:31:47 +02:00
Michael Chekin b9be78b689
Additional Util\Bitbucket class test coverage (#8835) 2020-04-28 11:45:30 +02:00
Jordi Boggiano 45ecbae8f5
Merge branch 'master' into 2.0 2020-02-07 22:20:51 +01:00
Ion Bazan a9bace37f6 fix windows build 2020-02-07 15:18:18 +08:00
Ion Bazan 58b34d13e8 fix risky tests (without any assertion) 2020-02-07 14:35:07 +08:00
Ion Bazan a2137d5263 use Symfony PHPUnit Bridge 2020-02-07 12:22:22 +08:00
Jordi Boggiano 1e68555e0a
Sanitize URLs in getRepoName and centralize the Url sanitization process 2020-01-30 15:50:46 +01:00
Jordi Boggiano 30b6a41035
Extract MetadataMinifier util 2020-01-15 12:58:30 +01:00
Jordi Boggiano 4a7d42604f
Fix tests 2020-01-14 16:27:16 +01:00
Jordi Boggiano a5b178084c
Merge branch 'master' into 2.0 2020-01-14 15:39:35 +01:00
Jordi Boggiano c43137db3f
Merge branch '1.9' 2020-01-13 15:50:39 +01:00
Jordi Boggiano 4e667f891b
Fix 5.3 build 2020-01-13 13:45:04 +01:00
Jordi Boggiano 23359f2db6
Merge branch 'master' into 2.0 2020-01-13 13:35:52 +01:00
Jordi Boggiano 3d72b56ed6
Merge branch '1.9' 2020-01-13 13:30:52 +01:00
Jordi Boggiano d3f1c664d4
Avoid formatting output from external processes, fixes #8524 2020-01-13 13:30:46 +01:00
Ondrej Mirtes 7d4d4622ab
ProcessExecutor - do not format output from executed processes 2020-01-13 13:20:04 +01:00
johnstevenson 00da9b125d Tidy and fix tests 2019-11-30 15:45:54 +00:00
johnstevenson 74ba9decdf Rewrite NoProxyPattern to include IPv6
This includes two breaking changes:
- the hostname is not resolved in the case of an IP address.
- a hostname with a trailing period (FQDN) is not matched.

This brings the basic implementation in line with curl behaviour, with
the addition of full IP address and range matching (curl does not
differentiate between IP addresses host names).

The NO_PROXY environment variable can be set to either a comma-separated
list of host names that should not use a proxy, or single asterisk `*`
to match all hosts.

- Port numbers can be included by prefixing the port with a colon `:`.
- IP addresses can be used, but must be enclosed in square brackets
`[...]` if they include a port number.
- IP address ranges can specified in CIDR notation, separating the IP
address and prefix-length with a forward slash `/`.
2019-11-29 20:39:08 +00:00
Jordi Boggiano 88b051c96b
Merge branch 'master' into 2.0
Update deps
2019-11-23 12:27:41 +01:00
Stephan Vock b847115617 Git: fix authentication handling for private GitHub repositories 2019-11-23 12:02:06 +01:00
Jordi Boggiano bc2a1d762a
Merge branch 'master' into 2.0 2019-10-30 08:54:44 +01:00
johnstevenson 8d9b822413 Add messages to junction tests to see failures 2019-10-21 11:09:17 +02:00
Jordi Boggiano 6c4357a7ed
Merge branch 'master' into 2.0 2019-07-31 17:50:01 +02:00
Jordi Boggiano 26a3e12c96
Merge pull request #7994 from aschempp/feature/zip-util
Extract the ZIP utility functions from ArtifactRepository
2019-07-30 11:36:10 +02:00
Gabriel Caruso 6c8ddd4d57
Remove unused private properties 2019-07-24 02:53:53 +02:00
Nils Adermann d2fa1e1319 Merge branch 'master' into 2.0
* master: (48 commits)
  SVN: hide passwords for debug output
  Free $solver asap
  fixes #8179
  [minor] Fixed a typo in the CHANGELOG.md.
  Update deps
  Update changelog
  Revert "Allow overriding self-update target file with envvar COMPOSER_SELF_UPDATE_TARGET" Revert "Add docs for COMPOSER_SELF_UPDATE_TARGET, refs #8151"
  Add docs for COMPOSER_SELF_UPDATE_TARGET, refs #8151
  Fix display of HHVM warning appearing when HHVM is not in use, fixes #8138
  Read classmap-authoritative and apcu-autoloader from project config when installing via create-project, fixes #8155
  Use possessive quantifiers
  Update xdebug-handler to 1.3.3
  fixes #8159
  Allow overriding self-update target file with envvar COMPOSER_SELF_UPDATE_TARGET
  flag should come before script name
  use full command name, not abbreviated/alias
  modify text
  Document the alternatives to disable the default script timeout
  Anchor pattern
  Fix URL resolution for Composer repositories
  ...
2019-06-27 14:08:00 +02:00
Stephan Vock 8da046e4e9 SVN: hide passwords for debug output 2019-06-23 18:59:36 +01:00
Andreas Schempp 0e2215dc6c Added full unit test coverage 2019-03-04 11:08:59 +01:00
Jordi Boggiano 64384f8b15 Fix tests 2019-01-14 17:29:24 +01:00
Jordi Boggiano fd11cf3618 Port/extract most behavior of RemoteFilesystem to CurlDownloader 2019-01-14 17:29:23 +01:00
Jordi Boggiano 1cd9f4f9db Disable request_fulluri by default for HTTPS connections 2019-01-14 17:29:23 +01:00
Jordi Boggiano 713bc4de1d Minor fixes and updated the rest of the code/tests to use HttpDownloader 2019-01-14 17:29:23 +01:00
Gabriel Caruso 2a13bb2649 Fixes from PHPStan (#7687)
* fix docblocks

* remove redundant conditional

* fix wrong variable name

* fix wrong namespaces

* add missing private members

* remove unused/redundant arguments

* move testcase class

* exclude TestCase.php

* Tweak RuleWatchGraph type hints

* Tweak doc comment
2018-11-12 15:23:32 +01:00
Jordi Boggiano bf125295df Fix escaping of URLs in Perforce and Subversion drivers 2018-08-25 18:48:56 +02:00
Jordi Boggiano ff59bbdab0 CS fixer 2018-07-24 14:32:52 +02:00