I have a GCP Healthcare API deployed in GCP. I have an API Product & proxy returning data ok. The IAM service account in the Apigee project has firestore reader permissions in the fhir store project and to access the fhir store my proxy is reading the fhir store like this :
<HTTPTargetConnection>
<URL>https://SET_URL_FROM_CONFIG</URL>
<Authentication>
<GoogleAccessToken>
<Scopes>
<Scope>https://www.googleapis.com/auth/cloud-platform</Scope>
</Scopes>
</GoogleAccessToken>
</Authentication>
</HTTPTargetConnection>
The above works just fine.
I’m looking to create an API Product that constrains access to a subset of fhir resources. e.g. Organization, Location, Practitioner
What are my options?
What I’ve tried:
-
Using Operations → No good. I can constrain the proxy by Operations e.g. /Practitioner/** but this is easily circumvented with a fhir reverse include query like this :
proxyname/Practitioner?_id=<unique_fhirstore_id>&_revinclude=Encounter:practitioner -
Was hoping using scopes like this below would work? docs ref
See the various attempts commented out..
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AssignMessage continueOnError="false" enabled="true" name="AssignMessage-AddScopesHeader">
<DisplayName>AssignMessage-AddScopesHeader</DisplayName>
<Properties/>
<Add>
<!-- https://cloud.google.com/healthcare-api/docs/smart-on-fhir#set-and -->
<!-- This is a scopes test. Will this restrict the FHIR server as described ?? -->
<Headers>
<!-- <Header name="X-Authorization-Scope">user/Practitioner.read user/PractitionerRole.read user/Organization.read user/Location.read</Header> -->
<!-- <Header name="X-Authorization-Scope">user/Practitioner.read</Header> -->
<!-- <Header name="X-Authorization-Scope">user/*.rs</Header> -->
<Header name="X-Authorization-Scope">user/*.read</Header>
</Headers>
</Add>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
<AssignTo createNew="false" transport="http" type="request"/>
</AssignMessage>
It’s not behaving at the moment. Still trying it. Thought I’d ask if in case I was heading down a rabbit hole!
Thanks