Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: replaced 'access token' with 'app password' from BitbucketOptions #7362

Merged
merged 3 commits into from
Jan 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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