-
Notifications
You must be signed in to change notification settings - Fork 10
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
Fb orscf #295
base: main
Are you sure you want to change the base?
Fb orscf #295
Conversation
updated orscf packages created filter service applied to uid-filters
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.
CodeQL found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.
return resp.status(200).json({ | ||
fault: null, | ||
createdVisitUids: createdVisitUids, | ||
updatedVisitUids: updatedVisitUids |
Check failure
Code scanning / CodeQL
Uncontrolled data used in path expression (experimental)
WHERE subject_uid = $5 RETURNING subject_uid', | ||
[ | ||
subjectMutation.periodStart, | ||
subjectMutation.status, |
Check failure
Code scanning / CodeQL
SQL database query built from user-controlled sources (experimental)
[ | ||
subjectMutation.periodStart, | ||
subjectMutation.status, | ||
subjectMutation.periodEnd, |
Check failure
Code scanning / CodeQL
SQL database query built from user-controlled sources (experimental)
public async applyVisitBatchMutation(req: Request, resp: Response) { | ||
try { | ||
const visitUids: string[] = req.body.visitUids; | ||
if (visitUids == undefined || visitUids == null) { |
Check notice
Code scanning / CodeQL
Unneeded defensive code
return resp.status(200).json({ fault: 'no visits on request', return: null }); | ||
} | ||
const mutation: VdrModels.BatchableVisitMutation = req.body.mutation; | ||
if (mutation == undefined || mutation == null) { |
Check notice
Code scanning / CodeQL
Unneeded defensive code
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.
logger.info(cmd); | ||
const getVisitsQuery = await pool.query(cmd); | ||
return getVisitsQuery.rows.map((x) => { | ||
return VdrMappingHelper.toCamelCase(x); |
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.
this is redundant as the query already returns all attributes in camel case?
// const searchQuery2 = await pool.query(`SELECT \ | ||
// subject_uid AS "subjectUid", \ | ||
// subject_id AS "subjectIdentifier", \ | ||
// study_uid AS "studyUid", \ | ||
// actual_site_uid AS "actualSiteUid", \ | ||
// 0 AS "isArchived", \ | ||
// 0 AS modiciationTimestampUtc \ | ||
// FROM studyparticipant`); | ||
|
||
// return searchQuery2.rows; |
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.
unused code?
// result = SearchFilterService.appendAndFilter( | ||
// result, | ||
// SearchFilterService.buildStringClause(filter.assignedArm, varName, 'assigned_arm') | ||
// ); | ||
// result = SearchFilterService.appendAndFilter( | ||
// result, | ||
// SearchFilterService.buildStringClause(filter.actualArm, varName, 'actual_arm') | ||
// ); |
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.
unused code?
|
||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types | ||
static secretCallback(req, payload, done) { | ||
const result = env | ||
.get('JWT_SECRET') | ||
.default(randomBytes(256).toString('base64')) | ||
.asString(); | ||
done(null, result); | ||
} |
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.
unused method?
static getJwtSecret(): string { | ||
return env.get('JWT_SECRET').default(randomBytes(256).toString('base64')).asString(); | ||
} |
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.
Same method as in AuthConfig: duplicate code; also unused
'${dr.recordedData}' | ||
)`; | ||
logger.info(cmd); | ||
await pool.query(cmd); |
Check failure
Code scanning / CodeQL
Database query built from user-controlled sources
where id = '${dr.dataRecordingUid}' | ||
`; | ||
logger.info(cmd); | ||
await pool.query(cmd); |
Check failure
Code scanning / CodeQL
Database query built from user-controlled sources
add orscf features to enable the study to be managed via orscf dashboard.
these features are optional