Skip to content

Commit

Permalink
fix healthcheck endpoint port handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Botsman committed Jan 10, 2025
1 parent e643e2a commit 4351d0f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ In order to build an image you need to:
```
docker run -d \
--name <container_name> \
-p 80:80 \
-p 443:443 \
--mount type=bind,source="$(pwd)"/open_banking_certs/,target=/app/open_banking_certs/ \
--mount type=bind,source="$(pwd)"/broker_tls/,target=/app/broker_tls/ \
Expand Down Expand Up @@ -213,6 +214,7 @@ folder. For example:
```
docker run -d \
--name <container_name> \
-p 80:80 \
-p 443:443 \
--mount type=bind,source="$(pwd)"/open_banking_certs/,target=/app/open_banking_certs/ \
--mount type=bind,source="$(pwd)"/broker_tls/,target=/app/broker_tls/ \
Expand Down Expand Up @@ -313,8 +315,7 @@ read from the file system, which can be changed if necessary by changing corresp
in the `ServicePlatform` class.

Implementation of secured access to the service (using client TLS certificate verification) relies on
[nginx](https://nginx.org/). Please refer to [nginx.conf](nginx.conf). *Please notice that this
configuration uses port 443 for secured connections.*
[nginx](https://nginx.org/). Please refer to [nginx.conf](nginx.conf).

### Running service locally without Docker

Expand Down
6 changes: 6 additions & 0 deletions app/tests/integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@


def test_health():
# health check is expected to be available over HTTP
broker_origin = config.BROKER_ORIGIN.replace("https://", "http://")
response = requests.get(broker_origin + "/health")
assert response.status_code == 200
assert response.text == '{"result":"ok"}'

response = requests.get(config.BROKER_ORIGIN + "/health", verify=False)
assert response.status_code == 200
assert response.text == '{"result":"ok"}'
Expand Down
1 change: 1 addition & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
server {
listen 80;
listen 443 ssl;
server_name localhost;
ssl_certificate /app/broker_tls/server.crt;
Expand Down

0 comments on commit 4351d0f

Please sign in to comment.