Skip to content

Commit 93930cf

Browse files
authored
docs: replaced 'access token' with 'app password' instructions for BitbucketOptions (#7362)
1 parent 45d2921 commit 93930cf

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

.changeset/old-shrimps-drive.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"app-builder-lib": patch
3+
"builder-util-runtime": patch
4+
"builder-util": patch
5+
---
6+
7+
docs: replaced 'access token' with 'app password' from BitbucketOptions

docs/configuration/publish.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -246,15 +246,15 @@ Define <code>KEYGEN_TOKEN</code> environment variable.</p>
246246
<a href="https://bitbucket.org/">https://bitbucket.org/</a>
247247
Define <code>BITBUCKET_TOKEN</code> environment variable.</p>
248248
<p>For converting an app password to a usable token, you can utilize this</p>
249-
<pre><code class="hljs language-typescript"><span class="hljs-title function_">convertAppPassword</span>(<span class="hljs-params">owner: <span class="hljs-built_in">string</span>, token: <span class="hljs-built_in">string</span></span>) {
250-
<span class="hljs-keyword">const</span> base64encodedData = <span class="hljs-title class_">Buffer</span>.<span class="hljs-title function_">from</span>(<span class="hljs-string">`<span class="hljs-subst">${owner}</span>:<span class="hljs-subst">${token.trim()}</span>`</span>).<span class="hljs-title function_">toString</span>(<span class="hljs-string">&quot;base64&quot;</span>)
249+
<pre><code class="hljs language-typescript"><span class="hljs-title function_">convertAppPassword</span>(<span class="hljs-params">owner: <span class="hljs-built_in">string</span>, appPassword: <span class="hljs-built_in">string</span></span>) {
250+
<span class="hljs-keyword">const</span> base64encodedData = <span class="hljs-title class_">Buffer</span>.<span class="hljs-title function_">from</span>(<span class="hljs-string">`<span class="hljs-subst">${owner}</span>:<span class="hljs-subst">${appPassword.trim()}</span>`</span>).<span class="hljs-title function_">toString</span>(<span class="hljs-string">&quot;base64&quot;</span>)
251251
<span class="hljs-keyword">return</span> <span class="hljs-string">`Basic <span class="hljs-subst">${base64encodedData}</span>`</span>
252252
}
253253
</code></pre>
254254
<ul>
255255
<li><strong><code id="BitbucketOptions-provider">provider</code></strong> “bitbucket” - The provider. Must be <code>bitbucket</code>.</li>
256256
<li><strong><code id="BitbucketOptions-owner">owner</code></strong> String - Repository owner</li>
257-
<li><code id="BitbucketOptions-token">token</code> String | “undefined” - The access token to support auto-update from private bitbucket repositories.</li>
257+
<li><code id="BitbucketOptions-token">token</code> String | “undefined” - The app password (account&gt;settings&gt;app-passwords) to support auto-update from private bitbucket repositories.</li>
258258
<li><code id="BitbucketOptions-username">username</code> String | “undefined” - The user name to support auto-update from private bitbucket repositories.</li>
259259
<li><strong><code id="BitbucketOptions-slug">slug</code></strong> String - Repository slug/name</li>
260260
<li><code id="BitbucketOptions-channel">channel</code> = <code>latest</code> String | “undefined” - The channel.</li>

packages/app-builder-lib/scheme.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@
334334
},
335335
"BitbucketOptions": {
336336
"additionalProperties": false,
337-
"description": "Bitbucket options.\nhttps://bitbucket.org/\nDefine `BITBUCKET_TOKEN` environment variable.\n\nFor converting an app password to a usable token, you can utilize this\n```typescript\nconvertAppPassword(owner: string, token: string) {\nconst base64encodedData = Buffer.from(`${owner}:${token.trim()}`).toString(\"base64\")\nreturn `Basic ${base64encodedData}`\n}\n```",
337+
"description": "Bitbucket options.\nhttps://bitbucket.org/\nDefine `BITBUCKET_TOKEN` environment variable.\n\nFor converting an app password to a usable token, you can utilize this\n```typescript\nconvertAppPassword(owner: string, appPassword: string) {\nconst base64encodedData = Buffer.from(`${owner}:${appPassword.trim()}`).toString(\"base64\")\nreturn `Basic ${base64encodedData}`\n}\n```",
338338
"properties": {
339339
"channel": {
340340
"default": "latest",
@@ -390,7 +390,7 @@
390390
]
391391
},
392392
"token": {
393-
"description": "The access token to support auto-update from private bitbucket repositories.",
393+
"description": "The app password (account>>settings>app-passwords) to support auto-update from private bitbucket repositories.",
394394
"type": [
395395
"null",
396396
"string"

packages/builder-util-runtime/src/publishOptions.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ export interface KeygenOptions extends PublishConfiguration {
208208
*
209209
* For converting an app password to a usable token, you can utilize this
210210
```typescript
211-
convertAppPassword(owner: string, token: string) {
212-
const base64encodedData = Buffer.from(`${owner}:${token.trim()}`).toString("base64")
211+
convertAppPassword(owner: string, appPassword: string) {
212+
const base64encodedData = Buffer.from(`${owner}:${appPassword.trim()}`).toString("base64")
213213
return `Basic ${base64encodedData}`
214214
}
215215
```
@@ -226,7 +226,7 @@ export interface BitbucketOptions extends PublishConfiguration {
226226
readonly owner: string
227227

228228
/**
229-
* The access token to support auto-update from private bitbucket repositories.
229+
* The app password (account>settings>app-passwords) to support auto-update from private bitbucket repositories.
230230
*/
231231
readonly token?: string | null
232232

0 commit comments

Comments
 (0)