private function registerWithApp(Manifest
$manifest, Context
$context): array
{ $handshake =
$this->handshakeFactory->
create($manifest);
$request =
$handshake->
assembleRequest();
$response =
$this->httpClient->
send($request,
[AuthMiddleware::APP_REQUEST_CONTEXT =>
$context]);
return $this->
parseResponse($manifest->
getMetadata()->
getName(),
$handshake,
$response);
} private function saveAppSecret(string
$id, Context
$context, string
$secret): void
{ $update =
['id' =>
$id, 'appSecret' =>
$secret];
$context->
scope(Context::SYSTEM_SCOPE,
function DContext
$context) use ($update): void
{ $this->appRepository->
update([$update],
$context);
});
}