MCPcopy Create free account
hub / github.com/SmartThingsCommunity/smartthings-cli / authorizeApp

Function authorizeApp

src/lib/command/util/apps-util.ts:95–110  ·  view source on GitHub ↗
(
		app: AppUpdateRequest,
		principal: string | undefined,
		statement: string | undefined,
)

Source from the content-addressed store, hash-verified

93}
94
95export 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}

Callers 3

executeUpdateFunction · 0.85
createAppFunction · 0.85
apps-util.test.tsFile · 0.85

Calls 2

fatalErrorFunction · 0.85
addPermissionFunction · 0.85

Tested by

no test coverage detected