Skip to content

Commit

Permalink
Merge pull request #23 from BeamFi/dev
Browse files Browse the repository at this point in the history
[CON-34 Security] Add clientKey requirement for webhook request for b…
  • Loading branch information
kinwo authored Mar 22, 2023
2 parents 270ca79 + b5fe496 commit f46ae3f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions backend/service/Beam.mo
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ actor Beam {
processHealthRequest(queryParams)
};
case "/zoom" {
processZoomReadRequest(req)
processZoomReadRequest(req, queryParams)
};
case _ Http.BadRequest()
}
Expand Down Expand Up @@ -423,7 +423,11 @@ actor Beam {
Http.JsonContent(jsonText, false)
};

func processZoomReadRequest(req : HttpRequest) : HttpResponse {
func processZoomReadRequest(req : HttpRequest, queryParams : [QueryParam]) : HttpResponse {
if (not Http.checkKey(queryParams, "clientKey", Env.clientKey)) {
return Http.BadRequest()
};

let jsonStr = Text.decodeUtf8(req.body);

switch (jsonStr) {
Expand Down

0 comments on commit f46ae3f

Please sign in to comment.