fix(core.gbapp): fix of sts token generation

This commit is contained in:
webgus 2019-10-23 22:05:46 -03:00
parent 9235f6cc74
commit d6aa65d840
5 changed files with 13 additions and 12 deletions

2
package-lock.json generated
View file

@ -1,6 +1,6 @@
{
"name": "botserver",
"version": "1.7.3",
"version": "1.7.5",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View file

@ -406,16 +406,17 @@ export class AzureDeployerService implements IGBInstallationDeployer {
instance.textAnalyticsEndpoint = textAnalytics.endpoint.replace(`/text/analytics/v2.0`, '');
instance.textAnalyticsKey = keys.key1;
if (false) {
GBLog.info(`Deploying NLP...`);
const nlp = await this.createNLP(name, `${name}-nlp`, instance.cloudLocation);
keys = await this.cognitiveClient.accounts.listKeys(name, nlp.name);
const nlpAppId = await this.createNLPService(name, name, instance.cloudLocation, culture, instance.nlpAuthoringKey);
instance.nlpEndpoint = nlp.endpoint; // TODO: Add this final URL /apps/a149dae1-5134-4624-96b5-885e9e674c9e
instance.nlpKey = keys.key1;
instance.nlpAppId = nlpAppId;
GBLog.info(`Deploying NLP...`);
const nlp = await this.createNLP(name, `${name}-nlp`, instance.cloudLocation);
keys = await this.cognitiveClient.accounts.listKeys(name, nlp.name);
const nlpAppId = await this.createNLPService(name, name, instance.cloudLocation, culture, instance.nlpAuthoringKey);
instance.nlpEndpoint = nlp.endpoint; // TODO: Add this final URL /apps/a149dae1-5134-4624-96b5-885e9e674c9e
instance.nlpKey = keys.key1;
instance.nlpAppId = nlpAppId;
}
GBLog.info(`Deploying Bot...`);
instance.botEndpoint = this.defaultEndPoint;

View file

@ -373,7 +373,7 @@ export class GBDeployer {
});
}
public runOnce() {
public setupDefaultGBUI() {
const root = 'packages/default.gbui';
const npm = urlJoin(process.env.PWD, 'node_modules', '.bin', 'npm');
if (!Fs.existsSync(`${root}/build`)) {

View file

@ -348,7 +348,7 @@ export class GBMinService {
private async getSTSToken(instance: any) {
const options = {
url: 'https://westus.api.cognitive.microsoft.com/sts/v1.0/issueToken',
url: instance.speechEndpoint,
method: 'POST',
headers: {
'Ocp-Apim-Subscription-Key': instance.speechKey

View file

@ -176,7 +176,7 @@ export class GBServer {
// Deployment of local applications for the first time.
deployer.runOnce();
deployer.setupDefaultGBUI();
GBLog.info(`The Bot Server is in RUNNING mode...`);