new(security.gblib): SMS Auth.
This commit is contained in:
		
							parent
							
								
									60db7b830a
								
							
						
					
					
						commit
						eb260b54f9
					
				
					 3 changed files with 5 additions and 7 deletions
				
			
		| 
						 | 
				
			
			@ -995,7 +995,6 @@ export class AzureDeployerService implements IGBInstallationDeployer {
 | 
			
		|||
          { name: 'BOT_ID', value: `${instance.botId}` },
 | 
			
		||||
          { name: 'CLOUD_SUBSCRIPTIONID', value: `${instance.cloudSubscriptionId}` },
 | 
			
		||||
          { name: 'CLOUD_LOCATION', value: `${instance.cloudLocation}` },
 | 
			
		||||
          { name: 'CLOUD_GROUP', value: `${instance.botId}` },
 | 
			
		||||
          { name: 'CLOUD_USERNAME', value: `${instance.cloudUsername}` },
 | 
			
		||||
          { name: 'CLOUD_PASSWORD', value: `${instance.cloudPassword}` },
 | 
			
		||||
          { name: 'MARKETPLACE_ID', value: `${instance.marketplaceId}` },
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -290,7 +290,6 @@ ADMIN_PASS=${instance.adminPass}
 | 
			
		|||
BOT_ID=${instance.botId}
 | 
			
		||||
CLOUD_SUBSCRIPTIONID=${instance.cloudSubscriptionId}
 | 
			
		||||
CLOUD_LOCATION=${instance.cloudLocation}
 | 
			
		||||
CLOUD_GROUP=${instance.botId}
 | 
			
		||||
CLOUD_USERNAME=${instance.cloudUsername}
 | 
			
		||||
CLOUD_PASSWORD=${instance.cloudPassword}
 | 
			
		||||
MARKETPLACE_ID=${instance.marketplaceId}
 | 
			
		||||
| 
						 | 
				
			
			@ -431,12 +430,12 @@ ENDPOINT_UPDATE=true
 | 
			
		|||
 | 
			
		||||
            await installationDeployer.updateBotProxy(
 | 
			
		||||
              instance.botId,
 | 
			
		||||
              GBConfigService.get('CLOUD_GROUP'),
 | 
			
		||||
              GBConfigService.get('BOT_ID'),
 | 
			
		||||
              `${proxyAddress}/api/messages/${instance.botId}`
 | 
			
		||||
            );
 | 
			
		||||
          } catch (error) {
 | 
			
		||||
            if (error.code === 'ResourceNotFound') {
 | 
			
		||||
              GBLog.warn(`Bot ${instance.botId} not found on resource group ${GBConfigService.get('CLOUD_GROUP')}.`);
 | 
			
		||||
              GBLog.warn(`Bot ${instance.botId} not found on resource group ${GBConfigService.get('BOT_ID')}.`);
 | 
			
		||||
            } else {
 | 
			
		||||
              throw new Error(`Error updating bot proxy, details: ${error}.`);
 | 
			
		||||
            }
 | 
			
		||||
| 
						 | 
				
			
			@ -659,7 +658,7 @@ ENDPOINT_UPDATE=true
 | 
			
		|||
   * Opens storage firewall used by the server when starting to get root bot instance.
 | 
			
		||||
   */
 | 
			
		||||
  private async openStorageFrontier(installationDeployer: IGBInstallationDeployer) {
 | 
			
		||||
    const group = GBConfigService.get('CLOUD_GROUP');
 | 
			
		||||
    const group = GBConfigService.get('BOT_ID');
 | 
			
		||||
    const serverName = GBConfigService.get('STORAGE_SERVER').split('.database.windows.net')[0];
 | 
			
		||||
    await installationDeployer.openStorageFirewall(group, serverName);
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -267,7 +267,7 @@ export class GBDeployer implements IGBDeployer {
 | 
			
		|||
    const username = GBConfigService.get('CLOUD_USERNAME');
 | 
			
		||||
    const password = GBConfigService.get('CLOUD_PASSWORD');
 | 
			
		||||
    const accessToken = await GBAdminService.getADALTokenFromUsername(username, password);
 | 
			
		||||
    const group = GBConfigService.get('CLOUD_GROUP');
 | 
			
		||||
    const group = GBConfigService.get('BOT_ID');
 | 
			
		||||
    const subscriptionId = GBConfigService.get('CLOUD_SUBSCRIPTIONID');
 | 
			
		||||
 | 
			
		||||
    // If the bot already exists, just update the endpoint.
 | 
			
		||||
| 
						 | 
				
			
			@ -540,7 +540,7 @@ export class GBDeployer implements IGBDeployer {
 | 
			
		|||
    // Deletes Bot registration on cloud.
 | 
			
		||||
 | 
			
		||||
    const service = await AzureDeployerService.createInstance(this);
 | 
			
		||||
    const group = GBConfigService.get('CLOUD_GROUP');
 | 
			
		||||
    const group = GBConfigService.get('BOT_ID');
 | 
			
		||||
    if (await service.botExists(botId)) {
 | 
			
		||||
      await service.deleteBot(botId, group);
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue