@@ -16,7 +16,7 @@ topics:
|
||||
- Workflows
|
||||
- CI
|
||||
---
|
||||
|
||||
|
||||
{% data reusables.actions.enterprise-github-hosted-runners %}
|
||||
|
||||
## Overview
|
||||
@@ -47,6 +47,17 @@ This procedure demonstrates how to create a starter workflow and metadata file.
|
||||
|
||||
If you need to refer to a repository's default branch, you can use the `$default-branch` placeholder. When a workflow is created the placeholder will be automatically replaced with the name of the repository's default branch.
|
||||
|
||||
{% ifversion ghes %}
|
||||
{% note %}
|
||||
|
||||
**Note:** The following values in the `runs-on` key are also treated as placeholders:
|
||||
|
||||
- "ubuntu-latest" is replaced with "[ self-hosted ]"
|
||||
- "windows-latest" is replaced with "[ self-hosted, windows ]"
|
||||
- "macos-latest" is replaced with "[ self-hosted, macOS ]"
|
||||
|
||||
{% endnote %}{% endif %}
|
||||
|
||||
For example, this file named `octo-organization-ci.yml` demonstrates a basic workflow.
|
||||
|
||||
```yaml copy
|
||||
|
||||
@@ -60,5 +60,5 @@
|
||||
"2022-11-28"
|
||||
]
|
||||
},
|
||||
"sha": "be35f587277120cef36dbfbf30d545825dd65044"
|
||||
"sha": "902841d79e04ac06ca03c8499a6fe4d32cd39370"
|
||||
}
|
||||
@@ -5342,7 +5342,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates an organization secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>.</p>\n<p>You must authenticate using an access token with the <code>admin:org</code> scope to use this endpoint.\nIf the repository is private, you must use an access token with the <code>repo</code> scope.\nGitHub Apps must have the <code>secrets</code> organization permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>\n<p>*<em>Example encrypting a secret using Node.js</em></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates an organization secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access token with the <code>admin:org</code> scope to use this endpoint.\nIf the repository is private, you must use an access token with the <code>repo</code> scope.\nGitHub Apps must have the <code>secrets</code> organization permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
@@ -7157,7 +7157,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates a repository secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>.</p>\n<p>You must authenticate using an access token with the <code>repo</code> scope to use this endpoint.\nGitHub Apps must have the <code>secrets</code> repository permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>\n<p><strong>Example encrypting a secret using Node.js</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates a repository secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access token with the <code>repo</code> scope to use this endpoint.\nGitHub Apps must have the <code>secrets</code> repository permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
@@ -7679,7 +7679,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates an environment secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>.</p>\n<p>You must authenticate using an access token with the <code>repo</code> scope to use this endpoint.\nGitHub Apps must have the <code>secrets</code> repository permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>\n<p><strong>Example encrypting a secret using Node.js</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates an environment secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access token with the <code>repo</code> scope to use this endpoint.\nGitHub Apps must have the <code>secrets</code> repository permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
@@ -183127,7 +183127,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates an organization secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. You must authenticate using an access\ntoken with the <code>admin:org</code> scope to use this endpoint.</p>\n<p><strong>Example encrypting a secret using Node.js</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates an organization secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access\ntoken with the <code>admin:org</code> scope to use this endpoint.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
@@ -191043,7 +191043,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates a repository secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. You must authenticate using an access\ntoken with the <code>repo</code> scope to use this endpoint. GitHub Apps must have write access to the <code>codespaces_secrets</code>\nrepository permission to use this endpoint.</p>\n<p>Example of encrypting a secret using Node.js:</p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p>Example of encrypting a secret using Python:</p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p>Example of encrypting a secret using C#:</p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p>Example of encrypting a secret using Ruby:</p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates a repository secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access\ntoken with the <code>repo</code> scope to use this endpoint. GitHub Apps must have write access to the <code>codespaces_secrets</code>\nrepository permission to use this endpoint.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
@@ -191515,7 +191515,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates a secret for a user's codespace with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>.</p>\n<p>You must authenticate using an access token with the <code>codespace</code> or <code>codespace:secrets</code> scope to use this endpoint. User must also have Codespaces access to use this endpoint.</p>\n<p>GitHub Apps must have write access to the <code>codespaces_user_secrets</code> user permission and <code>codespaces_secrets</code> repository permission on all referenced repositories to use this endpoint.</p>\n<p><strong>Example encrypting a secret using Node.js</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates a secret for a user's codespace with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access token with the <code>codespace</code> or <code>codespace:secrets</code> scope to use this endpoint. User must also have Codespaces access to use this endpoint.</p>\n<p>GitHub Apps must have write access to the <code>codespaces_user_secrets</code> user permission and <code>codespaces_secrets</code> repository permission on all referenced repositories to use this endpoint.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
@@ -223015,7 +223015,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates an organization secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. You must authenticate using an access\ntoken with the <code>admin:org</code> scope to use this endpoint. GitHub Apps must have the <code>dependabot_secrets</code> organization\npermission to use this endpoint.</p>\n<p><strong>Example encrypting a secret using Node.js</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates an organization secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access\ntoken with the <code>admin:org</code> scope to use this endpoint. GitHub Apps must have the <code>dependabot_secrets</code> organization\npermission to use this endpoint.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
@@ -224675,7 +224675,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates a repository secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. You must authenticate using an access\ntoken with the <code>repo</code> scope to use this endpoint. GitHub Apps must have the <code>dependabot_secrets</code> repository\npermission to use this endpoint.</p>\n<p><strong>Example encrypting a secret using Node.js</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates a repository secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access\ntoken with the <code>repo</code> scope to use this endpoint. GitHub Apps must have the <code>dependabot_secrets</code> repository\npermission to use this endpoint.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
|
||||
@@ -4553,7 +4553,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates an organization secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>.</p>\n<p>You must authenticate using an access token with the <code>admin:org</code> scope to use this endpoint.\nIf the repository is private, you must use an access token with the <code>repo</code> scope.\nGitHub Apps must have the <code>secrets</code> organization permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>\n<p>*<em>Example encrypting a secret using Node.js</em></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates an organization secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/github-ae@latest/rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access token with the <code>admin:org</code> scope to use this endpoint.\nIf the repository is private, you must use an access token with the <code>repo</code> scope.\nGitHub Apps must have the <code>secrets</code> organization permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
@@ -6368,7 +6368,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates a repository secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>.</p>\n<p>You must authenticate using an access token with the <code>repo</code> scope to use this endpoint.\nGitHub Apps must have the <code>secrets</code> repository permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>\n<p><strong>Example encrypting a secret using Node.js</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates a repository secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/github-ae@latest/rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access token with the <code>repo</code> scope to use this endpoint.\nGitHub Apps must have the <code>secrets</code> repository permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
|
||||
@@ -6282,7 +6282,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates an organization secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>.</p>\n<p>You must authenticate using an access token with the <code>admin:org</code> scope to use this endpoint.\nIf the repository is private, you must use an access token with the <code>repo</code> scope.\nGitHub Apps must have the <code>secrets</code> organization permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>\n<p>*<em>Example encrypting a secret using Node.js</em></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates an organization secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/enterprise-cloud@latest//rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access token with the <code>admin:org</code> scope to use this endpoint.\nIf the repository is private, you must use an access token with the <code>repo</code> scope.\nGitHub Apps must have the <code>secrets</code> organization permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
@@ -8097,7 +8097,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates a repository secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>.</p>\n<p>You must authenticate using an access token with the <code>repo</code> scope to use this endpoint.\nGitHub Apps must have the <code>secrets</code> repository permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>\n<p><strong>Example encrypting a secret using Node.js</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates a repository secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/enterprise-cloud@latest//rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access token with the <code>repo</code> scope to use this endpoint.\nGitHub Apps must have the <code>secrets</code> repository permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
@@ -8619,7 +8619,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates an environment secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>.</p>\n<p>You must authenticate using an access token with the <code>repo</code> scope to use this endpoint.\nGitHub Apps must have the <code>secrets</code> repository permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>\n<p><strong>Example encrypting a secret using Node.js</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates an environment secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/enterprise-cloud@latest//rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access token with the <code>repo</code> scope to use this endpoint.\nGitHub Apps must have the <code>secrets</code> repository permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
@@ -194826,7 +194826,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates an organization secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. You must authenticate using an access\ntoken with the <code>admin:org</code> scope to use this endpoint.</p>\n<p><strong>Example encrypting a secret using Node.js</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates an organization secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/enterprise-cloud@latest//rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access\ntoken with the <code>admin:org</code> scope to use this endpoint.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
@@ -202742,7 +202742,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates a repository secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. You must authenticate using an access\ntoken with the <code>repo</code> scope to use this endpoint. GitHub Apps must have write access to the <code>codespaces_secrets</code>\nrepository permission to use this endpoint.</p>\n<p>Example of encrypting a secret using Node.js:</p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p>Example of encrypting a secret using Python:</p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p>Example of encrypting a secret using C#:</p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p>Example of encrypting a secret using Ruby:</p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates a repository secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/enterprise-cloud@latest//rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access\ntoken with the <code>repo</code> scope to use this endpoint. GitHub Apps must have write access to the <code>codespaces_secrets</code>\nrepository permission to use this endpoint.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
@@ -203214,7 +203214,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates a secret for a user's codespace with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>.</p>\n<p>You must authenticate using an access token with the <code>codespace</code> or <code>codespace:secrets</code> scope to use this endpoint. User must also have Codespaces access to use this endpoint.</p>\n<p>GitHub Apps must have write access to the <code>codespaces_user_secrets</code> user permission and <code>codespaces_secrets</code> repository permission on all referenced repositories to use this endpoint.</p>\n<p><strong>Example encrypting a secret using Node.js</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates a secret for a user's codespace with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/enterprise-cloud@latest//rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access token with the <code>codespace</code> or <code>codespace:secrets</code> scope to use this endpoint. User must also have Codespaces access to use this endpoint.</p>\n<p>GitHub Apps must have write access to the <code>codespaces_user_secrets</code> user permission and <code>codespaces_secrets</code> repository permission on all referenced repositories to use this endpoint.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
@@ -234714,7 +234714,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates an organization secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. You must authenticate using an access\ntoken with the <code>admin:org</code> scope to use this endpoint. GitHub Apps must have the <code>dependabot_secrets</code> organization\npermission to use this endpoint.</p>\n<p><strong>Example encrypting a secret using Node.js</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates an organization secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/enterprise-cloud@latest//rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access\ntoken with the <code>admin:org</code> scope to use this endpoint. GitHub Apps must have the <code>dependabot_secrets</code> organization\npermission to use this endpoint.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
@@ -236374,7 +236374,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates a repository secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. You must authenticate using an access\ntoken with the <code>repo</code> scope to use this endpoint. GitHub Apps must have the <code>dependabot_secrets</code> repository\npermission to use this endpoint.</p>\n<p><strong>Example encrypting a secret using Node.js</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates a repository secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/enterprise-cloud@latest//rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access\ntoken with the <code>repo</code> scope to use this endpoint. GitHub Apps must have the <code>dependabot_secrets</code> repository\npermission to use this endpoint.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
|
||||
@@ -5704,7 +5704,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates an organization secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>.</p>\n<p>You must authenticate using an access token with the <code>admin:org</code> scope to use this endpoint.\nIf the repository is private, you must use an access token with the <code>repo</code> scope.\nGitHub Apps must have the <code>secrets</code> organization permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>\n<p>*<em>Example encrypting a secret using Node.js</em></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates an organization secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/enterprise-server@3.6/rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access token with the <code>admin:org</code> scope to use this endpoint.\nIf the repository is private, you must use an access token with the <code>repo</code> scope.\nGitHub Apps must have the <code>secrets</code> organization permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
@@ -7327,7 +7327,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates a repository secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>.</p>\n<p>You must authenticate using an access token with the <code>repo</code> scope to use this endpoint.\nGitHub Apps must have the <code>secrets</code> repository permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>\n<p><strong>Example encrypting a secret using Node.js</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates a repository secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/enterprise-server@3.6/rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access token with the <code>repo</code> scope to use this endpoint.\nGitHub Apps must have the <code>secrets</code> repository permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
@@ -7849,7 +7849,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates an environment secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>.</p>\n<p>You must authenticate using an access token with the <code>repo</code> scope to use this endpoint.\nGitHub Apps must have the <code>secrets</code> repository permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>\n<p><strong>Example encrypting a secret using Node.js</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates an environment secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/enterprise-server@3.6/rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access token with the <code>repo</code> scope to use this endpoint.\nGitHub Apps must have the <code>secrets</code> repository permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
@@ -172520,7 +172520,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates an organization secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. You must authenticate using an access\ntoken with the <code>admin:org</code> scope to use this endpoint. GitHub Apps must have the <code>dependabot_secrets</code> organization\npermission to use this endpoint.</p>\n<p><strong>Example encrypting a secret using Node.js</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates an organization secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/enterprise-server@3.6/rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access\ntoken with the <code>admin:org</code> scope to use this endpoint. GitHub Apps must have the <code>dependabot_secrets</code> organization\npermission to use this endpoint.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
@@ -174119,7 +174119,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates a repository secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. You must authenticate using an access\ntoken with the <code>repo</code> scope to use this endpoint. GitHub Apps must have the <code>dependabot_secrets</code> repository\npermission to use this endpoint.</p>\n<p><strong>Example encrypting a secret using Node.js</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates a repository secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/enterprise-server@3.6/rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access\ntoken with the <code>repo</code> scope to use this endpoint. GitHub Apps must have the <code>dependabot_secrets</code> repository\npermission to use this endpoint.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
|
||||
@@ -6470,7 +6470,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates an organization secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>.</p>\n<p>You must authenticate using an access token with the <code>admin:org</code> scope to use this endpoint.\nIf the repository is private, you must use an access token with the <code>repo</code> scope.\nGitHub Apps must have the <code>secrets</code> organization permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>\n<p>*<em>Example encrypting a secret using Node.js</em></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates an organization secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/enterprise-server@3.7/rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access token with the <code>admin:org</code> scope to use this endpoint.\nIf the repository is private, you must use an access token with the <code>repo</code> scope.\nGitHub Apps must have the <code>secrets</code> organization permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
@@ -8096,7 +8096,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates a repository secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>.</p>\n<p>You must authenticate using an access token with the <code>repo</code> scope to use this endpoint.\nGitHub Apps must have the <code>secrets</code> repository permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>\n<p><strong>Example encrypting a secret using Node.js</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates a repository secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/enterprise-server@3.7/rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access token with the <code>repo</code> scope to use this endpoint.\nGitHub Apps must have the <code>secrets</code> repository permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
@@ -8618,7 +8618,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates an environment secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>.</p>\n<p>You must authenticate using an access token with the <code>repo</code> scope to use this endpoint.\nGitHub Apps must have the <code>secrets</code> repository permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>\n<p><strong>Example encrypting a secret using Node.js</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates an environment secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/enterprise-server@3.7/rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access token with the <code>repo</code> scope to use this endpoint.\nGitHub Apps must have the <code>secrets</code> repository permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
@@ -174969,7 +174969,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates an organization secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. You must authenticate using an access\ntoken with the <code>admin:org</code> scope to use this endpoint. GitHub Apps must have the <code>dependabot_secrets</code> organization\npermission to use this endpoint.</p>\n<p><strong>Example encrypting a secret using Node.js</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates an organization secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/enterprise-server@3.7/rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access\ntoken with the <code>admin:org</code> scope to use this endpoint. GitHub Apps must have the <code>dependabot_secrets</code> organization\npermission to use this endpoint.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
@@ -176571,7 +176571,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates a repository secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. You must authenticate using an access\ntoken with the <code>repo</code> scope to use this endpoint. GitHub Apps must have the <code>dependabot_secrets</code> repository\npermission to use this endpoint.</p>\n<p><strong>Example encrypting a secret using Node.js</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates a repository secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/enterprise-server@3.7/rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access\ntoken with the <code>repo</code> scope to use this endpoint. GitHub Apps must have the <code>dependabot_secrets</code> repository\npermission to use this endpoint.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
|
||||
@@ -6491,7 +6491,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates an organization secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>.</p>\n<p>You must authenticate using an access token with the <code>admin:org</code> scope to use this endpoint.\nIf the repository is private, you must use an access token with the <code>repo</code> scope.\nGitHub Apps must have the <code>secrets</code> organization permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>\n<p>*<em>Example encrypting a secret using Node.js</em></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates an organization secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/enterprise-server@3.8/rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access token with the <code>admin:org</code> scope to use this endpoint.\nIf the repository is private, you must use an access token with the <code>repo</code> scope.\nGitHub Apps must have the <code>secrets</code> organization permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
@@ -8117,7 +8117,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates a repository secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>.</p>\n<p>You must authenticate using an access token with the <code>repo</code> scope to use this endpoint.\nGitHub Apps must have the <code>secrets</code> repository permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>\n<p><strong>Example encrypting a secret using Node.js</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates a repository secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/enterprise-server@3.8/rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access token with the <code>repo</code> scope to use this endpoint.\nGitHub Apps must have the <code>secrets</code> repository permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
@@ -8639,7 +8639,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates an environment secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>.</p>\n<p>You must authenticate using an access token with the <code>repo</code> scope to use this endpoint.\nGitHub Apps must have the <code>secrets</code> repository permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>\n<p><strong>Example encrypting a secret using Node.js</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates an environment secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/enterprise-server@3.8/rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access token with the <code>repo</code> scope to use this endpoint.\nGitHub Apps must have the <code>secrets</code> repository permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
@@ -184745,7 +184745,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates an organization secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. You must authenticate using an access\ntoken with the <code>admin:org</code> scope to use this endpoint. GitHub Apps must have the <code>dependabot_secrets</code> organization\npermission to use this endpoint.</p>\n<p><strong>Example encrypting a secret using Node.js</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates an organization secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/enterprise-server@3.8/rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access\ntoken with the <code>admin:org</code> scope to use this endpoint. GitHub Apps must have the <code>dependabot_secrets</code> organization\npermission to use this endpoint.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
@@ -186347,7 +186347,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates a repository secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. You must authenticate using an access\ntoken with the <code>repo</code> scope to use this endpoint. GitHub Apps must have the <code>dependabot_secrets</code> repository\npermission to use this endpoint.</p>\n<p><strong>Example encrypting a secret using Node.js</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates a repository secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/enterprise-server@3.8/rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access\ntoken with the <code>repo</code> scope to use this endpoint. GitHub Apps must have the <code>dependabot_secrets</code> repository\npermission to use this endpoint.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
|
||||
@@ -6491,7 +6491,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates an organization secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>.</p>\n<p>You must authenticate using an access token with the <code>admin:org</code> scope to use this endpoint.\nIf the repository is private, you must use an access token with the <code>repo</code> scope.\nGitHub Apps must have the <code>secrets</code> organization permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>\n<p>*<em>Example encrypting a secret using Node.js</em></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates an organization secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/enterprise-server@3.9/rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access token with the <code>admin:org</code> scope to use this endpoint.\nIf the repository is private, you must use an access token with the <code>repo</code> scope.\nGitHub Apps must have the <code>secrets</code> organization permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
@@ -8292,7 +8292,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates a repository secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>.</p>\n<p>You must authenticate using an access token with the <code>repo</code> scope to use this endpoint.\nGitHub Apps must have the <code>secrets</code> repository permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>\n<p><strong>Example encrypting a secret using Node.js</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates a repository secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/enterprise-server@3.9/rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access token with the <code>repo</code> scope to use this endpoint.\nGitHub Apps must have the <code>secrets</code> repository permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
@@ -8814,7 +8814,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates an environment secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>.</p>\n<p>You must authenticate using an access token with the <code>repo</code> scope to use this endpoint.\nGitHub Apps must have the <code>secrets</code> repository permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>\n<p><strong>Example encrypting a secret using Node.js</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates an environment secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/enterprise-server@3.9/rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access token with the <code>repo</code> scope to use this endpoint.\nGitHub Apps must have the <code>secrets</code> repository permission to use this endpoint.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
@@ -186588,7 +186588,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates an organization secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. You must authenticate using an access\ntoken with the <code>admin:org</code> scope to use this endpoint. GitHub Apps must have the <code>dependabot_secrets</code> organization\npermission to use this endpoint.</p>\n<p><strong>Example encrypting a secret using Node.js</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates an organization secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/enterprise-server@3.9/rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access\ntoken with the <code>admin:org</code> scope to use this endpoint. GitHub Apps must have the <code>dependabot_secrets</code> organization\npermission to use this endpoint.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
@@ -188234,7 +188234,7 @@
|
||||
}
|
||||
],
|
||||
"previews": [],
|
||||
"descriptionHTML": "<p>Creates or updates a repository secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. You must authenticate using an access\ntoken with the <code>repo</code> scope to use this endpoint. GitHub Apps must have the <code>dependabot_secrets</code> repository\npermission to use this endpoint.</p>\n<p><strong>Example encrypting a secret using Node.js</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.npmjs.com/package/libsodium-wrappers\">libsodium-wrappers</a> library.</p>\n<pre><code>const sodium = require('libsodium-wrappers')\nconst secret = 'plain-text-secret' // replace with the secret you want to encrypt\nconst key = 'base64-encoded-public-key' // replace with the Base64 encoded public key\n\n//Check if libsodium is ready and then proceed.\nsodium.ready.then(() => {\n // Convert Secret & Base64 key to Uint8Array.\n let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)\n let binsec = sodium.from_string(secret)\n\n //Encrypt the secret using LibSodium\n let encBytes = sodium.crypto_box_seal(binsec, binkey)\n\n // Convert encrypted Uint8Array to Base64\n let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)\n\n console.log(output)\n});\n</code></pre>\n<p><strong>Example encrypting a secret using Python</strong></p>\n<p>Encrypt your secret using <a href=\"https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox\">pynacl</a> with Python 3.</p>\n<pre><code>from 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</code></pre>\n<p><strong>Example encrypting a secret using C#</strong></p>\n<p>Encrypt your secret using the <a href=\"https://www.nuget.org/packages/Sodium.Core/\">Sodium.Core</a> package.</p>\n<pre><code>var 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</code></pre>\n<p><strong>Example encrypting a secret using Ruby</strong></p>\n<p>Encrypt your secret using the <a href=\"https://github.com/RubyCrypto/rbnacl\">rbnacl</a> gem.</p>\n<pre><code class=\"hljs language-ruby\"><span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"rbnacl\"</span>\n<span class=\"hljs-keyword\">require</span> <span class=\"hljs-string\">\"base64\"</span>\n\nkey = Base64.decode64(<span class=\"hljs-string\">\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\"</span>)\npublic_key = RbNaCl::PublicKey.new(key)\n\nbox = RbNaCl::Boxes::Sealed.from_public_key(public_key)\nencrypted_secret = box.encrypt(<span class=\"hljs-string\">\"my_secret\"</span>)\n\n<span class=\"hljs-comment\"># Print the base64 encoded secret</span>\nputs Base64.strict_encode64(encrypted_secret)\n</code></pre>",
|
||||
"descriptionHTML": "<p>Creates or updates a repository secret with an encrypted value. Encrypt your secret using\n<a href=\"https://libsodium.gitbook.io/doc/bindings_for_other_languages\">LibSodium</a>. For more information, see \"<a href=\"https://docs.github.com/enterprise-server@3.9/rest/guides/encrypting-secrets-for-the-rest-api\">Encrypting secrets for the REST API</a>.\"</p>\n<p>You must authenticate using an access\ntoken with the <code>repo</code> scope to use this endpoint. GitHub Apps must have the <code>dependabot_secrets</code> repository\npermission to use this endpoint.</p>",
|
||||
"statusCodes": [
|
||||
{
|
||||
"httpStatusCode": "201",
|
||||
|
||||
@@ -33,5 +33,5 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"sha": "be35f587277120cef36dbfbf30d545825dd65044"
|
||||
"sha": "902841d79e04ac06ca03c8499a6fe4d32cd39370"
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"sha": "be35f587277120cef36dbfbf30d545825dd65044"
|
||||
"sha": "902841d79e04ac06ca03c8499a6fe4d32cd39370"
|
||||
}
|
||||
Reference in New Issue
Block a user