Skip to content

Commit 6f7d96a

Browse files
authored
repo sync
2 parents 0de5804 + ed5a109 commit 6f7d96a

17 files changed

Lines changed: 216 additions & 130 deletions
174 KB
Loading

content/developers/apps/scopes-for-oauth-apps.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@ X-Accepted-OAuth-Scopes: user
3838
### Available scopes
3939

4040
Name | Description
41-
-----|-----------|
42-
**`(no scope)`** | Grants read-only access to public information (includes public user profile info, public repository info, and gists){% if enterpriseServerVersions contains currentVersion or currentVersion == "github-ae@latest" %}
41+
-----|-----------|{% if currentVersion != "github-ae@latest" %}
42+
**`(no scope)`** | Grants read-only access to public information (including user profile info, repository info, and gists){% endif %}{% if enterpriseServerVersions contains currentVersion or currentVersion == "github-ae@latest" %}
4343
**`site_admin`** | Grants site administrators access to [{% data variables.product.prodname_ghe_server %} Administration API endpoints](/rest/reference/enterprise-admin).{% endif %}
44-
**`repo`** | Grants full access to private and public repositories. That includes read/write access to code, commit statuses, repository and organization projects, invitations, collaborators, adding team memberships, deployment statuses, and repository webhooks for public and private repositories and organizations. Also grants ability to manage user projects.
45-
 `repo:status`| Grants read/write access to public and private repository commit statuses. This scope is only necessary to grant other users or services access to private repository commit statuses *without* granting access to the code.
46-
 `repo_deployment`| Grants access to [deployment statuses](/rest/reference/repos#deployments) for public and private repositories. This scope is only necessary to grant other users or services access to deployment statuses, *without* granting access to the code.
47-
 `public_repo`| Limits access to public repositories. That includes read/write access to code, commit statuses, repository projects, collaborators, and deployment statuses for public repositories and organizations. Also required for starring public repositories.
44+
**`repo`** | Grants full access to repositories, including private repositories. That includes read/write access to code, commit statuses, repository and organization projects, invitations, collaborators, adding team memberships, deployment statuses, and repository webhooks for repositories and organizations. Also grants ability to manage user projects.
45+
 `repo:status`| Grants read/write access to {% if currentVersion != "github-ae@latest" %}public{% else %}internal{% endif %} and private repository commit statuses. This scope is only necessary to grant other users or services access to private repository commit statuses *without* granting access to the code.
46+
 `repo_deployment`| Grants access to [deployment statuses](/rest/reference/repos#deployments) for {% if currentVersion != "github-ae@latest" %}public{% else %}internal{% endif %} and private repositories. This scope is only necessary to grant other users or services access to deployment statuses, *without* granting access to the code.{% if currentVersion != "github-ae@latest" %}
47+
 `public_repo`| Limits access to public repositories. That includes read/write access to code, commit statuses, repository projects, collaborators, and deployment statuses for public repositories and organizations. Also required for starring public repositories.{% endif %}
4848
 `repo:invite` | Grants accept/decline abilities for invitations to collaborate on a repository. This scope is only necessary to grant other users or services access to invites *without* granting access to the code.{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.0" %}
4949
&emsp;`security_events` | Grants: <br/> read and write access to security events in the [{% data variables.product.prodname_code_scanning %} API](/rest/reference/code-scanning) <br/> read and write access to security events in the [{% data variables.product.prodname_secret_scanning %} API](/rest/reference/secret-scanning) <br/> This scope is only necessary to grant other users or services access to security events *without* granting access to the code.{% endif %}{% if currentVersion ver_gt "enterprise-server@2.21" and currentVersion ver_lt "enterprise-server@3.1" %}
5050
&emsp;`security_events` | Grants read and write access to security events in the [{% data variables.product.prodname_code_scanning %} API](/rest/reference/code-scanning). This scope is only necessary to grant other users or services access to security events *without* granting access to the code.{% endif %}
51-
**`admin:repo_hook`** | Grants read, write, ping, and delete access to repository hooks in public and private repositories. The `repo` and `public_repo` scopes grants full access to repositories, including repository hooks. Use the `admin:repo_hook` scope to limit access to only repository hooks.
52-
&emsp;`write:repo_hook` | Grants read, write, and ping access to hooks in public or private repositories.
53-
&emsp;`read:repo_hook`| Grants read and ping access to hooks in public or private repositories.
51+
**`admin:repo_hook`** | Grants read, write, ping, and delete access to repository hooks in {% if currentVersion != "github-ae@latest" %}public{% else %}internal{% endif %} and private repositories. The `repo` {% if currentVersion != "github-ae@latest" %}and `public_repo` scopes grant{% else %}scope grants{% endif %} full access to repositories, including repository hooks. Use the `admin:repo_hook` scope to limit access to only repository hooks.
52+
&emsp;`write:repo_hook` | Grants read, write, and ping access to hooks in {% if currentVersion != "github-ae@latest" %}public{% else %}internal{% endif %} or private repositories.
53+
&emsp;`read:repo_hook`| Grants read and ping access to hooks in {% if currentVersion != "github-ae@latest" %}public{% else %}internal{% endif %} or private repositories.
5454
**`admin:org`** | Fully manage the organization and its teams, projects, and memberships.
5555
&emsp;`write:org`| Read and write access to organization membership, organization projects, and team membership.
5656
&emsp;`read:org`| Read-only access to organization membership, organization projects, and team membership.
@@ -78,11 +78,11 @@ Name | Description
7878
{% note %}
7979

8080
**Note:** Your OAuth App can request the scopes in the initial redirection. You
81-
can specify multiple scopes by separating them with a space:
81+
can specify multiple scopes by separating them with a space using `%20`:
8282

8383
https://github.com/login/oauth/authorize?
8484
client_id=...&
85-
scope=user%20public_repo
85+
scope=user%20repo_deployment
8686

8787
{% endnote %}
8888

content/github/authenticating-to-github/connecting-with-third-party-applications.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ There are several types of data that applications can request.
5555
| Type of data | Description |
5656
| --- | --- |
5757
| Commit status | You can grant access for a third-party application to report your commit status. Commit status access allows applications to determine if a build is a successful against a specific commit. Applications won't have access to your code, but they <em>can</em> read and write status information against a specific commit. |
58-
| Deployments | Deployment status access allows applications to determine if a deployment is successful against a specific commit for public and private repositories. Applications won't have access to your code. |
59-
| Gists | [Gist](https://gist.github.com) access allows applications to read or write to both your public and secret Gists. |
58+
| Deployments | Deployment status access allows applications to determine if a deployment is successful against a specific commit for a repository. Applications won't have access to your code. |
59+
| Gists | [Gist](https://gist.github.com) access allows applications to read or write to {% if currentVersion != "github-ae@latest" %}both your public and{% else %}both your internal and{% endif %} secret Gists. |
6060
| Hooks | [Webhooks](/webhooks) access allows applications to read or write hook configurations on repositories you manage. |
6161
| Notifications | Notification access allows applications to read your {% data variables.product.product_name %} notifications, such as comments on issues and pull requests. However, applications remain unable to access anything in your repositories. |
6262
| Organizations and teams | Organization and teams access allows apps to access and manage organization and team membership. |
6363
| Personal user data | User data includes information found in your user profile, like your name, e-mail address, and location. |
64-
| Repositories | Repository information includes the names of contributors, the branches you've created, and the actual files within your repository. Applications can request access for either public or private repositories on a user-wide level. |
64+
| Repositories | Repository information includes the names of contributors, the branches you've created, and the actual files within your repository. Applications can request access for either {% if currentVersion != "github-ae@latest" %}public{% else %}internal{% endif %} or private repositories on a user-wide level. |
6565
| Repository delete | Applications can request to delete repositories that you administer, but they won't have access to your code. |
6666

6767
### Requesting updated permissions

content/github/authenticating-to-github/creating-a-personal-access-token.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ Personal access tokens (PATs) are an alternative to using passwords for authenti
2929
5. Give your token a descriptive name.
3030
![Token description field](/assets/images/help/settings/token_description.png)
3131
6. Select the scopes, or permissions, you'd like to grant this token. To use your token to access repositories from the command line, select **repo**.
32+
{% if currentVersion == "free-pro-team@latest" or enterpriseServerVersions contains currentVersion %}
3233
![Selecting token scopes](/assets/images/help/settings/token_scopes.gif)
34+
{% elsif currentVersion == "github-ae@latest" %}
35+
![Selecting token scopes](/assets/images/enterprise/github-ae/settings/access-token-scopes-for-ghae.png)
36+
{% endif %}
3337
7. Click **Generate token**.
3438
![Generate token button](/assets/images/help/settings/generate_token.png)
3539
8. Click {% octicon "clippy" aria-label="The copy to clipboard icon" %} to copy the token to your clipboard. For security reasons, after you navigate off the page, you will not be able to see the token again.{% if currentVersion == "free-pro-team@latest" %}

content/graphql/guides/forming-calls-with-graphql.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ The following scopes are recommended:
2626

2727
{% endif %}
2828

29+
2930
```
30-
user
31-
public_repo
31+
user{% if currentVersion != "github-ae@latest" %}
32+
public_repo{% endif %}
3233
repo
3334
repo_deployment
3435
repo:status
@@ -246,7 +247,7 @@ Looking at the composition line by line:
246247

247248
The `labels` field has the type [`LabelConnection`](/graphql/reference/objects#labelconnection). As with the `issues` object, because `labels` is a connection, we must travel its edges to a connected node: the `label` object. At the node, we can specify the `label` object fields we want to return, in this case, `name`.
248249

249-
You may notice that running this query on the Octocat's public `Hello-World` repository won't return many labels. Try running it on one of your own repositories that does use labels, and you'll likely see a difference.
250+
You may notice that running this query on the Octocat's {% if currentVersion != "github-ae@latest" %}public{% endif %} `Hello-World` repository won't return many labels. Try running it on one of your own repositories that does use labels, and you'll likely see a difference.
250251

251252
### Example mutation
252253

content/graphql/guides/managing-enterprise-accounts.md

Lines changed: 88 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,7 @@ For some example queries, see "[An example query using the Enterprise Accounts A
5858
- `admin:enterprise`: Gives full control of enterprises (includes `manage_billing:enterprise` and `read:enterprise`)
5959
- `manage_billing:enterprise`: Read and write enterprise billing data.
6060
- `read:enterprise`: Read enterprise profile data.
61-
62-
![Permissions options for personal access token](/assets/images/developer/graphql/permissions-for-access-token.png)
63-
61+
6462
4. Copy your personal access token and keep it in a secure place until you add it to your GraphQL client.
6563

6664
#### 2. Choose a GraphQL client
@@ -95,7 +93,9 @@ Now you are ready to start making queries.
9593

9694
### An example query using the Enterprise Accounts API
9795

98-
This GraphQL query requests the total number of `public` repositories in each of your appliance's organizations using the Enterprise Accounts API. To customize this query, replace `<enterprise-account-name>` with the slug of your Enterprise's instance slug.
96+
This GraphQL query requests the total number of {% if currentVersion != "github-ae@latest" %}`public`{% else %}`private`{% endif %} repositories in each of your appliance's organizations using the Enterprise Accounts API. To customize this query, replace `<enterprise-account-name>` with the slug of your Enterprise's instance slug.
97+
98+
{% if currentVersion != "github-ae@latest" %}
9999

100100
```graphql
101101
query publicRepositoriesByOrganization($slug: String!) {
@@ -127,8 +127,42 @@ variables {
127127
}
128128
```
129129

130-
The next GraphQL query example shows how challenging it is to retrieve the number of `public` repositories in each organization without using the Enterprise Account API. Notice that the GraphQL Enterprise Accounts API has made this task simpler for enterprises since you only need to customize a single variable. To customize this query, replace `<name-of-organization-one>` and `<name-of-organization-one>`, etc. with the organization names on your instance.
130+
{% else %}
131+
132+
```graphql
133+
query privateRepositoriesByOrganization($slug: String!) {
134+
enterprise(slug: $slug) {
135+
...enterpriseFragment
136+
}
137+
}
138+
139+
fragment enterpriseFragment on Enterprise {
140+
... on Enterprise{
141+
name
142+
organizations(first: 100){
143+
nodes{
144+
name
145+
... on Organization{
146+
name
147+
repositories(privacy: PRIVATE){
148+
totalCount
149+
}
150+
}
151+
}
152+
}
153+
}
154+
}
155+
156+
# Passing our Enterprise Account as a variable
157+
variables {
158+
"slug": "<enterprise-account-name>"
159+
}
160+
```
161+
{% endif %}
162+
163+
The next GraphQL query example shows how challenging it is to retrieve the number of {% if currentVersion != "github-ae@latest" %}`public`{% else %}`private`{% endif %} repositories in each organization without using the Enterprise Account API. Notice that the GraphQL Enterprise Accounts API has made this task simpler for enterprises since you only need to customize a single variable. To customize this query, replace `<name-of-organization-one>` and `<name-of-organization-two>`, etc. with the organization names on your instance.
131164

165+
{% if currentVersion != "github-ae@latest" %}
132166
```graphql
133167
# Each organization is queried separately
134168
{
@@ -150,9 +184,34 @@ fragment repositories on Organization {
150184
}
151185
}
152186
```
187+
{% else %}
188+
```graphql
189+
# Each organization is queried separately
190+
{
191+
organizationOneAlias: organization(login: "name-of-organization-one") {
192+
# How to use a fragment
193+
...repositories
194+
}
195+
organizationTwoAlias: organization(login: "name-of-organization-two") {
196+
...repositories
197+
}
198+
# organizationThreeAlias ... and so on up-to lets say 100
199+
}
200+
201+
## How to define a fragment
202+
fragment repositories on Organization {
203+
name
204+
repositories(privacy: PRIVATE){
205+
totalCount
206+
}
207+
}
208+
```
209+
{% endif %}
153210

154211
### Query each organization separately
155212

213+
{% if currentVersion != "github-ae@latest" %}
214+
156215
```graphql
157216
query publicRepositoriesByOrganization {
158217
organizationOneAlias: organization(login: "<name-of-organization-one>") {
@@ -173,6 +232,30 @@ fragment repositories on Organization {
173232
}
174233
```
175234

235+
{% else %}
236+
237+
```graphql
238+
query privateRepositoriesByOrganization {
239+
organizationOneAlias: organization(login: "<name-of-organization-one>") {
240+
# How to use a fragment
241+
...repositories
242+
}
243+
organizationTwoAlias: organization(login: "<name-of-organization-two>") {
244+
...repositories
245+
}
246+
# organizationThreeAlias ... and so on up-to lets say 100
247+
}
248+
# How to define a fragment
249+
fragment repositories on Organization {
250+
name
251+
repositories(privacy: PRIVATE){
252+
totalCount
253+
}
254+
}
255+
```
256+
257+
{% endif %}
258+
176259
This GraphQL query requests the last 5 log entries for an enterprise organization. To customize this query, replace `<org-name>` and `<user-name>`.
177260

178261
```graphql

content/rest/guides/discovering-resources-for-a-user.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ If you haven't already, you should read the ["Basics of Authentication"][basics-
2222

2323
### Discover the repositories that your app can access for a user
2424

25-
In addition to having their own personal repositories, a user may be a collaborator on repositories owned by other users and organizations. Collectively, these are the repositories where the user has privileged access: either it's a private repository where the user has read or write access, or it's a public repository where the user has write access.
25+
In addition to having their own personal repositories, a user may be a collaborator on repositories owned by other users and organizations. Collectively, these are the repositories where the user has privileged access: either it's a private repository where the user has read or write access, or it's a {% if currentVersion != "github-ae@latest" %}public{% else %}internal{% endif %} repository where the user has write access.
2626

2727
[OAuth scopes][scopes] and [organization application policies][oap] determine which of those repositories your app can access for a user. Use the workflow below to discover those repositories.
2828

@@ -87,11 +87,11 @@ client.organizations.each do |organization|
8787
end
8888
```
8989

90-
#### Don’t rely on public organizations
90+
#### Return all of the user's organization memberships
9191

9292
If you've read the docs from cover to cover, you may have noticed an [API method for listing a user's public organization memberships][list-public-orgs]. Most applications should avoid this API method. This method only returns the user's public organization memberships, not their private organization memberships.
9393

94-
As an application, you typically want all of the user's organizations (public and private) that your app is authorized to access. The workflow above will give you exactly that.
94+
As an application, you typically want all of the user's organizations that your app is authorized to access. The workflow above will give you exactly that.
9595

9696
[basics-of-authentication]: /rest/guides/basics-of-authentication
9797
[list-public-orgs]: /rest/reference/orgs#list-organizations-for-a-user

0 commit comments

Comments
 (0)