Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove crypto.sign from the debug api #22

Merged
merged 1 commit into from
May 13, 2024
Merged
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: 4 additions & 6 deletions src/API.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ export function registerRoutes(server: FastifyInstance<Server, IncomingMessage,
(_request: FullNodeListRequest, reply) => {
profilerInstance.profileSectionStart('removed')
nestedCountersInstance.countEvent('consensor', 'removed')
reply.send(Crypto.sign({ removedAndApopedNodes: Cycles.removedAndApopedNodes }))
reply.send({ removedAndApopedNodes: Cycles.removedAndApopedNodes })
profilerInstance.profileSectionEnd('removed')
}
)
Expand Down Expand Up @@ -913,8 +913,7 @@ export function registerRoutes(server: FastifyInstance<Server, IncomingMessage,
},
},
(_request, reply) => {
const res = Crypto.sign(config)
reply.send(res)
reply.send({ ...config, ARCHIVER_SECRET_KEY: '' }) // send the config without the secret key
}
)

Expand All @@ -935,8 +934,7 @@ export function registerRoutes(server: FastifyInstance<Server, IncomingMessage,
data['dataSendersList'] = Array.from(Data.dataSenders.values()).map(
(item) => item.nodeInfo.ip + ':' + item.nodeInfo.port
)
const res = Crypto.sign(data)
reply.send(res)
reply.send(data)
}
)

Expand All @@ -955,7 +953,7 @@ export function registerRoutes(server: FastifyInstance<Server, IncomingMessage,
if (enableLoseYourself) {
Logger.mainLogger.debug('/lose-yourself: exit(1)')

reply.send(Crypto.sign({ status: 'success', message: 'will exit' }))
reply.send({ status: 'success', message: 'will exit' })

// We don't call exitArchiver() here because that awaits Data.sendLeaveRequest(...),
// but we're simulating a lost node.
Expand Down
Loading