diff --git a/src/github-apps/lib/config.json b/src/github-apps/lib/config.json index f96c8ac1509f..912aeac91565 100644 --- a/src/github-apps/lib/config.json +++ b/src/github-apps/lib/config.json @@ -60,5 +60,5 @@ "2022-11-28" ] }, - "sha": "5a9222e9dba71d8c7d75d8e780cf091f16a9f5a7" + "sha": "dd9a41e53082d946d5732c803cab3f9be31c1332" } \ No newline at end of file diff --git a/src/pagelist/middleware.ts b/src/pagelist/middleware.ts index 23656619a8c8..a4e2c11f7a28 100644 --- a/src/pagelist/middleware.ts +++ b/src/pagelist/middleware.ts @@ -30,16 +30,20 @@ router.get('/v1/:product@:version', (req: ExtendedRequest, res: Response) => { // we filter the permalinks to get only our target version const filteredPermalinks = keys.filter((key) => versionMatcher(key, `${product}@${version}`)) + const expression = /^\/en/ if (!filteredPermalinks.length) { res.status(400).type('text').send('Invalid version') return } + //right now we only need english permalinks perhaps we can use the language from the request in the future + const englishPermalinks = filteredPermalinks.filter((permalink) => expression.test(permalink)) + defaultCacheControl(res) // new line added at the end so `wc` works as expected with `-l` and `-w`. - res.type('text').send(filteredPermalinks.join('\n').concat('\n')) + res.type('text').send(englishPermalinks.join('\n').concat('\n')) }) router.get('/:product@:version', (req, res) => { diff --git a/src/pagelist/tests/pagelist.ts b/src/pagelist/tests/pagelist.ts index 142c5801845c..1a985758a5b2 100644 --- a/src/pagelist/tests/pagelist.ts +++ b/src/pagelist/tests/pagelist.ts @@ -61,4 +61,14 @@ describe.each(allVersionKeys)('pagelist api for %s', async (versionKey) => { expect(permalink).toMatch(expression) }) }) + + test('only returns urls that contain /en', async () => { + const expression = new RegExp(`^/en(/${nonEnterpriseDefaultVersion})?/?.*`) + res.body + .trim() + .split('\n') + .forEach((permalink: string) => { + expect(permalink).toMatch(expression) + }) + }) }) diff --git a/src/rest/data/fpt-2022-11-28/schema.json b/src/rest/data/fpt-2022-11-28/schema.json index f6adf708bf50..07058f48788a 100644 --- a/src/rest/data/fpt-2022-11-28/schema.json +++ b/src/rest/data/fpt-2022-11-28/schema.json @@ -154353,6 +154353,7 @@ "secret_scanning": "enabled", "secret_scanning_push_protection": "enabled", "secret_scanning_validity_checks": "enabled", + "secret_scanning_non_provider_patterns": "enabled", "private_vulnerability_reporting": "enabled", "enforcement": "enforced", "url": "https://api.github.com/orgs/octo-org/code-security/configurations/17", @@ -154377,6 +154378,7 @@ "secret_scanning": "enabled", "secret_scanning_push_protection": "enabled", "secret_scanning_validity_checks": "disabled", + "secret_scanning_non_provider_patterns": "disabled", "private_vulnerability_reporting": "enabled", "enforcement": "enforced", "url": "https://api.github.com/orgs/octo-org/code-security/configurations/1326", @@ -154808,6 +154810,7 @@ "secret_scanning": "enabled", "secret_scanning_push_protection": "disabled", "secret_scanning_validity_checks": "disabled", + "secret_scanning_non_provider_patterns": "disabled", "private_vulnerability_reporting": "disabled", "enforcement": "enforced", "url": "https://api.github.com/orgs/octo-org/code-security/configurations/1325", @@ -155050,6 +155053,7 @@ "secret_scanning": "enabled", "secret_scanning_push_protection": "enabled", "secret_scanning_validity_checks": "enabled", + "secret_scanning_non_provider_patterns": "enabled", "private_vulnerability_reporting": "enabled", "enforcement": "enforced", "url": "https://api.github.com/orgs/octo-org/code-security/configurations/1325", @@ -155441,6 +155445,7 @@ "secret_scanning": "enabled", "secret_scanning_push_protection": "disabled", "secret_scanning_validity_checks": "disabled", + "secret_scanning_non_provider_patterns": "disabled", "private_vulnerability_reporting": "disabled", "enforcement": "enforced", "url": "https://api.github.com/orgs/octo-org/code-security/configurations/1325", @@ -155864,6 +155869,7 @@ "secret_scanning": "disabled", "secret_scanning_push_protection": "disabled", "secret_scanning_validity_checks": "disabled", + "secret_scanning_non_provider_patterns": "disabled", "private_vulnerability_reporting": "disabled", "enforcement": "enforced", "url": "https://api.github.com/orgs/octo-org/code-security/configurations/1325", @@ -156314,6 +156320,7 @@ "secret_scanning": "enabled", "secret_scanning_push_protection": "disabled", "secret_scanning_validity_checks": "disabled", + "secret_scanning_non_provider_patterns": "disabled", "private_vulnerability_reporting": "disabled", "enforcement": "enforced", "url": "https://api.github.com/orgs/octo-org/code-security/configurations/1325", @@ -157345,6 +157352,7 @@ "secret_scanning": "enabled", "secret_scanning_push_protection": "disabled", "secret_scanning_validity_checks": "disabled", + "secret_scanning_non_provider_patterns": "disabled", "private_vulnerability_reporting": "disabled", "enforcement": "enforced", "url": "https://api.github.com/orgs/octo-org/code-security/configurations/1325", @@ -349482,7 +349490,7 @@ } ], "previews": [], - "descriptionHTML": "
Warning
\n\nDeprecation notice: The ability to enable or disable a security feature for all eligible repositories in an organization is deprecated. Please use code security configurations instead. For more information, see the changelog.
\nEnables or disables the specified security feature for all eligible repositories in an organization. For more information, see \"Managing security managers in your organization.\"
\nThe authenticated user must be an organization owner or be member of a team with the security manager role to use this endpoint.
\nOAuth app tokens and personal access tokens (classic) need the write:org
scope to use this endpoint.
Warning
\n\nDeprecation notice: The ability to enable or disable a security feature for all eligible repositories in an organization is deprecated. Please use code security configurations instead. For more information, see the changelog.
\nEnables or disables the specified security feature for all eligible repositories in an organization. For more information, see \"Managing security managers in your organization.\"
\nThe authenticated user must be an organization owner or be member of a team with the security manager role to use this endpoint.
\nOAuth app tokens and personal access tokens (classic) need the admin:org
, write:org
, or repo
scopes to use this endpoint.
The URL that will be displayed to contributors who are blocked from pushing a secret. For more information, see \"Protecting pushes with secret scanning.\"\nTo disable this functionality, set this field to null
.
Whether secret scanning of non-provider patterns is enabled for new repositories under this enterprise.
" } ], "progAccess": { @@ -256132,7 +256154,8 @@ "dependabot_alerts_enabled_for_new_repositories": true, "secret_scanning_enabled_for_new_repositories": true, "secret_scanning_push_protection_enabled_for_new_repositories": true, - "secret_scanning_push_protection_custom_link": "https://github.com/test-org/test-repo/blob/main/README.md" + "secret_scanning_push_protection_custom_link": "https://github.com/test-org/test-repo/blob/main/README.md", + "secret_scanning_non_provider_patterns_enabled_for_new_repositories": true }, "parameters": { "enterprise": "ENTERPRISE" @@ -256190,7 +256213,8 @@ "advanced_security_user_namespace", "dependabot_alerts", "secret_scanning", - "secret_scanning_push_protection" + "secret_scanning_push_protection", + "secret_scanning_non_provider_patterns" ] } }, @@ -369791,7 +369815,7 @@ } ], "previews": [], - "descriptionHTML": "Warning
\n\nDeprecation notice: The ability to enable or disable a security feature for all eligible repositories in an organization is deprecated. Please use code security configurations instead. For more information, see the changelog.
\nEnables or disables the specified security feature for all eligible repositories in an organization. For more information, see \"Managing security managers in your organization.\"
\nThe authenticated user must be an organization owner or be member of a team with the security manager role to use this endpoint.
\nOAuth app tokens and personal access tokens (classic) need the write:org
scope to use this endpoint.
Warning
\n\nDeprecation notice: The ability to enable or disable a security feature for all eligible repositories in an organization is deprecated. Please use code security configurations instead. For more information, see the changelog.
\nEnables or disables the specified security feature for all eligible repositories in an organization. For more information, see \"Managing security managers in your organization.\"
\nThe authenticated user must be an organization owner or be member of a team with the security manager role to use this endpoint.
\nOAuth app tokens and personal access tokens (classic) need the admin:org
, write:org
, or repo
scopes to use this endpoint.
Warning
\n\nDeprecation notice: The ability to enable or disable a security feature for all eligible repositories in an organization is deprecated. Please use code security configurations instead. For more information, see the changelog.
\nEnables or disables the specified security feature for all eligible repositories in an organization. For more information, see \"Managing security managers in your organization.\"
\nThe authenticated user must be an organization owner or be member of a team with the security manager role to use this endpoint.
\nOAuth app tokens and personal access tokens (classic) need the write:org
scope to use this endpoint.
Warning
\n\nDeprecation notice: The ability to enable or disable a security feature for all eligible repositories in an organization is deprecated. Please use code security configurations instead. For more information, see the changelog.
\nEnables or disables the specified security feature for all eligible repositories in an organization. For more information, see \"Managing security managers in your organization.\"
\nThe authenticated user must be an organization owner or be member of a team with the security manager role to use this endpoint.
\nOAuth app tokens and personal access tokens (classic) need the admin:org
, write:org
, or repo
scopes to use this endpoint.