-
Notifications
You must be signed in to change notification settings - Fork 159
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
Conversation
and add corresponding tests to AuthzPolicyEnforcementTest.java Signed-off-by: Lee Surprenant <lmsurpre@merative.com>
fhir-smart/src/test/java/org/linuxforhealth/fhir/smart/test/AuthzPolicyEnforcementTest.java
Outdated
Show resolved
Hide resolved
fhir-smart/src/test/java/org/linuxforhealth/fhir/smart/test/AuthzPolicyEnforcementTest.java
Outdated
Show resolved
Hide resolved
as suggested Signed-off-by: Lee Surprenant <lmsurpre@merative.com>
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.
LGTM
assertTrue(shouldSucceed(resourceTypesPermittedByScope, OBSERVATION, READ_APPROVED, permission) && | ||
shouldSucceed(resourceTypesPermittedByScope, OBSERVATION, WRITE_APPROVED, permission)); | ||
} catch (FHIRPersistenceInterceptorException e) { | ||
assertFalse(shouldSucceed(resourceTypesPermittedByScope, OBSERVATION, READ_APPROVED, permission) && |
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.
should this be an || instead of && ?
I'm assuming you want both of these to be false.
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.
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")); | ||
} |
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.
else?
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.
} | |
} | |
// 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>
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.
LGTM
and add corresponding tests to AuthzPolicyEnforcementTest.java
Signed-off-by: Lee Surprenant lmsurpre@merative.com