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

server centralize request validation for co-location and reduced redundancy #3228

Merged

Conversation

dillonstreator
Copy link
Contributor

No description provided.

@dillonstreator dillonstreator requested a review from a team as a code owner November 5, 2023 01:41
Copy link

vercel bot commented Nov 5, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
medplum-storybook ⬜️ Ignored (Inspect) Visit Preview Nov 11, 2023 10:35pm
medplum-www ⬜️ Ignored (Inspect) Visit Preview Nov 11, 2023 10:35pm

Copy link

vercel bot commented Nov 5, 2023

Someone is attempting to deploy a commit to the Medplum Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

sweep-ai bot commented Nov 5, 2023

Apply Sweep Rules to your PR?

  • Apply: All new business logic should have corresponding unit tests.
  • Apply: Refactor large functions to be more modular.

Comment on lines -34 to -39
const errors = validationResult(req);
if (!errors.isEmpty()) {
sendOutcome(res, invalidRequest(errors));
return;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this approach is viable given that the behavior is slightly different here in that request validation would now run prior to the config check

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's ok 👍

@codyebberson
Copy link
Member

Thanks @dillonstreator - this looks great.

@dillonstreator
Copy link
Contributor Author

Thank you @codyebberson!
Please let me know if there is anything I can do to support this through the pipeline. I see some workflow failures but I believe they're outside of my control. This is lower priority than other work so no rush!

@dillonstreator
Copy link
Contributor Author

rebased to include coveralls fix #3246


next();
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not in love with the filename
thoughts on utils/http.ts or utils/middleware.ts?
open to other suggestions or keeping if I'm being too nit-picky

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re name: Sounds ok to me. I like validator.ts better than http.ts or middleware.ts

Copy link
Member

@codyebberson codyebberson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks @dillonstreator !

Love this:
image


next();
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re name: Sounds ok to me. I like validator.ts better than http.ts or middleware.ts

Comment on lines -34 to -39
const errors = validationResult(req);
if (!errors.isEmpty()) {
sendOutcome(res, invalidRequest(errors));
return;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's ok 👍

@codyebberson codyebberson added this pull request to the merge queue Nov 14, 2023
Merged via the queue into medplum:main with commit fe4cec8 Nov 14, 2023
12 checks passed
codyebberson added a commit that referenced this pull request Nov 19, 2023
Refinements and additions fot Health Gorilla documentation as we proceed through testing (#3333)
Tighter input validation on security endpoints (#3334)
Use react-jsx transform (#3338)
Create documentation for chained search (#3312)
Document performing insurance eligibility checks (#3280)
feat(expo): add `ExpoClientStorage` for persisted store in RN (#3307)
test(server): add `test.config.json` with port `8104` (#3329)
Make Postgres version configurable in CDK (#3327)
Configure agent service name and automatic start (#3321)
Link authentication methods to relevant Medplum Client functions (#3323)
server centralize request validation for co-location and reduced redundancy (#3228)
Fixed FHIR link (#3319)
github-merge-queue bot pushed a commit that referenced this pull request Nov 19, 2023
Refinements and additions fot Health Gorilla documentation as we proceed through testing (#3333)
Tighter input validation on security endpoints (#3334)
Use react-jsx transform (#3338)
Create documentation for chained search (#3312)
Document performing insurance eligibility checks (#3280)
feat(expo): add `ExpoClientStorage` for persisted store in RN (#3307)
test(server): add `test.config.json` with port `8104` (#3329)
Make Postgres version configurable in CDK (#3327)
Configure agent service name and automatic start (#3321)
Link authentication methods to relevant Medplum Client functions (#3323)
server centralize request validation for co-location and reduced redundancy (#3228)
Fixed FHIR link (#3319)
@reshmakh reshmakh added this to the November 30, 2023 milestone Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants