Skip to content

Commit

Permalink
fix(core.gbapp): fix of sts token generation
Browse files Browse the repository at this point in the history
  • Loading branch information
webgus committed Oct 24, 2019
1 parent 9235f6c commit d6aa65d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 9 additions & 8 deletions packages/azuredeployer.gbapp/services/AzureDeployerService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion packages/core.gbapp/services/GBDeployer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`)) {
Expand Down
2 changes: 1 addition & 1 deletion packages/core.gbapp/services/GBMinService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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...`);

Expand Down

0 comments on commit d6aa65d

Please sign in to comment.