Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions descriptions/api.github.com/api.github.com.json

Large diffs are not rendered by default.

230 changes: 117 additions & 113 deletions descriptions/api.github.com/api.github.com.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6262,28 +6262,29 @@ paths:

#### Example encrypting a secret using Node.js

Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library.
Encrypt your secret using the [libsodium-wrappers](https://www.npmjs.com/package/libsodium-wrappers) library.

```
const sodium = require('tweetsodium');

const key = "base64-encoded-public-key";
const value = "plain-text-secret";
const sodium = require('libsodium-wrappers')
const secret = 'plain-text-secret' // replace with the secret you want to encrypt
const key = 'base64-encoded-public-key' // replace with the Base64 encoded public key

// Convert the message and key to Uint8Array's (Buffer implements that interface)
const messageBytes = Buffer.from(value);
const keyBytes = Buffer.from(key, 'base64');
//Check if libsodium is ready and then proceed.
sodium.ready.then(() => {
// Convert Secret & Base64 key to Uint8Array.
let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)
let binsec = sodium.from_string(secret)

// Encrypt using LibSodium.
const encryptedBytes = sodium.seal(messageBytes, keyBytes);
//Encrypt the secret using LibSodium
let encBytes = sodium.crypto_box_seal(binsec, binkey)

// Base64 the encrypted secret
const encrypted = Buffer.from(encryptedBytes).toString('base64');
// Convert encrypted Uint8Array to Base64
let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)

console.log(encrypted);
console.log(output)
});
```


#### Example encrypting a secret using Python

Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox) with Python 3.
Expand Down Expand Up @@ -6988,26 +6989,23 @@ paths:
Encrypt your secret using the [libsodium-wrappers](https://www.npmjs.com/package/libsodium-wrappers) library.

```
// Written with ❤️ by PSJ and free to use under The Unlicense.
const sodium=require('libsodium-wrappers')
const secret = 'plain-text-secret' // replace with secret before running the script.
const key = 'base64-encoded-public-key' // replace with the Base64 encoded public key.
const sodium = require('libsodium-wrappers')
const secret = 'plain-text-secret' // replace with the secret you want to encrypt
const key = 'base64-encoded-public-key' // replace with the Base64 encoded public key

//Check if libsodium is ready and then proceed.
sodium.ready.then(() => {
// Convert Secret & Base64 key to Uint8Array.
let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)
let binsec = sodium.from_string(secret)

sodium.ready.then( ()=>{
//Encrypt the secret using LibSodium
let encBytes = sodium.crypto_box_seal(binsec, binkey)

// Convert Secret & Base64 key to Uint8Array.
let binkey= sodium.from_base64(key, sodium.base64_variants.ORIGINAL) //Equivalent of Buffer.from(key, 'base64')
let binsec= sodium.from_string(secret) // Equivalent of Buffer.from(secret)
// Convert encrypted Uint8Array to Base64
let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)

//Encrypt the secret using LibSodium
let encBytes= sodium.crypto_box_seal(binsec,binkey) // Similar to tweetsodium.seal(binsec,binkey)

// Convert encrypted Uint8Array to Base64
let output=sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL) //Equivalent of Buffer.from(encBytes).toString('base64')

console.log(output)
console.log(output)
});
```

Expand Down Expand Up @@ -7686,28 +7684,29 @@ paths:

#### Example encrypting a secret using Node.js

Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library.
Encrypt your secret using the [libsodium-wrappers](https://www.npmjs.com/package/libsodium-wrappers) library.

```
const sodium = require('tweetsodium');
const sodium = require('libsodium-wrappers')
const secret = 'plain-text-secret' // replace with the secret you want to encrypt
const key = 'base64-encoded-public-key' // replace with the Base64 encoded public key

const key = "base64-encoded-public-key";
const value = "plain-text-secret";

// Convert the message and key to Uint8Array's (Buffer implements that interface)
const messageBytes = Buffer.from(value);
const keyBytes = Buffer.from(key, 'base64');
//Check if libsodium is ready and then proceed.
sodium.ready.then(() => {
// Convert Secret & Base64 key to Uint8Array.
let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)
let binsec = sodium.from_string(secret)

// Encrypt using LibSodium.
const encryptedBytes = sodium.seal(messageBytes, keyBytes);
//Encrypt the secret using LibSodium
let encBytes = sodium.crypto_box_seal(binsec, binkey)

// Base64 the encrypted secret
const encrypted = Buffer.from(encryptedBytes).toString('base64');
// Convert encrypted Uint8Array to Base64
let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)

console.log(encrypted);
console.log(output)
});
```


#### Example encrypting a secret using Python

Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox) with Python 3.
Expand Down Expand Up @@ -15823,28 +15822,29 @@ paths:

#### Example encrypting a secret using Node.js

Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library.
Encrypt your secret using the [libsodium-wrappers](https://www.npmjs.com/package/libsodium-wrappers) library.

```
const sodium = require('tweetsodium');
const sodium = require('libsodium-wrappers')
const secret = 'plain-text-secret' // replace with the secret you want to encrypt
const key = 'base64-encoded-public-key' // replace with the Base64 encoded public key

const key = "base64-encoded-public-key";
const value = "plain-text-secret";

// Convert the message and key to Uint8Array's (Buffer implements that interface)
const messageBytes = Buffer.from(value);
const keyBytes = Buffer.from(key, 'base64');
//Check if libsodium is ready and then proceed.
sodium.ready.then(() => {
// Convert Secret & Base64 key to Uint8Array.
let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)
let binsec = sodium.from_string(secret)

// Encrypt using LibSodium.
const encryptedBytes = sodium.seal(messageBytes, keyBytes);
//Encrypt the secret using LibSodium
let encBytes = sodium.crypto_box_seal(binsec, binkey)

// Base64 the encrypted secret
const encrypted = Buffer.from(encryptedBytes).toString('base64');
// Convert encrypted Uint8Array to Base64
let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)

console.log(encrypted);
console.log(output)
});
```


#### Example encrypting a secret using Python

Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox) with Python 3.
Expand Down Expand Up @@ -20654,28 +20654,29 @@ paths:

#### Example of encrypting a secret using Node.js

Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library.
Encrypt your secret using the [libsodium-wrappers](https://www.npmjs.com/package/libsodium-wrappers) library.

```
const sodium = require('tweetsodium');

const key = "base64-encoded-public-key";
const value = "plain-text-secret";
const sodium = require('libsodium-wrappers')
const secret = 'plain-text-secret' // replace with the secret you want to encrypt
const key = 'base64-encoded-public-key' // replace with the Base64 encoded public key

// Convert the message and key to Uint8Array's (Buffer implements that interface)
const messageBytes = Buffer.from(value);
const keyBytes = Buffer.from(key, 'base64');
//Check if libsodium is ready and then proceed.
sodium.ready.then(() => {
// Convert Secret & Base64 key to Uint8Array.
let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)
let binsec = sodium.from_string(secret)

// Encrypt using LibSodium.
const encryptedBytes = sodium.seal(messageBytes, keyBytes);
//Encrypt the secret using LibSodium
let encBytes = sodium.crypto_box_seal(binsec, binkey)

// Base64 the encrypted secret
const encrypted = Buffer.from(encryptedBytes).toString('base64');
// Convert encrypted Uint8Array to Base64
let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)

console.log(encrypted);
console.log(output)
});
```


#### Example of encrypting a secret using Python

Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox) with Python 3.
Expand Down Expand Up @@ -22710,28 +22711,29 @@ paths:

#### Example encrypting a secret using Node.js

Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library.
Encrypt your secret using the [libsodium-wrappers](https://www.npmjs.com/package/libsodium-wrappers) library.

```
const sodium = require('tweetsodium');

const key = "base64-encoded-public-key";
const value = "plain-text-secret";
const sodium = require('libsodium-wrappers')
const secret = 'plain-text-secret' // replace with the secret you want to encrypt
const key = 'base64-encoded-public-key' // replace with the Base64 encoded public key

// Convert the message and key to Uint8Array's (Buffer implements that interface)
const messageBytes = Buffer.from(value);
const keyBytes = Buffer.from(key, 'base64');
//Check if libsodium is ready and then proceed.
sodium.ready.then(() => {
// Convert Secret & Base64 key to Uint8Array.
let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)
let binsec = sodium.from_string(secret)

// Encrypt using LibSodium.
const encryptedBytes = sodium.seal(messageBytes, keyBytes);
//Encrypt the secret using LibSodium
let encBytes = sodium.crypto_box_seal(binsec, binkey)

// Base64 the encrypted secret
const encrypted = Buffer.from(encryptedBytes).toString('base64');
// Convert encrypted Uint8Array to Base64
let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)

console.log(encrypted);
console.log(output)
});
```


#### Example encrypting a secret using Python

Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox) with Python 3.
Expand Down Expand Up @@ -33466,28 +33468,29 @@ paths:

#### Example encrypting a secret using Node.js

Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library.
Encrypt your secret using the [libsodium-wrappers](https://www.npmjs.com/package/libsodium-wrappers) library.

```
const sodium = require('tweetsodium');
const sodium = require('libsodium-wrappers')
const secret = 'plain-text-secret' // replace with the secret you want to encrypt
const key = 'base64-encoded-public-key' // replace with the Base64 encoded public key

const key = "base64-encoded-public-key";
const value = "plain-text-secret";

// Convert the message and key to Uint8Array's (Buffer implements that interface)
const messageBytes = Buffer.from(value);
const keyBytes = Buffer.from(key, 'base64');
//Check if libsodium is ready and then proceed.
sodium.ready.then(() => {
// Convert Secret & Base64 key to Uint8Array.
let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)
let binsec = sodium.from_string(secret)

// Encrypt using LibSodium.
const encryptedBytes = sodium.seal(messageBytes, keyBytes);
//Encrypt the secret using LibSodium
let encBytes = sodium.crypto_box_seal(binsec, binkey)

// Base64 the encrypted secret
const encrypted = Buffer.from(encryptedBytes).toString('base64');
// Convert encrypted Uint8Array to Base64
let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)

console.log(encrypted);
console.log(output)
});
```


#### Example encrypting a secret using Python

Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox) with Python 3.
Expand Down Expand Up @@ -36254,28 +36257,29 @@ paths:

#### Example encrypting a secret using Node.js

Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library.
Encrypt your secret using the [libsodium-wrappers](https://www.npmjs.com/package/libsodium-wrappers) library.

```
const sodium = require('tweetsodium');
const sodium = require('libsodium-wrappers')
const secret = 'plain-text-secret' // replace with the secret you want to encrypt
const key = 'base64-encoded-public-key' // replace with the Base64 encoded public key

const key = "base64-encoded-public-key";
const value = "plain-text-secret";

// Convert the message and key to Uint8Array's (Buffer implements that interface)
const messageBytes = Buffer.from(value);
const keyBytes = Buffer.from(key, 'base64');
//Check if libsodium is ready and then proceed.
sodium.ready.then(() => {
// Convert Secret & Base64 key to Uint8Array.
let binkey = sodium.from_base64(key, sodium.base64_variants.ORIGINAL)
let binsec = sodium.from_string(secret)

// Encrypt using LibSodium.
const encryptedBytes = sodium.seal(messageBytes, keyBytes);
//Encrypt the secret using LibSodium
let encBytes = sodium.crypto_box_seal(binsec, binkey)

// Base64 the encrypted secret
const encrypted = Buffer.from(encryptedBytes).toString('base64');
// Convert encrypted Uint8Array to Base64
let output = sodium.to_base64(encBytes, sodium.base64_variants.ORIGINAL)

console.log(encrypted);
console.log(output)
});
```


#### Example encrypting a secret using Python

Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox) with Python 3.
Expand Down
Loading