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

issue #4101 - handle patch in fhir-smart interceptor #4103

Merged
merged 3 commits into from
Dec 9, 2022
Merged

Conversation

lmsurpre
Copy link
Member

and add corresponding tests to AuthzPolicyEnforcementTest.java

Signed-off-by: Lee Surprenant lmsurpre@merative.com

and add corresponding tests to AuthzPolicyEnforcementTest.java

Signed-off-by: Lee Surprenant <lmsurpre@merative.com>
as suggested

Signed-off-by: Lee Surprenant <lmsurpre@merative.com>
Copy link
Collaborator

@PrasannaHegde1 PrasannaHegde1 left a comment

Choose a reason for hiding this comment

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

LGTM

assertTrue(shouldSucceed(resourceTypesPermittedByScope, OBSERVATION, READ_APPROVED, permission) &&
shouldSucceed(resourceTypesPermittedByScope, OBSERVATION, WRITE_APPROVED, permission));
} catch (FHIRPersistenceInterceptorException e) {
assertFalse(shouldSucceed(resourceTypesPermittedByScope, OBSERVATION, READ_APPROVED, permission) &&
Copy link
Collaborator

@punktilious punktilious Dec 8, 2022

Choose a reason for hiding this comment

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

should this be an || instead of && ?

I'm assuming you want both of these to be false.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think the && is right. If either one of these is false, then we expect the method under test to throw a FHIRPersistenceInterceptorException.

if (shouldSucceed(resourceTypesPermittedByScope, BINARY, READ_APPROVED, permission) &&
shouldSucceed(resourceTypesPermittedByScope, BINARY, WRITE_APPROVED, permission)) {
assertTrue(e.getMessage().equals("securityContext is not supported for resource type Binary"));
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

else?

Copy link
Member Author

@lmsurpre lmsurpre Dec 8, 2022

Choose a reason for hiding this comment

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

Suggested change
}
}
// else beforePatch was rejected due to normal fhir-smart behavior (non-securityContext-related)

as requested in review

Signed-off-by: Lee Surprenant <lmsurpre@merative.com>
Copy link
Collaborator

@punktilious punktilious left a comment

Choose a reason for hiding this comment

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

LGTM

@lmsurpre lmsurpre merged commit 24a1ba5 into main Dec 9, 2022
@lmsurpre lmsurpre deleted the issue-4101 branch December 9, 2022 14:15
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.

3 participants