forked from Mirrors/doipjs
Compare commits
3 commits
prepare-ne
...
dev
Author | SHA1 | Date | |
---|---|---|---|
0f43a7b9e3 | |||
2153185729 | |||
a523ec4191 |
21 changed files with 7796 additions and 8193 deletions
|
@ -1,4 +1,4 @@
|
|||
#!/bin/sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
npm test
|
||||
yarn test
|
|
@ -15,10 +15,8 @@ examples
|
|||
\.woodpecker
|
||||
|
||||
package.json
|
||||
package-lock.json
|
||||
yarn.lock
|
||||
rollup.config.js
|
||||
\.editorconfig
|
||||
\.gitignore
|
||||
\.licenseignore
|
||||
flake.nix
|
||||
flake.lock
|
|
@ -3,9 +3,10 @@ when:
|
|||
event: tag
|
||||
steps:
|
||||
prepare:
|
||||
image: node:20
|
||||
image: node
|
||||
commands:
|
||||
- npm ci
|
||||
- yarn --pure-lockfile
|
||||
- yarn run prepare
|
||||
|
||||
publish-npm:
|
||||
when:
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
when:
|
||||
event: [push, pull_request, tag, release, manual]
|
||||
steps:
|
||||
test:
|
||||
image: node
|
||||
commands:
|
||||
- npm ci
|
||||
- npm run test
|
||||
- yarn --pure-lockfile
|
||||
- yarn run prepare
|
||||
- yarn run test
|
BIN
.yarn/install-state.gz
Normal file
BIN
.yarn/install-state.gz
Normal file
Binary file not shown.
6
.yarnrc.yml
Normal file
6
.yarnrc.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
nodeLinker: node-modules
|
||||
npmScopes:
|
||||
myriation:
|
||||
npmPublishRegistry: https://git.myriation.xyz/api/packages/myriation/npm/
|
||||
npmAlwaysAuth: true
|
||||
npmAuthToken: REPLACE-ME
|
643
dist/doip.core.js
vendored
643
dist/doip.core.js
vendored
File diff suppressed because it is too large
Load diff
4
dist/doip.core.min.js
vendored
4
dist/doip.core.min.js
vendored
File diff suppressed because one or more lines are too long
660
dist/doip.fetchers.js
vendored
660
dist/doip.fetchers.js
vendored
File diff suppressed because it is too large
Load diff
6
dist/doip.fetchers.min.js
vendored
6
dist/doip.fetchers.min.js
vendored
File diff suppressed because one or more lines are too long
660
dist/doip.fetchers.minimal.js
vendored
660
dist/doip.fetchers.minimal.js
vendored
File diff suppressed because it is too large
Load diff
6
dist/doip.fetchers.minimal.min.js
vendored
6
dist/doip.fetchers.minimal.min.js
vendored
File diff suppressed because one or more lines are too long
61
flake.lock
61
flake.lock
|
@ -1,61 +0,0 @@
|
|||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1717144377,
|
||||
"narHash": "sha256-F/TKWETwB5RaR8owkPPi+SPJh83AQsm6KrQAlJ8v/uA=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "805a384895c696f802a9bf5bf4720f37385df547",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-24.05",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs",
|
||||
"utils": "utils"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1710146030,
|
||||
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
26
flake.nix
26
flake.nix
|
@ -1,26 +0,0 @@
|
|||
{
|
||||
description = "doipjs";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
|
||||
utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, utils }:
|
||||
utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
in
|
||||
{
|
||||
devShell = with pkgs; mkShell {
|
||||
buildInputs = [
|
||||
nodejs_20
|
||||
];
|
||||
|
||||
shellHook = ''
|
||||
echo "node `${pkgs.nodejs_20}/bin/node --version`"
|
||||
'';
|
||||
};
|
||||
});
|
||||
|
||||
}
|
7474
package-lock.json
generated
7474
package-lock.json
generated
File diff suppressed because it is too large
Load diff
13
package.json
13
package.json
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "doipjs",
|
||||
"version": "1.2.9",
|
||||
"name": "@myriation/doipjs",
|
||||
"version": "1.2.9+myriaiton.1",
|
||||
"description": "Decentralized Online Identity Proofs library in Node.js",
|
||||
"type": "module",
|
||||
"main": "./src/index.js",
|
||||
|
@ -15,6 +15,7 @@
|
|||
"default": "./src/fetcher/index.minimal.js"
|
||||
}
|
||||
},
|
||||
"packageManager": "yarn@4.3.0",
|
||||
"dependencies": {
|
||||
"@openpgp/hkp-client": "^0.0.3",
|
||||
"@openpgp/wkd-client": "^0.0.4",
|
||||
|
@ -57,8 +58,8 @@
|
|||
"rollup-plugin-visualizer": "^5.9.2"
|
||||
},
|
||||
"scripts": {
|
||||
"release": "node ./prerelease.js && npm run test && npm run build",
|
||||
"build": "rm -rf ./dist/ && npm run build:bundle && npm run build:minify",
|
||||
"release": "node ./prerelease.js && yarn run test && yarn run build",
|
||||
"build": "rm -rf ./dist/ && yarn run build:bundle && yarn run build:minify",
|
||||
"build:bundle": "rollup -c",
|
||||
"build:minify": "minify ./dist/doip.core.js > ./dist/doip.core.min.js && minify ./dist/doip.fetchers.js > ./dist/doip.fetchers.min.js && minify ./dist/doip.fetchers.minimal.js > ./dist/doip.fetchers.minimal.min.js",
|
||||
"license:check": "license-check-and-add check",
|
||||
|
@ -67,12 +68,12 @@
|
|||
"docs:lib": "jsdoc -c jsdoc-lib.json -r -d ./docs -P package.json",
|
||||
"lint": "eslint ./src",
|
||||
"lint:fix": "eslint ./src --fix",
|
||||
"test": "npm run lint && npm run license:check && mocha",
|
||||
"test": "yarn lint && yarn run license:check && yarn run mocha",
|
||||
"prepare": "husky install"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://codeberg.org/keyoxide/doipjs"
|
||||
"url": "https://git.myriation.org/myriation/doipjs"
|
||||
},
|
||||
"homepage": "https://js.doip.rocks",
|
||||
"keywords": [
|
||||
|
|
|
@ -22,4 +22,4 @@ limitations under the License.
|
|||
* doip.js library version
|
||||
* @constant {string}
|
||||
*/
|
||||
export const version = '1.2.9'
|
||||
export const version = '1.2.9+myriaiton.1'
|
||||
|
|
|
@ -35,7 +35,8 @@ export const opts = {
|
|||
privateKey: null
|
||||
},
|
||||
irc: {
|
||||
nick: null
|
||||
nick: null,
|
||||
sasl: []
|
||||
},
|
||||
matrix: {
|
||||
instance: null,
|
||||
|
|
|
@ -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./
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue