-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add APISIX pep demo * update readme * update readme and setup for PEP selection
- Loading branch information
Showing
8 changed files
with
370 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,166 @@ | ||
services: | ||
lb: | ||
image: nginx:1.25.1 | ||
depends_on: | ||
- pep-left | ||
- pep-right | ||
- admin-left | ||
- admin-right | ||
networks: | ||
demo: | ||
ipv4_address: 172.90.10.2 | ||
ports: | ||
- 80:80 | ||
- 443:443 | ||
volumes: | ||
- "./docker-compose/lb/config/nginx-apisix.conf:/etc/nginx/nginx.conf" | ||
- "./docker-compose/lb/tls:/etc/nginx/ssl:ro" | ||
pep-left: | ||
image: &apisix-img apache/apisix:3.9.1-debian | ||
environment: | ||
APISIX_STAND_ALONE: true | ||
depends_on: | ||
- demo-left | ||
- node-left | ||
- pip-left | ||
networks: | ||
demo: | ||
ipv4_address: 172.90.10.11 | ||
volumes: | ||
- './docker-compose/left/config/pep/apisix.yaml:/usr/local/apisix/conf/apisix.yaml:ro' | ||
pep-right: | ||
image: *apisix-img | ||
environment: | ||
APISIX_STAND_ALONE: true | ||
depends_on: | ||
- demo-right | ||
- node-right | ||
- pip-right | ||
networks: | ||
demo: | ||
ipv4_address: 172.90.10.12 | ||
volumes: | ||
- './docker-compose/right/config/pep/apisix.yaml:/usr/local/apisix/conf/apisix.yaml:ro' | ||
pip-left: &pip | ||
image: nutsfoundation/nuts-pxp:main | ||
environment: | ||
NUTS_CONFIGFILE: /nuts/config.yaml | ||
ports: | ||
- 8080:8080 | ||
networks: | ||
demo: | ||
ipv4_address: 172.90.10.13 | ||
volumes: | ||
- "./docker-compose/left/data/nutspxp:/nuts/data" | ||
- "./docker-compose/left/config/nutspxp/policies:/nuts/policies" | ||
- "./docker-compose/left/config/nutspxp/config.yaml:/nuts/config.yaml" | ||
pip-right: | ||
<<: *pip | ||
ports: | ||
- 8081:8080 | ||
networks: | ||
demo: | ||
ipv4_address: 172.90.10.14 | ||
volumes: | ||
- "./docker-compose/right/data/nutspxp:/nuts/data" | ||
- "./docker-compose/right/config/nutspxp/policies:/nuts/policies" | ||
- "./docker-compose/left/config/nutspxp/config.yaml:/nuts/config.yaml" | ||
node-left: &node | ||
image: nutsfoundation/nuts-node:master | ||
environment: | ||
NUTS_CONFIGFILE: /nuts/nuts.yaml | ||
extra_hosts: | ||
- "left.local:172.90.10.2" | ||
- "node.left.local:172.90.10.2" | ||
- "right.local:172.90.10.2" | ||
- "node.right.local:172.90.10.2" | ||
networks: | ||
demo: | ||
ipv4_address: 172.90.10.3 | ||
volumes: | ||
- "./docker-compose/left/config/node/nuts.yaml:/nuts/nuts.yaml" | ||
- "./docker-compose/left/data/node:/nuts/data" | ||
- "./docker-compose/left/config/node/policies:/nuts/policies" | ||
- "./docker-compose/left/config/node/discovery:/nuts/discovery" | ||
- "./docker-compose/lb/tls/ca.pem:/etc/ssl/certs/demo_ca.pem" | ||
node-right: | ||
<<: *node | ||
networks: | ||
demo: | ||
ipv4_address: 172.90.10.4 | ||
volumes: | ||
- "./docker-compose/right/config/node/nuts.yaml:/nuts/nuts.yaml" | ||
- "./docker-compose/right/data/node:/nuts/data" | ||
- "./docker-compose/right/config/node/policies:/nuts/policies" | ||
- "./docker-compose/right/config/node/discovery:/nuts/discovery" | ||
- "./docker-compose/lb/tls/ca.pem:/etc/ssl/certs/demo_ca.pem" | ||
admin-left: &admin | ||
image: nutsfoundation/nuts-admin:main | ||
environment: | ||
NUTS_NODE_ADDRESS: http://node-left:8081 | ||
networks: | ||
demo: | ||
ipv4_address: 172.90.10.5 | ||
admin-right: | ||
<<: *admin | ||
environment: | ||
NUTS_NODE_ADDRESS: http://node-right:8081 | ||
networks: | ||
demo: | ||
ipv4_address: 172.90.10.6 | ||
demo-left: &demo | ||
image: nutsfoundation/nuts-demo-ehr:main | ||
volumes: | ||
- "./docker-compose/left/config/demo/server.config.yaml:/app/server.config.yaml" | ||
- "./docker-compose/left/config/demo/customers.json:/app/customers.json" | ||
- "./docker-compose/left/data/demo:/app/data" | ||
- "./docker-compose/lb/tls/ca.pem:/etc/ssl/certs/demo_ca.pem" | ||
depends_on: | ||
- hapi-left | ||
- node-left | ||
extra_hosts: | ||
- "left.local:172.90.10.2" | ||
- "node.left.local:172.90.10.2" | ||
- "right.local:172.90.10.2" | ||
- "node.right.local:172.90.10.2" | ||
networks: | ||
demo: | ||
ipv4_address: 172.90.10.7 | ||
demo-right: | ||
<<: *demo | ||
volumes: | ||
- "./docker-compose/right/config/demo/server.config.yaml:/app/server.config.yaml" | ||
- "./docker-compose/right/config/demo/customers.json:/app/customers.json" | ||
- "./docker-compose/right/data/demo:/app/data" | ||
- "./docker-compose/lb/tls/ca.pem:/etc/ssl/certs/demo_ca.pem" | ||
depends_on: | ||
- hapi-right | ||
- node-right | ||
networks: | ||
demo: | ||
ipv4_address: 172.90.10.8 | ||
hapi-left: &hapi | ||
image: hapiproject/hapi:v5.5.2 | ||
environment: | ||
hapi.fhir.fhir_version: DSTU3 | ||
hapi.fhir.partitioning.allow_references_across_partitions: "false" | ||
expose: | ||
- 8080 | ||
networks: | ||
demo: | ||
ipv4_address: 172.90.10.9 | ||
volumes: | ||
- "./docker-compose/left/data/hapi:/usr/local/tomcat/target" | ||
hapi-right: | ||
<<: *hapi | ||
networks: | ||
demo: | ||
ipv4_address: 172.90.10.10 | ||
volumes: | ||
- "./docker-compose/right/data/hapi:/usr/local/tomcat/target" | ||
networks: | ||
demo: | ||
ipam: | ||
config: | ||
- subnet: 172.90.0.0/16 | ||
ip_range: 172.90.10.0/24 |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
user nginx; | ||
worker_processes 1; | ||
|
||
error_log /var/log/nginx/error.log debug; | ||
pid /var/run/nginx.pid; | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
|
||
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | ||
'$status $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent" "$http_x_forwarded_for"'; | ||
|
||
access_log /var/log/nginx/access.log main; | ||
|
||
keepalive_timeout 65; | ||
|
||
include /etc/nginx/conf.d/*.conf; | ||
|
||
server { | ||
server_name node.left.local; | ||
listen 443 ssl; | ||
http2 on; | ||
ssl_certificate /etc/nginx/ssl/node.left.local.pem; | ||
ssl_certificate_key /etc/nginx/ssl/node.left.local.pem; | ||
ssl_protocols TLSv1.3; | ||
|
||
location / { | ||
proxy_pass http://node-left:8080; | ||
} | ||
} | ||
server { | ||
server_name admin.left.local; | ||
listen 443 ssl; | ||
http2 on; | ||
ssl_certificate /etc/nginx/ssl/admin.left.local.pem; | ||
ssl_certificate_key /etc/nginx/ssl/admin.left.local.pem; | ||
ssl_protocols TLSv1.3; | ||
|
||
location / { | ||
proxy_pass http://admin-left:1305; | ||
} | ||
} | ||
server { | ||
server_name left.local; | ||
listen 443 ssl; | ||
http2 on; | ||
ssl_certificate /etc/nginx/ssl/left.local.pem; | ||
ssl_certificate_key /etc/nginx/ssl/left.local.pem; | ||
ssl_protocols TLSv1.3; | ||
|
||
location / { | ||
proxy_pass http://pep-left:9080; | ||
} | ||
} | ||
server { | ||
server_name node.right.local; | ||
listen 443 ssl; | ||
http2 on; | ||
ssl_certificate /etc/nginx/ssl/node.right.local.pem; | ||
ssl_certificate_key /etc/nginx/ssl/node.right.local.pem; | ||
ssl_protocols TLSv1.3; | ||
|
||
location / { | ||
proxy_pass http://node-right:8080; | ||
} | ||
} | ||
server { | ||
server_name admin.right.local; | ||
listen 443 ssl; | ||
http2 on; | ||
ssl_certificate /etc/nginx/ssl/admin.right.local.pem; | ||
ssl_certificate_key /etc/nginx/ssl/admin.right.local.pem; | ||
ssl_protocols TLSv1.3; | ||
|
||
location / { | ||
proxy_pass http://admin-right:1305; | ||
} | ||
} | ||
server { | ||
server_name right.local; | ||
listen 443 ssl; | ||
http2 on; | ||
ssl_certificate /etc/nginx/ssl/right.local.pem; | ||
ssl_certificate_key /etc/nginx/ssl/right.local.pem; | ||
ssl_protocols TLSv1.3; | ||
|
||
location / { | ||
proxy_pass http://pep-right:9080; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
routes: | ||
- id: demo_public | ||
uri: /* | ||
upstream_id: demo | ||
- id: fhir_server | ||
uri: /fhir/* | ||
upstream_id: fhir | ||
plugin_config_id: introspect-and-opa | ||
- id: demo_authorized | ||
uri: /web/external/transfer/notify/* | ||
upstream_id: demo | ||
plugin_config_id: introspect-and-opa | ||
upstreams: | ||
- id: demo | ||
nodes: | ||
demo-left:1304: 1 | ||
type: roundrobin | ||
- id: fhir | ||
nodes: | ||
hapi-left:8080: 1 | ||
type: roundrobin | ||
# - id: node-internal | ||
# nodes: | ||
# node-left:8081: 1 | ||
# type: roundrobin | ||
# - id: pip | ||
# nodes: | ||
# pip-left:8080: 1 | ||
# type: roundrobin | ||
plugin_configs: | ||
- id: introspect-and-opa | ||
plugins: | ||
openid-connect: | ||
client_id: none | ||
client_secret: none | ||
discovery: none | ||
introspection_endpoint: "http://node-left:8081/internal/auth/v2/accesstoken/introspect" | ||
bearer_only: true | ||
realm: "go-nuts" | ||
introspection_endpoint_auth_method: none | ||
opa: | ||
host: "http://pip-left:8080" | ||
policy: apisix | ||
#END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
routes: | ||
- id: demo_public | ||
uri: /* | ||
upstream_id: demo | ||
- id: fhir_server | ||
uri: /fhir/* | ||
upstream_id: fhir | ||
plugin_config_id: introspect-and-opa | ||
- id: demo_authorized | ||
uri: /web/external/transfer/notify/* | ||
upstream_id: demo | ||
plugin_config_id: introspect-and-opa | ||
upstreams: | ||
- id: demo | ||
nodes: | ||
demo-right:1304: 1 | ||
type: roundrobin | ||
- id: fhir | ||
nodes: | ||
hapi-right:8080: 1 | ||
type: roundrobin | ||
# - id: node-internal | ||
# nodes: | ||
# node-right:8081: 1 | ||
# type: roundrobin | ||
# - id: pip | ||
# nodes: | ||
# pip-right:8080: 1 | ||
# type: roundrobin | ||
plugin_configs: | ||
- id: introspect-and-opa | ||
plugins: | ||
openid-connect: | ||
client_id: none | ||
client_secret: none | ||
discovery: none | ||
introspection_endpoint: "http://node-right:8081/internal/auth/v2/accesstoken/introspect" | ||
bearer_only: true | ||
realm: "go-nuts" | ||
introspection_endpoint_auth_method: none | ||
opa: | ||
host: "http://pip-right:8080" | ||
policy: apisix | ||
#END |
Oops, something went wrong.