Skip to content

Commit

Permalink
fix(sys-server): fix remote deploy token check message;
Browse files Browse the repository at this point in the history
  • Loading branch information
maslow committed Sep 10, 2021
1 parent 21ca41e commit e4cc3d3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/system-server/src/router/deploy/incoming.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* @Author: Maslow<wangfugen@126.com>
* @Date: 2021-08-30 16:34:45
* @LastEditTime: 2021-09-09 20:04:30
* @LastEditTime: 2021-09-10 16:55:45
* @Description:
*/

Expand Down Expand Up @@ -44,6 +44,15 @@ export async function handleDeployRequestIncoming(req: Request, res: Response) {
// the source that identified remote environment
const source = auth.src

// reject if token hasn't been granted
if (policies && !can_deploy_policy) {
return res.status(403).send('policies deploy is not granted to given token ')
}

if (functions && !can_deploy_function) {
return res.status(403).send('functions deploy is not granted to given token ')
}

try {
// write remote policies to db
if (policies && can_deploy_policy) {
Expand Down

0 comments on commit e4cc3d3

Please sign in to comment.