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

fix(admin/client): use :projectId param to create client as superadmin #2722

Merged
merged 6 commits into from
Aug 26, 2023

Conversation

ThatOneBro
Copy link
Member

Fixes #2717

Originally wanted to use meta fields on ClientApplication to check for the project ID, but may have found a bug around the meta field being clobbered by addition of versioning info on initial creation of a resource, or at least the ClientApplication. (Will probably open an issue about this tomorrow once I have more info)

@ThatOneBro ThatOneBro requested a review from a team as a code owner August 25, 2023 07:09
@vercel
Copy link

vercel bot commented Aug 25, 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 Aug 25, 2023 10:59pm
medplum-www ⬜️ Ignored (Inspect) Visit Preview Aug 25, 2023 10:59pm

@coveralls
Copy link

coveralls commented Aug 25, 2023

Coverage Status

coverage: 94.239% (+0.002%) from 94.237% when pulling a700497 on derrick-fix-ignored-project-id into dc69dc8 on main.

packages/server/src/admin/client.test.ts Outdated Show resolved Hide resolved
packages/server/src/admin/client.test.ts Outdated Show resolved Hide resolved
@reshmakh reshmakh added this to the August 31, 2023 milestone Aug 25, 2023
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, one formatting nit, otherwise lgtm 👍

const client = await createClient(res.locals.repo as Repository, {
let project: Project;
const { project: localsProject, repo } = res.locals as { project: Project; repo: Repository };
if (localsProject.superAdmin) {
Copy link
Member

Choose a reason for hiding this comment

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

Yep 👍

@@ -1,9 +1,14 @@
import { randomUUID } from 'crypto';
import express from 'express';
import request from 'supertest';
import { getReferenceString, resolveId } from '@medplum/core';

Copy link
Member

Choose a reason for hiding this comment

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

Remove blank lines & "Organize imports"

Copy link
Member Author

@ThatOneBro ThatOneBro Aug 25, 2023

Choose a reason for hiding this comment

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

Sweet, yeah I was wondering if you all had a style preference for imports.

I think there's a way to do auto-organize imports on save right? Or maybe thats if you use eslint as your formatter. Another way could be adding a lint rule, just to keep this consistent

Copy link
Member

Choose a reason for hiding this comment

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

Yeah... this is a gap in our ESLint config right now. Currently we're just using the VS Code default behavior. It would be nice to enforce with ESLint/Prettier.

@reshmakh reshmakh added the self-host Features and fixes related to self hosting label Aug 25, 2023
@ThatOneBro ThatOneBro added this pull request to the merge queue Aug 25, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 25, 2023
@ThatOneBro ThatOneBro force-pushed the derrick-fix-ignored-project-id branch from 1f6491a to a700497 Compare August 25, 2023 20:27
@sonarcloud
Copy link

sonarcloud bot commented Aug 25, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@ThatOneBro ThatOneBro added this pull request to the merge queue Aug 26, 2023
Merged via the queue into main with commit 37a22f2 Aug 26, 2023
11 checks passed
@ThatOneBro ThatOneBro deleted the derrick-fix-ignored-project-id branch August 26, 2023 01:29
codyebberson added a commit that referenced this pull request Aug 27, 2023
Capturing vital signs documentation (#2651)
Draft agent documentation (#2721)
Fixes #2727 - add signingKeyId to param store (#2728)
Organizing communications docs (#2579)
feat(Storybook): enable viewing story source code (#2723)
fix(admin/client): use `:projectId` param to create client as superadmin (#2722)
feat(QuestionnaireForm): add support for `exists`, `!=`, etc. operators (#2714)
read clientSecret from options (#2712)
Enable graphql __type (#2700)
add loading feedback (#2713)
fix(): fix blame page (#2711)
Array search via subqueries, minor refactor (#2701)
Patient Deduplication Reference Implementation (#2674)
Add FHIRPath criteria for write operations to AccessPolicy (#2684)
Fixes #2675 - added Medplum resource types to navbar (#2698)
Dependency upgrades (#2697)
Updating solutions to include reference to EMPI use cases (#2695)
add: app version to <meta> tag in app (#2692)
Fixed cli test on windows (#2696)
Adding blog content (#2686)
Allow Target Type input for references  (#2685)
Change extension url for Questionnaire Page (#2687)
Add validation benchmarks (#2420)
Add Category input to ReferenceRangeEditor component (#2676)
'Add Page' to Questionnaire  (#2667)
fix(docs): correct client credentials flow python example (#2682)
Document Lab Service Menu (#2629)
Add ReCAPTCHA site key to default app config (#2681)
Updating documentation for b10 (#2677)
Clarify user admin (#2671)
Clarify that patients can be part of more than one gropu (#2669)
Fixes #1418 - bot layer docs (#2656)
Keep super admin notifications open until user closes (#2666)
JWT Assertion login for CLI  (#2590)
Add default base URL to agent installer (#2665)
Use repo.searchOne where possible (#2661)
Fixes #1236 - login UX when user does not have membership (#2660)
Extract HL7 headers from bot input for AWS Athena (#2659)
Clean up temp binary storage for unit tests (#2658)
Dependency upgrades (#2655)
Blog post on system strings (#2646)
Allow bots to return Hl7Message instances (#2653)
Agent installer (#2652)
Deploy bot layer on new release version (#2654)
Enable profile validation (#2649)
Fixed JSON escaping of HL7 strings from lambda bots (#2650)
Handle slicing edge cases for profile validation (#2620)
Document system only search (#2648)
Medplum Agent data definitions (#2640)
Improve handling of primitive extension properties (#2641)
Fixes #2618 - initial field selection in filters dialog (#2645)
Document GraphQL list filtering with FHIRPath (#2643)
JWT Bearer Login for CLI  (#2587)
fix(docs): fix typo in `family-relationships.mdx` (#2644)
github-merge-queue bot pushed a commit that referenced this pull request Aug 27, 2023
Capturing vital signs documentation (#2651)
Draft agent documentation (#2721)
Fixes #2727 - add signingKeyId to param store (#2728)
Organizing communications docs (#2579)
feat(Storybook): enable viewing story source code (#2723)
fix(admin/client): use `:projectId` param to create client as superadmin (#2722)
feat(QuestionnaireForm): add support for `exists`, `!=`, etc. operators (#2714)
read clientSecret from options (#2712)
Enable graphql __type (#2700)
add loading feedback (#2713)
fix(): fix blame page (#2711)
Array search via subqueries, minor refactor (#2701)
Patient Deduplication Reference Implementation (#2674)
Add FHIRPath criteria for write operations to AccessPolicy (#2684)
Fixes #2675 - added Medplum resource types to navbar (#2698)
Dependency upgrades (#2697)
Updating solutions to include reference to EMPI use cases (#2695)
add: app version to <meta> tag in app (#2692)
Fixed cli test on windows (#2696)
Adding blog content (#2686)
Allow Target Type input for references  (#2685)
Change extension url for Questionnaire Page (#2687)
Add validation benchmarks (#2420)
Add Category input to ReferenceRangeEditor component (#2676)
'Add Page' to Questionnaire  (#2667)
fix(docs): correct client credentials flow python example (#2682)
Document Lab Service Menu (#2629)
Add ReCAPTCHA site key to default app config (#2681)
Updating documentation for b10 (#2677)
Clarify user admin (#2671)
Clarify that patients can be part of more than one gropu (#2669)
Fixes #1418 - bot layer docs (#2656)
Keep super admin notifications open until user closes (#2666)
JWT Assertion login for CLI  (#2590)
Add default base URL to agent installer (#2665)
Use repo.searchOne where possible (#2661)
Fixes #1236 - login UX when user does not have membership (#2660)
Extract HL7 headers from bot input for AWS Athena (#2659)
Clean up temp binary storage for unit tests (#2658)
Dependency upgrades (#2655)
Blog post on system strings (#2646)
Allow bots to return Hl7Message instances (#2653)
Agent installer (#2652)
Deploy bot layer on new release version (#2654)
Enable profile validation (#2649)
Fixed JSON escaping of HL7 strings from lambda bots (#2650)
Handle slicing edge cases for profile validation (#2620)
Document system only search (#2648)
Medplum Agent data definitions (#2640)
Improve handling of primitive extension properties (#2641)
Fixes #2618 - initial field selection in filters dialog (#2645)
Document GraphQL list filtering with FHIRPath (#2643)
JWT Bearer Login for CLI  (#2587)
fix(docs): fix typo in `family-relationships.mdx` (#2644)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
self-host Features and fixes related to self hosting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ClientApplication endpoint ignores :projectId as SuperAdmin
5 participants