Skip to content

Commit

Permalink
chore: Avoid Base64 encoding steps in documentation
Browse files Browse the repository at this point in the history
Signed-off-by: Anatolii Bazko <[email protected]>
  • Loading branch information
tolusha committed Nov 20, 2023
1 parent 3617a93 commit 2c760dd
Show file tree
Hide file tree
Showing 24 changed files with 86 additions and 179 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,6 @@ Prepare and apply the application link Secret for the Bitbucket Server.

.Procedure

. Encode the content of the `bitbucket-consumer-key` file to Base64:
+
[subs="+quotes,+attributes,+macros"]
----
$ echo -n '__<bitbucket-consumer-key file content>__' | base64
----

. Encode the content of the `bitbucket-shared-secret` file to Base64:
+
[subs="+quotes,+attributes,+macros"]
----
$ echo -n '__<bitbucket-shared-secret file content>__' | base64
----

. Prepare the Secret:
+
[source,yaml,subs="+quotes,+attributes,+macros"]
Expand All @@ -52,16 +38,16 @@ metadata:
che.eclipse.org/oauth-scm-server: bitbucket
che.eclipse.org/scm-server-endpoint: __<bitbucket_server_url>__ <2>
type: Opaque
data:
private.key: __<Base64_content_of_privatepkcs8-stripped.pem>__ <3>
consumer.key: __<Base64_content_of_bitbucket-consumer-key>__ <4>
shared_secret: __<Base64_content_of_bitbucket-shared-secret>__ <5>
stringData:
private.key: __<Content_of_privatepkcs8-stripped.pem>__ <3>
consumer.key: __<Content_of_bitbucket-consumer-key>__ <4>
shared_secret: __<Content_of_bitbucket-shared-secret>__ <5>
----
<1> The {prod-short} namespace. The default is `{prod-namespace}`.
<2> The URL of the Bitbucket Server.
<3> The content of the `privatepkcs8-stripped.pem` file, which was Base64-encoded when the file was generated.
<4> The content of the `bitbucket-consumer-key` file that you manually encoded to Base64 in step 1.
<5> The content of the `bitbucket-shared-secret` file that you manually encoded to Base64 in step 2.
<3> The content of the `privatepkcs8-stripped.pem` file.
<4> The content of the `bitbucket-consumer-key` file.
<5> The content of the `bitbucket-shared-secret` file.

. Apply the Secret:
+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Prepare and apply the OAuth 2.0 application link Secret for the Bitbucket Server

* The application link is set up on the Bitbucket Server.

* The Base64-encoded values, which were generated when setting up the Bitbucket application link, are prepared:
* The following values, which were generated when setting up the Bitbucket application link, are prepared:
** Bitbucket *Client ID*
** Bitbucket *Client secret*

Expand All @@ -37,14 +37,14 @@ metadata:
che.eclipse.org/oauth-scm-server: bitbucket
che.eclipse.org/scm-server-endpoint: __<bitbucket_server_url>__ <2>
type: Opaque
data:
id: __<Base64_Bitbucket_Client_ID>__ <3>
secret: __<Base64_Bitbucket_Client_Secret>__ <4>
stringData:
id: __<Bitbucket_Client_ID>__ <3>
secret: __<Bitbucket_Client_Secret>__ <4>
----
<1> The {prod-short} namespace. The default is `{prod-namespace}`.
<2> The URL of the Bitbucket Server.
<3> The Base64-encoded Bitbucket *Client ID*.
<4> The Base64-encoded Bitbucket *Client secret*.
<3> The Bitbucket *Client ID*.
<4> The Bitbucket *Client secret*.

. Apply the Secret:
+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Prepare and apply an OAuth consumer Secret for the Bitbucket Cloud.

* The OAuth consumer is set up in the Bitbucket Cloud.

* The Base64-encoded values, which were generated when setting up the Bitbucket OAuth consumer, are prepared:
* The following values, which were generated when setting up the Bitbucket OAuth consumer, are prepared:
** Bitbucket OAuth consumer Key
** Bitbucket OAuth consumer Secret

Expand All @@ -36,13 +36,13 @@ metadata:
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>
stringData:
id: __<Bitbucket_Oauth_Consumer_Key>__ <2>
secret: __<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*.
<2> The *Bitbucket OAuth consumer Key*.
<3> The *Bitbucket OAuth consumer Secret*.

. Apply the Secret:
+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Prepare and apply the GitHub OAuth App Secret.

* Setting up the GitHub OAuth App is completed.

* The Base64-encoded values, which were generated when setting up the GitHub OAuth App, are prepared:
* The following values, which were generated when setting up the GitHub OAuth App, are prepared:
** *GitHub OAuth Client ID*
** *GitHub OAuth Client Secret*

Expand All @@ -38,15 +38,15 @@ metadata:
che.eclipse.org/scm-server-endpoint: __<github_server_url>__ <2>
che.eclipse.org/scm-github-disable-subdomain-isolation: "__<true_or_false>__" <3>
type: Opaque
data:
id: __<Base64_GitHub_OAuth_Client_ID>__ <4>
secret: __<Base64_GitHub_OAuth_Client_Secret>__ <5>
stringData:
id: __<GitHub_OAuth_Client_ID>__ <4>
secret: __<GitHub_OAuth_Client_Secret>__ <5>
----
<1> The {prod-short} namespace. The default is `{prod-namespace}`.
<2> This depends on the GitHub product your organization is using: When hosting repositories on GitHub.com or GitHub Enterprise Cloud, omit this line or enter the default `https://github.com`. When hosting repositories on GitHub Enterprise Server, enter the GitHub Enterprise Server URL.
<3> This line is only added for GitHub Enterprise Server. To disable subdomain isolation, set this to `"true"`. To enable subdomain isolation, set this to `"false"`.
<4> The Base64-encoded *GitHub OAuth Client ID*.
<5> The Base64-encoded *GitHub OAuth Client Secret*.
<4> The *GitHub OAuth Client ID*.
<5> The *GitHub OAuth Client Secret*.

. Apply the Secret:
+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Prepare and apply the GitLab-authorized application Secret.

* Setting up the GitLab authorized application is completed.

* The Base64-encoded values, which were generated when setting up the GitLab authorized application, are prepared:
* The following values, which were generated when setting up the GitLab authorized application, are prepared:
** *GitLab Application ID*
** *GitLab Client Secret*

Expand All @@ -37,14 +37,14 @@ metadata:
che.eclipse.org/oauth-scm-server: gitlab
che.eclipse.org/scm-server-endpoint: __<gitlab_server_url>__ <2>
type: Opaque
data:
id: __<Base64_GitLab_Application_ID>__ <3>
secret: __<Base64_GitLab_Client_Secret>__ <4>
stringData:
id: __<GitLab_Application_ID>__ <3>
secret: __<GitLab_Client_Secret>__ <4>
----
<1> The {prod-short} namespace. The default is `{prod-namespace}`.
<2> The *GitLab server URL*. Use `https://gitlab.com` for the `SAAS` version.
<3> The Base64-encoded *GitLab Application ID*.
<4> The Base64-encoded *GitLab Client Secret*.
<3> The *GitLab Application ID*.
<4> The *GitLab Client Secret*.

. Apply the Secret:
+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Prepare and apply the Microsoft Azure DevOps Services Secret.

* Setting up the Microsoft Azure DevOps Services OAuth App is completed.

* The Base64-encoded values, which were generated when setting up the Microsoft Azure DevOps Services OAuth App, are prepared:
* The following values, which were generated when setting up the Microsoft Azure DevOps Services OAuth App, are prepared:
** *App ID*
** *Client Secret*

Expand All @@ -36,13 +36,13 @@ metadata:
annotations:
che.eclipse.org/oauth-scm-server: azure-devops
type: Opaque
data:
id: __<Base64_Microsoft_Azure_DevOps_Services_OAuth_App_ID>__# <2>
secret: __<Base64_Microsoft_Azure_DevOps_Services_OAuth_Client_Secret>__# <3>
stringData:
id: __<Microsoft_Azure_DevOps_Services_OAuth_App_ID>__# <2>
secret: __<Microsoft_Azure_DevOps_Services_OAuth_Client_Secret>__# <3>
----
<1> The {prod-short} namespace. The default is `{prod-namespace}`.
<2> The Base64-encoded Microsoft Azure DevOps Services OAuth *App ID*.
<3> The Base64-encoded Microsoft Azure DevOps Services OAuth *Client Secret*.
<2> The Microsoft Azure DevOps Services OAuth *App ID*.
<3> The Microsoft Azure DevOps Services OAuth *Client Secret*.

. Apply the Secret:
+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ metadata:
annotations:
che.eclipse.org/mount-as: file
che.eclipse.org/mount-path: /data
data:
ca.crt: __<base64 encoded data content here>__
stringData:
ca.crt: >-
__<data_content_here>__
----
or
[source,yaml,subs="+quotes,attributes"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ metadata:
che.eclipse.org/otherkey_env-name: OTHER_ENV
labels:
...
data:
mykey: __<base64 encoded data content here>__
otherkey: __<base64 encoded data content here>__
stringData:
mykey: __<data_content_here>__
otherkey: __<data_content_here>__
----
or
[source,yaml]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Set up an application link for OAuth 1.0 on the Bitbucket Server.

* You are logged in to the Bitbucket Server.
* link:https://www.openssl.org/[`openssl`] is installed in the operating system you are using.
* link:https://www.gnu.org/software/coreutils/base64[`base64`] is installed in the operating system you are using.

.Procedure

Expand All @@ -23,7 +22,7 @@ Set up an application link for OAuth 1.0 on the Bitbucket Server.
----
$ openssl genrsa -out private.pem 2048 && \
openssl pkcs8 -topk8 -inform pem -outform pem -nocrypt -in private.pem -out privatepkcs8.pem && \
cat privatepkcs8.pem | sed 's/-----BEGIN PRIVATE KEY-----//g' | sed 's/-----END PRIVATE KEY-----//g' | tr -d '\n' | base64 | tr -d '\n' > privatepkcs8-stripped.pem && \
cat privatepkcs8.pem | sed 's/-----BEGIN PRIVATE KEY-----//g' | sed 's/-----END PRIVATE KEY-----//g' | tr -d '\n' > privatepkcs8-stripped.pem && \
openssl rsa -in private.pem -pubout > public.pub && \
cat public.pub | sed 's/-----BEGIN PUBLIC KEY-----//g' | sed 's/-----END PUBLIC KEY-----//g' | tr -d '\n' > public-stripped.pub && \
openssl rand -base64 24 > bitbucket-consumer-key && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Set up an OAuth 2.0 application link on the Bitbucket Server.
.Prerequisites

* You are logged in to the Bitbucket Server.
* link:https://www.gnu.org/software/coreutils/base64[`base64`] is installed in the operating system you are using.

.Procedure

Expand All @@ -22,19 +21,8 @@ Set up an OAuth 2.0 application link on the Bitbucket Server.
. Enter `pass:c,a,q[{prod-url}]/api/oauth/callback` to the *Redirect URL* field.
. Select the *Admin - Write* checkbox in *Application permissions*.
. Click *Save*.
. Copy the *Client ID* and encode it to Base64 for use when applying the Bitbucket application link Secret:
+
[subs="+quotes,+attributes,+macros"]
----
$ echo -n '__<Bitbucket_Client_ID>__' | base64
----

. Copy the *Client secret* and encode it to Base64 for use when applying the Bitbucket application link Secret:
+
[subs="+quotes,+attributes,+macros"]
----
$ echo -n '__<Bitbucket_Client_secret>__' | base64
----
. Copy and save the *Client ID* for use when applying the Bitbucket application link Secret.
. Copy and save the *Client secret* for use when applying the Bitbucket application link Secret.

.Additional resources

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Set up an OAuth consumer for OAuth 2.0 in the Bitbucket Cloud.
.Prerequisites

* You are logged in to the Bitbucket Cloud.
* link:https://www.gnu.org/software/coreutils/base64[`base64`] is installed in the operating system you are using.

.Procedure

Expand All @@ -28,19 +27,9 @@ Set up an OAuth consumer for OAuth 2.0 in the Bitbucket Cloud.

. Under *Permissions*, check all of the *Account* and *Repositories* checkboxes, and click *Save*.

. Expand the added consumer and then 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
----
. Expand the added consumer and then copy and save the *Key* value for use when applying the Bitbucket OAuth consumer Secret:

. Copy and save the *Secret* value for use when applying the Bitbucket OAuth consumer Secret.

.Additional resources

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Set up a GitHub OAuth App using OAuth 2.0.
.Prerequisites

* You are logged in to GitHub.
* link:https://www.gnu.org/software/coreutils/base64[`base64`] is installed in the operating system you are using.

.Procedure

Expand All @@ -29,19 +28,9 @@ Set up a GitHub OAuth App using OAuth 2.0.

. Click *Generate new client secret*.

. Copy the *GitHub OAuth Client ID* and encode it to Base64 for use when applying the GitHub OAuth App Secret:
+
[subs="+quotes,+attributes,+macros"]
----
$ echo -n '__<github_oauth_client_id>__' | base64
----

. Copy the *GitHub OAuth Client Secret* and encode it to Base64 for use when applying the GitHub OAuth App Secret:
+
[subs="+quotes,+attributes,+macros"]
----
$ echo -n '__<github_oauth_client_secret>__' | base64
----
. Copy and save the *GitHub OAuth Client ID* for use when applying the GitHub OAuth App Secret.

. Copy and save the *GitHub OAuth Client Secret* for use when applying the GitHub OAuth App Secret.

.Additional resources

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Set up a GitLab authorized application using OAuth 2.0.
.Prerequisites

* You are logged in to GitLab.
* link:https://www.gnu.org/software/coreutils/base64[`base64`] is installed in the operating system you are using.

.Procedure

Expand All @@ -28,19 +27,9 @@ Set up a GitLab authorized application using OAuth 2.0.

. Click *Save application*.

. Copy the *GitLab Application ID* and encode it to Base64 for use when applying the GitLab-authorized application Secret:
+
[subs="+quotes,+attributes,+macros"]
----
$ echo -n '__<gitlab_application_id>__' | base64
----

. Copy the *GitLab Client Secret* and encode it to Base64 for use when applying the GitLab-authorized application Secret:
+
[subs="+quotes,+attributes,+macros"]
----
$ echo -n '__<gitlab_client_secret>__' | base64
----
. Copy and save the *GitLab Application ID* for use when applying the GitLab-authorized application Secret.

. Copy and save the *GitLab Client Secret* for use when applying the GitLab-authorized application Secret.

.Additional resources

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ Set up a Microsoft Azure DevOps Services OAuth App using OAuth 2.0.
====
+

* link:https://www.gnu.org/software/coreutils/base64[`base64`] is installed in the operating system you are using.

.Procedure

. Visit link:https://app.vsaex.visualstudio.com/app/register/[].
Expand All @@ -38,21 +36,11 @@ Set up a Microsoft Azure DevOps Services OAuth App using OAuth 2.0.

. Click *Create application*.

. Copy the *App ID* and encode it to Base64 for use when applying the Microsoft Azure DevOps Services OAuth App Secret:
+
[subs="+quotes,+attributes,+macros"]
----
$ echo -n '__<microsoft_azure_devops_services_oauth_app_id>__' | base64
----
. Copy and save the *App ID* for use when applying the Microsoft Azure DevOps Services OAuth App Secret.

. Click *Show* to display the *Client Secret*.

. Copy the *Client Secret* and encode it to Base64 for use when applying the Microsoft Azure DevOps Services OAuth App Secret:
+
[subs="+quotes,+attributes,+macros"]
----
$ echo -n '__<microsoft_azure_devops_services_oauth_client_secret>__' | base64 -w 0
----
. Copy and save the *Client Secret* for use when applying the Microsoft Azure DevOps Services OAuth App Secret.

pass:[<!-- vale RedHat.TermsWarnings = YES -->]

Expand Down
Loading

0 comments on commit 2c760dd

Please sign in to comment.