Compare commits

...

2 commits

Author SHA1 Message Date
Tyler Beckman
fc5cd752dc
Add sasl support 2024-06-14 21:57:11 -06:00
Tyler Beckman
79d417f0fb
Update to yarn modern 2024-06-14 17:39:39 -06:00
13 changed files with 7773 additions and 4914 deletions

BIN
.yarn/install-state.gz Normal file

Binary file not shown.

1
.yarnrc.yml Normal file
View file

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

643
dist/doip.core.js vendored

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

658
dist/doip.fetchers.js vendored

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

View file

@ -15,7 +15,7 @@
"default": "./src/fetcher/index.minimal.js"
}
},
"packageManager": "yarn@1.22.19",
"packageManager": "yarn@4.3.0",
"dependencies": {
"@openpgp/hkp-client": "^0.0.3",
"@openpgp/wkd-client": "^0.0.4",

View file

@ -35,7 +35,8 @@ export const opts = {
privateKey: null
},
irc: {
nick: null
nick: null,
sasl: []
},
matrix: {
instance: null,

View file

@ -59,12 +59,25 @@ export async function fn (data, opts) {
}
try {
// Add sasl-related config if the server matches
const matchedSaslConfig = opts.claims.irc.sasl.find(saslConfig => data.domain.match(new RegExp(saslConfig.domainRegex)) !== null);
const saslOptions = matchedSaslConfig
? {
sasl: true,
userName: matchedSaslConfig.username,
password: matchedSaslConfig.password
}
: {
sasl: false
}
const client = new irc.Client(data.domain, opts.claims.irc.nick, {
port: 6697,
secure: true,
channels: [],
showErrors: false,
debug: false
debug: false,
...saslOptions
})
const reKey = /[a-zA-Z0-9\-_]+\s+:\s((?:openpgp4fpr|aspe):.*)/
const reEnd = /End\sof\s.*\staxonomy./

View file

@ -130,6 +130,7 @@ import { PublicKeyType, PublicKeyEncoding, PublicKeyFetchMethod, ProxyPolicy, Cl
* Config related to the verification of IRC claims
* @typedef {object} IrcClaimVerificationConfig
* @property {string} nick - The nick that the library uses to connect to the IRC server
* @property {{ domainRegex: string; username: string; password: string; }[]} sasl - An array of possible SASL logins
*/
/**

10690
yarn.lock

File diff suppressed because it is too large Load diff