Skip to content

Commit

Permalink
feat: add support for is_alphanumeric attribute on autolinks, `rule…
Browse files Browse the repository at this point in the history
….help_uri` attribute on code scanning alerts and `anonymous_access_enabled` attribute on repos (see PR body for more changes) (#237)

WIP
  • Loading branch information
octokitbot committed Sep 2, 2022
1 parent 2297876 commit 01faa14
Show file tree
Hide file tree
Showing 21 changed files with 393 additions and 154 deletions.
64 changes: 44 additions & 20 deletions cache/api.github.com.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"openapi": "3.0.3",
"info": {
"version": "7.7.0",
"version": "7.8.0",
"title": "GitHub's official OpenAPI spec + Octokit extension",
"description": "OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs",
"license": {
Expand Down Expand Up @@ -12448,17 +12448,6 @@
}
}
},
"302": {
"description": "Response if requester is not an organization member",
"headers": {
"Location": {
"example": "https://api.github.com/orgs/github/public_members",
"schema": {
"type": "string"
}
}
}
},
"422": {
"$ref": "#/components/responses/validation_failed"
}
Expand Down Expand Up @@ -23260,11 +23249,16 @@
"properties": {
"key_prefix": {
"type": "string",
"description": "The prefix appended by alphanumeric characters will generate a link any time it is found in an issue, pull request, or commit."
"description": "This prefix appended by certain characters will generate a link any time it is found in an issue, pull request, or commit."
},
"url_template": {
"type": "string",
"description": "The URL must contain `<num>` for the reference number. `<num>` matches alphanumeric characters `A-Z` (case insensitive), `0-9`, and `-`."
"description": "The URL must contain `<num>` for the reference number. `<num>` matches different characters depending on the value of `is_alphanumeric`."
},
"is_alphanumeric": {
"type": "boolean",
"default": "true",
"description": "Whether this autolink reference matches alphanumeric characters. If true, the `<num>` parameter of the `url_template` matches alphanumeric characters `A-Z` (case insensitive), `0-9`, and `-`. If false, this autolink reference only matches numeric characters."
}
},
"required": [
Expand All @@ -23276,7 +23270,8 @@
"default": {
"value": {
"key_prefix": "TICKET-",
"url_template": "https://example.com/TICKET?query=<num>"
"url_template": "https://example.com/TICKET?query=<num>",
"is_alphanumeric": true
}
}
}
Expand Down Expand Up @@ -30219,6 +30214,9 @@
},
"500": {
"$ref": "#/components/responses/internal_error"
},
"503": {
"$ref": "#/components/responses/service_unavailable"
}
},
"x-github": {
Expand Down Expand Up @@ -30674,6 +30672,9 @@
},
"500": {
"$ref": "#/components/responses/internal_error"
},
"503": {
"$ref": "#/components/responses/service_unavailable"
}
},
"x-github": {
Expand Down Expand Up @@ -41476,6 +41477,9 @@
},
"500": {
"$ref": "#/components/responses/internal_error"
},
"503": {
"$ref": "#/components/responses/service_unavailable"
}
},
"x-github": {
Expand Down Expand Up @@ -42153,6 +42157,9 @@
},
"500": {
"$ref": "#/components/responses/internal_error"
},
"503": {
"$ref": "#/components/responses/service_unavailable"
}
},
"x-github": {
Expand Down Expand Up @@ -46495,7 +46502,7 @@
"/repos/{template_owner}/{template_repo}/generate": {
"post": {
"summary": "Create a repository using a template",
"description": "Creates a new repository using a repository template. Use the `template_owner` and `template_repo` route parameters to specify the repository to use as the template. The authenticated user must own or be a member of an organization that owns the repository. To check if a repository is available to use as a template, get the repository's information using the [Get a repository](https://docs.github.com/rest/reference/repos#get-a-repository) endpoint and check that the `is_template` key is `true`.\n\n**OAuth scope requirements**\n\nWhen using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include:\n\n* `public_repo` scope or `repo` scope to create a public repository. Note: For GitHub AE, use `repo` scope to create an internal repository.\n* `repo` scope to create a private repository",
"description": "Creates a new repository using a repository template. Use the `template_owner` and `template_repo` route parameters to specify the repository to use as the template. If the repository is not public, the authenticated user must own or be a member of an organization that owns the repository. To check if a repository is available to use as a template, get the repository's information using the [Get a repository](https://docs.github.com/rest/reference/repos#get-a-repository) endpoint and check that the `is_template` key is `true`.\n\n**OAuth scope requirements**\n\nWhen using [OAuth](https://docs.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include:\n\n* `public_repo` scope or `repo` scope to create a public repository. Note: For GitHub AE, use `repo` scope to create an internal repository.\n* `repo` scope to create a private repository",
"tags": [
"repos"
],
Expand Down Expand Up @@ -61712,6 +61719,10 @@
"starred_at": {
"type": "string",
"example": "\"2020-07-09T00:17:42Z\""
},
"anonymous_access_enabled": {
"type": "boolean",
"description": "Whether anonymous git access is enabled for this repository"
}
},
"required": [
Expand Down Expand Up @@ -62932,6 +62943,11 @@
"nullable": true,
"type": "string",
"description": "Detailed documentation for the rule as GitHub Flavored Markdown."
},
"help_uri": {
"nullable": true,
"type": "string",
"description": "A link to the documentation for the rule used to detect the alert."
}
}
},
Expand Down Expand Up @@ -66656,6 +66672,10 @@
"starred_at": {
"type": "string",
"example": "\"2020-07-09T00:17:42Z\""
},
"anonymous_access_enabled": {
"type": "boolean",
"description": "Whether anonymous git access is enabled for this repository"
}
},
"required": [
Expand Down Expand Up @@ -73184,14 +73204,16 @@
"type": "string"
},
"is_alphanumeric": {
"description": "Whether this autolink reference matches alphanumeric characters. If false, this autolink reference is a legacy autolink that only matches numeric characters.",
"description": "Whether this autolink reference matches alphanumeric characters. If false, this autolink reference only matches numeric characters.",
"example": true,
"type": "boolean"
}
},
"required": [
"id",
"key_prefix",
"url_template"
"url_template",
"is_alphanumeric"
]
},
"protected-branch-required-status-check": {
Expand Down Expand Up @@ -99640,7 +99662,8 @@
"security",
"external/cwe/cwe-022"
],
"help": "# Arbitrary file write during zip extraction (\"Zip Slip\")\\nExtracting files from a malicious zip archive without validating that the destination file path is within the destination directory can cause files outside the destination directory to be overwritten ..."
"help": "# Arbitrary file write during zip extraction (\"Zip Slip\")\\nExtracting files from a malicious zip archive without validating that the destination file path is within the destination directory can cause files outside the destination directory to be overwritten ...",
"help_uri": "https://codeql.github.com/"
},
"tool": {
"name": "CodeQL",
Expand Down Expand Up @@ -99712,7 +99735,8 @@
"security",
"external/cwe/cwe-022"
],
"help": "# Arbitrary file write during zip extraction (\"Zip Slip\")\\nExtracting files from a malicious zip archive without validating that the destination file path is within the destination directory can cause files outside the destination directory to be overwritten ..."
"help": "# Arbitrary file write during zip extraction (\"Zip Slip\")\\nExtracting files from a malicious zip archive without validating that the destination file path is within the destination directory can cause files outside the destination directory to be overwritten ...",
"help_uri": "https://codeql.github.com/"
},
"tool": {
"name": "CodeQL",
Expand Down
46 changes: 31 additions & 15 deletions cache/ghes-3.2.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"openapi": "3.0.3",
"info": {
"version": "7.7.0",
"version": "7.8.0",
"title": "GitHub's official OpenAPI spec + Octokit extension",
"description": "OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs",
"license": {
Expand Down Expand Up @@ -12582,17 +12582,6 @@
}
}
},
"302": {
"description": "Response if requester is not an organization member",
"headers": {
"Location": {
"example": "https://api.github.com/orgs/github/public_members",
"schema": {
"type": "string"
}
}
}
},
"422": {
"$ref": "#/components/responses/validation_failed"
}
Expand Down Expand Up @@ -26756,6 +26745,9 @@
},
"500": {
"$ref": "#/components/responses/internal_error"
},
"503": {
"$ref": "#/components/responses/service_unavailable"
}
},
"x-github": {
Expand Down Expand Up @@ -27177,6 +27169,9 @@
},
"500": {
"$ref": "#/components/responses/internal_error"
},
"503": {
"$ref": "#/components/responses/service_unavailable"
}
},
"x-github": {
Expand Down Expand Up @@ -37218,6 +37213,9 @@
},
"500": {
"$ref": "#/components/responses/internal_error"
},
"503": {
"$ref": "#/components/responses/service_unavailable"
}
},
"x-github": {
Expand Down Expand Up @@ -37784,6 +37782,9 @@
},
"500": {
"$ref": "#/components/responses/internal_error"
},
"503": {
"$ref": "#/components/responses/service_unavailable"
}
},
"x-github": {
Expand Down Expand Up @@ -41518,7 +41519,7 @@
"/repos/{template_owner}/{template_repo}/generate": {
"post": {
"summary": "Create a repository using a template",
"description": "Creates a new repository using a repository template. Use the `template_owner` and `template_repo` route parameters to specify the repository to use as the template. The authenticated user must own or be a member of an organization that owns the repository. To check if a repository is available to use as a template, get the repository's information using the [Get a repository](https://docs.github.com/enterprise-server@3.2/rest/reference/repos#get-a-repository) endpoint and check that the `is_template` key is `true`.\n\n**OAuth scope requirements**\n\nWhen using [OAuth](https://docs.github.com/enterprise-server@3.2/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include:\n\n* `public_repo` scope or `repo` scope to create a public repository. Note: For GitHub AE, use `repo` scope to create an internal repository.\n* `repo` scope to create a private repository",
"description": "Creates a new repository using a repository template. Use the `template_owner` and `template_repo` route parameters to specify the repository to use as the template. If the repository is not public, the authenticated user must own or be a member of an organization that owns the repository. To check if a repository is available to use as a template, get the repository's information using the [Get a repository](https://docs.github.com/enterprise-server@3.2/rest/reference/repos#get-a-repository) endpoint and check that the `is_template` key is `true`.\n\n**OAuth scope requirements**\n\nWhen using [OAuth](https://docs.github.com/enterprise-server@3.2/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/), authorizations must include:\n\n* `public_repo` scope or `repo` scope to create a public repository. Note: For GitHub AE, use `repo` scope to create an internal repository.\n* `repo` scope to create a private repository",
"tags": [
"repos"
],
Expand Down Expand Up @@ -53557,6 +53558,10 @@
"starred_at": {
"type": "string",
"example": "\"2020-07-09T00:17:42Z\""
},
"anonymous_access_enabled": {
"type": "boolean",
"description": "Whether anonymous git access is enabled for this repository"
}
},
"required": [
Expand Down Expand Up @@ -56941,6 +56946,10 @@
"starred_at": {
"type": "string",
"example": "\"2020-07-09T00:17:42Z\""
},
"anonymous_access_enabled": {
"type": "boolean",
"description": "Whether anonymous git access is enabled for this repository"
}
},
"required": [
Expand Down Expand Up @@ -63254,6 +63263,11 @@
"nullable": true,
"type": "string",
"description": "Detailed documentation for the rule as GitHub Flavored Markdown."
},
"help_uri": {
"nullable": true,
"type": "string",
"description": "A link to the documentation for the rule used to detect the alert."
}
}
},
Expand Down Expand Up @@ -84695,7 +84709,8 @@
"security",
"external/cwe/cwe-022"
],
"help": "# Arbitrary file write during zip extraction (\"Zip Slip\")\\nExtracting files from a malicious zip archive without validating that the destination file path is within the destination directory can cause files outside the destination directory to be overwritten ..."
"help": "# Arbitrary file write during zip extraction (\"Zip Slip\")\\nExtracting files from a malicious zip archive without validating that the destination file path is within the destination directory can cause files outside the destination directory to be overwritten ...",
"help_uri": "https://codeql.github.com/"
},
"tool": {
"name": "CodeQL",
Expand Down Expand Up @@ -84764,7 +84779,8 @@
"security",
"external/cwe/cwe-022"
],
"help": "# Arbitrary file write during zip extraction (\"Zip Slip\")\\nExtracting files from a malicious zip archive without validating that the destination file path is within the destination directory can cause files outside the destination directory to be overwritten ..."
"help": "# Arbitrary file write during zip extraction (\"Zip Slip\")\\nExtracting files from a malicious zip archive without validating that the destination file path is within the destination directory can cause files outside the destination directory to be overwritten ...",
"help_uri": "https://codeql.github.com/"
},
"tool": {
"name": "CodeQL",
Expand Down
Loading

0 comments on commit 01faa14

Please sign in to comment.