Skip to content

Commit

Permalink
Make api calls require authorization
Browse files Browse the repository at this point in the history
  • Loading branch information
justvanrossum committed Dec 16, 2023
1 parent b23960a commit 30f750d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/fontra/core/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ async def serverInfoHandler(self, request: web.Request) -> web.Response:
)

async def webAPIHandler(self, request: web.Request) -> web.Response:
authToken = await self.projectManager.authorize(request)
if not authToken:
raise web.HTTPUnauthorized()

functionName = request.match_info["function"]
function = apiFunctions.get(functionName)
if function is None:
Expand Down

0 comments on commit 30f750d

Please sign in to comment.