-
Notifications
You must be signed in to change notification settings - Fork 5
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
BLUE-118(feat): Config-patch endpoint added #36
Conversation
BLUE-118 Ability to update the archiver config while running ( with dev key )
ISSUE SUMMARY: <<TODO: Replace this with a short summary of the issue.>> ISSUE REPRO STEPS: <HINT: Add steps to list as-needed. If interaction is complex, add screenshots or a Slack screen-capture video (just drag and drop)>
EXPECTED RESULT: <<TODO: Replace this with your expected results.>> PULL REQUESTS: <HINT: If your fix requires changes in multiple repos, add the following info per-repository.> <<TODO: Enter Repository Name>> Pull Request Link: <<TODO: Insert PR-LINK>> GPT Review Link: <<TODO: Insert GPT-Review-Link>> Jenkins Test Link: <<TODO: Insert Jenkins Test Job Link>> ADDITIONAL INSTRUCTIONS: <HINT: Add any additional instructions needed for the assignee. If you have specific requirements for how the task should be implemented or fixed, enter them or link them here.> <<TODO: Insert additional instructions for assignee.>> |
src/Config.ts
Outdated
if (newConfig[key] === 'true') newConfig[key] = true | ||
else if (newConfig[key] === 'false') newConfig[key] = false | ||
else if (typeof newConfig[key] !== 'boolean' && !Number.isNaN(Number(newConfig[key]))) | ||
newConfig[key] = Number(newConfig[key])} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a small formatting issue here. Could you please fix it?
src/Data/Data.ts
Outdated
const devPublicKeys = tallyItem.value.config.devPublicKeys | ||
const updateConfigProps = { | ||
newPOQReceipt: tallyItem.value.config.useNewPOQ, | ||
DevPublicKey: Object.keys(devPublicKeys).find((key) => devPublicKeys[key] === 3), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add an undefined check here? If no devPublicKey has a security level of 3, then we should avoid setting this config
d61b2c5
to
6c945ca
Compare
Logger.mainLogger.debug('Archiver config update executed: ', JSON.stringify(newConfig)) | ||
|
||
const updatedConfig = updateConfig(newConfig) | ||
reply.send({ success: true, ...updatedConfig, ARCHIVER_SECRET_KEY: '' }) |
Check failure
Code scanning / CodeQL
Reflected cross-site scripting High
user-provided value
c9824f3
to
04bd0fb
Compare
5c7b070
to
7ea642b
Compare
Summary
This PR adds a new endpoint:
/set-config
that allows updating the archiver's config on-the-fly.Linear Task - BLUE-118