Skip to content

Commit

Permalink
docs: replaced 'access token' with 'app password' instructions for Bi…
Browse files Browse the repository at this point in the history
…tbucketOptions (#7362)
  • Loading branch information
onucsecu2 authored Jan 11, 2023
1 parent 45d2921 commit 93930cf
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
7 changes: 7 additions & 0 deletions .changeset/old-shrimps-drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"app-builder-lib": patch
"builder-util-runtime": patch
"builder-util": patch
---

docs: replaced 'access token' with 'app password' from BitbucketOptions
6 changes: 3 additions & 3 deletions docs/configuration/publish.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,15 @@ Define <code>KEYGEN_TOKEN</code> environment variable.</p>
<a href="https://bitbucket.org/">https://bitbucket.org/</a>
Define <code>BITBUCKET_TOKEN</code> environment variable.</p>
<p>For converting an app password to a usable token, you can utilize this</p>
<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>) {
<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>)
<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>) {
<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>)
<span class="hljs-keyword">return</span> <span class="hljs-string">`Basic <span class="hljs-subst">${base64encodedData}</span>`</span>
}
</code></pre>
<ul>
<li><strong><code id="BitbucketOptions-provider">provider</code></strong> “bitbucket” - The provider. Must be <code>bitbucket</code>.</li>
<li><strong><code id="BitbucketOptions-owner">owner</code></strong> String - Repository owner</li>
<li><code id="BitbucketOptions-token">token</code> String | “undefined” - The access token to support auto-update from private bitbucket repositories.</li>
<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>
<li><code id="BitbucketOptions-username">username</code> String | “undefined” - The user name to support auto-update from private bitbucket repositories.</li>
<li><strong><code id="BitbucketOptions-slug">slug</code></strong> String - Repository slug/name</li>
<li><code id="BitbucketOptions-channel">channel</code> = <code>latest</code> String | “undefined” - The channel.</li>
Expand Down
4 changes: 2 additions & 2 deletions packages/app-builder-lib/scheme.json
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@
},
"BitbucketOptions": {
"additionalProperties": false,
"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```",
"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```",
"properties": {
"channel": {
"default": "latest",
Expand Down Expand Up @@ -390,7 +390,7 @@
]
},
"token": {
"description": "The access token to support auto-update from private bitbucket repositories.",
"description": "The app password (account>>settings>app-passwords) to support auto-update from private bitbucket repositories.",
"type": [
"null",
"string"
Expand Down
6 changes: 3 additions & 3 deletions packages/builder-util-runtime/src/publishOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ export interface KeygenOptions extends PublishConfiguration {
*
* For converting an app password to a usable token, you can utilize this
```typescript
convertAppPassword(owner: string, token: string) {
const base64encodedData = Buffer.from(`${owner}:${token.trim()}`).toString("base64")
convertAppPassword(owner: string, appPassword: string) {
const base64encodedData = Buffer.from(`${owner}:${appPassword.trim()}`).toString("base64")
return `Basic ${base64encodedData}`
}
```
Expand All @@ -226,7 +226,7 @@ export interface BitbucketOptions extends PublishConfiguration {
readonly owner: string

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

Expand Down

0 comments on commit 93930cf

Please sign in to comment.