Skip to content
This repository was archived by the owner on Nov 5, 2022. It is now read-only.

Commit 06f9209

Browse files
faysal-ishtiaqisedwards
authored andcommitted
allow /climsoft/docs and /climsoft/openapi.json without auth
1 parent 9f10547 commit 06f9209

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,6 @@ Each master release should pass all the To check if the tests are as expected o
8989

9090
To run the tests, you just need to run `docker-compose -f docker-compose.test.yml up --build`
9191

92-
Check the logs for error.
92+
Check the logs for error.
93+
94+
### How to access surface, climsoft or mch API

src/opencdms_api/middelware.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,9 @@ def authenticate_request(self, request: Request):
4747

4848
async def __call__(self, scope: Scope, receive: Receive, send: Send):
4949
request = Request(scope, receive, send)
50-
self.authenticate_request(request)
50+
if request.url.path not in {
51+
"/climsoft/docs",
52+
"/climsoft/openapi.json"
53+
}:
54+
self.authenticate_request(request)
5155
await self.app(scope, receive, send)

0 commit comments

Comments
 (0)