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

ONA Gateway <> Upstream Gateway Merge attempt #179

Merged
merged 189 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
189 commits
Select commit Hold shift + click to select a range
8d4c6c9
WIP- 1665: Implement PermissionAccessChecker
rehammuzzamil Sep 25, 2022
55bb437
1659: Add the Composition & Binary GET resources to the Allow-List of…
rehammuzzamil Sep 26, 2022
5bf4abf
Fix broken unit tests.
rehammuzzamil Sep 26, 2022
b60438d
1661: [Sync Enhancement | Data Access Checker] Identify the App & Use…
rehammuzzamil Oct 3, 2022
3574c20
Implement GET Resource Request Permission Checker ✨
ndegwamartin Oct 4, 2022
333d2c4
Implement Additonal HTTP Verbs Permission Processing
ndegwamartin Oct 4, 2022
99a2823
Add Unit Tests ✅
ndegwamartin Oct 4, 2022
09584ef
Enable pre-processing the request for adding location tags
ekigamba Oct 6, 2022
237a86e
Implement HTTP PUT and POST Permission Checker
ndegwamartin Oct 6, 2022
f1036b4
1661: [Sync Enhancement | Data Access Checker] Identify the App & Use…
rehammuzzamil Oct 6, 2022
4d325b0
1661: [Sync Enhancement | Data Access Checker] Identify the App & Use…
rehammuzzamil Oct 6, 2022
c555575
Fix Permisson Access Checker Not Loading 🩹
ndegwamartin Oct 7, 2022
90954c4
Permission Checker Implementation For POST Bundle
ndegwamartin Oct 7, 2022
1fbb25f
1661: [Sync Enhancement | Data Access Checker] Identify the App & Use…
rehammuzzamil Oct 13, 2022
eb368eb
Merge branch 'main' into permission-checker
ndegwamartin Oct 19, 2022
b6745a7
Pre-process the request URL adding _tag filter
ekigamba Oct 6, 2022
c5c85fb
:construction: Updated the spotless,HAPI nad logback dependencies
dubdabasoduba Oct 25, 2022
463106f
Merge branch 'main' into 1661_Data_Access_Checker_Foundation
dubdabasoduba Oct 25, 2022
80a6e68
Access Factory Interface Refactor
ndegwamartin Oct 31, 2022
48d03b0
Refactor and Clean Up Permission Checker ♻️
ndegwamartin Oct 31, 2022
8aa3fb0
Add Error Logging For POST Bundle
ndegwamartin Oct 31, 2022
f6596f3
Fix preprocessing to add correct _tag filter
ekigamba Oct 24, 2022
e235cea
Merge branch '1661_Data_Access_Checker_Foundation' into issue/1662-da…
ekigamba Nov 7, 2022
0c44ed0
Fix bug
rehammuzzamil Nov 7, 2022
4af210d
Fix conflicts
rehammuzzamil Nov 7, 2022
5397871
Merge DataAccessChecker.java into PermissionAccessChecker
rehammuzzamil Nov 7, 2022
4c3ba6d
remove tests and spotless check on dockerfile
bennsimon Nov 8, 2022
706a4c3
Clean Up Unused Methods
ndegwamartin Nov 8, 2022
f1982be
Merge remote-tracking branch 'origin/permission-checker-and-data-acce…
ekigamba Nov 8, 2022
047dd4b
add tests and checks workflow
bennsimon Nov 8, 2022
c304d1c
skip spotless check and apply in Dockerfile
bennsimon Nov 8, 2022
6b40dbc
Merge pull request #8 from opensrp/update-dockerfile
bennsimon Nov 9, 2022
62a97bf
add fhir access proxy chart
bennsimon Nov 7, 2022
9b87d85
fix lint issues
bennsimon Nov 7, 2022
d4e6d61
fix lint
bennsimon Nov 7, 2022
6161151
update github secrets
bennsimon Nov 7, 2022
12d0c3b
test docker publish workflow
bennsimon Nov 8, 2022
8d41971
update github action modules
bennsimon Nov 8, 2022
3c4262e
cleanup workflow
bennsimon Nov 9, 2022
b6b664f
spotless apply
bennsimon Nov 9, 2022
5e4c0eb
trigger ci
bennsimon Nov 10, 2022
bf2d098
Code cleanup
ekigamba Nov 10, 2022
2d36845
Merge pull request #6 from opensrp/add-fhir-access-proxy-helm-chart
bennsimon Nov 11, 2022
7e61649
update chart repo url
bennsimon Nov 11, 2022
196a51e
update chart version
bennsimon Nov 11, 2022
646466d
Merge pull request #10 from opensrp/update-chart-repo-url
bennsimon Nov 11, 2022
71a1ba2
Merge pull request #9 from opensrp/issue/1662-data-filtering-user-ass…
rehammuzzamil Nov 12, 2022
73acecd
Merge branch permission-checker
rehammuzzamil Nov 12, 2022
4cbdbcc
Minor fixes
rehammuzzamil Nov 16, 2022
158f87a
Ignore broken unit tests
rehammuzzamil Nov 16, 2022
baa5e60
fix spacing issue after spotless apply on chart (#11)
bennsimon Nov 16, 2022
e546270
Fix in the ids format and update versions for the beta testing
rehammuzzamil Nov 24, 2022
a1321f9
Add distribution management code block
rehammuzzamil Nov 25, 2022
cbc0bc9
Merge pull request #7 from opensrp/permission-checker-and-data-access…
dubdabasoduba Jan 12, 2023
da1b14f
Merge pull request #2 from opensrp/1659_Add_Composition_And_Binary_Re…
dubdabasoduba Jan 12, 2023
40f0448
Add FHIR Common Utils Dependency
ndegwamartin Jan 27, 2023
9d2c65d
Enable Spotless Apply Plugin ➕
ndegwamartin Jan 27, 2023
f06605d
Upgrade Spring Boot Maven Plugin Version
ndegwamartin Jan 31, 2023
9dff9cc
Upgrade JDK version
ndegwamartin Jan 31, 2023
528e190
Apply Spotless Formatting
ndegwamartin Feb 1, 2023
353d770
Update common-utils versions
rehammuzzamil Feb 2, 2023
8bb66e9
Merge pull request #15 from opensrp/update-versions
dubdabasoduba Feb 3, 2023
94c4661
Merge remote-tracking branch 'origin/main' into reinstate-common-utils
ndegwamartin Feb 10, 2023
b273244
Partial Fix Search By Tag Parameter
ndegwamartin Feb 10, 2023
66db5f8
Fix Bug Allowed Queries Implementation
ndegwamartin Feb 13, 2023
3627d5f
Implement Sync Filter Resource Ignore Suport
ndegwamartin Feb 17, 2023
80ebfc2
Refactor Sync Filter Ignore Resources
ndegwamartin Feb 17, 2023
d79ca06
Update Docker Configuration
ndegwamartin Feb 18, 2023
12ca877
Optimize Remote Data Sync Strategy Implementation
ndegwamartin Feb 20, 2023
a3b599b
Merge pull request #16 from opensrp/optimize-data-filtering
dubdabasoduba Feb 20, 2023
81a9273
Merge remote-tracking branch 'origin/main' into reinstate-common-utils
ndegwamartin Feb 21, 2023
954bfe2
Refactor Proxy Request Filtering Implementation
ndegwamartin Feb 23, 2023
2c24b3e
Temporary HAPI FHIR Bug Workaround
ndegwamartin Feb 23, 2023
77f75fe
Clean up
ndegwamartin Feb 24, 2023
c7a2e08
Merge pull request #14 from opensrp/reinstate-common-utils
ndegwamartin Feb 24, 2023
4a9a85c
Implement Sync Data Filter Ignored Queries (#17)
dubdabasoduba Mar 14, 2023
c7f0784
Update hapi_sync_filter_ignored_queries.json config (#21)
ndegwamartin Mar 15, 2023
ea167f8
Update docker-publish.yml (#22)
ndegwamartin Mar 15, 2023
7886409
Merge upstream/main to forked/main branch
rehammuzzamil Mar 27, 2023
a56ae9f
Merge upstream/main to forked/main branch
rehammuzzamil Mar 27, 2023
1c1e96c
Merge upstream/main to forked/main branch
rehammuzzamil Mar 27, 2023
c8c1d83
Merge upstream/main to forked/main branch
rehammuzzamil Mar 27, 2023
d430993
Merge upstream/main to forked/main branch
rehammuzzamil Mar 27, 2023
8229363
Merge upstream/main to forked/main branch
rehammuzzamil Mar 27, 2023
8e1b8e6
Merge upstream/main to forked/main branch
rehammuzzamil Mar 27, 2023
3fea9cf
Fix bytebuddy exception on docker CI build
rehammuzzamil Mar 29, 2023
4dd5a86
Fix bytebuddy exception on docker CI build
rehammuzzamil Mar 29, 2023
1fea1d9
Merge pull request #23 from opensrp/upstream_changes
dubdabasoduba Mar 30, 2023
44f4d8a
Code Refactoring of FHIR Gateway
rehammuzzamil Apr 11, 2023
6a5ec86
Fix broken unit tests
rehammuzzamil Apr 11, 2023
d112cdc
Fixed formatting issues and build failure fixes due to missing depend…
rehammuzzamil Apr 11, 2023
e0d6b65
Merge branch 'google:main' into main
dubdabasoduba Apr 17, 2023
d92aebe
♻️ Rename the FHIR access proxy to the fhir gateway (#25)
dubdabasoduba Apr 25, 2023
63d6f37
Merge pull request #24 from opensrp/copy-of-main-before-sync_and_main…
dubdabasoduba May 4, 2023
a93adb6
Revert filter by code url and value
ekigamba May 8, 2023
9249a19
Fix failing tests in OpenSRPSyncAccessDecisionTest
ekigamba May 9, 2023
8f93524
Remove comments
ekigamba May 9, 2023
c93cade
Merge pull request #26 from opensrp/issue/2090-search-by-tag
ekigamba May 9, 2023
dd8b50e
Update version to 0.1.18-beta (#28)
ekigamba May 12, 2023
208f0fc
[ServerSide] Sync the OpenSRP FHIR Gateway repo with the upstream Goo…
rehammuzzamil May 15, 2023
2c10a8b
Update missing commits
rehammuzzamil May 17, 2023
1709d75
Empty commit
rehammuzzamil May 17, 2023
25de285
Update missing commits
rehammuzzamil May 17, 2023
579aa95
Update missing commits
rehammuzzamil May 17, 2023
03a9a13
Bump up version
rehammuzzamil May 17, 2023
7eb7479
Merge pull request #31 from opensrp/main-and-upstream-missing-commits
rehammuzzamil May 17, 2023
7d9384e
Move the Practitioner Details endpoint to plugins on the FHIR Gateway
rehammuzzamil May 23, 2023
e523287
Fix PermissionAccessChecker bugs resolving sync strategy
ekigamba May 24, 2023
018de14
Merge pull request #33 from opensrp/issue/2377-permission-checker-bugs
ekigamba May 25, 2023
6b1df2e
Release 0.1.21 Beta (#34)
ndegwamartin May 25, 2023
7a14158
Update the resource tag code system urls
ekigamba May 30, 2023
dff40be
Update versions to 0.1.22
ekigamba May 30, 2023
4774283
Merge pull request #35 from opensrp/issue/2401-fix-mobile-app-integra…
ekigamba May 30, 2023
3513ac1
Update versions to 0.1.23
ekigamba May 31, 2023
25c049f
Merge pull request #36 from opensrp/change-v0.1.23
ekigamba May 31, 2023
27c2407
Update careteam, location and organisation tag url removing last slash
ekigamba May 31, 2023
c1563d8
Update versions to 0.1.24
ekigamba May 31, 2023
7447096
Fix spotless issues in java file
ekigamba May 31, 2023
7be1789
Merge pull request #37 from opensrp/remove-slash-tag-urls-v0.1.24
ekigamba Jun 5, 2023
c7359ea
Move the Practitioner Details endpoint to plugins on the FHIR Gateway
rehammuzzamil Jun 13, 2023
ddecc94
Move the Practitioner Details endpoint to plugins on the FHIR Gateway
rehammuzzamil Jun 19, 2023
4b79c80
Move the Practitioner Details endpoint to plugins on the FHIR Gateway
rehammuzzamil Jun 21, 2023
75fb398
Move the Practitioner Details endpoint to plugins on the FHIR Gateway
rehammuzzamil Jun 21, 2023
52745cc
Fix Buffered Reader Closed Stream Bug
ndegwamartin Jul 5, 2023
2ca1847
Reinstate Entity Content Logging
ndegwamartin Jul 5, 2023
dbb0978
Implement List Mode Content Fetch ⚡️ (#40)
ndegwamartin Jul 7, 2023
51ebac7
Refactor Permission Checker to handle String type Ids
ndegwamartin Jul 7, 2023
93dbc33
Refactor Pre Processing Implementation ♻️
ndegwamartin Jul 7, 2023
ec150aa
Fix Request Fails For Illegal Header State
ndegwamartin Jul 7, 2023
b5ddc31
Release Version 0.2.5
ndegwamartin Jul 7, 2023
724d491
Merge pull request #41 from opensrp/fixes-enhancements
ndegwamartin Jul 7, 2023
bf02fc7
Refactor Gateway list entries mode to support Search by Tag
ndegwamartin Jul 11, 2023
d1b5ce7
Add Exceptions processing and Error Feedback
ndegwamartin Jul 11, 2023
f36cd6e
Code Refactor + Clean up
ndegwamartin Jul 12, 2023
5b8b015
Disable search by _tags
ndegwamartin Jul 15, 2023
28f1198
Bump up Release Version 🔖
ndegwamartin Jul 16, 2023
f18ae67
Merge pull request #39 from opensrp/prac-details-fix
rehammuzzamil Jul 17, 2023
3d1b26f
Move the Practitioner Details endpoint to plugins on the FHIR Gateway
rehammuzzamil Jul 19, 2023
7eb7cb2
Merge pull request #42 from opensrp/fixes-enhancements
dubdabasoduba Jul 20, 2023
8a35175
Refactor Sync Strategy To Single Value
ndegwamartin Jul 21, 2023
daded4c
Implement Multiple practitioners details endpoint ✨
ndegwamartin Jul 22, 2023
71d6d0a
Update Multi practitioners endpoint
ndegwamartin Jul 25, 2023
d4a004b
Bump up artifact release version to 0.1.28
ndegwamartin Jul 25, 2023
c2dec39
Refactor FHIR Practitioner Details Response
ndegwamartin Jul 26, 2023
9f67c0d
Bump up release version
ndegwamartin Jul 26, 2023
1e5a722
Add Cleartext sync bug troubleshooting logs
ndegwamartin Jul 26, 2023
47fab18
Strip out Troubleshooting Logs
ndegwamartin Jul 27, 2023
ddd8d9e
Add support for hierarchy of locations data sync fetch
ndegwamartin Jul 28, 2023
af09751
Allow Base URL POST requests
ndegwamartin Jul 28, 2023
cb0f739
Clean up
ndegwamartin Aug 1, 2023
d87b9a1
Move the Practitioner Details endpoint to plugins on the FHIR Gateway
rehammuzzamil Aug 1, 2023
11eb871
Move the Practitioner Details endpoint to plugins on the FHIR Gateway
rehammuzzamil Aug 2, 2023
55bb810
Rename OpenSRPHelper to PractitionerDetailsEndpointHelper.
ndegwamartin Aug 2, 2023
56c4afd
Move the Practitioner Details and LocationHierarchy endpoint to plugi…
rehammuzzamil Aug 2, 2023
fbd339c
Rename OpenSRPSyncAccessDecision to SyncAccessDecision class/variables
ndegwamartin Aug 2, 2023
3355855
Merge pull request #43 from opensrp/multiple-practitioner-details
ndegwamartin Aug 2, 2023
0e57945
Move the Practitioner Details and LocationHierarchy endpoint to plugi…
rehammuzzamil Aug 10, 2023
104ef0a
Move the Practitioner Details and LocationHierarchy endpoint to plugi…
rehammuzzamil Aug 10, 2023
cbd4436
Move the Practitioner Details and LocationHierarchy endpoint to plugi…
rehammuzzamil Aug 10, 2023
776c496
Move the Practitioner Details and LocationHierarchy endpoint to plugi…
rehammuzzamil Aug 10, 2023
e2c34cb
Remove redundant code
rehammuzzamil Aug 10, 2023
72741c2
Remove redundant code
rehammuzzamil Aug 10, 2023
fa7fe00
Update with Main
rehammuzzamil Aug 16, 2023
0934268
Fix spotless issues
rehammuzzamil Aug 16, 2023
4846b11
Merge branch 'main' into 2213-prac-details
ndegwamartin Aug 16, 2023
581743a
clean up
ndegwamartin Aug 16, 2023
08b3f24
Merge branch 'main' into 2213-prac-details
dubdabasoduba Aug 24, 2023
51e7f44
Merge branch 'main' into 2213-prac-details
ndegwamartin Sep 4, 2023
941c401
Change method visibility
rehammuzzamil Sep 6, 2023
b3dc299
Move custom code to custom repo for access checkers and custm APIs
rehammuzzamil Sep 13, 2023
858a88c
Remove Helm related files and revert release versions
rehammuzzamil Sep 13, 2023
076f1dd
Remove Helm related files and revert release versions
rehammuzzamil Sep 13, 2023
a5c354e
Remove Helm related files and revert release versions
rehammuzzamil Sep 13, 2023
f90f33c
Revert HttpFhirClient changes
rehammuzzamil Sep 13, 2023
d5f0ffe
Remove redundant code
rehammuzzamil Sep 13, 2023
54352cc
Add constant
rehammuzzamil Sep 13, 2023
c5349b2
Patch Token verification Race condition
ndegwamartin Aug 30, 2023
580d86c
Refactor
ndegwamartin Sep 1, 2023
d980aec
Addressed PR feedback
rehammuzzamil Sep 15, 2023
6d660ff
Remove synchronized keyword before decodeAndVerifyBearerToken method
rehammuzzamil Sep 15, 2023
09daceb
Remove unused ResourceFinder Files
ndegwamartin Sep 16, 2023
951becd
Moving authentication check to where it was before
rehammuzzamil Sep 20, 2023
a6eb8cd
Addressed PR feedback
rehammuzzamil Sep 27, 2023
822fa61
Addressed PR feedback
rehammuzzamil Sep 27, 2023
d69d79c
Revert the renaming in the comment of the proxy to gate way.
rehammuzzamil Sep 27, 2023
4434fd2
Remove extra test cases for custom allowed queries configuration reso…
rehammuzzamil Sep 27, 2023
b042fbd
Clean up test class
ndegwamartin Oct 3, 2023
73360c7
More clean up
ndegwamartin Oct 3, 2023
9cdd024
Remove redundant check
ndegwamartin Oct 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Dockerfile
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#

# Image for building and running tests against the source code of
# the FHIR Access Proxy.
FROM maven:3.8.5-openjdk-11 as build
# the FHIR Gateway.
FROM maven:3.8.5-openjdk-11-slim as build

RUN apt-get update && apt-get install -y nodejs npm
RUN npm cache clean -f && npm install -g n && n stable
Expand All @@ -37,10 +37,10 @@ RUN mvn spotless:check
RUN mvn --batch-mode package -Pstandalone-app -Dlicense.skip=true


# Image for FHIR Access Proxy binary with configuration knobs as environment vars.
# Image for FHIR Gateway binary with configuration knobs as environment vars.
FROM eclipse-temurin:11-jdk-focal as main

COPY --from=build /app/exec/target/exec-0.2.1-SNAPSHOT.jar /
COPY --from=build /app/exec/target/fhir-gateway-exec.jar /
COPY resources/hapi_page_url_allowed_queries.json resources/hapi_page_url_allowed_queries.json

ENV PROXY_PORT=8080
Expand All @@ -54,4 +54,4 @@ ENV BACKEND_TYPE="HAPI"
ENV ACCESS_CHECKER="list"
ENV RUN_MODE="PROD"

ENTRYPOINT java -jar exec-0.2.1-SNAPSHOT.jar --server.port=${PROXY_PORT}
ENTRYPOINT java -jar fhir-gateway-exec.jar --server.port=${PROXY_PORT}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ The proxy is also available as a [docker image](Dockerfile):
```shell
$ docker run -p 8081:8080 -e TOKEN_ISSUER=[token_issuer_url] \
-e PROXY_TO=[fhir_server_url] -e ACCESS_CHECKER=list \
us-docker.pkg.dev/fhir-proxy-build/stable/fhir-access-proxy:latest
us-docker.pkg.dev/fhir-proxy-build/stable/fhir-gateway:latest
bashir2 marked this conversation as resolved.
Show resolved Hide resolved
```

Note if the `TOKEN_ISSUER` is on the `localhost` you may need to bypass proxy's
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ set -e
export BUILD_ID=${KOKORO_BUILD_ID:-local}
gcloud auth configure-docker us-docker.pkg.dev
./e2e-test/e2e.sh
docker push us-docker.pkg.dev/fhir-proxy-build/stable/fhir-access-proxy:${BUILD_ID}
docker push us-docker.pkg.dev/fhir-proxy-build/stable/fhir-gateway:${BUILD_ID}
30 changes: 15 additions & 15 deletions doc/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,35 +320,35 @@ varies by context.
Each of these approaches are described in the following sections. In each case,
we briefly describe what is supported in the first release of the access
gateway. The "first release" is when we open-sourced the project in June 2022 in
[this GitHub repository](https://github.com/google/fhir-access-proxy). Let's
[this GitHub repository](https://github.com/google/fhir-gateway). Let's
first look at the architecture of the gateway. There are two main components:

**[Server](https://github.com/google/fhir-access-proxy/tree/main/server/src/main/java/com/google/fhir/gateway)**:
**[Server](https://github.com/google/fhir-gateway/tree/main/server/src/main/java/com/google/fhir/gateway)**:
The core of the access gateway is the "server" which provides a
[servlet](https://github.com/google/fhir-access-proxy/blob/main/server/src/main/java/com/google/fhir/gateway/FhirProxyServer.java)
[servlet](https://github.com/google/fhir-gateway/blob/main/server/src/main/java/com/google/fhir/gateway/FhirProxyServer.java)
that processes FHIR queries and an
[authorization interceptor](https://github.com/google/fhir-access-proxy/blob/main/server/src/main/java/com/google/fhir/gateway/BearerAuthorizationInterceptor.java)
[authorization interceptor](https://github.com/google/fhir-gateway/blob/main/server/src/main/java/com/google/fhir/gateway/BearerAuthorizationInterceptor.java)
that inspects those. The interceptor decodes and validates the JWT access-token
and makes a call to an
[AccessChecker](https://github.com/google/fhir-access-proxy/blob/main/server/src/main/java/com/google/fhir/gateway/interfaces/AccessChecker.java)
[AccessChecker](https://github.com/google/fhir-gateway/blob/main/server/src/main/java/com/google/fhir/gateway/interfaces/AccessChecker.java)
plugin to decide whether access should be granted or not. The server also
provides common FHIR query/resource processing, e.g.,
[PatientFinder](https://github.com/google/fhir-access-proxy/blob/main/server/src/main/java/com/google/fhir/gateway/interfaces/PatientFinder.java)
[PatientFinder](https://github.com/google/fhir-gateway/blob/main/server/src/main/java/com/google/fhir/gateway/interfaces/PatientFinder.java)
for finding patient context. These libraries are meant to be used in the plugin
implementations.

**[AccessChecker plugin](https://github.com/google/fhir-access-proxy/tree/main/plugins)**:
**[AccessChecker plugin](https://github.com/google/fhir-gateway/tree/main/plugins)**:
Each access gateway needs at least one AccessChecker plugin. Gateway
implementers can provide their customized access-check logic in this plugin. The
server code's initialization finds plugins by looking for
[AccessCheckerFactory](https://github.com/google/fhir-access-proxy/blob/main/server/src/main/java/com/google/fhir/gateway/interfaces/AccessCheckerFactory.java)
[AccessCheckerFactory](https://github.com/google/fhir-gateway/blob/main/server/src/main/java/com/google/fhir/gateway/interfaces/AccessCheckerFactory.java)
implementations that are
[@Named](https://docs.oracle.com/javaee/7/api/javax/inject/Named.html). The
specified name is used to select that plugin at runtime. Example implementations
are
[ListAccessChecker](https://github.com/google/fhir-access-proxy/blob/main/plugins/src/main/java/com/google/fhir/gateway/plugin/ListAccessChecker.java)
[ListAccessChecker](https://github.com/google/fhir-gateway/blob/main/plugins/src/main/java/com/google/fhir/gateway/plugin/ListAccessChecker.java)
and
[PatientAccessChecker](https://github.com/google/fhir-access-proxy/blob/main/plugins/src/main/java/com/google/fhir/gateway/plugin/PatientAccessChecker.java).
[PatientAccessChecker](https://github.com/google/fhir-gateway/blob/main/plugins/src/main/java/com/google/fhir/gateway/plugin/PatientAccessChecker.java).
AccessChecker plugins can send RPCs to other backends if they need to collect
extra information. In our examples, the plugins consult with the same FHIR store
that resources are pulled from, but you could imagine consulting more hardened
Expand All @@ -374,7 +374,7 @@ This approach helps support both the **flexible-access-control** and
**untrusted-app** items from the [constraints](#scenarios-and-constraints)
section. Note to use this approach for access-control, the patient context
should be inferred from the FHIR query. The server provides
[a library](https://github.com/google/fhir-access-proxy/blob/main/server/src/main/java/com/google/fhir/gateway/PatientFinderImp.java)
[a library](https://github.com/google/fhir-gateway/blob/main/server/src/main/java/com/google/fhir/gateway/PatientFinderImp.java)
for doing this.

### Query templates allowed/blocked list
Expand All @@ -394,7 +394,7 @@ search results of a previous query. Just from these queries, we cannot decide
what the patient context is, so we should let those queries go through (there is
a security risk here but since `_getpages` param values are ephemeral UUIDs,
this is probably ok). Here is a
[sample config](https://github.com/google/fhir-access-proxy/blob/main/resources/hapi_page_url_allowed_queries.json)
[sample config](https://github.com/google/fhir-gateway/blob/main/resources/hapi_page_url_allowed_queries.json)
for this. We note that we want our core "server" to be _stateless_ (for easy
scalability); therefore cannot store next/prev URLs from previous query results.

Expand Down Expand Up @@ -424,11 +424,11 @@ structure of FHIR queries that the gateway accepts). So we still need some
restrictions on the permitted queries as mentioned above.

Among gateway interfaces, there is
[AccessDecision](https://github.com/google/fhir-access-proxy/blob/main/server/src/main/java/com/google/fhir/gateway/interfaces/AccessDecision.java)
[AccessDecision](https://github.com/google/fhir-gateway/blob/main/server/src/main/java/com/google/fhir/gateway/interfaces/AccessDecision.java)
which is returned from a
[checkAccess](https://github.com/google/fhir-access-proxy/blob/85f7c87a26494d4efba5d01904c8c27074eb26a9/server/src/main/java/com/google/fhir/gateway/interfaces/AccessChecker.java#L31).
[checkAccess](https://github.com/google/fhir-gateway/blob/85f7c87a26494d4efba5d01904c8c27074eb26a9/server/src/main/java/com/google/fhir/gateway/interfaces/AccessChecker.java#L31).
This interface has a
[postProcess](https://github.com/google/fhir-access-proxy/blob/85f7c87a26494d4efba5d01904c8c27074eb26a9/server/src/main/java/com/google/fhir/gateway/interfaces/AccessDecision.java#L39)
[postProcess](https://github.com/google/fhir-gateway/blob/85f7c87a26494d4efba5d01904c8c27074eb26a9/server/src/main/java/com/google/fhir/gateway/interfaces/AccessDecision.java#L39)
method which can be used for post-processing of resources returned from the FHIR
server.

Expand Down
2 changes: 1 addition & 1 deletion docker/hapi-proxy-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ version: "3.0"

services:
fhir-proxy:
image: us-docker.pkg.dev/fhir-proxy-build/stable/fhir-access-proxy:${BUILD_ID:-latest}
image: us-docker.pkg.dev/fhir-proxy-build/stable/fhir-gateway:${BUILD_ID:-latest}
environment:
- TOKEN_ISSUER
- PROXY_TO
Expand Down
2 changes: 1 addition & 1 deletion e2e-test/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ set -e
export BUILD_ID=${KOKORO_BUILD_ID:-local}

function setup() {
docker build -t us-docker.pkg.dev/fhir-proxy-build/stable/fhir-access-proxy:${BUILD_ID} .
docker build -t us-docker.pkg.dev/fhir-proxy-build/stable/fhir-gateway:${BUILD_ID} .
docker-compose -f docker/keycloak/config-compose.yaml \
up --force-recreate --remove-orphans -d --quiet-pull
# TODO find a way to expose docker container logs in the output; currently
Expand Down
3 changes: 3 additions & 0 deletions exec/pom.xml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@
</dependencies>

<build>

<finalName>${project.parent.artifactId}-${project.artifactId}</finalName>

<plugins>
<!-- With this we can create a standalone executable JAR. -->
<plugin>
Expand Down
Empty file modified plugins/pom.xml
100644 → 100755
Empty file.
Empty file modified pom.xml
100644 → 100755
Empty file.
Empty file modified server/pom.xml
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static void throwRuntimeExceptionAndLog(Logger logger, String errorMessage) {
throwRuntimeExceptionAndLog(logger, errorMessage, null, RuntimeException.class);
}

static void throwRuntimeExceptionAndLog(Logger logger, String errorMessage, Exception e) {
public static void throwRuntimeExceptionAndLog(Logger logger, String errorMessage, Exception e) {
bashir2 marked this conversation as resolved.
Show resolved Hide resolved
throwRuntimeExceptionAndLog(logger, errorMessage, e, RuntimeException.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.rest.api.Constants;
import ca.uhn.fhir.rest.server.ApacheProxyAddressStrategy;
import ca.uhn.fhir.rest.server.RestfulServer;
import ca.uhn.fhir.rest.server.interceptor.CorsInterceptor;
import com.google.fhir.gateway.interfaces.AccessCheckerFactory;
Expand Down Expand Up @@ -46,7 +47,7 @@ public class FhirProxyServer extends RestfulServer {
// Spring's automatic scanning.
@Autowired private Map<String, AccessCheckerFactory> accessCheckerFactories;

static boolean isDevMode() {
public static boolean isDevMode() {
bashir2 marked this conversation as resolved.
Show resolved Hide resolved
String runMode = System.getenv("RUN_MODE");
return "DEV".equals(runMode);
}
Expand Down Expand Up @@ -77,6 +78,8 @@ protected void initialize() throws ServletException {
} catch (IOException e) {
ExceptionUtil.throwRuntimeExceptionAndLog(logger, "IOException while initializing", e);
}

setServerAddressStrategy(new ApacheProxyAddressStrategy(true));
}

private AccessCheckerFactory chooseAccessCheckerFactory() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import org.apache.http.entity.ContentType;

public class ProxyConstants {

// Note we should not set charset here; otherwise GCP FHIR store complains about Content-Type.
static final ContentType JSON_PATCH_CONTENT = ContentType.create(Constants.CT_JSON_PATCH);
public static final String HTTP_URL_SEPARATOR = "/";
}
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,11 @@
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnitRunner;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.mock.web.MockHttpServletResponse;

@RunWith(MockitoJUnitRunner.class)
public class BearerAuthorizationInterceptorTest {

private static final Logger logger =
LoggerFactory.getLogger(BearerAuthorizationInterceptorTest.class);

private static final FhirContext fhirContext = FhirContext.forR4();

private BearerAuthorizationInterceptor testInstance;
Expand Down