Improve WeChat MP replies and ship MindSpace/H5 production updates.
Add WeChat service account routing with sync acks, connectivity tests, and context isolation; document deploy runbooks; and bundle related MindSpace, voice, Plaza, and server gateway changes for production rollout. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+9
-10
@@ -1,6 +1,7 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import crypto from 'node:crypto';
|
||||
import test from 'node:test';
|
||||
import { Algorithm as Argon2Algorithm, hashRawSync as argon2HashRawSync } from '@node-rs/argon2';
|
||||
import { createUserAuth } from './user-auth.mjs';
|
||||
|
||||
function hashPasswordPbkdf2(password, salt) {
|
||||
@@ -8,16 +9,14 @@ function hashPasswordPbkdf2(password, salt) {
|
||||
}
|
||||
|
||||
function hashPasswordArgon2id(password, salt) {
|
||||
return crypto
|
||||
.argon2Sync('argon2id', {
|
||||
message: password,
|
||||
nonce: Buffer.from(salt, 'hex'),
|
||||
parallelism: 1,
|
||||
tagLength: 32,
|
||||
memory: 64 * 1024,
|
||||
passes: 3,
|
||||
})
|
||||
.toString('hex');
|
||||
return argon2HashRawSync(password, {
|
||||
salt: Buffer.from(salt, 'hex'),
|
||||
parallelism: 1,
|
||||
outputLen: 32,
|
||||
memoryCost: 64 * 1024,
|
||||
timeCost: 3,
|
||||
algorithm: Argon2Algorithm.Argon2id,
|
||||
}).toString('hex');
|
||||
}
|
||||
|
||||
function createAuthPool(userRow) {
|
||||
|
||||
Reference in New Issue
Block a user