Skip to content

Commit 6fcd497

Browse files
authored
Branch was updated using the 'autoupdate branch' Actions workflow.
2 parents ef32114 + 81a9415 commit 6fcd497

File tree

8 files changed

+285
-53
lines changed

8 files changed

+285
-53
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ Name | Description
4646
 `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.
4747
 `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.
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 "[email protected]" %}
49-
&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).{% endif %}{% if currentVersion ver_gt "[email protected]" and currentVersion ver_lt "[email protected]" %}
50-
&emsp;`security_events` | Grants read and write access to security events in the [{% data variables.product.prodname_code_scanning %} API](/rest/reference/code-scanning).{% endif %}
49+
&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 "[email protected]" and currentVersion ver_lt "[email protected]" %}
50+
&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 %}
5151
**`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.
5252
&emsp;`write:repo_hook` | Grants read, write, and ping access to hooks in public or private repositories.
5353
&emsp;`read:repo_hook`| Grants read and ping access to hooks in public or private repositories.

lib/warm-server.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ const loadSiteTree = require('./site-tree')
77
// Instrument these functions so that
88
// it's wrapped in a timer that reports to Datadog
99
const dog = {
10-
loadPages: statsd.timer(loadPages, 'load_pages'),
11-
loadPageMap: statsd.timer(loadPageMap, 'load_page_map'),
10+
loadPages: statsd.asyncTimer(loadPages, 'load_pages'),
11+
loadPageMap: statsd.asyncTimer(loadPageMap, 'load_page_map'),
1212
loadRedirects: statsd.timer(loadRedirects, 'load_redirects'),
1313
loadSiteData: statsd.timer(loadSiteData, 'load_site_data'),
1414
loadSiteTree: statsd.asyncTimer(loadSiteTree, 'load_site_tree')

middleware/contextualizers/graphql.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,17 @@ const explorerUrl = process.env.NODE_ENV === 'production'
99
: 'http://localhost:3000'
1010

1111
module.exports = async (req, res, next) => {
12+
const currentVersionObj = allVersions[req.context.currentVersion]
1213
// ignore requests to non-GraphQL reference paths
13-
if (!req.path.includes('/graphql/')) return next()
14-
14+
// and to versions that don't exist
15+
if (!req.path.includes('/graphql/') || !currentVersionObj) {
16+
return next()
17+
}
1518
// Get the relevant name of the GraphQL schema files for the current version
1619
// For example, free-pro-team@latest corresponds to dotcom,
1720
// [email protected] corresponds to ghes-2.22,
1821
// and github-ae@latest corresponds to ghae
19-
const graphqlVersion = allVersions[req.context.currentVersion].miscVersionName
22+
const graphqlVersion = currentVersionObj.miscVersionName
2023

2124
req.context.graphql = {
2225
schemaForCurrentVersion: require(`../../lib/graphql/static/schema-${graphqlVersion}`),

middleware/contextualizers/webhooks.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,18 @@ const nonEnterpriseDefaultVersion = require('../../lib/non-enterprise-default-ve
55
const allVersions = require('../../lib/all-versions')
66

77
module.exports = async (req, res, next) => {
8-
if (!req.path.includes('webhook')) return next()
8+
const currentVersionObj = allVersions[req.context.currentVersion]
9+
// ignore requests to non-webhook reference paths
10+
// and to versions that don't exist
11+
if (!req.path.includes('webhook') || !currentVersionObj) {
12+
return next()
13+
}
914

1015
// Get the name of the dir under lib/webhooks/static
1116
// For example, free-pro-team@latest corresponds to dotcom,
1217
// [email protected] corresponds to ghes-2.22,
1318
// and github-ae@latest corresponds to ghae
14-
if (!allVersions[req.context.currentVersion]) return next()
15-
const webhookPayloadDir = allVersions[req.context.currentVersion].miscVersionName
19+
const webhookPayloadDir = currentVersionObj.miscVersionName
1620

1721
const webhookPayloadsForCurrentVersion = webhookPayloads[webhookPayloadDir]
1822

middleware/csp.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ module.exports = async (req, res, next) => {
5656

5757
// Exception for Algolia instantsearch in deprecated Enterprise docs (Node.js era)
5858
if (versionSatisfiesRange(requestedVersion, '<=2.19') && versionSatisfiesRange(requestedVersion, '>2.12')) {
59-
csp.directives.scriptSrc.push("'unsafe-eval'")
59+
csp.directives.scriptSrc.push("'unsafe-eval'", "'unsafe-inline'", 'http://www.google-analytics.com', 'https://ssl.google-analytics.com')
60+
csp.directives.connectSrc.push('https://www.google-analytics.com')
61+
csp.directives.imgSrc.push('http://www.google-analytics.com', 'https://ssl.google-analytics.com')
6062
}
6163

6264
// Exception for search in deprecated Enterprise docs <=2.12 (static site era)

0 commit comments

Comments
 (0)