-
Notifications
You must be signed in to change notification settings - Fork 0
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
Allow multiple CHEFS forms to be configured/displayed #1
Conversation
FE can pull from multiple data sources. BE has dynamic basic auth based on the requested form ID
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.
Provisionally approving, needs to fix failing tests.
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.
Seems good for the most part - just a few minor odds and ends to address, including the failed linting/tests.
"formId": "FORM_1_ID", | ||
"formApiKey": "FORM_1_APIKEY" | ||
}, | ||
"form2": { | ||
"name": "FORM_2_NAME", | ||
"formId": "FORM_2_ID", | ||
"formApiKey": "FORM_2_APIKEY" |
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.
Style: Since we know the values are nested, might be able to call it just "id" and "apiKey" without needing the form prefix for the attribute names.
app/src/controllers/chefs.ts
Outdated
* BCeID/Business should only see their own submissions | ||
*/ | ||
const filterData = (data: Array<ChefsSubmissionDataSource>) => { | ||
const filterToUser = (req.currentUser?.tokenPayload as JwtPayload).identity_provider !== IdentityProvider.IDIR; |
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.
Just as a note - in the event we use a non-SSO Keycloak IAM we might not necessarily have the identity_provider
attribute available. This is one of those few situations where I'm thinking it may be worth doing a defensive null check for tokenPayload?
app/src/types/ChefsFormConfig.ts
Outdated
formId: string; | ||
formApiKey: string; |
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 be 'id' and 'apiKey' from earlier style comment if we wanted to be more terse.
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 looking great!
6e68153
to
bb94a84
Compare
Allow multiple CHEFS forms to be configured on the back end. Requests to the CHEFS API from the back end will create an Axios request with a dynamic basic auth by doing a lookup into the config map based on the form ID in the request. Submission data will be merged together for every form that is configured, before finally being filtered by user (if required) and sent to the front end.
Description
Types of changes
New feature (non-breaking change which adds functionality)
Checklist
Further comments