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

Validate access policy criteria against stated resource type #5412

Merged
merged 4 commits into from
Oct 21, 2024

Conversation

mattwiller
Copy link
Member

@mattwiller mattwiller commented Oct 21, 2024

Ensure that AccessPolicy criteria are consistent: they must refer to the same resource type as the AccessPolicy.resource.resourceType, e.g.

{
  "resourceType": "Practitioner",
  "criteria": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999999999"
}

This is checked in two places:

  • When the AccessPolicy is modified, invalid criteria will trigger a 400 error
  • When the access policy is applied, invalid criteria will be ignored

@mattwiller mattwiller added the fhir-datastore Related to the FHIR datastore, includes API and FHIR operations label Oct 21, 2024
@mattwiller mattwiller added this to the October 31, 2024 milestone Oct 21, 2024
@mattwiller mattwiller self-assigned this Oct 21, 2024
@mattwiller mattwiller requested a review from a team as a code owner October 21, 2024 18:00
Copy link

vercel bot commented Oct 21, 2024

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

Name Status Preview Comments Updated (UTC)
medplum-provider ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 21, 2024 7:48pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
medplum-app ⬜️ Ignored (Inspect) Visit Preview Oct 21, 2024 7:48pm
medplum-storybook ⬜️ Ignored (Inspect) Visit Preview Oct 21, 2024 7:48pm
medplum-www ⬜️ Ignored (Inspect) Visit Preview Oct 21, 2024 7:48pm

packages/server/src/fhir/repo.ts Outdated Show resolved Hide resolved
Copy link

@mattwiller mattwiller added this pull request to the merge queue Oct 21, 2024
Merged via the queue into main with commit 3557e16 Oct 21, 2024
32 checks passed
@mattwiller mattwiller deleted the axp-consistency-validation branch October 21, 2024 20:17
medplumbot added a commit that referenced this pull request Oct 28, 2024
## What's Changed

* Search for exact code match in ValueSet expand (#5354)
* Fix _id special case in reverse chained search (#5355)
* Add limited readonly user to /auth/me response (#5357)
* Deduplicate search results (#5353)
* Log all database errors (#5359)
* Pass through already-normalized database errors (#5361)
* Use Postgres 16 for local development (#5362)
* Add ProjectMembership.identifier (#5364)
* tweak(cli): make `medplum token` more cli consumer friendly (#5363)
* Document assigning ownership via Project init (#5360)
* chore(actions): auto-assign reviewers from list (#5372)
* Validate boolean search parameters (#5370)
* Validate resource ID before reading from DB (#5369)
* Centralize escaping of text search query strings (#5368)
* fix(fhircast): align context change request with STU3 (#5366)
* Exclude attrs in Docker build (#5375)
* Docs: s/Permission-Policy/Permissions-Policy (#5376)
* Add opt-out config to not configure database connections to avoid session pinning (#5374)
* Handle database timeout error (#5373)
* Only include resolvable aliases (#5377)
* [Photon Health] Update sync patient bot to handle allergies and medication history (#5358)
* QuestionnaireForm no longer needs requestSchema (#5381)
* Proof-of-concept Dosespot UX in medplum-provider (#5341)
* Minor UI tweaks to QuestionnaireBuilder (#5382)
* Dependency upgrades 2024-10-14 (#5384)
* Automatically retry deploy bot on ResourceConflictException (#5388)
* fix(fhircast): associate topic with separate random connection endpoint (#4951)
* Remove cyclonedx (#5387)
* feat(ToolsPage): add confirm on `Upgrade` (#5305)
* Fixes #5385 - optional source param on QuestionnaireForm (#5389)
* Add compound index for Observation:_lastUpdated (#5393)
* DoseSpot UI ready for evaluation (#5391)
* Added R5 ResearchStudy (#5394)
* Update PDF demo bots to use DocumentReference rather than Media (#5395)
* Fix condition for GraphQL requests to use reader DB when available (#5398)
* Update readme for more thorough instructions (#5399)
* Enable async batch processing (#5308)
* feat(cli): add agent commands (#4750)
* Validate date search values (#5404)
* Document how userinfo values are generated (#5405)
* Improve docs on running bots on localhost (#5410)
* Document rate server rate limits config settings (#5403)
* Updating R5 and Real World Test Plan (#5411)
* Validate access policy criteria against stated resource type (#5412)
* Dependency upgrades 2024-10-21 (#5409)
* Specify application_name (#5407)
* Fix GraphQL max depth validation (#4949)
* Include pre-expanded ValueSets and flatten expansion for output (#5414)
* Fix documentation links (#5422)
* Pin `@tabler/icons-react` to not load all icons (#5423)
* docs(client): add docs about `MedplumClient` lifecycle (#5419)
* [Photon Health] Make minor improvements to demo app (#5420)
* Document asynchronous batch request pattern (#5408)
* Fix fork link typo in README files (#5417)
* feat(useSearch): add debounce to `useSearch` (#5413)
* Document JSON formatting for Batch Patch (#5425)
* Fixes #5418 - backport R5 search params for ResearchStudy et al (#5427)
* Updated types for R5 ResearchStudy and EvidenceVariable (#5428)
* Fixes #5378 - Handle multiple values in Timing.repeat.when (#5429)
* Dependency upgrades 2024-10-28 (#5430)

**Full Changelog**: v3.2.17...v3.2.18
codyebberson pushed a commit that referenced this pull request Oct 28, 2024
## What's Changed

* Search for exact code match in ValueSet expand (#5354)
* Fix _id special case in reverse chained search (#5355)
* Add limited readonly user to /auth/me response (#5357)
* Deduplicate search results (#5353)
* Log all database errors (#5359)
* Pass through already-normalized database errors (#5361)
* Use Postgres 16 for local development (#5362)
* Add ProjectMembership.identifier (#5364)
* tweak(cli): make `medplum token` more cli consumer friendly (#5363)
* Document assigning ownership via Project init (#5360)
* chore(actions): auto-assign reviewers from list (#5372)
* Validate boolean search parameters (#5370)
* Validate resource ID before reading from DB (#5369)
* Centralize escaping of text search query strings (#5368)
* fix(fhircast): align context change request with STU3 (#5366)
* Exclude attrs in Docker build (#5375)
* Docs: s/Permission-Policy/Permissions-Policy (#5376)
* Add opt-out config to not configure database connections to avoid session pinning (#5374)
* Handle database timeout error (#5373)
* Only include resolvable aliases (#5377)
* [Photon Health] Update sync patient bot to handle allergies and medication history (#5358)
* QuestionnaireForm no longer needs requestSchema (#5381)
* Proof-of-concept Dosespot UX in medplum-provider (#5341)
* Minor UI tweaks to QuestionnaireBuilder (#5382)
* Dependency upgrades 2024-10-14 (#5384)
* Automatically retry deploy bot on ResourceConflictException (#5388)
* fix(fhircast): associate topic with separate random connection endpoint (#4951)
* Remove cyclonedx (#5387)
* feat(ToolsPage): add confirm on `Upgrade` (#5305)
* Fixes #5385 - optional source param on QuestionnaireForm (#5389)
* Add compound index for Observation:_lastUpdated (#5393)
* DoseSpot UI ready for evaluation (#5391)
* Added R5 ResearchStudy (#5394)
* Update PDF demo bots to use DocumentReference rather than Media (#5395)
* Fix condition for GraphQL requests to use reader DB when available (#5398)
* Update readme for more thorough instructions (#5399)
* Enable async batch processing (#5308)
* feat(cli): add agent commands (#4750)
* Validate date search values (#5404)
* Document how userinfo values are generated (#5405)
* Improve docs on running bots on localhost (#5410)
* Document rate server rate limits config settings (#5403)
* Updating R5 and Real World Test Plan (#5411)
* Validate access policy criteria against stated resource type (#5412)
* Dependency upgrades 2024-10-21 (#5409)
* Specify application_name (#5407)
* Fix GraphQL max depth validation (#4949)
* Include pre-expanded ValueSets and flatten expansion for output (#5414)
* Fix documentation links (#5422)
* Pin `@tabler/icons-react` to not load all icons (#5423)
* docs(client): add docs about `MedplumClient` lifecycle (#5419)
* [Photon Health] Make minor improvements to demo app (#5420)
* Document asynchronous batch request pattern (#5408)
* Fix fork link typo in README files (#5417)
* feat(useSearch): add debounce to `useSearch` (#5413)
* Document JSON formatting for Batch Patch (#5425)
* Fixes #5418 - backport R5 search params for ResearchStudy et al (#5427)
* Updated types for R5 ResearchStudy and EvidenceVariable (#5428)
* Fixes #5378 - Handle multiple values in Timing.repeat.when (#5429)
* Dependency upgrades 2024-10-28 (#5430)

**Full Changelog**: v3.2.17...v3.2.18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fhir-datastore Related to the FHIR datastore, includes API and FHIR operations
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants