测试脚本添加签名密钥生成
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
1a3e37f39a
commit
373ce3d003
|
@ -1,7 +1,25 @@
|
|||
import { config } from '../../src/config.js'
|
||||
import { server, setup, shutdown } from '../../src/index.js'
|
||||
import { generateKeyPairSync } from 'crypto'
|
||||
import { existsSync, writeFileSync } from 'fs'
|
||||
|
||||
beforeAll(() => {
|
||||
if(!existsSync(config.signing.private)) {
|
||||
const { publicKey, privateKey } = generateKeyPairSync('rsa', {
|
||||
modulusLength: 4096,
|
||||
publicKeyEncoding: {
|
||||
type: "pkcs1",
|
||||
format: "pem"
|
||||
},
|
||||
privateKeyEncoding: {
|
||||
type: "pkcs1",
|
||||
format: "pem"
|
||||
}
|
||||
})
|
||||
writeFileSync('public.pem', publicKey)
|
||||
writeFileSync('private.pem', privateKey)
|
||||
}
|
||||
|
||||
config.database.url = 'mongodb://setup-database:27017/yggdrasil?readPreference=primary&appname=MongoDB%20Compass&directConnection=true&ssl=false'
|
||||
return setup()
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue