Skip to content

Commit 600832d

Browse files
authored
Update content for user pats and git tokens (codefresh-io#766)
* Update content for user pats and git tokens Updated content for Manage Git PATs topic to align with Git token reference topic * Update git-tokens.md Content edits and formatting fixes * Update git-tokens.md * Update git tokens and manage tokens Added new screenshots and updated content for manage PATs with all options * Update manage-pats.md Minor content edits * Update git token content Updated comparison table and service account desc based on feedback * Update git-tokens.md * Edit content Minor content edits after more feedback * Update git-tokens.md * Update git-tokens.md
1 parent 716039a commit 600832d

File tree

6 files changed

+135
-153
lines changed

6 files changed

+135
-153
lines changed
Lines changed: 93 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,108 @@
11
---
22
title: "Managing Git PATs"
3-
description: ""
3+
description: "Generate, assign, and manage Git user tokens for GitOps Runtimes"
44
group: administration
55
sub_group: user-self-management
66
toc: true
77
---
88

9-
As a user in Codefresh, you must authorize access to your Git provider accounts, and authenticate Git-based actions from Codefresh clients, per provisioned runtime.
10-
The authorization method depends on the Git provider and on what authorization has been set up by your account admin.
11-
* If your admin has set up authentication with OAuth2, you can authorize access using OAuth2.
12-
* You can always generate a personal access token from your Git provider and then add the same to Codefresh to authorize access.
9+
As a user in Codefresh, you must authorize access to your Git provider accounts, and authenticate Git-based actions from Codefresh clients, per provisioned GitOps Runtime. This is done through the Git user token, which is an access token unique to each user. For more details, including required scopes and how the Git user token differs from the Git Runtime token, see [Git tokens in Codefresh]({{site.baseurl}}/docs/reference/git-tokens/).
1310

14-
> If you have access to more than one runtime, you can use the same token for multiple runtimes.
15-
You must however authorize access individually for each runtime.
11+
The authorization mode depends on the authorization method set up by your account admin:
12+
* OAuth2
13+
If your admin has set up authentication with OAuth2, you can authorize access using OAuth2.
14+
* Git user access token
15+
You can always generate a Git user token from your Git provider and then add the same to the GitOps Runtime in Codefresh to authorize access.
1616

17-
{::nomarkdown}
18-
</br>
19-
{:/}
2017

2118

22-
## Authorize Git access in Codefresh
23-
Authorize Git access with OAuth2 if your account admin has set up Codefresh as an OAuth application, or alternatively through personal access tokens from your Git provider.
24-
>Notes:
25-
For OAuth2: The adminstrator pre-configures the permissions and expiry date. Once you supply your credentials for authorization, you are automatically directed to the Git Personal Tokens page.
19+
## Authorize Git access to GitOps Runtimes
20+
Authorize Git access to GitOps Runtimes with OAuth2 if your account admin has set up Codefresh as an OAuth application, or alternatively through Git user access tokens from your Git provider.
21+
22+
If you have access to more than one GitOps Runtime in the same or in different accounts, you can use the same Git user token for all the Runtimes you have access to. _You must however authorize access for each GitOps Runtime individually_.
23+
24+
>**NOTE**:
25+
For OAuth2, the administrator pre-configures the permissions and expiry date. Once you supply your credentials for authorization, you are automatically directed to the Git Personal Tokens page.
2626

2727
**Before you begin**
2828

29-
Make sure you have:
29+
Make sure you have:
3030
* For Bitbucket only, your Bitbucket account username
31-
* If needed, a _personal access token_ from your Git provider with the required scopes:
32-
* [GitHub](#generate-github-personal-access-tokens)
33-
* [GitLab](#generate-gitlab-personal-access-tokens)
34-
* [Bitbucket](#generate-bitbucket-personal-access-tokens)
31+
* If needed, a _user access token_ from your Git provider with the required scopes
32+
* [GitHub](#generate-github-user-access-tokens)
33+
* [GitLab](#generate-gitlab-user-access-tokens)
34+
* [Bitbucket](#generate-bitbucket-user-access-tokens)
3535

36-
37-
**How to**
36+
**How to**
3837
1. In the Codefresh UI, on the toolbar, click your avatar, and then select [**Git Personal Access Token**](https://g.codefresh.io/2.0/git-personal-access-token){:target="\_blank"}.
39-
1. Select the runtime, and then do one of the following:
40-
* To add a token, select **Add Token**.
41-
* To update an existing token by replacing it with a new token, select **Update Token**.
42-
1. For **OAuth2**:
43-
> If the application is not registered, the button is disabled. Contact your admin for help.
44-
* Click **Authorize Access to GitHub**.
45-
* Enter your credentials, and select **Sign In**.
46-
* Complete the verification if required, as when two-factor authentication is configured, for example.
47-
<!---add new screenshot> -->
48-
38+
1. Select the GitOps Runtime to authenticate to, and then click **Add Token**.
39+
1. Do as needed:
40+
* For **OAuth2**:
41+
1. Click **Authorize Access to GitHub**.
42+
1. Enter your credentials, and select **Sign In**.
43+
1. Complete the verification if required, as when two-factor authentication is configured, for example.
44+
* For **Git user access tokens**:
45+
1. Expand **Advanced authorization options**.
46+
1. For Bitbucket, enter your **Bitbucket username**.
47+
1. In the **Personal Access Token** field, paste the token you generated.
48+
49+
{% include
50+
image.html
51+
lightbox="true"
52+
file="/images/runtime/gitops-user-authorize-runtime-access.png"
53+
url="/images/runtime/gitops-user-authorize-runtime-access.png"
54+
alt="Authorize access to GitOps Runtime with OAuth/Git user token"
55+
caption="Authorize access to GitOps Runtime with OAuth/Git user token"
56+
max-width="50%"
57+
%}
4958

50-
For **Git personal access tokens**:
51-
* Expand **Advanced authorization options**.
52-
* For Bitbucket, enter your **Bitbucket username**.
53-
* In the **Personal Access Token** field, paste the token you generated.
59+
{:start="4"}
60+
1. Click **Add Token**.
61+
In the Git Personal Access Tokens list, you can see that the new token is assigned to the GitOps Runtime.
5462

55-
<!---add new screenshot> -->
63+
## Manage Git user tokens for GitOps Runtimes
64+
Once you authorize access to one or more GitOps Runtimes through OAuth or Git user tokens, the GitOps Runtimes and their associated tokens are listed in the Git Personal Access Tokens page.
5665

66+
**Manage Git user access tokens**
67+
You can manage Git user tokens for any GitOps Runtime, without affecting the GitOps Runtime at the account-level. Deleting the Git user token for a GitOps Runtime will deny _you_ access to the Git repositories, Git Sources and other resources associated with that Runtime, while the Runtime itself is not affected.
5768

58-
{:start="4"}
59-
1. Click **Add Token**.
60-
In the Git Personal Access Tokens list, you can see that the new token is assigned to the runtime.
69+
**Notifications for GitOps Runtimes**
70+
If you have turned on notifications for GitOps Runtimes, Codefresh alerts you to GitOps Runtimes with invalid or expired Git personal access tokens.
71+
You can turn off these notifications for selectively for Runtimes for which these alerts are less critical.
6172

62-
{::nomarkdown}
63-
</br>
64-
{:/}
73+
**Before you begin**
74+
Heve your Git user token handy
6575

66-
### Generate GitHub personal access tokens
76+
**How to**
77+
1. In the Codefresh UI, on the toolbar, click your avatar, and then select [**Git Personal Access Token**](https://g.codefresh.io/2.0/git-personal-access-token){:target="\_blank"}.
78+
1. To replace/delete the Git user token for a Runtime, do one of the following:
79+
* To replace, click **Add Token**, and then either click **Authorize Access to Git provider** for OAuth2, or paste your Git user token into the **Git Personal Access Token** field.
80+
* To delete, click **Delete Token**. The token is deleted and the **Add Token** button is displayed next to the Runtime.
81+
1. To turn off notifications, click the context menu at the right of the row with the Runtime and enable **Hide notifications**.
82+
83+
{% include
84+
image.html
85+
lightbox="true"
86+
file="/images/runtime/gitops-user-disable-runtime-notifications.png"
87+
url="/images/runtime/gitops-user-disable-runtime-notifications.png"
88+
alt="Disable notifications option for GitOps Runtimes"
89+
caption="Disable notifications option for GitOps Runtimes"
90+
max-width="70%"
91+
%}
92+
93+
{% include
94+
image.html
95+
lightbox="true"
96+
file="/images/runtime/gitops-indication-notification-disabled.png"
97+
url="/images/runtime/gitops-indication-notification-disabled.png"
98+
alt="GitOps Runtime with notifications disabled"
99+
caption="GitOps Runtime with notifications disabled"
100+
max-width="70%"
101+
%}
102+
103+
104+
105+
## Generate GitHub user access tokens
67106

68107
1. Log in to your GitHub or GitHub Enterprise account.
69108
1. Select **Settings > Developer Settings > Personal Access Tokens > Tokens (classic)**.
@@ -77,19 +116,19 @@ Make sure you have:
77116
lightbox="true"
78117
file="/images/administration/manage-pats/github-pat-scopes.png"
79118
url="/images/administration/manage-pats/github-pat-scopes.png"
80-
alt="GitHub personal access token scopes"
81-
caption="GitHub personal access token scopes"
119+
alt="GitHub user access token scopes"
120+
caption="GitHub user access token scopes"
82121
max-width="50%"
83122
%}
84123

85124
{:start="4"}
86-
1. Copy the personal access token generated as you will need it to authorize access.
125+
1. Copy the user access token generated as you will need it to authorize access.
87126

88127
{::nomarkdown}
89128
</br>
90129
{:/}
91130

92-
### Generate GitLab personal access tokens
131+
## Generate GitLab user access tokens
93132

94133
1. Log in to your GitLab Cloud or Server account.
95134
1. Select **User settings > Access tokens**.
@@ -103,22 +142,15 @@ Make sure you have:
103142
lightbox="true"
104143
file="/images/administration/manage-pats/gitlab-pat-scopes.png"
105144
url="/images/administration/manage-pats/gitlab-pat-scopes.png"
106-
alt="GitLab personal access token scopes"
107-
caption="GitLab personal access token scopes"
145+
alt="GitLab user access token scopes"
146+
caption="GitLab user access token scopes"
108147
max-width="50%"
109148
%}
110149

111150
{:start="4"}
112-
1. Copy the personal access token generated as you will need it to authorize access.
113-
114-
115-
116-
117-
{::nomarkdown}
118-
</br>
119-
{:/}
151+
1. Copy the user access token generated as you will need it to authorize access.
120152

121-
### Generate Bitbucket personal access tokens
153+
## Generate Bitbucket user access tokens
122154

123155

124156
1. Log in to your Bitbucket Cloud or Server account.
@@ -134,17 +166,14 @@ Make sure you have:
134166
lightbox="true"
135167
file="/images/administration/manage-pats/bitbucket-pat-scopes.png"
136168
url="/images/administration/manage-pats/bitbucket-pat-scopes.png"
137-
alt="Bitbucket personal access token scopes"
138-
caption="Bitbucket personal access token scopes"
169+
alt="Bitbucket user access token scopes"
170+
caption="Bitbucket user access token scopes"
139171
max-width="50%"
140172
%}
141173

142174
{:start="4"}
143-
1. Copy the personal access token generated as you will need it to authorize access.
175+
1. Copy the user access token generated as you will need it to authorize access.
144176

145-
{::nomarkdown}
146-
</br>
147-
{:/}
148177

149178
## Related articles
150179
[Git tokens in Codefresh]({{site.baseurl}}/docs/reference/git-tokens/)

_docs/administration/user-self-management/user-settings.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,15 @@ redirect_from:
88
toc: true
99
---
1010

11-
As a Codefresh user, you can manage several settings in your personal account, including:
11+
As a Codefresh user, you can manage several settings and resources through your personal account, including:
1212

1313
* Email notifications for builds and build usage
14-
* Select date and time formats for pipeline modules
15-
* Get updates on weekly usage
16-
* Grant account access to Codefresh support
17-
* Grant access to private Git repositories
18-
* Create and manage API keys
14+
* Date and time formats for pipeline modules
15+
* Updates on weekly usage
16+
* Account access to Codefresh support
17+
* API keys
1918

20-
> To manage Git personal access tokens for GitOps, see [Managing PATs]({{site.baseurl}}/docs/administration/user-self-management/manage-pats).
19+
> To manage Git user personal access tokens for GitOps, see [Managing Git PATs]({{site.baseurl}}/docs/administration/user-self-management/manage-pats).
2120
2221
## Access user settings
2322
* In the Codefresh UI, on the toolbar, click the **Settings** icon and then select [**User Settings**](https://g.codefresh.io/user/settings){:target="\_blank"}.

0 commit comments

Comments
 (0)