Fix proxy verification options

This commit is contained in:
Yarmo Mackenbach 2022-10-27 21:47:41 +02:00
parent 6d89cc0542
commit fcc62a6025
No known key found for this signature in database
GPG key ID: 37367F4AF4087AD1
2 changed files with 24 additions and 12 deletions

View file

@ -27,17 +27,22 @@ const E = require('./enums')
* @property {string|null} proxy.hostname - The hostname of the proxy * @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 {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 - 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 {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 {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 {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.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 {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 {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.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.username - The username used to log in
* @property {string|null} claims.xmpp.password - The password 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 = { const opts = {
proxy: { proxy: {
@ -45,6 +50,10 @@ const opts = {
policy: E.ProxyPolicy.NEVER policy: E.ProxyPolicy.NEVER
}, },
claims: { claims: {
activitypub: {
url: null,
privateKey: null
},
irc: { irc: {
nick: null nick: null
}, },
@ -52,17 +61,16 @@ const opts = {
instance: null, instance: null,
accessToken: null accessToken: null
}, },
xmpp: { telegram: {
service: null, token: null
username: null,
password: null
}, },
twitter: { twitter: {
bearerToken: null bearerToken: null
}, },
activitypub: { xmpp: {
acct: null, service: null,
privateKey: null username: null,
password: null
} }
} }
} }

View file

@ -21,6 +21,10 @@ require('dotenv').config()
const opts = { const opts = {
claims: { claims: {
activitypub: {
url: process.env.ACTIVITYPUB_URL || null,
privateKey: process.env.ACTIVITYPUB_PRIVATE_KEY || null
},
irc: { irc: {
nick: process.env.IRC_NICK || null nick: process.env.IRC_NICK || null
}, },
@ -31,13 +35,13 @@ const opts = {
telegram: { telegram: {
token: process.env.TELEGRAM_TOKEN || null token: process.env.TELEGRAM_TOKEN || null
}, },
twitter: {
bearerToken: process.env.TWITTER_BEARER_TOKEN || null
},
xmpp: { xmpp: {
service: process.env.XMPP_SERVICE || null, service: process.env.XMPP_SERVICE || null,
username: process.env.XMPP_USERNAME || null, username: process.env.XMPP_USERNAME || null,
password: process.env.XMPP_PASSWORD || null password: process.env.XMPP_PASSWORD || null
},
twitter: {
bearerToken: process.env.TWITTER_BEARER_TOKEN || null
} }
} }
} }