From fcc62a60253ce04eb102a68d994ee4131063e134 Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Thu, 27 Oct 2022 21:47:41 +0200 Subject: [PATCH] Fix proxy verification options --- src/defaults.js | 26 +++++++++++++++++--------- src/proxy/api/v2/index.js | 10 +++++++--- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/defaults.js b/src/defaults.js index 2fd03ae..6d5ac5f 100644 --- a/src/defaults.js +++ b/src/defaults.js @@ -27,17 +27,22 @@ const E = require('./enums') * @property {string|null} proxy.hostname - The hostname of the proxy * @property {string} proxy.policy - The policy that defines when to use a proxy ({@link module:enums~ProxyPolicy|here}) * @property {object} claims - Options related to claim verification + * @property {object} claims.activitypub - Options related to the verification of activitypub claims + * @property {string|null} claims.activitypub.url - The URL of the verifier account + * @property {string|null} claims.activitypub.privateKey - The private key to sign the request * @property {object} claims.irc - Options related to the verification of IRC claims * @property {string|null} claims.irc.nick - The nick that the library uses to connect to the IRC server * @property {object} claims.matrix - Options related to the verification of Matrix claims * @property {string|null} claims.matrix.instance - The server hostname on which the library can log in * @property {string|null} claims.matrix.accessToken - The access token required to identify the library ({@link https://www.matrix.org/docs/guides/client-server-api|Matrix docs}) + * @property {object} claims.telegram - Options related to the verification of Telegram claims + * @property {string|null} claims.telegram.token - The Telegram API's token ({@link https://core.telegram.org/bots/api#authorizing-your-bot|Telegram docs}) + * @property {object} claims.twitter - Options related to the verification of Twitter claims + * @property {string|null} claims.twitter.bearerToken - The Twitter API's bearer token ({@link https://developer.twitter.com/en/docs/authentication/oauth-2-0/bearer-tokens|Twitter docs}) * @property {object} claims.xmpp - Options related to the verification of XMPP claims * @property {string|null} claims.xmpp.service - The server hostname on which the library can log in * @property {string|null} claims.xmpp.username - The username used to log in * @property {string|null} claims.xmpp.password - The password used to log in - * @property {object} claims.twitter - Options related to the verification of Twitter claims - * @property {string|null} claims.twitter.bearerToken - The Twitter API's bearer token ({@link https://developer.twitter.com/en/docs/authentication/oauth-2-0/bearer-tokens|Twitter docs}) */ const opts = { proxy: { @@ -45,6 +50,10 @@ const opts = { policy: E.ProxyPolicy.NEVER }, claims: { + activitypub: { + url: null, + privateKey: null + }, irc: { nick: null }, @@ -52,17 +61,16 @@ const opts = { instance: null, accessToken: null }, - xmpp: { - service: null, - username: null, - password: null + telegram: { + token: null }, twitter: { bearerToken: null }, - activitypub: { - acct: null, - privateKey: null + xmpp: { + service: null, + username: null, + password: null } } } diff --git a/src/proxy/api/v2/index.js b/src/proxy/api/v2/index.js index 715d27c..2b86b08 100644 --- a/src/proxy/api/v2/index.js +++ b/src/proxy/api/v2/index.js @@ -21,6 +21,10 @@ require('dotenv').config() const opts = { claims: { + activitypub: { + url: process.env.ACTIVITYPUB_URL || null, + privateKey: process.env.ACTIVITYPUB_PRIVATE_KEY || null + }, irc: { nick: process.env.IRC_NICK || null }, @@ -31,13 +35,13 @@ const opts = { telegram: { token: process.env.TELEGRAM_TOKEN || null }, + twitter: { + bearerToken: process.env.TWITTER_BEARER_TOKEN || null + }, xmpp: { service: process.env.XMPP_SERVICE || null, username: process.env.XMPP_USERNAME || null, password: process.env.XMPP_PASSWORD || null - }, - twitter: { - bearerToken: process.env.TWITTER_BEARER_TOKEN || null } } }