Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"express-ws": "^5.0.2",
"got": "^15.1.0",
"http-z": "^7.0.0",
"js-yaml": "^4.2.0",
"js-yaml": "^5.2.1",
"minimist": "^1.2.8",
"mqtt": "^5.15.2",
"node-forge": "^1.4.0",
Expand Down
4 changes: 2 additions & 2 deletions src/routes/admin/profiles/export.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { exportProfile } from './export.js'
import { Environment } from '../../../utils/Environment.js'

import { vi, type MockInstance } from 'vitest'
import yaml from 'js-yaml'
import { load } from 'js-yaml'
import crypto from 'crypto'

describe('Profiles - Export', () => {
Expand Down Expand Up @@ -41,7 +41,7 @@ describe('Profiles - Export', () => {
decipher.setAuthTag(tag)
const decrypted = Buffer.concat([decipher.update(ct), decipher.final()])
const pt = decrypted.toString('utf8')
return yaml.load(pt)
return load(pt)
}

beforeEach(() => {
Expand Down
4 changes: 2 additions & 2 deletions src/routes/admin/profiles/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { NOT_FOUND_EXCEPTION, NOT_FOUND_MESSAGE } from '../../../utils/constants
import handleError from '../../../utils/handleError.js'
import { RPSError } from '../../../utils/RPSError.js'
import { type Request, type Response } from 'express'
import yaml from 'js-yaml'
import { dump } from 'js-yaml'
import { encryptWithRandomKey } from '../../../utils/encryptWithRandomKey.js'
import { type CertCredentials } from '../../../interfaces/ISecretManagerService.js'
import { Environment } from '../../../utils/Environment.js'
Expand Down Expand Up @@ -203,7 +203,7 @@ export async function exportProfile(req: Request, res: Response): Promise<void>
}
}

const yamlStr = yaml.dump(output)
const yamlStr = dump(output)
// Encrypt the YAML string and provide the key
const { cipherText, key } = encryptWithRandomKey(yamlStr)

Expand Down
Loading