1
0
Fork 0

issue #11811 auth token links on separate lines (#11812)

* issue #11811 auth token links on separate lines

* 11811 - remove stray bracket

* 11811 : links on separte lines
pull/11895/head
Derek Stephen McLean 2024-02-06 16:53:18 +01:00 committed by GitHub
parent ef6c224ec2
commit ebb6a82099
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 17 additions and 6 deletions

View File

@ -143,7 +143,8 @@ class Bitbucket
$localAuthConfig = $this->config->getLocalAuthConfigSource();
$url = 'https://support.atlassian.com/bitbucket-cloud/docs/use-oauth-on-bitbucket-cloud/';
$this->io->writeError(sprintf('Follow the instructions on %s', $url));
$this->io->writeError('Follow the instructions here:');
$this->io->writeError($url);
$this->io->writeError(sprintf('to create a consumer. It will be stored in "%s" for future use by Composer.', ($localAuthConfig !== null ? $localAuthConfig->getName() . ' OR ' : '') . $this->config->getAuthConfigSource()->getName()));
$this->io->writeError('Ensure you enter a "Callback URL" (http://example.com is fine) or it will not be possible to create an Access Token (this callback url will not be used by composer)');

View File

@ -92,12 +92,14 @@ class GitHub
$note .= ' ' . date('Y-m-d Hi');
$url = 'https://'.$originUrl.'/settings/tokens/new?scopes=&description=' . str_replace('%20', '+', rawurlencode($note));
$this->io->writeError(sprintf('When working with _public_ GitHub repositories only, head to %s to retrieve a token.', $url));
$this->io->writeError('When working with _public_ GitHub repositories only, head here to retrieve a token:');
$this->io->writeError($url);
$this->io->writeError('This token will have read-only permission for public information only.');
$localAuthConfig = $this->config->getLocalAuthConfigSource();
$url = 'https://'.$originUrl.'/settings/tokens/new?scopes=repo&description=' . str_replace('%20', '+', rawurlencode($note));
$this->io->writeError(sprintf('When you need to access _private_ GitHub repositories as well, go to %s', $url));
$this->io->writeError('When you need to access _private_ GitHub repositories as well, go to:');
$this->io->writeError($url);
$this->io->writeError('Note that such tokens have broad read/write permissions on your behalf, even if not needed by Composer.');
$this->io->writeError(sprintf('Tokens will be stored in plain text in "%s" for future use by Composer.', ($localAuthConfig !== null ? $localAuthConfig->getName() . ' OR ' : '') . $this->config->getAuthConfigSource()->getName()));
$this->io->writeError('For additional information, check https://getcomposer.org/doc/articles/authentication-for-private-packages.md#github-oauth');

View File

@ -126,9 +126,16 @@ class GitLab
}
$localAuthConfig = $this->config->getLocalAuthConfigSource();
$personalAccessTokenLink = $scheme.'://'.$originUrl.'/-/profile/personal_access_tokens';
$revokeLink = $scheme.'://'.$originUrl.'/-/profile/applications';
$this->io->writeError(sprintf('A token will be created and stored in "%s", your password will never be stored', ($localAuthConfig !== null ? $localAuthConfig->getName() . ' OR ' : '') . $this->config->getAuthConfigSource()->getName()));
$this->io->writeError('To revoke access to this token you can visit '.$scheme.'://'.$originUrl.'/-/profile/applications');
$this->io->writeError('Alternatively you can setup an personal access token on '.$scheme.'://'.$originUrl.'/-/profile/personal_access_tokens and store it under "gitlab-token" see https://getcomposer.org/doc/articles/authentication-for-private-packages.md#gitlab-token for more details.');
$this->io->writeError('To revoke access to this token you can visit:');
$this->io->writeError($revokeLink);
$this->io->writeError('Alternatively you can setup an personal access token on:');
$this->io->writeError($personalAccessTokenLink);
$this->io->writeError('and store it under "gitlab-token" see https://getcomposer.org/doc/articles/authentication-for-private-packages.md#gitlab-token for more details.');
$this->io->writeError('https://getcomposer.org/doc/articles/authentication-for-private-packages.md#gitlab-token');
$this->io->writeError('for more details.');
$storeInLocalAuthConfig = false;
if ($localAuthConfig !== null) {
@ -155,7 +162,8 @@ class GitLab
$this->io->writeError('Maximum number of login attempts exceeded. Please try again later.');
}
$this->io->writeError('You can also manually create a personal access token enabling the "read_api" scope at '.$scheme.'://'.$originUrl.'/profile/personal_access_tokens');
$this->io->writeError('You can also manually create a personal access token enabling the "read_api" scope at:');
$this->io->writeError($scheme.'://'.$originUrl.'/profile/personal_access_tokens');
$this->io->writeError('Add it using "composer config --global --auth gitlab-token.'.$originUrl.' <token>"');
continue;