forked from eclipse-che/che-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add documentation pages for the Bitbucket SAAS OAuth flow
Signed-off-by: Igor Vinokur <ivinokur@redhat.com>
- Loading branch information
Showing
5 changed files
with
129 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
modules/administration-guide/pages/configuring-oauth-2-for-bitbucket.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
:_content-type: ASSEMBLY | ||
:description: Configuring OAuth 2.0 for Bitbucket | ||
:keywords: configuring-oauth, authorization, bitbucket, oauth-2, oauth-2.0 | ||
:navtitle: Configuring OAuth 2.0 for Bitbucket | ||
// :page-aliases: | ||
|
||
[id="configuring-oauth-2-for-bitbucket{context}"] | ||
= Configuring OAuth 2.0 for Bitbucket SAAS | ||
|
||
To enable users to work with a remote Git repository that is hosted using a Bitbucket instance: | ||
|
||
. Set up the Bitbucket OAuth consumer (OAuth 2.0). | ||
. Apply the Bitbucket OAuth consumer Secret. | ||
|
||
include::partial$proc_setting-up-the-bitbucket-saas-oauth-consumer.adoc[leveloffset=+1] | ||
|
||
include::partial$proc_applying-the-bitbucket-saas-oauth-consumer-secret.adoc[leveloffset=+1] |
9 changes: 5 additions & 4 deletions
9
modules/administration-guide/pages/oauth-for-github-gitlab-or-bitbucket.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
:_content-type: CONCEPT | ||
:description: OAuth for GitHub, GitLab, or Bitbucket | ||
:description: OAuth for GitHub, GitLab, Bitbucket or Bitbucket SAAS | ||
:keywords: bitbucket | ||
:navtitle: OAuth for GitHub, GitLab, or Bitbucket | ||
:navtitle: OAuth for GitHub, GitLab, Bitbucket or Bitbucket SAAS | ||
// :page-aliases: | ||
|
||
[id="oauth-for-github-gitlab-or-bitbucket_{context}"] | ||
= OAuth for GitHub, GitLab, or Bitbucket | ||
= OAuth for GitHub, GitLab, Bitbucket or Bitbucket SAAS | ||
|
||
To enable users to work with remote Git repositories: | ||
|
||
* xref:configuring-oauth-2-for-github.adoc[] | ||
* xref:configuring-oauth-2-for-gitlab.adoc[] | ||
* Configuring xref:configuring-oauth-1-for-a-bitbucket-server.adoc[OAuth 1.0 for a Bitbucket Server] or xref:configuring-oauth-2-for-the-bitbucket-cloud.adoc[OAuth 2.0 for the Bitbucket Cloud] | ||
* xref:configuring-oauth-1-for-bitbucket.adoc[] | ||
* xref:configuring-oauth-2-for-bitbucket.adoc[] |
56 changes: 56 additions & 0 deletions
56
...tion-guide/partials/proc_applying-the-bitbucket-saas-oauth-consumer-secret.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
:_content-type: PROCEDURE | ||
:description: Applying the Bitbucket OAuth consumer Secret | ||
:keywords: bitbucket, apply, secret, bitbucket-consumer, bitbucket-client-secret | ||
:navtitle: Applying the Bitbucket OAuth consumer Secret | ||
// :page-aliases: | ||
|
||
[id="applying-the-bitbucket-oauth-consumer-secret_{context}"] | ||
= Applying the Bitbucket OAuth consumer Secret | ||
|
||
Prepare and apply the Bitbucket OAuth consumer Secret. | ||
|
||
.Prerequisites | ||
|
||
* Setting up the Bitbucket OAuth consumer is completed. | ||
|
||
* The Base64-encoded values, which were generated when setting up the Bitbucket OAuth consumer, are prepared: | ||
** *Bitbucket OAuth consumer Key* | ||
** *Bitbucket OAuth consumer Secret* | ||
|
||
* An active `{orch-cli}` session with administrative permissions to the destination {orch-name} cluster. See {orch-cli-link}. | ||
|
||
.Procedure | ||
|
||
. Prepare the Secret: | ||
+ | ||
[source,yaml,subs="+quotes,+attributes,+macros"] | ||
---- | ||
kind: Secret | ||
apiVersion: v1 | ||
metadata: | ||
name: bitbucket-oauth-config | ||
namespace: {prod-namespace} <1> | ||
labels: | ||
app.kubernetes.io/part-of: che.eclipse.org | ||
app.kubernetes.io/component: oauth-scm-configuration | ||
annotations: | ||
che.eclipse.org/oauth-scm-server: bitbucket | ||
type: Opaque | ||
data: | ||
id: __<Base64_Bitbucket_Oauth_Consumer_Key>__ <2> | ||
secret: __<Base64_Bitbucket_Oauth_Consumer_Secret>__ <3> | ||
---- | ||
<1> The {prod-short} namespace. The default is `{prod-namespace}`. | ||
<2> The Base64-encoded *Bitbucket OAuth consumer Key*. | ||
<3> The Base64-encoded *Bitbucket OAuth consumer Secret*. | ||
|
||
. Apply the Secret: | ||
+ | ||
[subs="+quotes,+attributes,+macros"] | ||
---- | ||
$ {orch-cli} apply -f - <<EOF | ||
__<Secret_prepared_in_the_previous_step>__ | ||
EOF | ||
---- | ||
|
||
. Verify in the output that the Secret is created. |
49 changes: 49 additions & 0 deletions
49
...istration-guide/partials/proc_setting-up-the-bitbucket-saas-oauth-consumer.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
:_content-type: PROCEDURE | ||
:description: Setting up the Bitbucket OAuth consumer | ||
:keywords: bitbucket, bitbucket-application, bitbucket-oauth-consumer, oauth-application | ||
:navtitle: Setting up the Bitbucket OAuth consumer | ||
// :page-aliases: | ||
|
||
[id="setting-up-the-bitbucket-saas-oauth-consumer_{context}"] | ||
= Setting up the Bitbucket OAuth consumer | ||
|
||
Set up a Bitbucket OAuth consumer using OAuth 2.0. | ||
|
||
.Prerequisites | ||
|
||
* You are logged in to Bitbucket. | ||
* link:https://www.gnu.org/software/coreutils/base64[`base64`] is installed in the operating system you are using. | ||
|
||
.Procedure | ||
|
||
. Click your avatar and go to *All workspaces* page. | ||
|
||
. Select a workspace and click it. | ||
|
||
. Go to menu:Settings[OAuth consumers] and click *Add consumer*. | ||
|
||
. Enter *{prod-short}* as the *Name*. | ||
|
||
. Enter `pass:c,a,q[{prod-url}]/api/oauth/callback` as the *Callback URL*. | ||
|
||
. Under *Permissions*, check all of the `Account` and `Repositories` checkboxes. | ||
|
||
. Click *Save*. | ||
|
||
. Expand the added consumer, copy the *Key* value and encode it to Base64 for use when applying the Bitbucket OAuth consumer Secret: | ||
+ | ||
[subs="+quotes,+attributes,+macros"] | ||
---- | ||
$ echo -n '__<bitbucket_oauth_consumer_key>__' | base64 | ||
---- | ||
|
||
. Copy the *Secret* value and encode it to Base64 for use when applying the Bitbucket OAuth consumer Secret: | ||
+ | ||
[subs="+quotes,+attributes,+macros"] | ||
---- | ||
$ echo -n '__<bitbucket_oauth_consumer_secret>__' | base64 | ||
---- | ||
|
||
.Additional resources | ||
|
||
* link:https://support.atlassian.com/bitbucket-cloud/docs/use-oauth-on-bitbucket-cloud[Bitbucket Docs: Use OAuth on Bitbucket Cloud] |