( app: AppUpdateRequest, principal: string | undefined, statement: string | undefined, )
| 93 | } |
| 94 | |
| 95 | export const authorizeApp = async ( |
| 96 | app: AppUpdateRequest, |
| 97 | principal: string | undefined, |
| 98 | statement: string | undefined, |
| 99 | ): Promise<void> => { |
| 100 | if (!app.lambdaSmartApp) { |
| 101 | return fatalError('Authorization is only applicable to Lambda SmartApps.') |
| 102 | } |
| 103 | |
| 104 | if (app.lambdaSmartApp.functions) { |
| 105 | const requests = app.lambdaSmartApp.functions.map((functionArn) => { |
| 106 | return addPermission(functionArn, principal, statement) |
| 107 | }) |
| 108 | await Promise.all(requests) |
| 109 | } |
| 110 | } |
no test coverage detected