Updates a codespace owned by the authenticated user. Currently only the codespace's machine type and recent folders can be modified using this endpoint.
\n
If you specify a new machine type it will be applied the next time your codespace is started.
\n
You must authenticate using an access token with the codespace scope to use this endpoint.
",
+ "descriptionHTML": "
Updates a codespace owned by the authenticated user. Currently only the codespace's machine type and recent folders can be modified using this endpoint.
\n
If you specify a new machine type it will be applied the next time your codespace is started.
\n
You must authenticate using an access token with the codespace scope to use this endpoint.
\n
GitHub Apps must have write access to the codespaces repository permission to use this endpoint.
Lists all secrets available in a repository without revealing their encrypted values. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the secrets repository permission to use this endpoint.
Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the secrets repository permission to use this endpoint.
Gets a single repository secret without revealing its encrypted value. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the codespaces_secrets repository permission to use this endpoint.
",
+ "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$",
+ "name": "encrypted_value",
+ "in": "body",
+ "rawType": "string",
+ "rawDescription": "Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get a repository public key](https://docs.github.com/rest/reference/codespaces#get-a-repository-public-key) endpoint.",
+ "childParamsGroups": []
+ },
+ "key_id": {
+ "type": "string",
+ "description": "
Creates or updates a repository secret with an encrypted value. Encrypt your secret using\nLibSodium. You must authenticate using an access\ntoken with the repo scope to use this endpoint. GitHub Apps must have the codespaces_secrets repository\npermission to use this endpoint.
\n
Example of encrypting a secret using Node.js
\n
Encrypt your secret using the tweetsodium library.
\n
const sodium = require('tweetsodium');\n\nconst key = \"base64-encoded-public-key\";\nconst value = \"plain-text-secret\";\n\n// Convert the message and key to Uint8Array's (Buffer implements that interface)\nconst messageBytes = Buffer.from(value);\nconst keyBytes = Buffer.from(key, 'base64');\n\n// Encrypt using LibSodium.\nconst encryptedBytes = sodium.seal(messageBytes, keyBytes);\n\n// Base64 the encrypted secret\nconst encrypted = Buffer.from(encryptedBytes).toString('base64');\n\nconsole.log(encrypted);\n
",
+ "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$",
+ "name": "encrypted_value",
+ "in": "body",
+ "rawType": "string",
+ "rawDescription": "Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get a repository public key](https://docs.github.com/rest/reference/codespaces#get-a-repository-public-key) endpoint.",
+ "childParamsGroups": []
+ },
+ {
+ "type": "string",
+ "description": "
Deletes a secret in a repository using the secret name. You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the codespaces_secrets repository permission to use this endpoint.
Lists all secrets available for a user's Codespaces without revealing their\nencrypted values.\nYou must authenticate using an access token with the user or read:user scope to use this endpoint. User must have Codespaces access to use this endpoint.
",
+ "descriptionHTML": "
Lists all secrets available for a user's Codespaces without revealing their\nencrypted values.
\n
You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint.
\n
GitHub Apps must have read access to the codespaces_user_secrets user permission to use this endpoint.
Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. Anyone with one of the 'read:user' or 'user' scopes in their personal access token. User must have Codespaces access to use this endpoint.
",
+ "descriptionHTML": "
Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets.
\n
You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint.
\n
GitHub Apps must have read access to the codespaces_user_secrets user permission to use this endpoint.
Gets a secret available to a user's codespaces without revealing its encrypted value.\nYou must authenticate using an access token with the user or read:user scope to use this endpoint. User must have Codespaces access to use this endpoint.
",
+ "descriptionHTML": "
Gets a secret available to a user's codespaces without revealing its encrypted value.
\n
You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint.
\n
GitHub Apps must have read access to the codespaces_user_secrets user permission to use this endpoint.
Creates or updates a secret for a user's codespace with an encrypted value. Encrypt your secret using\nLibSodium. You must authenticate using an access token with the user scope to use this endpoint. User must also have Codespaces access to use this endpoint.
\n
Example encrypting a secret using Node.js
\n
Encrypt your secret using the tweetsodium library.
\n
const sodium = require('tweetsodium');\n\nconst key = \"base64-encoded-public-key\";\nconst value = \"plain-text-secret\";\n\n// Convert the message and key to Uint8Array's (Buffer implements that interface)\nconst messageBytes = Buffer.from(value);\nconst keyBytes = Buffer.from(key, 'base64');\n\n// Encrypt using LibSodium.\nconst encryptedBytes = sodium.seal(messageBytes, keyBytes);\n\n// Base64 the encrypted secret\nconst encrypted = Buffer.from(encryptedBytes).toString('base64');\n\nconsole.log(encrypted);\n
Creates or updates a secret for a user's codespace with an encrypted value. Encrypt your secret using\nLibSodium.
\n
You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must also have Codespaces access to use this endpoint.
\n
GitHub Apps must have read access to the codespaces_user_secrets user permission and codespace_secrets repository permission on all referenced repositories to use this endpoint.
\n
Example encrypting a secret using Node.js
\n
Encrypt your secret using the tweetsodium library.
\n
const sodium = require('tweetsodium');\n\nconst key = \"base64-encoded-public-key\";\nconst value = \"plain-text-secret\";\n\n// Convert the message and key to Uint8Array's (Buffer implements that interface)\nconst messageBytes = Buffer.from(value);\nconst keyBytes = Buffer.from(key, 'base64');\n\n// Encrypt using LibSodium.\nconst encryptedBytes = sodium.seal(messageBytes, keyBytes);\n\n// Base64 the encrypted secret\nconst encrypted = Buffer.from(encryptedBytes).toString('base64');\n\nconsole.log(encrypted);\n
Deletes a secret from a user's codespaces using the secret name. Deleting the secret will remove access from all codespaces that were allowed to access the secret. You must authenticate using an access token with the user scope to use this endpoint. User must have Codespaces access to use this endpoint.
",
+ "descriptionHTML": "
Deletes a secret from a user's codespaces using the secret name. Deleting the secret will remove access from all codespaces that were allowed to access the secret.
\n
You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint.
\n
GitHub Apps must have write access to the codespaces_user_secrets user permission to use this endpoint.
List the repositories that have been granted the ability to use a user's codespace secret.\nYou must authenticate using an access token with the user or read:user scope to use this endpoint. User must have Codespaces access to use this endpoint.
",
+ "descriptionHTML": "
List the repositories that have been granted the ability to use a user's codespace secret.
\n
You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint.
\n
GitHub Apps must have read access to the codespaces_user_secrets user permission and write access to the codespace_secrets repository permission on all referenced repositories to use this endpoint.
Select the repositories that will use a user's codespace secret.\nYou must authenticate using an access token with the user or read:user scope to use this endpoint. User must have Codespaces access to use this endpoint.
",
+ "descriptionHTML": "
Select the repositories that will use a user's codespace secret.
\n
You must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint.
\n
GitHub Apps must have write access to the codespaces_user_secrets user permission and write access to the codespace_secrets repository permission on all referenced repositories to use this endpoint.
Adds a repository to the selected repositories for a user's codespace secret.\nYou must authenticate using an access token with the user or read:user scope to use this endpoint. User must have Codespaces access to use this endpoint.
",
+ "descriptionHTML": "
Adds a repository to the selected repositories for a user's codespace secret.\nYou must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint.\nGitHub Apps must have write access to the codespaces_user_secrets user permission and write access to the codespace_secrets repository permission on the referenced repository to use this endpoint.
Removes a repository from the selected repositories for a user's codespace secret.\nYou must authenticate using an access token with the user or read:user scope to use this endpoint. User must have Codespaces access to use this endpoint.
",
+ "descriptionHTML": "
Removes a repository from the selected repositories for a user's codespace secret.\nYou must authenticate using an access token with the codespace or codespace:secrets scope to use this endpoint. User must have Codespaces access to use this endpoint.\nGitHub Apps must have write access to the codespaces_user_secrets user permission to use this endpoint.
",
"responses": [
{
"httpStatusCode": "204",
diff --git a/lib/rest/static/dereferenced/api.github.com.deref.json b/lib/rest/static/dereferenced/api.github.com.deref.json
index 312142e442..0e3667fa6c 100644
--- a/lib/rest/static/dereferenced/api.github.com.deref.json
+++ b/lib/rest/static/dereferenced/api.github.com.deref.json
@@ -232795,7 +232795,7 @@
"/repos/{owner}/{repo}/codespaces": {
"get": {
"summary": "List codespaces in a repository for the authenticated user",
- "description": "Lists the codespaces associated to a specified repository and the authenticated user.\n\nYou must authenticate using an access token with the `codespace` scope to use this endpoint.",
+ "description": "Lists the codespaces associated to a specified repository and the authenticated user.\n\nYou must authenticate using an access token with the `codespace` scope to use this endpoint.\n\nGitHub Apps must have read access to the `codespaces` repository permission to use this endpoint.",
"tags": [
"codespaces"
],
@@ -236022,7 +236022,7 @@
},
"post": {
"summary": "Create a codespace in a repository",
- "description": "Creates a codespace owned by the authenticated user in the specified repository.\n\nYou must authenticate using an access token with the `codespace` scope to use this endpoint.",
+ "description": "Creates a codespace owned by the authenticated user in the specified repository.\n\nYou must authenticate using an access token with the `codespace` scope to use this endpoint.\n\nGitHub Apps must have write access to the `codespaces` repository permission to use this endpoint.",
"tags": [
"codespaces"
],
@@ -241993,7 +241993,7 @@
"/repos/{owner}/{repo}/codespaces/machines": {
"get": {
"summary": "List available machine types for a repository",
- "description": "List the machine types available for a given repository based on its configuration.\n\nYou must authenticate using an access token with the `codespace` scope to use this endpoint.",
+ "description": "List the machine types available for a given repository based on its configuration.\n\nYou must authenticate using an access token with the `codespace` scope to use this endpoint.\n\nGitHub Apps must have write access to the `codespaces_metadata` repository permission to use this endpoint.",
"tags": [
"codespaces"
],
@@ -242263,12 +242263,480 @@
},
"x-github": {
"githubCloudOnly": false,
- "enabledForGitHubApps": false,
+ "enabledForGitHubApps": true,
"category": "codespaces",
"subcategory": "machines"
}
}
},
+ "/repos/{owner}/{repo}/codespaces/secrets": {
+ "get": {
+ "summary": "List repository secrets",
+ "description": "Lists all secrets available in a repository without revealing their encrypted values. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `secrets` repository permission to use this endpoint.",
+ "tags": [
+ "codespaces"
+ ],
+ "operationId": "codespaces/list-repo-secrets",
+ "externalDocs": {
+ "description": "API method documentation",
+ "url": "https://docs.github.com/rest/reference/codespaces#list-repository-secrets"
+ },
+ "parameters": [
+ {
+ "name": "owner",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "repo",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "per_page",
+ "description": "Results per page (max 100)",
+ "in": "query",
+ "schema": {
+ "type": "integer",
+ "default": 30
+ }
+ },
+ {
+ "name": "page",
+ "description": "Page number of the results to fetch.",
+ "in": "query",
+ "schema": {
+ "type": "integer",
+ "default": 1
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "total_count",
+ "secrets"
+ ],
+ "properties": {
+ "total_count": {
+ "type": "integer"
+ },
+ "secrets": {
+ "type": "array",
+ "items": {
+ "title": "Codespaces Secret",
+ "description": "Set repository secrets for GitHub Codespaces.",
+ "type": "object",
+ "properties": {
+ "name": {
+ "description": "The name of the secret.",
+ "type": "string",
+ "examples": [
+ "SECRET_TOKEN"
+ ]
+ },
+ "created_at": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "updated_at": {
+ "type": "string",
+ "format": "date-time"
+ }
+ },
+ "required": [
+ "name",
+ "created_at",
+ "updated_at"
+ ]
+ }
+ }
+ }
+ },
+ "examples": {
+ "default": {
+ "value": {
+ "total_count": 2,
+ "secrets": [
+ {
+ "name": "GH_TOKEN",
+ "created_at": "2019-08-10T14:59:22Z",
+ "updated_at": "2020-01-10T14:59:22Z"
+ },
+ {
+ "name": "GIST_ID",
+ "created_at": "2020-01-10T10:59:22Z",
+ "updated_at": "2020-01-11T11:59:22Z"
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "headers": {
+ "Link": {
+ "example": "; rel=\"next\", ; rel=\"last\"",
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "x-github": {
+ "githubCloudOnly": false,
+ "enabledForGitHubApps": true,
+ "category": "codespaces",
+ "subcategory": "repository-secrets"
+ }
+ }
+ },
+ "/repos/{owner}/{repo}/codespaces/secrets/public-key": {
+ "get": {
+ "summary": "Get a repository public key",
+ "description": "Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the `repo` scope. GitHub Apps must have the `secrets` repository permission to use this endpoint.",
+ "tags": [
+ "codespaces"
+ ],
+ "operationId": "codespaces/get-repo-public-key",
+ "externalDocs": {
+ "description": "API method documentation",
+ "url": "https://docs.github.com/rest/reference/codespaces#get-a-repository-public-key"
+ },
+ "parameters": [
+ {
+ "name": "owner",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "repo",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "title": "CodespacesPublicKey",
+ "description": "The public key used for setting Codespaces secrets.",
+ "type": "object",
+ "properties": {
+ "key_id": {
+ "description": "The identifier for the key.",
+ "type": "string",
+ "examples": [
+ "1234567"
+ ]
+ },
+ "key": {
+ "description": "The Base64 encoded public key.",
+ "type": "string",
+ "examples": [
+ "hBT5WZEj8ZoOv6TYJsfWq7MxTEQopZO5/IT3ZCVQPzs="
+ ]
+ },
+ "id": {
+ "type": "integer",
+ "examples": [
+ 2
+ ]
+ },
+ "url": {
+ "type": "string",
+ "examples": [
+ "https://api.github.com/user/keys/2"
+ ]
+ },
+ "title": {
+ "type": "string",
+ "examples": [
+ "ssh-rsa AAAAB3NzaC1yc2EAAA"
+ ]
+ },
+ "created_at": {
+ "type": "string",
+ "examples": [
+ "2011-01-26T19:01:12Z"
+ ]
+ }
+ },
+ "required": [
+ "key_id",
+ "key"
+ ]
+ },
+ "examples": {
+ "default": {
+ "value": {
+ "key_id": "012345678912345678",
+ "key": "2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "x-github": {
+ "githubCloudOnly": false,
+ "enabledForGitHubApps": false,
+ "category": "codespaces",
+ "subcategory": "repository-secrets"
+ }
+ }
+ },
+ "/repos/{owner}/{repo}/codespaces/secrets/{secret_name}": {
+ "get": {
+ "summary": "Get a repository secret",
+ "description": "Gets a single repository secret without revealing its encrypted value. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `codespaces_secrets` repository permission to use this endpoint.",
+ "tags": [
+ "codespaces"
+ ],
+ "operationId": "codespaces/get-repo-secret",
+ "externalDocs": {
+ "description": "API method documentation",
+ "url": "https://docs.github.com/rest/reference/codespaces#get-a-repository-secret"
+ },
+ "parameters": [
+ {
+ "name": "owner",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "repo",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "secret_name",
+ "description": "secret_name parameter",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "title": "Codespaces Secret",
+ "description": "Set repository secrets for GitHub Codespaces.",
+ "type": "object",
+ "properties": {
+ "name": {
+ "description": "The name of the secret.",
+ "type": "string",
+ "examples": [
+ "SECRET_TOKEN"
+ ]
+ },
+ "created_at": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "updated_at": {
+ "type": "string",
+ "format": "date-time"
+ }
+ },
+ "required": [
+ "name",
+ "created_at",
+ "updated_at"
+ ]
+ },
+ "examples": {
+ "default": {
+ "value": {
+ "name": "GH_TOKEN",
+ "created_at": "2019-08-10T14:59:22Z",
+ "updated_at": "2020-01-10T14:59:22Z"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "x-github": {
+ "githubCloudOnly": false,
+ "enabledForGitHubApps": true,
+ "category": "codespaces",
+ "subcategory": "repository-secrets"
+ }
+ },
+ "put": {
+ "summary": "Create or update a repository secret",
+ "description": "Creates or updates a repository secret with an encrypted value. Encrypt your secret using\n[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access\ntoken with the `repo` scope to use this endpoint. GitHub Apps must have the `codespaces_secrets` repository\npermission to use this endpoint.\n\n#### Example of encrypting a secret using Node.js\n\nEncrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library.\n\n```\nconst sodium = require('tweetsodium');\n\nconst key = \"base64-encoded-public-key\";\nconst value = \"plain-text-secret\";\n\n// Convert the message and key to Uint8Array's (Buffer implements that interface)\nconst messageBytes = Buffer.from(value);\nconst keyBytes = Buffer.from(key, 'base64');\n\n// Encrypt using LibSodium.\nconst encryptedBytes = sodium.seal(messageBytes, keyBytes);\n\n// Base64 the encrypted secret\nconst encrypted = Buffer.from(encryptedBytes).toString('base64');\n\nconsole.log(encrypted);\n```\n\n\n#### Example of encrypting a secret using Python\n\nEncrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox) with Python 3.\n\n```\nfrom base64 import b64encode\nfrom nacl import encoding, public\n\ndef encrypt(public_key: str, secret_value: str) -> str:\n \"\"\"Encrypt a Unicode string using the public key.\"\"\"\n public_key = public.PublicKey(public_key.encode(\"utf-8\"), encoding.Base64Encoder())\n sealed_box = public.SealedBox(public_key)\n encrypted = sealed_box.encrypt(secret_value.encode(\"utf-8\"))\n return b64encode(encrypted).decode(\"utf-8\")\n```\n\n#### Example of encrypting a secret using C#\n\nEncrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package.\n\n```\nvar secretValue = System.Text.Encoding.UTF8.GetBytes(\"mySecret\");\nvar publicKey = Convert.FromBase64String(\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU=\");\n\nvar sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey);\n\nConsole.WriteLine(Convert.ToBase64String(sealedPublicKeyBox));\n```\n\n#### Example of encrypting a secret using Ruby\n\nEncrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem.\n\n```ruby\nrequire \"rbnacl\"\nrequire \"base64\"\n\nkey = Base64.decode64(\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\")\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(\"my_secret\")\n\n# Print the base64 encoded secret\nputs Base64.strict_encode64(encrypted_secret)\n```",
+ "tags": [
+ "codespaces"
+ ],
+ "operationId": "codespaces/create-or-update-repo-secret",
+ "externalDocs": {
+ "description": "API method documentation",
+ "url": "https://docs.github.com/rest/reference/codespaces#create-or-update-a-repository-secret"
+ },
+ "parameters": [
+ {
+ "name": "owner",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "repo",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "secret_name",
+ "description": "secret_name parameter",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "encrypted_value": {
+ "type": "string",
+ "description": "Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get a repository public key](https://docs.github.com/rest/reference/codespaces#get-a-repository-public-key) endpoint.",
+ "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$"
+ },
+ "key_id": {
+ "type": "string",
+ "description": "ID of the key you used to encrypt the secret."
+ }
+ }
+ },
+ "example": {
+ "encrypted_value": "c2VjcmV0",
+ "key_id": "012345678912345678"
+ }
+ }
+ }
+ },
+ "responses": {
+ "201": {
+ "description": "Response when creating a secret",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ },
+ "additionalProperties": false
+ }
+ }
+ }
+ },
+ "204": {
+ "description": "Response when updating a secret"
+ }
+ },
+ "x-github": {
+ "githubCloudOnly": false,
+ "enabledForGitHubApps": true,
+ "category": "codespaces",
+ "subcategory": "repository-secrets"
+ }
+ },
+ "delete": {
+ "summary": "Delete a repository secret",
+ "description": "Deletes a secret in a repository using the secret name. You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `codespaces_secrets` repository permission to use this endpoint.",
+ "tags": [
+ "codespaces"
+ ],
+ "operationId": "codespaces/delete-repo-secret",
+ "externalDocs": {
+ "description": "API method documentation",
+ "url": "https://docs.github.com/rest/reference/codespaces#delete-a-repository-secret"
+ },
+ "parameters": [
+ {
+ "name": "owner",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "repo",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "secret_name",
+ "description": "secret_name parameter",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "Response"
+ }
+ },
+ "x-github": {
+ "githubCloudOnly": false,
+ "enabledForGitHubApps": true,
+ "category": "codespaces",
+ "subcategory": "repository-secrets"
+ }
+ }
+ },
"/repos/{owner}/{repo}/collaborators": {
"get": {
"summary": "List repository collaborators",
@@ -400171,7 +400639,7 @@
"/repos/{owner}/{repo}/pulls/{pull_number}/codespaces": {
"post": {
"summary": "Create a codespace from a pull request",
- "description": "Creates a codespace owned by the authenticated user for the specified pull request.\n\nYou must authenticate using an access token with the `codespace` scope to use this endpoint.",
+ "description": "Creates a codespace owned by the authenticated user for the specified pull request.\n\nYou must authenticate using an access token with the `codespace` scope to use this endpoint.\n\nGitHub Apps must have write access to the `codespaces` repository permission to use this endpoint.",
"tags": [
"codespaces"
],
@@ -479786,7 +480254,7 @@
"/user/codespaces": {
"get": {
"summary": "List codespaces for the authenticated user",
- "description": "Lists the authenticated user's codespaces.\n\nYou must authenticate using an access token with the `codespace` scope to use this endpoint.",
+ "description": "Lists the authenticated user's codespaces.\n\nYou must authenticate using an access token with the `codespace` scope to use this endpoint.\n\nGitHub Apps must have read access to the `codespaces` repository permission to use this endpoint.",
"tags": [
"codespaces"
],
@@ -483153,7 +483621,7 @@
},
"post": {
"summary": "Create a codespace for the authenticated user",
- "description": "Creates a new codespace, owned by the authenticated user.\n\nThis endpoint requires either a `repository_id` OR a `pull_request` but not both.\n\nYou must authenticate using an access token with the `codespace` scope to use this endpoint.",
+ "description": "Creates a new codespace, owned by the authenticated user.\n\nThis endpoint requires either a `repository_id` OR a `pull_request` but not both.\n\nYou must authenticate using an access token with the `codespace` scope to use this endpoint.\n\nGitHub Apps must have write access to the `codespaces` repository permission to use this endpoint.",
"tags": [
"codespaces"
],
@@ -489157,7 +489625,7 @@
"/user/codespaces/secrets": {
"get": {
"summary": "List secrets for the authenticated user",
- "description": "Lists all secrets available for a user's Codespaces without revealing their\nencrypted values.\nYou must authenticate using an access token with the `user` or `read:user` scope to use this endpoint. User must have Codespaces access to use this endpoint.",
+ "description": "Lists all secrets available for a user's Codespaces without revealing their\nencrypted values.\n\nYou must authenticate using an access token with the `codespace` or `codespace:secrets` scope to use this endpoint. User must have Codespaces access to use this endpoint.\n\nGitHub Apps must have read access to the `codespaces_user_secrets` user permission to use this endpoint.",
"tags": [
"codespaces"
],
@@ -489524,7 +489992,7 @@
"/user/codespaces/secrets/public-key": {
"get": {
"summary": "Get public key for the authenticated user",
- "description": "Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. Anyone with one of the 'read:user' or 'user' scopes in their personal access token. User must have Codespaces access to use this endpoint.",
+ "description": "Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets.\n\nYou must authenticate using an access token with the `codespace` or `codespace:secrets` scope to use this endpoint. User must have Codespaces access to use this endpoint.\n\nGitHub Apps must have read access to the `codespaces_user_secrets` user permission to use this endpoint.",
"tags": [
"codespaces"
],
@@ -489586,7 +490054,7 @@
"/user/codespaces/secrets/{secret_name}": {
"get": {
"summary": "Get a secret for the authenticated user",
- "description": "Gets a secret available to a user's codespaces without revealing its encrypted value.\nYou must authenticate using an access token with the `user` or `read:user` scope to use this endpoint. User must have Codespaces access to use this endpoint.",
+ "description": "Gets a secret available to a user's codespaces without revealing its encrypted value.\n\nYou must authenticate using an access token with the `codespace` or `codespace:secrets` scope to use this endpoint. User must have Codespaces access to use this endpoint.\n\nGitHub Apps must have read access to the `codespaces_user_secrets` user permission to use this endpoint.",
"tags": [
"codespaces"
],
@@ -489680,7 +490148,7 @@
},
"put": {
"summary": "Create or update a secret for the authenticated user",
- "description": "Creates or updates a secret for a user's codespace with an encrypted value. Encrypt your secret using\n[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access token with the `user` scope to use this endpoint. User must also have Codespaces access to use this endpoint.\n\n#### Example encrypting a secret using Node.js\n\nEncrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library.\n\n```\nconst sodium = require('tweetsodium');\n\nconst key = \"base64-encoded-public-key\";\nconst value = \"plain-text-secret\";\n\n// Convert the message and key to Uint8Array's (Buffer implements that interface)\nconst messageBytes = Buffer.from(value);\nconst keyBytes = Buffer.from(key, 'base64');\n\n// Encrypt using LibSodium.\nconst encryptedBytes = sodium.seal(messageBytes, keyBytes);\n\n// Base64 the encrypted secret\nconst encrypted = Buffer.from(encryptedBytes).toString('base64');\n\nconsole.log(encrypted);\n```\n\n\n#### Example encrypting a secret using Python\n\nEncrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox) with Python 3.\n\n```\nfrom base64 import b64encode\nfrom nacl import encoding, public\n\ndef encrypt(public_key: str, secret_value: str) -> str:\n \"\"\"Encrypt a Unicode string using the public key.\"\"\"\n public_key = public.PublicKey(public_key.encode(\"utf-8\"), encoding.Base64Encoder())\n sealed_box = public.SealedBox(public_key)\n encrypted = sealed_box.encrypt(secret_value.encode(\"utf-8\"))\n return b64encode(encrypted).decode(\"utf-8\")\n```\n\n#### Example encrypting a secret using C#\n\nEncrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package.\n\n```\nvar secretValue = System.Text.Encoding.UTF8.GetBytes(\"mySecret\");\nvar publicKey = Convert.FromBase64String(\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU=\");\n\nvar sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey);\n\nConsole.WriteLine(Convert.ToBase64String(sealedPublicKeyBox));\n```\n\n#### Example encrypting a secret using Ruby\n\nEncrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem.\n\n```ruby\nrequire \"rbnacl\"\nrequire \"base64\"\n\nkey = Base64.decode64(\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\")\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(\"my_secret\")\n\n# Print the base64 encoded secret\nputs Base64.strict_encode64(encrypted_secret)\n```",
+ "description": "Creates or updates a secret for a user's codespace with an encrypted value. Encrypt your secret using\n[LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages).\n\nYou must authenticate using an access token with the `codespace` or `codespace:secrets` scope to use this endpoint. User must also have Codespaces access to use this endpoint.\n\nGitHub Apps must have read access to the `codespaces_user_secrets` user permission and `codespace_secrets` repository permission on all referenced repositories to use this endpoint.\n\n#### Example encrypting a secret using Node.js\n\nEncrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library.\n\n```\nconst sodium = require('tweetsodium');\n\nconst key = \"base64-encoded-public-key\";\nconst value = \"plain-text-secret\";\n\n// Convert the message and key to Uint8Array's (Buffer implements that interface)\nconst messageBytes = Buffer.from(value);\nconst keyBytes = Buffer.from(key, 'base64');\n\n// Encrypt using LibSodium.\nconst encryptedBytes = sodium.seal(messageBytes, keyBytes);\n\n// Base64 the encrypted secret\nconst encrypted = Buffer.from(encryptedBytes).toString('base64');\n\nconsole.log(encrypted);\n```\n\n\n#### Example encrypting a secret using Python\n\nEncrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox) with Python 3.\n\n```\nfrom base64 import b64encode\nfrom nacl import encoding, public\n\ndef encrypt(public_key: str, secret_value: str) -> str:\n \"\"\"Encrypt a Unicode string using the public key.\"\"\"\n public_key = public.PublicKey(public_key.encode(\"utf-8\"), encoding.Base64Encoder())\n sealed_box = public.SealedBox(public_key)\n encrypted = sealed_box.encrypt(secret_value.encode(\"utf-8\"))\n return b64encode(encrypted).decode(\"utf-8\")\n```\n\n#### Example encrypting a secret using C#\n\nEncrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package.\n\n```\nvar secretValue = System.Text.Encoding.UTF8.GetBytes(\"mySecret\");\nvar publicKey = Convert.FromBase64String(\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU=\");\n\nvar sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey);\n\nConsole.WriteLine(Convert.ToBase64String(sealedPublicKeyBox));\n```\n\n#### Example encrypting a secret using Ruby\n\nEncrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem.\n\n```ruby\nrequire \"rbnacl\"\nrequire \"base64\"\n\nkey = Base64.decode64(\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\")\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(\"my_secret\")\n\n# Print the base64 encoded secret\nputs Base64.strict_encode64(encrypted_secret)\n```",
"tags": [
"codespaces"
],
@@ -489867,7 +490335,7 @@
},
"delete": {
"summary": "Delete a secret for the authenticated user",
- "description": "Deletes a secret from a user's codespaces using the secret name. Deleting the secret will remove access from all codespaces that were allowed to access the secret. You must authenticate using an access token with the `user` scope to use this endpoint. User must have Codespaces access to use this endpoint.",
+ "description": "Deletes a secret from a user's codespaces using the secret name. Deleting the secret will remove access from all codespaces that were allowed to access the secret.\n\nYou must authenticate using an access token with the `codespace` or `codespace:secrets` scope to use this endpoint. User must have Codespaces access to use this endpoint.\n\nGitHub Apps must have write access to the `codespaces_user_secrets` user permission to use this endpoint.",
"tags": [
"codespaces"
],
@@ -489903,7 +490371,7 @@
"/user/codespaces/secrets/{secret_name}/repositories": {
"get": {
"summary": "List selected repositories for a user secret",
- "description": "List the repositories that have been granted the ability to use a user's codespace secret.\nYou must authenticate using an access token with the `user` or `read:user` scope to use this endpoint. User must have Codespaces access to use this endpoint.",
+ "description": "List the repositories that have been granted the ability to use a user's codespace secret.\n\nYou must authenticate using an access token with the `codespace` or `codespace:secrets` scope to use this endpoint. User must have Codespaces access to use this endpoint.\n\nGitHub Apps must have read access to the `codespaces_user_secrets` user permission and write access to the `codespace_secrets` repository permission on all referenced repositories to use this endpoint.",
"tags": [
"codespaces"
],
@@ -492419,7 +492887,7 @@
},
"put": {
"summary": "Set selected repositories for a user secret",
- "description": "Select the repositories that will use a user's codespace secret.\nYou must authenticate using an access token with the `user` or `read:user` scope to use this endpoint. User must have Codespaces access to use this endpoint.",
+ "description": "Select the repositories that will use a user's codespace secret.\n\nYou must authenticate using an access token with the `codespace` or `codespace:secrets` scope to use this endpoint. User must have Codespaces access to use this endpoint.\n\nGitHub Apps must have write access to the `codespaces_user_secrets` user permission and write access to the `codespace_secrets` repository permission on all referenced repositories to use this endpoint.",
"tags": [
"codespaces"
],
@@ -492587,7 +493055,7 @@
"/user/codespaces/secrets/{secret_name}/repositories/{repository_id}": {
"put": {
"summary": "Add a selected repository to a user secret",
- "description": "Adds a repository to the selected repositories for a user's codespace secret.\nYou must authenticate using an access token with the `user` or `read:user` scope to use this endpoint. User must have Codespaces access to use this endpoint.",
+ "description": "Adds a repository to the selected repositories for a user's codespace secret.\nYou must authenticate using an access token with the `codespace` or `codespace:secrets` scope to use this endpoint. User must have Codespaces access to use this endpoint.\nGitHub Apps must have write access to the `codespaces_user_secrets` user permission and write access to the `codespace_secrets` repository permission on the referenced repository to use this endpoint.",
"tags": [
"codespaces"
],
@@ -492733,7 +493201,7 @@
},
"delete": {
"summary": "Remove a selected repository from a user secret",
- "description": "Removes a repository from the selected repositories for a user's codespace secret.\nYou must authenticate using an access token with the `user` or `read:user` scope to use this endpoint. User must have Codespaces access to use this endpoint.",
+ "description": "Removes a repository from the selected repositories for a user's codespace secret.\nYou must authenticate using an access token with the `codespace` or `codespace:secrets` scope to use this endpoint. User must have Codespaces access to use this endpoint.\nGitHub Apps must have write access to the `codespaces_user_secrets` user permission to use this endpoint.",
"tags": [
"codespaces"
],
@@ -492881,7 +493349,7 @@
"/user/codespaces/{codespace_name}": {
"get": {
"summary": "Get a codespace for the authenticated user",
- "description": "Gets information about a user's codespace.\n\nYou must authenticate using an access token with the `codespace` scope to use this endpoint.",
+ "description": "Gets information about a user's codespace.\n\nYou must authenticate using an access token with the `codespace` scope to use this endpoint.\n\nGitHub Apps must have read access to the `codespaces` repository permission to use this endpoint.",
"tags": [
"codespaces"
],
@@ -495922,7 +496390,7 @@
},
"patch": {
"summary": "Update a codespace for the authenticated user",
- "description": "Updates a codespace owned by the authenticated user. Currently only the codespace's machine type and recent folders can be modified using this endpoint.\n\nIf you specify a new machine type it will be applied the next time your codespace is started.\n\nYou must authenticate using an access token with the `codespace` scope to use this endpoint.",
+ "description": "Updates a codespace owned by the authenticated user. Currently only the codespace's machine type and recent folders can be modified using this endpoint.\n\nIf you specify a new machine type it will be applied the next time your codespace is started.\n\nYou must authenticate using an access token with the `codespace` scope to use this endpoint.\n\nGitHub Apps must have write access to the `codespaces` repository permission to use this endpoint.",
"tags": [
"codespaces"
],
@@ -498968,7 +499436,7 @@
},
"delete": {
"summary": "Delete a codespace for the authenticated user",
- "description": "Deletes a user's codespace.\n\nYou must authenticate using an access token with the `codespace` scope to use this endpoint.",
+ "description": "Deletes a user's codespace.\n\nYou must authenticate using an access token with the `codespace` scope to use this endpoint.\n\nGitHub Apps must have write access to the `codespaces` repository permission to use this endpoint.",
"tags": [
"codespaces"
],
@@ -499118,7 +499586,7 @@
"/user/codespaces/{codespace_name}/exports": {
"post": {
"summary": "Export a codespace for the authenticated user",
- "description": "Triggers an export of the specified codespace and returns a URL and ID where the status of the export can be monitored.\n\nYou must authenticate using a personal access token with the `codespace` scope to use this endpoint.",
+ "description": "Triggers an export of the specified codespace and returns a URL and ID where the status of the export can be monitored.\n\nYou must authenticate using a personal access token with the `codespace` scope to use this endpoint.\n\nGitHub Apps must have write access to the `codespaces_lifecycle_admin` repository permission to use this endpoint.",
"tags": [
"codespaces"
],
@@ -499417,7 +499885,7 @@
"/user/codespaces/{codespace_name}/exports/{export_id}": {
"get": {
"summary": "Get details about a codespace export",
- "description": "Gets information about an export of a codespace.\n\nYou must authenticate using a personal access token with the `codespace` scope to use this endpoint.",
+ "description": "Gets information about an export of a codespace.\n\nYou must authenticate using a personal access token with the `codespace` scope to use this endpoint.\n\nGitHub Apps must have read access to the `codespaces_lifecycle_admin` repository permission to use this endpoint.",
"tags": [
"codespaces"
],
@@ -499572,7 +500040,7 @@
"/user/codespaces/{codespace_name}/machines": {
"get": {
"summary": "List machine types for a codespace",
- "description": "List the machine types a codespace can transition to use.\n\nYou must authenticate using an access token with the `codespace` scope to use this endpoint.",
+ "description": "List the machine types a codespace can transition to use.\n\nYou must authenticate using an access token with the `codespace` scope to use this endpoint.\n\nGitHub Apps must have read access to the `codespaces_metadata` repository permission to use this endpoint.",
"tags": [
"codespaces"
],
@@ -499833,7 +500301,7 @@
"/user/codespaces/{codespace_name}/start": {
"post": {
"summary": "Start a codespace for the authenticated user",
- "description": "Starts a user's codespace.\n\nYou must authenticate using an access token with the `codespace` scope to use this endpoint.",
+ "description": "Starts a user's codespace.\n\nYou must authenticate using an access token with the `codespace` scope to use this endpoint.\n\nGitHub Apps must have write access to the `codespaces_lifecycle_admin` repository permission to use this endpoint.",
"tags": [
"codespaces"
],
@@ -502996,7 +503464,7 @@
"/user/codespaces/{codespace_name}/stop": {
"post": {
"summary": "Stop a codespace for the authenticated user",
- "description": "Stops a user's codespace.\n\nYou must authenticate using an access token with the `codespace` scope to use this endpoint.",
+ "description": "Stops a user's codespace.\n\nYou must authenticate using an access token with the `codespace` scope to use this endpoint.\n\nGitHub Apps must have write access to the `codespaces_lifecycle_admin` repository permission to use this endpoint.",
"tags": [
"codespaces"
],