$secretAccessKey =
$metadata['accessToken'
] ?? '';
unset($metadata['accessToken'
],
$metadata['icon'
]);
$metadata['path'
] =
str_replace($this->projectDir . '/', '',
$manifest->
getPath());
$metadata['id'
] =
$id;
$metadata['modules'
] =
[];
$metadata['iconRaw'
] =
$this->
getIcon($manifest);
$metadata['cookies'
] =
$manifest->
getCookies() !== null ?
$manifest->
getCookies()->
getCookies() :
[];
$metadata['baseAppUrl'
] =
$manifest->
getAdmin() !== null ?
$manifest->
getAdmin()->
getBaseAppUrl() : null;
$metadata['allowedHosts'
] =
$manifest->
getAllHosts();
$metadata['templateLoadPriority'
] =
$manifest->
getStorefront() ?
$manifest->
getStorefront()->
getTemplateLoadPriority() : 0;
$this->
updateMetadata($metadata,
$context);
$app =
$this->
loadApp($id,
$context);
$this->
updateCustomEntities($app->
getId(),
$app->
getPath(),
$manifest);
$this->permissionPersister->
updatePrivileges($manifest->
getPermissions(),
$roleId);
// If the app has no secret yet, but now specifies setup data we do a registration to get an app secret
// this mostly happens during install, but may happen in the update case if the app previously worked without an external server
if (!
$app->
getAppSecret() &&
$manifest->
getSetup()) { try {