Update to yarn modern, patch doip for SASL auth

This commit is contained in:
Tyler Beckman 2023-08-03 21:05:44 -06:00
parent b8114bad9e
commit d34d3027ee
Signed by: Ty
GPG key ID: 2813440C772555A4
7 changed files with 7895 additions and 5284 deletions

11
.gitignore vendored
View file

@ -33,4 +33,13 @@ node_modules
ignore
dist
static
logs
logs
# yarn
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

View file

@ -0,0 +1,92 @@
diff --git a/dist/doip.core.js b/dist/doip.core.js
index e019a48b8136941fd8e21091a7d323d5cfbf83e7..368e9b0b7ea0b5dde987ea3805a69d82c724536d 100644
--- a/dist/doip.core.js
+++ b/dist/doip.core.js
@@ -5263,6 +5263,7 @@ var doip = (function (exports, fetcher, openpgp$1) {
* @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 {string|null} claims.irc.password - The password 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})
@@ -5284,7 +5285,8 @@ var doip = (function (exports, fetcher, openpgp$1) {
privateKey: null
},
irc: {
- nick: null
+ nick: null,
+ password: null
},
matrix: {
instance: null,
diff --git a/dist/doip.fetchers.js b/dist/doip.fetchers.js
index acef0d990b81eba01e78404e726766e81bf46ddd..e056d695a3aabe16ce5312e42b733fb930110b59 100644
--- a/dist/doip.fetchers.js
+++ b/dist/doip.fetchers.js
@@ -23603,6 +23603,7 @@ var doipFetchers = (function (exports) {
* @param {object} opts.claims
* @param {object} opts.claims.irc
* @param {string} opts.claims.irc.nick - The nick to be used by the library to log in
+ * @param {string} opts.claims.irc.password - The password to be used by the library to log in
* @returns {Promise<object>}
*/
async function fn$3 (data, opts) {
@@ -23627,7 +23628,10 @@ var doipFetchers = (function (exports) {
secure: true,
channels: [],
showErrors: false,
- debug: false
+ debug: false,
+ sasl: opts.claims.irc.password !== null ? true : false,
+ userName: opts.claims.irc.nick,
+ password: opts.claims.irc.password
});
const reKey = /[a-zA-Z0-9\-_]+\s+:\s(openpgp4fpr:.*)/;
const reEnd = /End\sof\s.*\staxonomy./;
diff --git a/src/defaults.js b/src/defaults.js
index 024cc19612bba1e55f5233e61f78e0f00bc9aa92..2ab81779576f4eb2a7ebc46544a7992d0b1fb7e9 100644
--- a/src/defaults.js
+++ b/src/defaults.js
@@ -32,6 +32,7 @@ import { ProxyPolicy } from './enums.js'
* @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 {string|null} claims.irc.password - The password 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})
@@ -53,7 +54,8 @@ export const opts = {
privateKey: null
},
irc: {
- nick: null
+ nick: null,
+ password: null
},
matrix: {
instance: null,
diff --git a/src/fetcher/irc.js b/src/fetcher/irc.js
index f07a32a7c54a9489dbab27b32b1b1d8246485ec1..c3c953257431a50f826c24d2a9ba7f638860fda5 100644
--- a/src/fetcher/irc.js
+++ b/src/fetcher/irc.js
@@ -30,6 +30,7 @@ export const timeout = 20000
* @param {object} opts.claims
* @param {object} opts.claims.irc
* @param {string} opts.claims.irc.nick - The nick to be used by the library to log in
+ * @param {string} opts.claims.irc.password - The password to be used by the library to log in
* @returns {Promise<object>}
*/
export async function fn (data, opts) {
@@ -54,7 +55,10 @@ export async function fn (data, opts) {
secure: true,
channels: [],
showErrors: false,
- debug: false
+ debug: false,
+ sasl: opts.claims.irc.password !== null ? true : false,
+ userName: opts.claims.irc.nick,
+ password: opts.claims.irc.password
})
const reKey = /[a-zA-Z0-9\-_]+\s+:\s(openpgp4fpr:.*)/
const reEnd = /End\sof\s.*\staxonomy./

1
.yarnrc.yml Normal file
View file

@ -0,0 +1 @@
nodeLinker: node-modules

View file

@ -3,7 +3,8 @@ FROM node:16-alpine as builder
WORKDIR /app
COPY . .
RUN yarn --pure-lockfile
RUN corepack enable
RUN yarn install --immutable
RUN yarn run build
###

View file

@ -4,6 +4,7 @@
"description": "Verifying online identity with cryptography",
"main": "./src/index.js",
"type": "module",
"packageManager": "yarn@3.6.1",
"dependencies": {
"ajv": "^8.6.3",
"bent": "^7.3.12",
@ -72,5 +73,8 @@
"identity"
],
"author": "Yarmo Mackenbach <yarmo@yarmo.eu> (https://yarmo.eu)",
"license": "AGPL-3.0-or-later"
"license": "AGPL-3.0-or-later",
"resolutions": {
"doipjs@^1.0.0": "patch:doipjs@npm%3A1.0.0#./.yarn/patches/doipjs-npm-1.0.0-942d2e0840.patch"
}
}

View file

@ -42,7 +42,8 @@ const opts = {
privateKey: process.env.ACTIVITYPUB_PRIVATE_KEY || null
},
irc: {
nick: process.env.IRC_NICK || null
nick: process.env.IRC_NICK || null,
password: process.env.IRC_PASSWORD || null,
},
matrix: {
instance: process.env.MATRIX_INSTANCE || null,

13063
yarn.lock

File diff suppressed because it is too large Load diff