Skip to content

Commit 2532b7f

Browse files
authored
feat: add support for new security feature enablement and SSH signing keys APIs (#542)
* WIP octokit/openapi updated * WIP octokit/openapi updated
1 parent 33f2e49 commit 2532b7f

13 files changed

+908
-16
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
name: Enable or disable a security feature for an organization
3+
example: octokit.rest.orgs.enableOrDisableSecurityProductOnAllOrgRepos({ org, security_product, enablement })
4+
route: POST /orgs/{org}/{security_product}/{enablement}
5+
scope: orgs
6+
type: API method
7+
---
8+
9+
# Enable or disable a security feature for an organization
10+
11+
Enables or disables the specified security feature for all repositories in an organization.
12+
13+
To use this endpoint, you must be an organization owner or be member of a team with the security manager role.
14+
A token with the 'write:org' scope is also required.
15+
16+
GitHub Apps must have the `organization_administration:write` permission to use this endpoint.
17+
18+
For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."
19+
20+
```js
21+
octokit.rest.orgs.enableOrDisableSecurityProductOnAllOrgRepos({
22+
org,
23+
security_product,
24+
enablement,
25+
});
26+
```
27+
28+
## Parameters
29+
30+
<table>
31+
<thead>
32+
<tr>
33+
<th>name</th>
34+
<th>required</th>
35+
<th>description</th>
36+
</tr>
37+
</thead>
38+
<tbody>
39+
<tr><td>org</td><td>yes</td><td>
40+
41+
The organization name. The name is not case sensitive.
42+
43+
</td></tr>
44+
<tr><td>security_product</td><td>yes</td><td>
45+
46+
The security feature to enable or disable.
47+
48+
</td></tr>
49+
<tr><td>enablement</td><td>yes</td><td>
50+
51+
The action to take.
52+
53+
`enable_all` means to enable the specified security feature for all repositories in the organization.
54+
`disable_all` means to disable the specified security feature for all repositories in the organization.
55+
56+
</td></tr>
57+
</tbody>
58+
</table>
59+
60+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/orgs#enable-or-disable-security-product-on-all-org-repos).

docs/orgs/update.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,60 @@ Whether contributors to organization repositories are required to sign off on co
137137
</td></tr>
138138
<tr><td>blog</td><td>no</td><td>
139139

140+
</td></tr>
141+
<tr><td>advanced_security_enabled_for_new_repositories</td><td>no</td><td>
142+
143+
Whether GitHub Advanced Security is automatically enabled for new repositories.
144+
145+
To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."
146+
147+
You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request.
148+
149+
</td></tr>
150+
<tr><td>dependabot_alerts_enabled_for_new_repositories</td><td>no</td><td>
151+
152+
Whether Dependabot alerts is automatically enabled for new repositories.
153+
154+
To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."
155+
156+
You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request.
157+
158+
</td></tr>
159+
<tr><td>dependabot_security_updates_enabled_for_new_repositories</td><td>no</td><td>
160+
161+
Whether Dependabot security updates is automatically enabled for new repositories.
162+
163+
To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."
164+
165+
You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request.
166+
167+
</td></tr>
168+
<tr><td>dependency_graph_enabled_for_new_repositories</td><td>no</td><td>
169+
170+
Whether dependency graph is automatically enabled for new repositories.
171+
172+
To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."
173+
174+
You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request.
175+
176+
</td></tr>
177+
<tr><td>secret_scanning_enabled_for_new_repositories</td><td>no</td><td>
178+
179+
Whether secret scanning is automatically enabled for new repositories.
180+
181+
To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."
182+
183+
You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request.
184+
185+
</td></tr>
186+
<tr><td>secret_scanning_push_protection_enabled_for_new_repositories</td><td>no</td><td>
187+
188+
Whether secret scanning push protection is automatically enabled for new repositories.
189+
190+
To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."
191+
192+
You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request.
193+
140194
</td></tr>
141195
</tbody>
142196
</table>
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
name: Create a SSH signing key for the authenticated user
3+
example: octokit.rest.users.createSshSigningKeyForAuthenticatedUser({ key })
4+
route: POST /user/ssh_signing_keys
5+
scope: users
6+
type: API method
7+
---
8+
9+
# Create a SSH signing key for the authenticated user
10+
11+
Creates an SSH signing key for the authenticated user's GitHub account. You must authenticate with Basic Authentication, or you must authenticate with OAuth with at least `write:ssh_signing_key` scope. For more information, see "[Understanding scopes for OAuth apps](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/)."
12+
13+
```js
14+
octokit.rest.users.createSshSigningKeyForAuthenticatedUser({
15+
key,
16+
});
17+
```
18+
19+
## Parameters
20+
21+
<table>
22+
<thead>
23+
<tr>
24+
<th>name</th>
25+
<th>required</th>
26+
<th>description</th>
27+
</tr>
28+
</thead>
29+
<tbody>
30+
<tr><td>title</td><td>no</td><td>
31+
32+
A descriptive name for the new key.
33+
34+
</td></tr>
35+
<tr><td>key</td><td>yes</td><td>
36+
37+
The public SSH key to add to your GitHub account. For more information, see "[Checking for existing SSH keys](https://docs.github.com/authentication/connecting-to-github-with-ssh/checking-for-existing-ssh-keys)."
38+
39+
</td></tr>
40+
</tbody>
41+
</table>
42+
43+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/users#create-an-ssh-signing-key-for-the-authenticated-user).
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Delete an SSH signing key for the authenticated user
3+
example: octokit.rest.users.deleteSshSigningKeyForAuthenticatedUser({ ssh_signing_key_id })
4+
route: DELETE /user/ssh_signing_keys/{ssh_signing_key_id}
5+
scope: users
6+
type: API method
7+
---
8+
9+
# Delete an SSH signing key for the authenticated user
10+
11+
Deletes an SSH signing key from the authenticated user's GitHub account. You must authenticate with Basic Authentication, or you must authenticate with OAuth with at least `admin:ssh_signing_key` scope. For more information, see "[Understanding scopes for OAuth apps](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/)."
12+
13+
```js
14+
octokit.rest.users.deleteSshSigningKeyForAuthenticatedUser({
15+
ssh_signing_key_id,
16+
});
17+
```
18+
19+
## Parameters
20+
21+
<table>
22+
<thead>
23+
<tr>
24+
<th>name</th>
25+
<th>required</th>
26+
<th>description</th>
27+
</tr>
28+
</thead>
29+
<tbody>
30+
<tr><td>ssh_signing_key_id</td><td>yes</td><td>
31+
32+
The unique identifier of the SSH signing key.
33+
34+
</td></tr>
35+
</tbody>
36+
</table>
37+
38+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/users#delete-a-ssh-signing-key-for-the-authenticated-user).
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Get an SSH signing key for the authenticated user
3+
example: octokit.rest.users.getSshSigningKeyForAuthenticatedUser({ ssh_signing_key_id })
4+
route: GET /user/ssh_signing_keys/{ssh_signing_key_id}
5+
scope: users
6+
type: API method
7+
---
8+
9+
# Get an SSH signing key for the authenticated user
10+
11+
Gets extended details for an SSH signing key. You must authenticate with Basic Authentication, or you must authenticate with OAuth with at least `read:ssh_signing_key` scope. For more information, see "[Understanding scopes for OAuth apps](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/)."
12+
13+
```js
14+
octokit.rest.users.getSshSigningKeyForAuthenticatedUser({
15+
ssh_signing_key_id,
16+
});
17+
```
18+
19+
## Parameters
20+
21+
<table>
22+
<thead>
23+
<tr>
24+
<th>name</th>
25+
<th>required</th>
26+
<th>description</th>
27+
</tr>
28+
</thead>
29+
<tbody>
30+
<tr><td>ssh_signing_key_id</td><td>yes</td><td>
31+
32+
The unique identifier of the SSH signing key.
33+
34+
</td></tr>
35+
</tbody>
36+
</table>
37+
38+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/users#get-a-ssh-signing-key-for-the-authenticated-user).
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
name: List SSH signing keys for the authenticated user
3+
example: octokit.rest.users.listSshSigningKeysForAuthenticatedUser()
4+
route: GET /user/ssh_signing_keys
5+
scope: users
6+
type: API method
7+
---
8+
9+
# List SSH signing keys for the authenticated user
10+
11+
Lists the SSH signing keys for the authenticated user's GitHub account. You must authenticate with Basic Authentication, or you must authenticate with OAuth with at least `read:ssh_signing_key` scope. For more information, see "[Understanding scopes for OAuth apps](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/)."
12+
13+
```js
14+
octokit.rest.users.listSshSigningKeysForAuthenticatedUser();
15+
```
16+
17+
## Parameters
18+
19+
<table>
20+
<thead>
21+
<tr>
22+
<th>name</th>
23+
<th>required</th>
24+
<th>description</th>
25+
</tr>
26+
</thead>
27+
<tbody>
28+
<tr><td>per_page</td><td>no</td><td>
29+
30+
The number of results per page (max 100).
31+
32+
</td></tr>
33+
<tr><td>page</td><td>no</td><td>
34+
35+
Page number of the results to fetch.
36+
37+
</td></tr>
38+
</tbody>
39+
</table>
40+
41+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/users#list-public-ssh-signing-keys-for-the-authenticated-user).
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
name: List SSH signing keys for a user
3+
example: octokit.rest.users.listSshSigningKeysForUser({ username })
4+
route: GET /users/{username}/ssh_signing_keys
5+
scope: users
6+
type: API method
7+
---
8+
9+
# List SSH signing keys for a user
10+
11+
Lists the SSH signing keys for a user. This operation is accessible by anyone.
12+
13+
```js
14+
octokit.rest.users.listSshSigningKeysForUser({
15+
username,
16+
});
17+
```
18+
19+
## Parameters
20+
21+
<table>
22+
<thead>
23+
<tr>
24+
<th>name</th>
25+
<th>required</th>
26+
<th>description</th>
27+
</tr>
28+
</thead>
29+
<tbody>
30+
<tr><td>username</td><td>yes</td><td>
31+
32+
The handle for the GitHub user account.
33+
34+
</td></tr>
35+
<tr><td>per_page</td><td>no</td><td>
36+
37+
The number of results per page (max 100).
38+
39+
</td></tr>
40+
<tr><td>page</td><td>no</td><td>
41+
42+
Page number of the results to fetch.
43+
44+
</td></tr>
45+
</tbody>
46+
</table>
47+
48+
See also: [GitHub Developer Guide documentation](https://docs.github.com/rest/reference/users#list-ssh-signing-keys-for-a-user).

0 commit comments

Comments
 (0)