Skip to content

Commit

Permalink
Update BitBucket repo properties labels
Browse files Browse the repository at this point in the history
Reflect end of support for account passwords for API authentication:
change the labels for bit_basic_login and bit_basic_pwd to reference
Username ant App Password instead of login/password for basic auth.

Also adapt bit_usernname and bit_reponame to avoid confusion.

Define a new label string and a constant to display a link to generate
an App Password.

Fixes #399
  • Loading branch information
dregad committed Jul 14, 2022
1 parent 8b0ebae commit d1a64fc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
10 changes: 9 additions & 1 deletion SourceBitBucket/SourceBitBucket.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class SourceBitBucketPlugin extends MantisSourceGitBasePlugin {
*/
const URL_MAIN = "https://bitbucket.org/";
const URL_API = self::URL_MAIN . 'api/2.0/';
const URL_APP_PWD = self::URL_MAIN . 'account/settings/app-passwords/';

public $type = 'bb';

Expand Down Expand Up @@ -148,7 +149,14 @@ public function update_repo_form( $p_repo ) {
<tr>
<th class="category">
<label for="bit_basic_pwd">
<?php echo plugin_lang_get( 'bit_basic_pwd' ) ?>
<?php
echo plugin_lang_get( 'bit_basic_pwd' );
echo '<br>';
/** @noinspection HtmlUnknownTarget */
printf( '<span class="small">' . plugin_lang_get( 'generate_app_pwd' ) . '</span>',
sprintf( '<a href="%1$s" target="_blank">%1$s</a>', self::URL_APP_PWD )
);
?>
</label>
</th>
<td>
Expand Down
11 changes: 6 additions & 5 deletions SourceBitBucket/lang/strings_english.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ $s_plugin_SourceBitBucket_bitbucket = 'BitBucket';
$s_plugin_SourceBitBucket_title = 'Source BitBucket Integration';
$s_plugin_SourceBitBucket_description = 'Adds BitBucket integration to the Source Integration framework.';

$s_plugin_SourceBitBucket_bit_basic_login = 'BitBucket login (for basic auth)';
$s_plugin_SourceBitBucket_bit_basic_pwd = 'BitBucket password (for basic auth)';
$s_plugin_SourceBitBucket_bit_username = 'BitBucket Username/Teamname';
$s_plugin_SourceBitBucket_bit_reponame = 'BitBucket Repository Name<br/><span class="small">(no spaces; must match the name as received from the webservice\'s payload)</span>';
$s_plugin_SourceBitBucket_master_branch = 'Primary Branches<br/><span class="small">(comma-separated list, * imports all branches)</span>';
$s_plugin_SourceBitBucket_bit_basic_login = 'BitBucket Username (for REST API access)<br><span class="small">This is the Id, NOT the e-mail address</span>';
$s_plugin_SourceBitBucket_bit_basic_pwd = 'BitBucket App Password';
$s_plugin_SourceBitBucket_generate_app_pwd = 'Generate one at %1$s';
$s_plugin_SourceBitBucket_bit_username = 'BitBucket Repository Owner<br><span class="small">Username or Team name</span>';
$s_plugin_SourceBitBucket_bit_reponame = 'BitBucket Repository Name<br><span class="small">(no spaces; must match the name as received from the webservice\'s payload)</span>';
$s_plugin_SourceBitBucket_master_branch = 'Primary Branches<br><span class="small">(comma-separated list, * imports all branches)</span>';

$s_plugin_SourceBitBucket_repo_authorized = '<p>MantisBT is now authorized to access this BitBucket repository.</p>';
$s_plugin_SourceBitBucket_repo_authorization_failed = 'Sorry, MantisBT could not be authorized to access this BitBucket repository.';
Expand Down

0 comments on commit d1a64fc

Please sign in to comment.