Skip to content

Commit 7788d6b

Browse files
CopilotNoahCardoza
andcommitted
Update BitBucket integration to use API tokens instead of app passwords
Co-authored-by: NoahCardoza <10343470+NoahCardoza@users.noreply.github.com>
1 parent 23e1c27 commit 7788d6b

4 files changed

Lines changed: 21 additions & 18 deletions

File tree

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ Choose which platform hosts your pull requests and code reviews.
402402
| **Provider** | **Setup** | **Notes** |
403403
|--------------|-----------|-----------|
404404
| **GitHub** | `gh auth login` | Default. Integrated with GitHub Issues. |
405-
| **BitBucket** | Configure in `.iloom/settings.json` | Atlassian Cloud. Requires app password. See [BitBucket Setup](#bitbucket-setup) below. |
405+
| **BitBucket** | Configure in `.iloom/settings.json` | Atlassian Cloud. Requires API token. See [BitBucket Setup](#bitbucket-setup) below. |
406406

407407
### Jira Setup
408408

@@ -476,21 +476,21 @@ To use BitBucket for pull requests, add this configuration:
476476
{
477477
"versionControl": {
478478
"bitbucket": {
479-
"appPassword": "your-bitbucket-app-password"
479+
"apiToken": "your-bitbucket-api-token"
480480
}
481481
}
482482
}
483483
```
484484

485-
**Generate a BitBucket App Password:**
485+
**Generate a BitBucket API Token:**
486486
1. Visit https://bitbucket.org/account/settings/app-passwords/
487-
2. Click "Create app password"
487+
2. Click "Create API token" (Note: App passwords were deprecated September 2025)
488488
3. Grant permissions: `repository:read`, `repository:write`, `pullrequest:read`, `pullrequest:write`
489-
4. Copy the password to `.iloom/settings.local.json`
489+
4. Copy the token to `.iloom/settings.local.json`
490490

491491
**Configuration Options:**
492492
- `username`: Your BitBucket username
493-
- `appPassword`: App password (store in settings.local.json only!)
493+
- `apiToken`: API token (store in settings.local.json only!)
494494
- `workspace`: (Optional) BitBucket workspace, auto-detected from git remote if not provided
495495
- `repoSlug`: (Optional) Repository slug, auto-detected from git remote if not provided
496496

@@ -531,7 +531,7 @@ Use Jira for issues and BitBucket for pull requests:
531531
},
532532
"versionControl": {
533533
"bitbucket": {
534-
"appPassword": "your-bitbucket-app-password"
534+
"apiToken": "your-bitbucket-api-token"
535535
}
536536
}
537537
}

src/lib/SettingsManager.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -379,10 +379,10 @@ export const IloomSettingsSchema = z.object({
379379
.string()
380380
.min(1, 'BitBucket username cannot be empty')
381381
.describe('BitBucket username'),
382-
appPassword: z
382+
apiToken: z
383383
.string()
384384
.optional()
385-
.describe('BitBucket app password. SECURITY: Store in settings.local.json only, never commit to source control. Generate at: https://bitbucket.org/account/settings/app-passwords/'),
385+
.describe('BitBucket API token. SECURITY: Store in settings.local.json only, never commit to source control. Generate at: https://bitbucket.org/account/settings/app-passwords/ (Note: App passwords deprecated Sep 2025, use API tokens)'),
386386
workspace: z
387387
.string()
388388
.optional()
@@ -608,10 +608,10 @@ export const IloomSettingsSchemaNoDefaults = z.object({
608608
.string()
609609
.min(1, 'BitBucket username cannot be empty')
610610
.describe('BitBucket username'),
611-
appPassword: z
611+
apiToken: z
612612
.string()
613613
.optional()
614-
.describe('BitBucket app password. SECURITY: Store in settings.local.json only, never commit to source control. Generate at: https://bitbucket.org/account/settings/app-passwords/'),
614+
.describe('BitBucket API token. SECURITY: Store in settings.local.json only, never commit to source control. Generate at: https://bitbucket.org/account/settings/app-passwords/ (Note: App passwords deprecated Sep 2025, use API tokens)'),
615615
workspace: z
616616
.string()
617617
.optional()

src/lib/VCSProviderFactory.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ export class VCSProviderFactory {
4545
if (!bbSettings?.username) {
4646
throw new Error('BitBucket username is required. Configure versionControl.bitbucket.username in .iloom/settings.json')
4747
}
48-
if (!bbSettings?.appPassword) {
49-
throw new Error('BitBucket app password is required. Configure versionControl.bitbucket.appPassword in .iloom/settings.local.json')
48+
if (!bbSettings?.apiToken) {
49+
throw new Error('BitBucket API token is required. Configure versionControl.bitbucket.apiToken in .iloom/settings.local.json')
5050
}
5151

5252
const bbConfig: BitBucketVCSConfig = {
5353
username: bbSettings.username,
54-
appPassword: bbSettings.appPassword,
54+
apiToken: bbSettings.apiToken,
5555
}
5656

5757
if (bbSettings.workspace) {

src/lib/providers/bitbucket/BitBucketApiClient.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { getLogger } from '../../../utils/logger-context.js'
99
*/
1010
export interface BitBucketConfig {
1111
username: string
12-
appPassword: string // App password from BitBucket settings
12+
apiToken: string // API token from BitBucket settings
1313
workspace?: string // Optional, can be auto-detected from git remote
1414
repoSlug?: string // Optional, can be auto-detected from git remote
1515
}
@@ -67,8 +67,11 @@ export interface BitBucketRepository {
6767
/**
6868
* BitBucketApiClient provides low-level REST API access to BitBucket
6969
*
70-
* Authentication: Basic Auth with username and app password
70+
* Authentication: Basic Auth with username and API token
7171
* API Reference: https://developer.atlassian.com/cloud/bitbucket/rest/intro/
72+
*
73+
* Note: As of September 9, 2025, BitBucket app passwords can no longer be created.
74+
* Use API tokens with scopes instead. All existing app passwords will be disabled on June 9, 2026.
7275
*/
7376
export class BitBucketApiClient {
7477
private readonly baseUrl = 'https://api.bitbucket.org/2.0'
@@ -77,8 +80,8 @@ export class BitBucketApiClient {
7780
private readonly repoSlug: string | undefined
7881

7982
constructor(config: BitBucketConfig) {
80-
// Create Basic Auth header
81-
const credentials = Buffer.from(`${config.username}:${config.appPassword}`).toString('base64')
83+
// Create Basic Auth header with API token
84+
const credentials = Buffer.from(`${config.username}:${config.apiToken}`).toString('base64')
8285
this.authHeader = `Basic ${credentials}`
8386

8487
this.workspace = config.workspace

0 commit comments

Comments
 (0)