diff --git a/lib/rest/static/decorated/api.github.com.2022-11-28.json b/lib/rest/static/decorated/api.github.com.2022-11-28.json index 7036371a56..57922386c0 100644 --- a/lib/rest/static/decorated/api.github.com.2022-11-28.json +++ b/lib/rest/static/decorated/api.github.com.2022-11-28.json @@ -468766,6 +468766,265 @@ }, "secret-scanning": { "secret-scanning": [ + { + "serverUrl": "https://api.github.com", + "verb": "get", + "requestPath": "/enterprises/{enterprise}/code_security_and_analysis", + "title": "Get code security and analysis settings for an enterprise", + "category": "secret-scanning", + "parameters": [ + { + "name": "enterprise", + "description": "
The slug version of the enterprise name. You can also substitute this value with the enterprise id.
", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "bodyParameters": [], + "enabledForGitHubApps": false, + "codeExamples": [ + { + "key": "default", + "request": { + "description": "Example", + "acceptHeader": "application/vnd.github.v3+json", + "parameters": { + "enterprise": "ENTERPRISE" + } + }, + "response": { + "statusCode": "200", + "contentType": "application/json", + "description": "Response
", + "example": { + "advanced_security_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_enabled": true, + "secret_scanning_push_protection_custom_link": "https://github.com/test-org/test-repo/blob/main/README.md" + }, + "schema": { + "title": "Enterprise Security Analysis Settings", + "type": "object", + "properties": { + "advanced_security_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether GitHub advanced security is automatically enabled for new repositories and repositories transferred to\nthis enterprise.", + "examples": [ + false + ] + }, + "secret_scanning_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether secret scanning is automatically enabled for new repositories and repositories transferred to this\nenterprise.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether secret scanning push protection is automatically enabled for new repositories and repositories\ntransferred to this enterprise.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_custom_link_enabled": { + "type": "boolean", + "description": "Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_custom_link": { + "type": [ + "string", + "null" + ], + "description": "An optional URL string to display to contributors who are blocked from pushing a secret.", + "examples": [ + "https://github.com/test-org/test-repo/blob/main/README.md" + ] + } + }, + "required": [ + "advanced_security_enabled_for_new_repositories", + "secret_scanning_enabled_for_new_repositories", + "secret_scanning_push_protection_enabled_for_new_repositories" + ] + } + } + } + ], + "previews": [], + "descriptionHTML": "Gets code security and analysis settings for the specified enterprise.\nTo use this endpoint, you must be an administrator of the enterprise.
", + "statusCodes": [ + { + "httpStatusCode": "200", + "description": "OK
" + }, + { + "httpStatusCode": "404", + "description": "Resource not found
" + }, + { + "httpStatusCode": "503", + "description": "Service unavailable
" + } + ], + "subcategory": "secret-scanning" + }, + { + "serverUrl": "https://api.github.com", + "verb": "patch", + "requestPath": "/enterprises/{enterprise}/code_security_and_analysis", + "title": "Update security and analysis settings for new repositories in an enterprise", + "category": "secret-scanning", + "parameters": [ + { + "name": "enterprise", + "description": "The slug version of the enterprise name. You can also substitute this value with the enterprise id.
", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "bodyParameters": [ + { + "type": "boolean", + "name": "advanced_security_enabled_for_new_repositories", + "in": "body", + "description": "Whether GitHub Advanced Security is automatically enabled for new repositories. For more information, see \"About GitHub Advanced Security\".
" + }, + { + "type": "boolean", + "name": "secret_scanning_enabled_for_new_repositories", + "in": "body", + "description": "Whether secret scanning is automatically enabled for new repositories. For more information, see \"About secret scanning\".
" + }, + { + "type": "boolean", + "name": "secret_scanning_push_protection_enabled_for_new_repositories", + "in": "body", + "description": "Whether secret scanning push protection is automatically enabled for new repositories. For more information, see \"Protecting pushes with secret scanning\".
" + }, + { + "type": "boolean", + "name": "secret_scanning_push_protection_custom_link_enabled", + "in": "body", + "description": "Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection. For more information, see \"Protecting pushes with secret scanning\".
" + }, + { + "type": "string", + "name": "secret_scanning_push_protection_custom_link", + "in": "body", + "description": "If secret_scanning_push_protection_custom_link_enabled is true, the URL that will be displayed to contributors who are blocked from pushing a secret. For more information, see \"Protecting pushes with secret scanning\".
Response
", + "example": { + "advanced_security_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_enabled": true, + "secret_scanning_push_protection_custom_link": "https://github.com/test-org/test-repo/blob/main/README.md" + }, + "schema": { + "title": "Enterprise Security Analysis Settings", + "type": "object", + "properties": { + "advanced_security_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether GitHub advanced security is automatically enabled for new repositories and repositories transferred to\nthis enterprise.", + "examples": [ + false + ] + }, + "secret_scanning_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether secret scanning is automatically enabled for new repositories and repositories transferred to this\nenterprise.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether secret scanning push protection is automatically enabled for new repositories and repositories\ntransferred to this enterprise.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_custom_link_enabled": { + "type": "boolean", + "description": "Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_custom_link": { + "type": [ + "string", + "null" + ], + "description": "An optional URL string to display to contributors who are blocked from pushing a secret.", + "examples": [ + "https://github.com/test-org/test-repo/blob/main/README.md" + ] + } + }, + "required": [ + "advanced_security_enabled_for_new_repositories", + "secret_scanning_enabled_for_new_repositories", + "secret_scanning_push_protection_enabled_for_new_repositories" + ] + } + } + } + ], + "previews": [], + "descriptionHTML": "Updates the settings for advanced security, secret scanning, and push protection for new repositories in an enterprise.\nTo use this endpoint, you must be an administrator of the enterprise, and you must use an access token with the admin:enterprise scope.
OK
" + }, + { + "httpStatusCode": "404", + "description": "Resource not found
" + }, + { + "httpStatusCode": "503", + "description": "Service unavailable
" + } + ], + "subcategory": "secret-scanning" + }, { "serverUrl": "https://api.github.com", "verb": "get", @@ -470108,6 +470367,92 @@ ], "subcategory": "secret-scanning" }, + { + "serverUrl": "https://api.github.com", + "verb": "post", + "requestPath": "/enterprises/{enterprise}/{security_product}/{enablement}", + "title": "Enable or disable security features for an enterprise", + "category": "secret-scanning", + "parameters": [ + { + "name": "enterprise", + "description": "The slug version of the enterprise name. You can also substitute this value with the enterprise id.
", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "security_product", + "in": "path", + "description": "The security feature to enable or disable.
", + "required": true, + "schema": { + "type": "string", + "enum": [ + "advanced_security", + "secret_scanning", + "secret_scanning_push_protection" + ] + } + }, + { + "name": "enablement", + "in": "path", + "description": "The action to take.
\nenable_all means to enable the specified security feature for all repositories in the enterprise.\ndisable_all means to disable the specified security feature for all repositories in the enterprise.
Action started
" + } + } + ], + "previews": [], + "descriptionHTML": "Enables or disables the specified security feature for all repositories in an enterprise.
\nTo use this endpoint, you must be an administrator of the enterprise, and you must use an access token with the admin:enterprise scope.
Action started
" + }, + { + "httpStatusCode": "404", + "description": "Resource not found
" + }, + { + "httpStatusCode": "422", + "description": "The action could not be taken due to an in progress enablement, or a policy is preventing enablement
" + }, + { + "httpStatusCode": "503", + "description": "Service unavailable
" + } + ], + "subcategory": "secret-scanning" + }, { "serverUrl": "https://api.github.com", "verb": "get", diff --git a/lib/rest/static/decorated/ghec.2022-11-28.json b/lib/rest/static/decorated/ghec.2022-11-28.json index 0458bf0b0e..3cd7c7040d 100644 --- a/lib/rest/static/decorated/ghec.2022-11-28.json +++ b/lib/rest/static/decorated/ghec.2022-11-28.json @@ -472917,6 +472917,265 @@ }, "secret-scanning": { "secret-scanning": [ + { + "serverUrl": "https://api.github.com", + "verb": "get", + "requestPath": "/enterprises/{enterprise}/code_security_and_analysis", + "title": "Get code security and analysis settings for an enterprise", + "category": "secret-scanning", + "parameters": [ + { + "name": "enterprise", + "description": "The slug version of the enterprise name. You can also substitute this value with the enterprise id.
", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "bodyParameters": [], + "enabledForGitHubApps": false, + "codeExamples": [ + { + "key": "default", + "request": { + "description": "Example", + "acceptHeader": "application/vnd.github.v3+json", + "parameters": { + "enterprise": "ENTERPRISE" + } + }, + "response": { + "statusCode": "200", + "contentType": "application/json", + "description": "Response
", + "example": { + "advanced_security_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_enabled": true, + "secret_scanning_push_protection_custom_link": "https://github.com/test-org/test-repo/blob/main/README.md" + }, + "schema": { + "title": "Enterprise Security Analysis Settings", + "type": "object", + "properties": { + "advanced_security_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether GitHub advanced security is automatically enabled for new repositories and repositories transferred to\nthis enterprise.", + "examples": [ + false + ] + }, + "secret_scanning_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether secret scanning is automatically enabled for new repositories and repositories transferred to this\nenterprise.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether secret scanning push protection is automatically enabled for new repositories and repositories\ntransferred to this enterprise.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_custom_link_enabled": { + "type": "boolean", + "description": "Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_custom_link": { + "type": [ + "string", + "null" + ], + "description": "An optional URL string to display to contributors who are blocked from pushing a secret.", + "examples": [ + "https://github.com/test-org/test-repo/blob/main/README.md" + ] + } + }, + "required": [ + "advanced_security_enabled_for_new_repositories", + "secret_scanning_enabled_for_new_repositories", + "secret_scanning_push_protection_enabled_for_new_repositories" + ] + } + } + } + ], + "previews": [], + "descriptionHTML": "Gets code security and analysis settings for the specified enterprise.\nTo use this endpoint, you must be an administrator of the enterprise.
", + "statusCodes": [ + { + "httpStatusCode": "200", + "description": "OK
" + }, + { + "httpStatusCode": "404", + "description": "Resource not found
" + }, + { + "httpStatusCode": "503", + "description": "Service unavailable
" + } + ], + "subcategory": "secret-scanning" + }, + { + "serverUrl": "https://api.github.com", + "verb": "patch", + "requestPath": "/enterprises/{enterprise}/code_security_and_analysis", + "title": "Update security and analysis settings for new repositories in an enterprise", + "category": "secret-scanning", + "parameters": [ + { + "name": "enterprise", + "description": "The slug version of the enterprise name. You can also substitute this value with the enterprise id.
", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "bodyParameters": [ + { + "type": "boolean", + "name": "advanced_security_enabled_for_new_repositories", + "in": "body", + "description": "Whether GitHub Advanced Security is automatically enabled for new repositories. For more information, see \"About GitHub Advanced Security\".
" + }, + { + "type": "boolean", + "name": "secret_scanning_enabled_for_new_repositories", + "in": "body", + "description": "Whether secret scanning is automatically enabled for new repositories. For more information, see \"About secret scanning\".
" + }, + { + "type": "boolean", + "name": "secret_scanning_push_protection_enabled_for_new_repositories", + "in": "body", + "description": "Whether secret scanning push protection is automatically enabled for new repositories. For more information, see \"Protecting pushes with secret scanning\".
" + }, + { + "type": "boolean", + "name": "secret_scanning_push_protection_custom_link_enabled", + "in": "body", + "description": "Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection. For more information, see \"Protecting pushes with secret scanning\".
" + }, + { + "type": "string", + "name": "secret_scanning_push_protection_custom_link", + "in": "body", + "description": "If secret_scanning_push_protection_custom_link_enabled is true, the URL that will be displayed to contributors who are blocked from pushing a secret. For more information, see \"Protecting pushes with secret scanning\".
Response
", + "example": { + "advanced_security_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_enabled": true, + "secret_scanning_push_protection_custom_link": "https://github.com/test-org/test-repo/blob/main/README.md" + }, + "schema": { + "title": "Enterprise Security Analysis Settings", + "type": "object", + "properties": { + "advanced_security_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether GitHub advanced security is automatically enabled for new repositories and repositories transferred to\nthis enterprise.", + "examples": [ + false + ] + }, + "secret_scanning_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether secret scanning is automatically enabled for new repositories and repositories transferred to this\nenterprise.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether secret scanning push protection is automatically enabled for new repositories and repositories\ntransferred to this enterprise.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_custom_link_enabled": { + "type": "boolean", + "description": "Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_custom_link": { + "type": [ + "string", + "null" + ], + "description": "An optional URL string to display to contributors who are blocked from pushing a secret.", + "examples": [ + "https://github.com/test-org/test-repo/blob/main/README.md" + ] + } + }, + "required": [ + "advanced_security_enabled_for_new_repositories", + "secret_scanning_enabled_for_new_repositories", + "secret_scanning_push_protection_enabled_for_new_repositories" + ] + } + } + } + ], + "previews": [], + "descriptionHTML": "Updates the settings for advanced security, secret scanning, and push protection for new repositories in an enterprise.\nTo use this endpoint, you must be an administrator of the enterprise, and you must use an access token with the admin:enterprise scope.
OK
" + }, + { + "httpStatusCode": "404", + "description": "Resource not found
" + }, + { + "httpStatusCode": "503", + "description": "Service unavailable
" + } + ], + "subcategory": "secret-scanning" + }, { "serverUrl": "https://api.github.com", "verb": "get", @@ -474259,6 +474518,92 @@ ], "subcategory": "secret-scanning" }, + { + "serverUrl": "https://api.github.com", + "verb": "post", + "requestPath": "/enterprises/{enterprise}/{security_product}/{enablement}", + "title": "Enable or disable security features for an enterprise", + "category": "secret-scanning", + "parameters": [ + { + "name": "enterprise", + "description": "The slug version of the enterprise name. You can also substitute this value with the enterprise id.
", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "security_product", + "in": "path", + "description": "The security feature to enable or disable.
", + "required": true, + "schema": { + "type": "string", + "enum": [ + "advanced_security", + "secret_scanning", + "secret_scanning_push_protection" + ] + } + }, + { + "name": "enablement", + "in": "path", + "description": "The action to take.
\nenable_all means to enable the specified security feature for all repositories in the enterprise.\ndisable_all means to disable the specified security feature for all repositories in the enterprise.
Action started
" + } + } + ], + "previews": [], + "descriptionHTML": "Enables or disables the specified security feature for all repositories in an enterprise.
\nTo use this endpoint, you must be an administrator of the enterprise, and you must use an access token with the admin:enterprise scope.
Action started
" + }, + { + "httpStatusCode": "404", + "description": "Resource not found
" + }, + { + "httpStatusCode": "422", + "description": "The action could not be taken due to an in progress enablement, or a policy is preventing enablement
" + }, + { + "httpStatusCode": "503", + "description": "Service unavailable
" + } + ], + "subcategory": "secret-scanning" + }, { "serverUrl": "https://api.github.com", "verb": "get", diff --git a/lib/rest/static/dereferenced/api.github.com.2022-11-28.deref.json b/lib/rest/static/dereferenced/api.github.com.2022-11-28.deref.json index 69ab8e25e5..70ad088872 100644 --- a/lib/rest/static/dereferenced/api.github.com.2022-11-28.deref.json +++ b/lib/rest/static/dereferenced/api.github.com.2022-11-28.deref.json @@ -22035,6 +22035,341 @@ } } }, + "/enterprises/{enterprise}/code_security_and_analysis": { + "get": { + "summary": "Get code security and analysis settings for an enterprise", + "description": "Gets code security and analysis settings for the specified enterprise.\nTo use this endpoint, you must be an administrator of the enterprise.", + "tags": [ + "secret-scanning" + ], + "operationId": "secret-scanning/get-security-analysis-settings-for-enterprise", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/rest/secret-scanning#get-security-analysis-settings-for-enterprise" + }, + "parameters": [ + { + "name": "enterprise", + "description": "The slug version of the enterprise name. You can also substitute this value with the enterprise id.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Response", + "content": { + "application/json": { + "schema": { + "title": "Enterprise Security Analysis Settings", + "type": "object", + "properties": { + "advanced_security_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether GitHub advanced security is automatically enabled for new repositories and repositories transferred to\nthis enterprise.", + "examples": [ + false + ] + }, + "secret_scanning_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether secret scanning is automatically enabled for new repositories and repositories transferred to this\nenterprise.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether secret scanning push protection is automatically enabled for new repositories and repositories\ntransferred to this enterprise.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_custom_link_enabled": { + "type": "boolean", + "description": "Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_custom_link": { + "type": [ + "string", + "null" + ], + "description": "An optional URL string to display to contributors who are blocked from pushing a secret.", + "examples": [ + "https://github.com/test-org/test-repo/blob/main/README.md" + ] + } + }, + "required": [ + "advanced_security_enabled_for_new_repositories", + "secret_scanning_enabled_for_new_repositories", + "secret_scanning_push_protection_enabled_for_new_repositories" + ] + }, + "examples": { + "default": { + "value": { + "advanced_security_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_enabled": true, + "secret_scanning_push_protection_custom_link": "https://github.com/test-org/test-repo/blob/main/README.md" + } + } + } + } + } + }, + "404": { + "description": "Resource not found", + "content": { + "application/json": { + "schema": { + "title": "Basic Error", + "description": "Basic Error", + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + }, + "url": { + "type": "string" + }, + "status": { + "type": "string" + } + } + } + } + } + }, + "503": { + "description": "Service unavailable", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + } + } + } + } + } + } + }, + "x-github": { + "githubCloudOnly": false, + "enabledForGitHubApps": false, + "category": "secret-scanning", + "subcategory": null + } + }, + "patch": { + "summary": "Update security and analysis settings for new repositories in an enterprise", + "description": "Updates the settings for advanced security, secret scanning, and push protection for new repositories in an enterprise.\nTo use this endpoint, you must be an administrator of the enterprise, and you must use an access token with the `admin:enterprise` scope.", + "tags": [ + "secret-scanning" + ], + "operationId": "secret-scanning/patch-security-analysis-settings-for-enterprise", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/rest/secret-scanning#update-security-and-analysis-settings-for-new-repositories-in-the-enterprise" + }, + "parameters": [ + { + "name": "enterprise", + "description": "The slug version of the enterprise name. You can also substitute this value with the enterprise id.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "advanced_security_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether GitHub Advanced Security is automatically enabled for new repositories. For more information, see \"[About GitHub Advanced Security](https://docs.github.com/enterprise-cloud@latest/get-started/learning-about-github/about-github-advanced-security)\"." + }, + "secret_scanning_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether secret scanning is automatically enabled for new repositories. For more information, see \"[About secret scanning](https://docs.github.com/enterprise-cloud@latest/code-security/secret-scanning/about-secret-scanning)\"." + }, + "secret_scanning_push_protection_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether secret scanning push protection is automatically enabled for new repositories. For more information, see \"[Protecting pushes with secret scanning](https://docs.github.com/enterprise-cloud@latest/code-security/secret-scanning/protecting-pushes-with-secret-scanning)\"." + }, + "secret_scanning_push_protection_custom_link_enabled": { + "type": "boolean", + "description": "Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection. For more information, see \"[Protecting pushes with secret scanning](https://docs.github.com/enterprise-cloud@latest/code-security/secret-scanning/protecting-pushes-with-secret-scanning)\"." + }, + "secret_scanning_push_protection_custom_link": { + "type": "string", + "description": "If `secret_scanning_push_protection_custom_link_enabled` is true, the URL that will be displayed to contributors who are blocked from pushing a secret. For more information, see \"[Protecting pushes with secret scanning](https://docs.github.com/enterprise-cloud@latest/code-security/secret-scanning/protecting-pushes-with-secret-scanning)\"." + } + } + }, + "examples": { + "default": { + "value": { + "advanced_security_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_enabled": true, + "secret_scanning_push_protection_custom_link": "https://github.com/test-org/test-repo/blob/main/README.md" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Response", + "content": { + "application/json": { + "schema": { + "title": "Enterprise Security Analysis Settings", + "type": "object", + "properties": { + "advanced_security_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether GitHub advanced security is automatically enabled for new repositories and repositories transferred to\nthis enterprise.", + "examples": [ + false + ] + }, + "secret_scanning_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether secret scanning is automatically enabled for new repositories and repositories transferred to this\nenterprise.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether secret scanning push protection is automatically enabled for new repositories and repositories\ntransferred to this enterprise.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_custom_link_enabled": { + "type": "boolean", + "description": "Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_custom_link": { + "type": [ + "string", + "null" + ], + "description": "An optional URL string to display to contributors who are blocked from pushing a secret.", + "examples": [ + "https://github.com/test-org/test-repo/blob/main/README.md" + ] + } + }, + "required": [ + "advanced_security_enabled_for_new_repositories", + "secret_scanning_enabled_for_new_repositories", + "secret_scanning_push_protection_enabled_for_new_repositories" + ] + }, + "examples": { + "default": { + "value": { + "advanced_security_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_enabled": true, + "secret_scanning_push_protection_custom_link": "https://github.com/test-org/test-repo/blob/main/README.md" + } + } + } + } + } + }, + "404": { + "description": "Resource not found", + "content": { + "application/json": { + "schema": { + "title": "Basic Error", + "description": "Basic Error", + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + }, + "url": { + "type": "string" + }, + "status": { + "type": "string" + } + } + } + } + } + }, + "503": { + "description": "Service unavailable", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + } + } + } + } + } + } + }, + "x-github": { + "githubCloudOnly": false, + "enabledForGitHubApps": false, + "category": "secret-scanning", + "subcategory": null + } + } + }, "/enterprises/{enterprise}/dependabot/alerts": { "get": { "summary": "List Dependabot alerts for an enterprise", @@ -25414,6 +25749,119 @@ } } }, + "/enterprises/{enterprise}/{security_product}/{enablement}": { + "post": { + "summary": "Enable or disable security features for an enterprise", + "description": "Enables or disables the specified security feature for all repositories in an enterprise.\n\nTo use this endpoint, you must be an administrator of the enterprise, and you must use an access token with the `admin:enterprise` scope.", + "tags": [ + "secret-scanning" + ], + "operationId": "secret-scanning/post-security-product-enablement-for-enterprise", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/rest/secret-scanning#enable-or-disable-security-features-for-an-enterprise" + }, + "parameters": [ + { + "name": "enterprise", + "description": "The slug version of the enterprise name. You can also substitute this value with the enterprise id.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "security_product", + "in": "path", + "description": "The security feature to enable or disable.", + "required": true, + "schema": { + "type": "string", + "enum": [ + "advanced_security", + "secret_scanning", + "secret_scanning_push_protection" + ] + } + }, + { + "name": "enablement", + "in": "path", + "description": "The action to take.\n\n`enable_all` means to enable the specified security feature for all repositories in the enterprise.\n`disable_all` means to disable the specified security feature for all repositories in the enterprise.", + "required": true, + "schema": { + "type": "string", + "enum": [ + "enable_all", + "disable_all" + ] + } + } + ], + "responses": { + "204": { + "description": "Action started" + }, + "422": { + "description": "The action could not be taken due to an in progress enablement, or a policy is preventing enablement" + }, + "404": { + "description": "Resource not found", + "content": { + "application/json": { + "schema": { + "title": "Basic Error", + "description": "Basic Error", + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + }, + "url": { + "type": "string" + }, + "status": { + "type": "string" + } + } + } + } + } + }, + "503": { + "description": "Service unavailable", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + } + } + } + } + } + } + }, + "x-github": { + "githubCloudOnly": false, + "enabledForGitHubApps": false, + "category": "secret-scanning", + "subcategory": null + } + } + }, "/events": { "get": { "summary": "List public events", diff --git a/lib/rest/static/dereferenced/api.github.com.deref.json b/lib/rest/static/dereferenced/api.github.com.deref.json index 69ab8e25e5..70ad088872 100644 --- a/lib/rest/static/dereferenced/api.github.com.deref.json +++ b/lib/rest/static/dereferenced/api.github.com.deref.json @@ -22035,6 +22035,341 @@ } } }, + "/enterprises/{enterprise}/code_security_and_analysis": { + "get": { + "summary": "Get code security and analysis settings for an enterprise", + "description": "Gets code security and analysis settings for the specified enterprise.\nTo use this endpoint, you must be an administrator of the enterprise.", + "tags": [ + "secret-scanning" + ], + "operationId": "secret-scanning/get-security-analysis-settings-for-enterprise", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/rest/secret-scanning#get-security-analysis-settings-for-enterprise" + }, + "parameters": [ + { + "name": "enterprise", + "description": "The slug version of the enterprise name. You can also substitute this value with the enterprise id.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Response", + "content": { + "application/json": { + "schema": { + "title": "Enterprise Security Analysis Settings", + "type": "object", + "properties": { + "advanced_security_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether GitHub advanced security is automatically enabled for new repositories and repositories transferred to\nthis enterprise.", + "examples": [ + false + ] + }, + "secret_scanning_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether secret scanning is automatically enabled for new repositories and repositories transferred to this\nenterprise.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether secret scanning push protection is automatically enabled for new repositories and repositories\ntransferred to this enterprise.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_custom_link_enabled": { + "type": "boolean", + "description": "Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_custom_link": { + "type": [ + "string", + "null" + ], + "description": "An optional URL string to display to contributors who are blocked from pushing a secret.", + "examples": [ + "https://github.com/test-org/test-repo/blob/main/README.md" + ] + } + }, + "required": [ + "advanced_security_enabled_for_new_repositories", + "secret_scanning_enabled_for_new_repositories", + "secret_scanning_push_protection_enabled_for_new_repositories" + ] + }, + "examples": { + "default": { + "value": { + "advanced_security_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_enabled": true, + "secret_scanning_push_protection_custom_link": "https://github.com/test-org/test-repo/blob/main/README.md" + } + } + } + } + } + }, + "404": { + "description": "Resource not found", + "content": { + "application/json": { + "schema": { + "title": "Basic Error", + "description": "Basic Error", + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + }, + "url": { + "type": "string" + }, + "status": { + "type": "string" + } + } + } + } + } + }, + "503": { + "description": "Service unavailable", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + } + } + } + } + } + } + }, + "x-github": { + "githubCloudOnly": false, + "enabledForGitHubApps": false, + "category": "secret-scanning", + "subcategory": null + } + }, + "patch": { + "summary": "Update security and analysis settings for new repositories in an enterprise", + "description": "Updates the settings for advanced security, secret scanning, and push protection for new repositories in an enterprise.\nTo use this endpoint, you must be an administrator of the enterprise, and you must use an access token with the `admin:enterprise` scope.", + "tags": [ + "secret-scanning" + ], + "operationId": "secret-scanning/patch-security-analysis-settings-for-enterprise", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/rest/secret-scanning#update-security-and-analysis-settings-for-new-repositories-in-the-enterprise" + }, + "parameters": [ + { + "name": "enterprise", + "description": "The slug version of the enterprise name. You can also substitute this value with the enterprise id.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "advanced_security_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether GitHub Advanced Security is automatically enabled for new repositories. For more information, see \"[About GitHub Advanced Security](https://docs.github.com/enterprise-cloud@latest/get-started/learning-about-github/about-github-advanced-security)\"." + }, + "secret_scanning_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether secret scanning is automatically enabled for new repositories. For more information, see \"[About secret scanning](https://docs.github.com/enterprise-cloud@latest/code-security/secret-scanning/about-secret-scanning)\"." + }, + "secret_scanning_push_protection_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether secret scanning push protection is automatically enabled for new repositories. For more information, see \"[Protecting pushes with secret scanning](https://docs.github.com/enterprise-cloud@latest/code-security/secret-scanning/protecting-pushes-with-secret-scanning)\"." + }, + "secret_scanning_push_protection_custom_link_enabled": { + "type": "boolean", + "description": "Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection. For more information, see \"[Protecting pushes with secret scanning](https://docs.github.com/enterprise-cloud@latest/code-security/secret-scanning/protecting-pushes-with-secret-scanning)\"." + }, + "secret_scanning_push_protection_custom_link": { + "type": "string", + "description": "If `secret_scanning_push_protection_custom_link_enabled` is true, the URL that will be displayed to contributors who are blocked from pushing a secret. For more information, see \"[Protecting pushes with secret scanning](https://docs.github.com/enterprise-cloud@latest/code-security/secret-scanning/protecting-pushes-with-secret-scanning)\"." + } + } + }, + "examples": { + "default": { + "value": { + "advanced_security_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_enabled": true, + "secret_scanning_push_protection_custom_link": "https://github.com/test-org/test-repo/blob/main/README.md" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Response", + "content": { + "application/json": { + "schema": { + "title": "Enterprise Security Analysis Settings", + "type": "object", + "properties": { + "advanced_security_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether GitHub advanced security is automatically enabled for new repositories and repositories transferred to\nthis enterprise.", + "examples": [ + false + ] + }, + "secret_scanning_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether secret scanning is automatically enabled for new repositories and repositories transferred to this\nenterprise.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether secret scanning push protection is automatically enabled for new repositories and repositories\ntransferred to this enterprise.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_custom_link_enabled": { + "type": "boolean", + "description": "Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_custom_link": { + "type": [ + "string", + "null" + ], + "description": "An optional URL string to display to contributors who are blocked from pushing a secret.", + "examples": [ + "https://github.com/test-org/test-repo/blob/main/README.md" + ] + } + }, + "required": [ + "advanced_security_enabled_for_new_repositories", + "secret_scanning_enabled_for_new_repositories", + "secret_scanning_push_protection_enabled_for_new_repositories" + ] + }, + "examples": { + "default": { + "value": { + "advanced_security_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_enabled": true, + "secret_scanning_push_protection_custom_link": "https://github.com/test-org/test-repo/blob/main/README.md" + } + } + } + } + } + }, + "404": { + "description": "Resource not found", + "content": { + "application/json": { + "schema": { + "title": "Basic Error", + "description": "Basic Error", + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + }, + "url": { + "type": "string" + }, + "status": { + "type": "string" + } + } + } + } + } + }, + "503": { + "description": "Service unavailable", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + } + } + } + } + } + } + }, + "x-github": { + "githubCloudOnly": false, + "enabledForGitHubApps": false, + "category": "secret-scanning", + "subcategory": null + } + } + }, "/enterprises/{enterprise}/dependabot/alerts": { "get": { "summary": "List Dependabot alerts for an enterprise", @@ -25414,6 +25749,119 @@ } } }, + "/enterprises/{enterprise}/{security_product}/{enablement}": { + "post": { + "summary": "Enable or disable security features for an enterprise", + "description": "Enables or disables the specified security feature for all repositories in an enterprise.\n\nTo use this endpoint, you must be an administrator of the enterprise, and you must use an access token with the `admin:enterprise` scope.", + "tags": [ + "secret-scanning" + ], + "operationId": "secret-scanning/post-security-product-enablement-for-enterprise", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/rest/secret-scanning#enable-or-disable-security-features-for-an-enterprise" + }, + "parameters": [ + { + "name": "enterprise", + "description": "The slug version of the enterprise name. You can also substitute this value with the enterprise id.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "security_product", + "in": "path", + "description": "The security feature to enable or disable.", + "required": true, + "schema": { + "type": "string", + "enum": [ + "advanced_security", + "secret_scanning", + "secret_scanning_push_protection" + ] + } + }, + { + "name": "enablement", + "in": "path", + "description": "The action to take.\n\n`enable_all` means to enable the specified security feature for all repositories in the enterprise.\n`disable_all` means to disable the specified security feature for all repositories in the enterprise.", + "required": true, + "schema": { + "type": "string", + "enum": [ + "enable_all", + "disable_all" + ] + } + } + ], + "responses": { + "204": { + "description": "Action started" + }, + "422": { + "description": "The action could not be taken due to an in progress enablement, or a policy is preventing enablement" + }, + "404": { + "description": "Resource not found", + "content": { + "application/json": { + "schema": { + "title": "Basic Error", + "description": "Basic Error", + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + }, + "url": { + "type": "string" + }, + "status": { + "type": "string" + } + } + } + } + } + }, + "503": { + "description": "Service unavailable", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + } + } + } + } + } + } + }, + "x-github": { + "githubCloudOnly": false, + "enabledForGitHubApps": false, + "category": "secret-scanning", + "subcategory": null + } + } + }, "/events": { "get": { "summary": "List public events", diff --git a/lib/rest/static/dereferenced/ghec.2022-11-28.deref.json b/lib/rest/static/dereferenced/ghec.2022-11-28.deref.json index ed0bffe771..5e16754743 100644 --- a/lib/rest/static/dereferenced/ghec.2022-11-28.deref.json +++ b/lib/rest/static/dereferenced/ghec.2022-11-28.deref.json @@ -22419,6 +22419,341 @@ } } }, + "/enterprises/{enterprise}/code_security_and_analysis": { + "get": { + "summary": "Get code security and analysis settings for an enterprise", + "description": "Gets code security and analysis settings for the specified enterprise.\nTo use this endpoint, you must be an administrator of the enterprise.", + "tags": [ + "secret-scanning" + ], + "operationId": "secret-scanning/get-security-analysis-settings-for-enterprise", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/enterprise-cloud@latest//rest/secret-scanning#get-security-analysis-settings-for-enterprise" + }, + "parameters": [ + { + "name": "enterprise", + "description": "The slug version of the enterprise name. You can also substitute this value with the enterprise id.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Response", + "content": { + "application/json": { + "schema": { + "title": "Enterprise Security Analysis Settings", + "type": "object", + "properties": { + "advanced_security_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether GitHub advanced security is automatically enabled for new repositories and repositories transferred to\nthis enterprise.", + "examples": [ + false + ] + }, + "secret_scanning_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether secret scanning is automatically enabled for new repositories and repositories transferred to this\nenterprise.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether secret scanning push protection is automatically enabled for new repositories and repositories\ntransferred to this enterprise.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_custom_link_enabled": { + "type": "boolean", + "description": "Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_custom_link": { + "type": [ + "string", + "null" + ], + "description": "An optional URL string to display to contributors who are blocked from pushing a secret.", + "examples": [ + "https://github.com/test-org/test-repo/blob/main/README.md" + ] + } + }, + "required": [ + "advanced_security_enabled_for_new_repositories", + "secret_scanning_enabled_for_new_repositories", + "secret_scanning_push_protection_enabled_for_new_repositories" + ] + }, + "examples": { + "default": { + "value": { + "advanced_security_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_enabled": true, + "secret_scanning_push_protection_custom_link": "https://github.com/test-org/test-repo/blob/main/README.md" + } + } + } + } + } + }, + "404": { + "description": "Resource not found", + "content": { + "application/json": { + "schema": { + "title": "Basic Error", + "description": "Basic Error", + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + }, + "url": { + "type": "string" + }, + "status": { + "type": "string" + } + } + } + } + } + }, + "503": { + "description": "Service unavailable", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + } + } + } + } + } + } + }, + "x-github": { + "githubCloudOnly": false, + "enabledForGitHubApps": false, + "category": "secret-scanning", + "subcategory": null + } + }, + "patch": { + "summary": "Update security and analysis settings for new repositories in an enterprise", + "description": "Updates the settings for advanced security, secret scanning, and push protection for new repositories in an enterprise.\nTo use this endpoint, you must be an administrator of the enterprise, and you must use an access token with the `admin:enterprise` scope.", + "tags": [ + "secret-scanning" + ], + "operationId": "secret-scanning/patch-security-analysis-settings-for-enterprise", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/enterprise-cloud@latest//rest/secret-scanning#update-security-and-analysis-settings-for-new-repositories-in-the-enterprise" + }, + "parameters": [ + { + "name": "enterprise", + "description": "The slug version of the enterprise name. You can also substitute this value with the enterprise id.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "advanced_security_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether GitHub Advanced Security is automatically enabled for new repositories. For more information, see \"[About GitHub Advanced Security](https://docs.github.com/enterprise-cloud@latest//enterprise-cloud@latest/get-started/learning-about-github/about-github-advanced-security)\"." + }, + "secret_scanning_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether secret scanning is automatically enabled for new repositories. For more information, see \"[About secret scanning](https://docs.github.com/enterprise-cloud@latest//enterprise-cloud@latest/code-security/secret-scanning/about-secret-scanning)\"." + }, + "secret_scanning_push_protection_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether secret scanning push protection is automatically enabled for new repositories. For more information, see \"[Protecting pushes with secret scanning](https://docs.github.com/enterprise-cloud@latest//enterprise-cloud@latest/code-security/secret-scanning/protecting-pushes-with-secret-scanning)\"." + }, + "secret_scanning_push_protection_custom_link_enabled": { + "type": "boolean", + "description": "Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection. For more information, see \"[Protecting pushes with secret scanning](https://docs.github.com/enterprise-cloud@latest//enterprise-cloud@latest/code-security/secret-scanning/protecting-pushes-with-secret-scanning)\"." + }, + "secret_scanning_push_protection_custom_link": { + "type": "string", + "description": "If `secret_scanning_push_protection_custom_link_enabled` is true, the URL that will be displayed to contributors who are blocked from pushing a secret. For more information, see \"[Protecting pushes with secret scanning](https://docs.github.com/enterprise-cloud@latest//enterprise-cloud@latest/code-security/secret-scanning/protecting-pushes-with-secret-scanning)\"." + } + } + }, + "examples": { + "default": { + "value": { + "advanced_security_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_enabled": true, + "secret_scanning_push_protection_custom_link": "https://github.com/test-org/test-repo/blob/main/README.md" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Response", + "content": { + "application/json": { + "schema": { + "title": "Enterprise Security Analysis Settings", + "type": "object", + "properties": { + "advanced_security_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether GitHub advanced security is automatically enabled for new repositories and repositories transferred to\nthis enterprise.", + "examples": [ + false + ] + }, + "secret_scanning_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether secret scanning is automatically enabled for new repositories and repositories transferred to this\nenterprise.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether secret scanning push protection is automatically enabled for new repositories and repositories\ntransferred to this enterprise.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_custom_link_enabled": { + "type": "boolean", + "description": "Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_custom_link": { + "type": [ + "string", + "null" + ], + "description": "An optional URL string to display to contributors who are blocked from pushing a secret.", + "examples": [ + "https://github.com/test-org/test-repo/blob/main/README.md" + ] + } + }, + "required": [ + "advanced_security_enabled_for_new_repositories", + "secret_scanning_enabled_for_new_repositories", + "secret_scanning_push_protection_enabled_for_new_repositories" + ] + }, + "examples": { + "default": { + "value": { + "advanced_security_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_enabled": true, + "secret_scanning_push_protection_custom_link": "https://github.com/test-org/test-repo/blob/main/README.md" + } + } + } + } + } + }, + "404": { + "description": "Resource not found", + "content": { + "application/json": { + "schema": { + "title": "Basic Error", + "description": "Basic Error", + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + }, + "url": { + "type": "string" + }, + "status": { + "type": "string" + } + } + } + } + } + }, + "503": { + "description": "Service unavailable", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + } + } + } + } + } + } + }, + "x-github": { + "githubCloudOnly": false, + "enabledForGitHubApps": false, + "category": "secret-scanning", + "subcategory": null + } + } + }, "/enterprises/{enterprise}/consumed-licenses": { "get": { "summary": "List enterprise consumed licenses", @@ -26450,6 +26785,119 @@ } } }, + "/enterprises/{enterprise}/{security_product}/{enablement}": { + "post": { + "summary": "Enable or disable security features for an enterprise", + "description": "Enables or disables the specified security feature for all repositories in an enterprise.\n\nTo use this endpoint, you must be an administrator of the enterprise, and you must use an access token with the `admin:enterprise` scope.", + "tags": [ + "secret-scanning" + ], + "operationId": "secret-scanning/post-security-product-enablement-for-enterprise", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/enterprise-cloud@latest//rest/secret-scanning#enable-or-disable-security-features-for-an-enterprise" + }, + "parameters": [ + { + "name": "enterprise", + "description": "The slug version of the enterprise name. You can also substitute this value with the enterprise id.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "security_product", + "in": "path", + "description": "The security feature to enable or disable.", + "required": true, + "schema": { + "type": "string", + "enum": [ + "advanced_security", + "secret_scanning", + "secret_scanning_push_protection" + ] + } + }, + { + "name": "enablement", + "in": "path", + "description": "The action to take.\n\n`enable_all` means to enable the specified security feature for all repositories in the enterprise.\n`disable_all` means to disable the specified security feature for all repositories in the enterprise.", + "required": true, + "schema": { + "type": "string", + "enum": [ + "enable_all", + "disable_all" + ] + } + } + ], + "responses": { + "204": { + "description": "Action started" + }, + "422": { + "description": "The action could not be taken due to an in progress enablement, or a policy is preventing enablement" + }, + "404": { + "description": "Resource not found", + "content": { + "application/json": { + "schema": { + "title": "Basic Error", + "description": "Basic Error", + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + }, + "url": { + "type": "string" + }, + "status": { + "type": "string" + } + } + } + } + } + }, + "503": { + "description": "Service unavailable", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + } + } + } + } + } + } + }, + "x-github": { + "githubCloudOnly": false, + "enabledForGitHubApps": false, + "category": "secret-scanning", + "subcategory": null + } + } + }, "/events": { "get": { "summary": "List public events", diff --git a/lib/rest/static/dereferenced/ghec.deref.json b/lib/rest/static/dereferenced/ghec.deref.json index ed0bffe771..5e16754743 100644 --- a/lib/rest/static/dereferenced/ghec.deref.json +++ b/lib/rest/static/dereferenced/ghec.deref.json @@ -22419,6 +22419,341 @@ } } }, + "/enterprises/{enterprise}/code_security_and_analysis": { + "get": { + "summary": "Get code security and analysis settings for an enterprise", + "description": "Gets code security and analysis settings for the specified enterprise.\nTo use this endpoint, you must be an administrator of the enterprise.", + "tags": [ + "secret-scanning" + ], + "operationId": "secret-scanning/get-security-analysis-settings-for-enterprise", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/enterprise-cloud@latest//rest/secret-scanning#get-security-analysis-settings-for-enterprise" + }, + "parameters": [ + { + "name": "enterprise", + "description": "The slug version of the enterprise name. You can also substitute this value with the enterprise id.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Response", + "content": { + "application/json": { + "schema": { + "title": "Enterprise Security Analysis Settings", + "type": "object", + "properties": { + "advanced_security_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether GitHub advanced security is automatically enabled for new repositories and repositories transferred to\nthis enterprise.", + "examples": [ + false + ] + }, + "secret_scanning_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether secret scanning is automatically enabled for new repositories and repositories transferred to this\nenterprise.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether secret scanning push protection is automatically enabled for new repositories and repositories\ntransferred to this enterprise.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_custom_link_enabled": { + "type": "boolean", + "description": "Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_custom_link": { + "type": [ + "string", + "null" + ], + "description": "An optional URL string to display to contributors who are blocked from pushing a secret.", + "examples": [ + "https://github.com/test-org/test-repo/blob/main/README.md" + ] + } + }, + "required": [ + "advanced_security_enabled_for_new_repositories", + "secret_scanning_enabled_for_new_repositories", + "secret_scanning_push_protection_enabled_for_new_repositories" + ] + }, + "examples": { + "default": { + "value": { + "advanced_security_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_enabled": true, + "secret_scanning_push_protection_custom_link": "https://github.com/test-org/test-repo/blob/main/README.md" + } + } + } + } + } + }, + "404": { + "description": "Resource not found", + "content": { + "application/json": { + "schema": { + "title": "Basic Error", + "description": "Basic Error", + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + }, + "url": { + "type": "string" + }, + "status": { + "type": "string" + } + } + } + } + } + }, + "503": { + "description": "Service unavailable", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + } + } + } + } + } + } + }, + "x-github": { + "githubCloudOnly": false, + "enabledForGitHubApps": false, + "category": "secret-scanning", + "subcategory": null + } + }, + "patch": { + "summary": "Update security and analysis settings for new repositories in an enterprise", + "description": "Updates the settings for advanced security, secret scanning, and push protection for new repositories in an enterprise.\nTo use this endpoint, you must be an administrator of the enterprise, and you must use an access token with the `admin:enterprise` scope.", + "tags": [ + "secret-scanning" + ], + "operationId": "secret-scanning/patch-security-analysis-settings-for-enterprise", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/enterprise-cloud@latest//rest/secret-scanning#update-security-and-analysis-settings-for-new-repositories-in-the-enterprise" + }, + "parameters": [ + { + "name": "enterprise", + "description": "The slug version of the enterprise name. You can also substitute this value with the enterprise id.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "advanced_security_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether GitHub Advanced Security is automatically enabled for new repositories. For more information, see \"[About GitHub Advanced Security](https://docs.github.com/enterprise-cloud@latest//enterprise-cloud@latest/get-started/learning-about-github/about-github-advanced-security)\"." + }, + "secret_scanning_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether secret scanning is automatically enabled for new repositories. For more information, see \"[About secret scanning](https://docs.github.com/enterprise-cloud@latest//enterprise-cloud@latest/code-security/secret-scanning/about-secret-scanning)\"." + }, + "secret_scanning_push_protection_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether secret scanning push protection is automatically enabled for new repositories. For more information, see \"[Protecting pushes with secret scanning](https://docs.github.com/enterprise-cloud@latest//enterprise-cloud@latest/code-security/secret-scanning/protecting-pushes-with-secret-scanning)\"." + }, + "secret_scanning_push_protection_custom_link_enabled": { + "type": "boolean", + "description": "Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection. For more information, see \"[Protecting pushes with secret scanning](https://docs.github.com/enterprise-cloud@latest//enterprise-cloud@latest/code-security/secret-scanning/protecting-pushes-with-secret-scanning)\"." + }, + "secret_scanning_push_protection_custom_link": { + "type": "string", + "description": "If `secret_scanning_push_protection_custom_link_enabled` is true, the URL that will be displayed to contributors who are blocked from pushing a secret. For more information, see \"[Protecting pushes with secret scanning](https://docs.github.com/enterprise-cloud@latest//enterprise-cloud@latest/code-security/secret-scanning/protecting-pushes-with-secret-scanning)\"." + } + } + }, + "examples": { + "default": { + "value": { + "advanced_security_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_enabled": true, + "secret_scanning_push_protection_custom_link": "https://github.com/test-org/test-repo/blob/main/README.md" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Response", + "content": { + "application/json": { + "schema": { + "title": "Enterprise Security Analysis Settings", + "type": "object", + "properties": { + "advanced_security_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether GitHub advanced security is automatically enabled for new repositories and repositories transferred to\nthis enterprise.", + "examples": [ + false + ] + }, + "secret_scanning_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether secret scanning is automatically enabled for new repositories and repositories transferred to this\nenterprise.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_enabled_for_new_repositories": { + "type": "boolean", + "description": "Whether secret scanning push protection is automatically enabled for new repositories and repositories\ntransferred to this enterprise.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_custom_link_enabled": { + "type": "boolean", + "description": "Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection.", + "examples": [ + false + ] + }, + "secret_scanning_push_protection_custom_link": { + "type": [ + "string", + "null" + ], + "description": "An optional URL string to display to contributors who are blocked from pushing a secret.", + "examples": [ + "https://github.com/test-org/test-repo/blob/main/README.md" + ] + } + }, + "required": [ + "advanced_security_enabled_for_new_repositories", + "secret_scanning_enabled_for_new_repositories", + "secret_scanning_push_protection_enabled_for_new_repositories" + ] + }, + "examples": { + "default": { + "value": { + "advanced_security_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_enabled": true, + "secret_scanning_push_protection_custom_link": "https://github.com/test-org/test-repo/blob/main/README.md" + } + } + } + } + } + }, + "404": { + "description": "Resource not found", + "content": { + "application/json": { + "schema": { + "title": "Basic Error", + "description": "Basic Error", + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + }, + "url": { + "type": "string" + }, + "status": { + "type": "string" + } + } + } + } + } + }, + "503": { + "description": "Service unavailable", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + } + } + } + } + } + } + }, + "x-github": { + "githubCloudOnly": false, + "enabledForGitHubApps": false, + "category": "secret-scanning", + "subcategory": null + } + } + }, "/enterprises/{enterprise}/consumed-licenses": { "get": { "summary": "List enterprise consumed licenses", @@ -26450,6 +26785,119 @@ } } }, + "/enterprises/{enterprise}/{security_product}/{enablement}": { + "post": { + "summary": "Enable or disable security features for an enterprise", + "description": "Enables or disables the specified security feature for all repositories in an enterprise.\n\nTo use this endpoint, you must be an administrator of the enterprise, and you must use an access token with the `admin:enterprise` scope.", + "tags": [ + "secret-scanning" + ], + "operationId": "secret-scanning/post-security-product-enablement-for-enterprise", + "externalDocs": { + "description": "API method documentation", + "url": "https://docs.github.com/enterprise-cloud@latest//rest/secret-scanning#enable-or-disable-security-features-for-an-enterprise" + }, + "parameters": [ + { + "name": "enterprise", + "description": "The slug version of the enterprise name. You can also substitute this value with the enterprise id.", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "security_product", + "in": "path", + "description": "The security feature to enable or disable.", + "required": true, + "schema": { + "type": "string", + "enum": [ + "advanced_security", + "secret_scanning", + "secret_scanning_push_protection" + ] + } + }, + { + "name": "enablement", + "in": "path", + "description": "The action to take.\n\n`enable_all` means to enable the specified security feature for all repositories in the enterprise.\n`disable_all` means to disable the specified security feature for all repositories in the enterprise.", + "required": true, + "schema": { + "type": "string", + "enum": [ + "enable_all", + "disable_all" + ] + } + } + ], + "responses": { + "204": { + "description": "Action started" + }, + "422": { + "description": "The action could not be taken due to an in progress enablement, or a policy is preventing enablement" + }, + "404": { + "description": "Resource not found", + "content": { + "application/json": { + "schema": { + "title": "Basic Error", + "description": "Basic Error", + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + }, + "url": { + "type": "string" + }, + "status": { + "type": "string" + } + } + } + } + } + }, + "503": { + "description": "Service unavailable", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "documentation_url": { + "type": "string" + } + } + } + } + } + } + }, + "x-github": { + "githubCloudOnly": false, + "enabledForGitHubApps": false, + "category": "secret-scanning", + "subcategory": null + } + } + }, "/events": { "get": { "summary": "List public events",