Hello community, here is the log from the commit of package platformsh-cli for openSUSE:Leap:15.2 checked in at 2020-02-16 18:30:16 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Leap:15.2/platformsh-cli (Old) and /work/SRC/openSUSE:Leap:15.2/.platformsh-cli.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "platformsh-cli" Sun Feb 16 18:30:16 2020 rev:40 rq:774568 version:3.52.2 Changes: -------- --- /work/SRC/openSUSE:Leap:15.2/platformsh-cli/platformsh-cli.changes 2020-01-30 15:47:38.713303907 +0100 +++ /work/SRC/openSUSE:Leap:15.2/.platformsh-cli.new.26092/platformsh-cli.changes 2020-02-16 18:30:50.458797174 +0100 @@ -1,0 +2,9 @@ +Mon Feb 10 18:15:14 UTC 2020 - ji...@boombatower.com + +- Update to version 3.52.2: + * Release v3.52.2 + * Ignore parse exceptions from xdebug command when loading command list (#901) + * Return OAuth2 errors to the terminal + * Handle OAuth2 errors (e.g. denied consent/scopes) + +------------------------------------------------------------------- Old: ---- platformsh-cli-3.52.1.tar.xz New: ---- platformsh-cli-3.52.2.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ platformsh-cli.spec ++++++ --- /var/tmp/diff_new_pack.XtAdeC/_old 2020-02-16 18:30:50.862797386 +0100 +++ /var/tmp/diff_new_pack.XtAdeC/_new 2020-02-16 18:30:50.862797386 +0100 @@ -17,7 +17,7 @@ Name: platformsh-cli -Version: 3.52.1 +Version: 3.52.2 Release: 0 Summary: Tool for managing Platform.sh services from the command line # See licenses.txt for dependency licenses. ++++++ _service ++++++ --- /var/tmp/diff_new_pack.XtAdeC/_old 2020-02-16 18:30:50.882797396 +0100 +++ /var/tmp/diff_new_pack.XtAdeC/_new 2020-02-16 18:30:50.882797396 +0100 @@ -2,7 +2,7 @@ <service name="tar_scm" mode="disabled"> <param name="versionformat">@PARENT_TAG@</param> <param name="versionrewrite-pattern">v(.*)</param> - <param name="revision">refs/tags/v3.52.1</param> + <param name="revision">refs/tags/v3.52.2</param> <param name="url">git://github.com/platformsh/platformsh-cli.git</param> <param name="scm">git</param> <param name="changesgenerate">enable</param> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.XtAdeC/_old 2020-02-16 18:30:50.890797400 +0100 +++ /var/tmp/diff_new_pack.XtAdeC/_new 2020-02-16 18:30:50.894797403 +0100 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">git://github.com/platformsh/platformsh-cli.git</param> - <param name="changesrevision">0f776ae4191f1fe10c015f27c6b7cadcd104c5a5</param> + <param name="changesrevision">56c5c56723e8f045223cf6564036b273d404621d</param> </service> </servicedata> ++++++ platformsh-cli-3.52.1.tar.xz -> platformsh-cli-3.52.2.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.52.1/dist/manifest.json new/platformsh-cli-3.52.2/dist/manifest.json --- old/platformsh-cli-3.52.1/dist/manifest.json 2020-01-29 12:29:32.000000000 +0100 +++ new/platformsh-cli-3.52.2/dist/manifest.json 2020-02-07 10:28:56.000000000 +0100 @@ -17,10 +17,10 @@ }, { "name": "platform.phar", - "sha1": "c7b03ff56dbd10b70a137baa86af7900ccfe5a22", - "sha256": "4d74907c3c2a988aa71754a80bde358a890032568b820b8e5d544ced617884f3", - "url": "https://github.com/platformsh/platformsh-cli/releases/download/v3.52.1/platform.phar", - "version": "3.52.1", + "sha1": "fdbe56ad089fddb833845c42157f82d5b9d32773", + "sha256": "aa420d0f2cf1efd90efb464dd0d7d544c1ba5be381e79eb22a86afb6f17bd181", + "url": "https://github.com/platformsh/platformsh-cli/releases/download/v3.52.2/platform.phar", + "version": "3.52.2", "php": { "min": "5.5.9" }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.52.1/resources/oauth-listener/index.php new/platformsh-cli-3.52.2/resources/oauth-listener/index.php --- old/platformsh-cli-3.52.1/resources/oauth-listener/index.php 2020-01-29 12:29:32.000000000 +0100 +++ new/platformsh-cli-3.52.2/resources/oauth-listener/index.php 2020-02-07 10:28:56.000000000 +0100 @@ -62,8 +62,8 @@ $this->reportError('Invalid returned code_challenge parameter'); return; } - if (!file_put_contents($this->file, $_GET['code'], LOCK_EX)) { - $this->reportError('Failed to write authorization code to file'); + if (!$this->sendToTerminal(['code' => $_GET['code']])) { + $this->reportError('Failed to send authorization code back to terminal'); return; } $this->setRedirect($this->localUrl . '/?done'); @@ -74,13 +74,20 @@ // Show the final result page. if (array_key_exists('done', $_GET)) { - $this->response->content = '<p><strong>Successfully logged in.</strong></p>' - . '<p>You can return to the command line.</p>'; + $this->response->content = '<h1>Successfully logged in</h1>' + . '<p>You can return to the command line</p>'; return; } - // Redirect to login. + // Respond after an OAuth2 error. + if (isset($_GET['error'])) { + $message = isset($_GET['error_description']) ? $_GET['error_description'] : null; + $this->reportError($message, $_GET['error']); + return; + } + + // In any other case: redirect to login. $url = $this->getOAuthUrl(); $this->setRedirect($url); $this->response->content = '<p><a href="' . htmlspecialchars($url) .'">Log in</a>.</p>'; @@ -106,13 +113,36 @@ } /** - * @param string $message + * @param array $response + * + * @return bool */ - private function reportError($message) + private function sendToTerminal(array $response) + { + return (bool) file_put_contents($this->file, json_encode($response), LOCK_EX); + } + + /** + * @param string $message The error message. + * @param string|null $error An OAuth2 error type. + */ + private function reportError($message = null, $error = null) { $this->response->headers['Status'] = 401; - $this->response->content = '<p>An error occurred while trying to log in. Please try again.</p>' - . '<p>Error message: <code>' . htmlspecialchars($message) . '</code></p>'; + $this->response->content = '<h1 class="error">Error</h1>'; + if (isset($error)) { + $this->response->content .= '<p class="error"><code>' . htmlspecialchars($error) . '</code></p>'; + } + if (isset($message)) { + $this->response->content .= '<p class="error">' . htmlspecialchars($message) . '</p>'; + } + if ($message || $error) { + $response = ['error' => $error, 'error_description' => $message]; + if (!$this->sendToTerminal($response)) { + $this->response->content .= '<p class="error">Additionally: failed to send error message back to terminal</p>'; + } + } + $this->response->content .= '<p>Please try again</p>'; } } @@ -170,6 +200,13 @@ display: block; margin: 10px auto; } + + .error { + color: darkred; + } + .error-hint { + font-style: oblique; + } </style> </head> <body> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.52.1/src/Command/Auth/BrowserLoginCommand.php new/platformsh-cli-3.52.2/src/Command/Auth/BrowserLoginCommand.php --- old/platformsh-cli-3.52.1/src/Command/Auth/BrowserLoginCommand.php 2020-01-29 12:29:32.000000000 +0100 +++ new/platformsh-cli-3.52.2/src/Command/Auth/BrowserLoginCommand.php 2020-02-07 10:28:56.000000000 +0100 @@ -113,13 +113,13 @@ $listenerDir = $this->config()->getWritableUserDir() . '/oauth-listener'; $this->createDocumentRoot($listenerDir); - // Create the file where an authorization code will be saved (by the - // local server script). - $codeFile = $listenerDir . '/.code'; - if (file_put_contents($codeFile, '', LOCK_EX) === false) { - throw new \RuntimeException('Failed to create temporary file: ' . $codeFile); + // Create the file where a response will be saved (by the local server + // script). + $responseFile = $listenerDir . '/.response'; + if (file_put_contents($responseFile, '', LOCK_EX) === false) { + throw new \RuntimeException('Failed to create temporary file: ' . $responseFile); } - chmod($codeFile, 0600); + chmod($responseFile, 0600); // Start the local server. $process = new Process([ @@ -137,7 +137,7 @@ 'CLI_OAUTH_CODE_CHALLENGE' => $this->convertVerifierToChallenge($codeVerifier), 'CLI_OAUTH_AUTH_URL' => $this->config()->get('api.oauth2_auth_url'), 'CLI_OAUTH_CLIENT_ID' => $this->config()->get('api.oauth2_client_id'), - 'CLI_OAUTH_FILE' => $codeFile, + 'CLI_OAUTH_FILE' => $responseFile, ] + $this->getParentEnv()); $process->setTimeout(null); $this->stdErr->writeln('Starting local web server with command: <info>' . $process->getCommandLine() . '</info>', OutputInterface::VERBOSITY_VERY_VERBOSE); @@ -176,32 +176,52 @@ $this->stdErr->writeln(''); // Wait for the file to be filled with an OAuth2 authorization code. - $code = null; - while ($process->isRunning() && empty($code)) { + /** @var array|null $response */ + $response = null; + while ($process->isRunning()) { usleep(300000); - if (!file_exists($codeFile)) { - $this->stdErr->writeln('File not found: <error>' . $codeFile . '</error>'); + if (!file_exists($responseFile)) { + $this->stdErr->writeln('File not found: <error>' . $responseFile . '</error>'); $this->stdErr->writeln(''); break; } - $code = file_get_contents($codeFile); - if ($code === false) { - $this->stdErr->writeln('Failed to read file: <error>' . $codeFile . '</error>'); + $responseRaw = file_get_contents($responseFile); + if ($responseRaw === false) { + $this->stdErr->writeln('Failed to read file: <error>' . $responseFile . '</error>'); $this->stdErr->writeln(''); break; } + if ($responseRaw !== '') { + $response = json_decode($responseRaw, true); + break; + } } + // Allow a little time for the final page to be displayed in the + // browser. + usleep(100000); + // Clean up. $process->stop(); (new Filesystem())->remove([$listenerDir]); - if (empty($code)) { - $this->stdErr->writeln('Failed to get an authorization code. Please try again.'); + if (empty($response) || empty($response['code'])) { + $this->stdErr->writeln('Failed to get an authorization code.'); + $this->stdErr->writeln(''); + if (!empty($response['error']) && !empty($response['error_description'])) { + $this->stdErr->writeln(sprintf('%s (<error>%s</error>)', $response['error_description'], $response['error'])); + $this->stdErr->writeln(''); + } elseif (!empty($response['error_description'])) { + $this->stdErr->writeln($response['error_description']); + $this->stdErr->writeln(''); + } + $this->stdErr->writeln('Please try again.'); return 1; } + $code = $response['code']; + // Using the authorization code, request an access token. $this->stdErr->writeln('Login information received. Verifying...'); $token = $this->getAccessToken($code, $codeVerifier, $localUrl); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/platformsh-cli-3.52.1/src/Command/Environment/EnvironmentXdebugCommand.php new/platformsh-cli-3.52.2/src/Command/Environment/EnvironmentXdebugCommand.php --- old/platformsh-cli-3.52.1/src/Command/Environment/EnvironmentXdebugCommand.php 2020-01-29 12:29:32.000000000 +0100 +++ new/platformsh-cli-3.52.2/src/Command/Environment/EnvironmentXdebugCommand.php 2020-02-07 10:28:56.000000000 +0100 @@ -8,6 +8,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Process\Process; +use Symfony\Component\Yaml\Exception\ParseException; class EnvironmentXdebugCommand extends CommandBase { @@ -35,7 +36,11 @@ // Hide this command in the list if the project is not PHP. $projectRoot = $this->getProjectRoot(); if ($projectRoot) { - return !$this->isPhp($projectRoot); + try { + return !$this->isPhp($projectRoot); + } catch (ParseException $e) { + // Ignore configuration parsing errors. + } } return parent::isHidden(); ++++++ platformsh-cli-vendor.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/autoload.php new/vendor/autoload.php --- old/vendor/autoload.php 2020-01-29 17:30:54.542839483 +0100 +++ new/vendor/autoload.php 2020-02-10 19:15:16.886496916 +0100 @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInitcfd0c813ccdb46278216003b7e8793b7::getLoader(); +return ComposerAutoloaderInit4edc4db2821358843cedb9c56f03618e::getLoader(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/composer/autoload_real.php new/vendor/composer/autoload_real.php --- old/vendor/composer/autoload_real.php 2020-01-29 17:30:54.542839483 +0100 +++ new/vendor/composer/autoload_real.php 2020-02-10 19:15:16.886496916 +0100 @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInitcfd0c813ccdb46278216003b7e8793b7 +class ComposerAutoloaderInit4edc4db2821358843cedb9c56f03618e { private static $loader; @@ -19,15 +19,15 @@ return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInitcfd0c813ccdb46278216003b7e8793b7', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit4edc4db2821358843cedb9c56f03618e', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInitcfd0c813ccdb46278216003b7e8793b7', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit4edc4db2821358843cedb9c56f03618e', 'loadClassLoader')); $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); if ($useStaticLoader) { require_once __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInitcfd0c813ccdb46278216003b7e8793b7::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit4edc4db2821358843cedb9c56f03618e::getInitializer($loader)); } else { $map = require __DIR__ . '/autoload_namespaces.php'; foreach ($map as $namespace => $path) { @@ -48,19 +48,19 @@ $loader->register(true); if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInitcfd0c813ccdb46278216003b7e8793b7::$files; + $includeFiles = Composer\Autoload\ComposerStaticInit4edc4db2821358843cedb9c56f03618e::$files; } else { $includeFiles = require __DIR__ . '/autoload_files.php'; } foreach ($includeFiles as $fileIdentifier => $file) { - composerRequirecfd0c813ccdb46278216003b7e8793b7($fileIdentifier, $file); + composerRequire4edc4db2821358843cedb9c56f03618e($fileIdentifier, $file); } return $loader; } } -function composerRequirecfd0c813ccdb46278216003b7e8793b7($fileIdentifier, $file) +function composerRequire4edc4db2821358843cedb9c56f03618e($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { require $file; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/composer/autoload_static.php new/vendor/composer/autoload_static.php --- old/vendor/composer/autoload_static.php 2020-01-29 17:30:54.542839483 +0100 +++ new/vendor/composer/autoload_static.php 2020-02-10 19:15:16.886496916 +0100 @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInitcfd0c813ccdb46278216003b7e8793b7 +class ComposerStaticInit4edc4db2821358843cedb9c56f03618e { public static $files = array ( '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', @@ -193,9 +193,9 @@ public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInitcfd0c813ccdb46278216003b7e8793b7::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInitcfd0c813ccdb46278216003b7e8793b7::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInitcfd0c813ccdb46278216003b7e8793b7::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit4edc4db2821358843cedb9c56f03618e::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit4edc4db2821358843cedb9c56f03618e::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit4edc4db2821358843cedb9c56f03618e::$classMap; }, null, ClassLoader::class); }