in runtimes/runtimes/standalone.ts [133:161]
function initializeAuth() {
if (shouldWaitForEncryptionKey()) {
// Before starting the runtime, accept encryption initialization details
// directly from the destination for standalone runtimes.
// Contract: Only read up to (and including) the first newline (\n).
readEncryptionDetails(process.stdin)
.then(
(encryptionDetails: EncryptionInitialization) => {
validateEncryptionDetails(encryptionDetails)
lspConnection.console.info('Runtime: Initializing runtime with encryption')
auth = new Auth(lspConnection, lspRouter, encryptionDetails.key, encryptionDetails.mode)
chat = new EncryptedChat(lspConnection, encryptionDetails.key, encryptionDetails.mode)
initializeRuntime(encryptionDetails.key)
},
error => {
console.error(error)
process.exit(10)
}
)
.catch((error: Error) => {
console.error('Error at runtime initialization:', error.message)
})
} else {
lspConnection.console.info('Runtime: Initializing runtime without encryption')
auth = new Auth(lspConnection, lspRouter)
initializeRuntime()
}
}