Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

[4,4]update everything to latest skills and solutions package #1186

Merged
merged 2 commits into from
Apr 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
<PackageReference Include="Microsoft.Bot.Builder.Dialogs" Version="4.3.1" />
<PackageReference Include="Microsoft.Bot.Builder.Integration.ApplicationInsights.Core" Version="4.3.1" />
<PackageReference Include="Microsoft.Bot.Builder.Integration.AspNet.Core" Version="4.3.1" />
<PackageReference Include="Microsoft.Bot.Builder.Skills" Version="4.4.0-preview-19" />
<PackageReference Include="Microsoft.Bot.Builder.Skills" Version="4.4.0-preview41" />
<PackageReference Include="Microsoft.Bot.Builder.Solutions" Version="4.4.0-preview41" />
<PackageReference Include="Microsoft.Bot.Builder.TemplateManager" Version="4.3.1" />
<PackageReference Include="Microsoft.Bot.Configuration" Version="4.3.1" />
<PackageReference Include="Microsoft.Bot.Connector" Version="4.3.1" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Bot.Builder;
using Microsoft.Bot.Builder.Integration.AspNet.Core;
using Microsoft.Bot.Builder.Skills;
using Microsoft.Bot.Builder.Solutions;

Expand All @@ -8,9 +9,14 @@ namespace AutomotiveSkill.Controllers
[ApiController]
public class BotController : SkillController
{
public BotController(IServiceProvider serviceProvider, BotSettingsBase botSettings)
: base(serviceProvider, botSettings)
{
}
}
public BotController(
IBotFrameworkHttpAdapter botFrameworkHttpAdapter,
SkillHttpAdapter skillHttpAdapter,
SkillWebSocketAdapter skillWebSocketAdapter,
IBot bot,
BotSettingsBase botSettings)
: base(botFrameworkHttpAdapter, skillHttpAdapter, skillWebSocketAdapter, bot, botSettings)
{
}
}
}
21 changes: 2 additions & 19 deletions skills/src/csharp/automotiveskill/automotiveskill/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ namespace AutomotiveSkill
using AutomotiveSkill.Responses.VehicleSettings;
using AutomotiveSkill.Services;
using Microsoft.ApplicationInsights;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Bot.Builder;
Expand All @@ -23,13 +22,11 @@ namespace AutomotiveSkill
using Microsoft.Bot.Builder.Integration.AspNet.Core;
using Microsoft.Bot.Builder.Skills;
using Microsoft.Bot.Builder.Solutions;
using Microsoft.Bot.Builder.Solutions.Proactive;
using Microsoft.Bot.Builder.Solutions.Responses;
using Microsoft.Bot.Builder.Solutions.TaskExtensions;
using Microsoft.Bot.Connector.Authentication;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.IdentityModel.Tokens;

public class Startup
{
Expand Down Expand Up @@ -77,12 +74,10 @@ public void ConfigureServices(IServiceCollection services)
services.AddSingleton<IStorage>(new CosmosDbStorage(settings.CosmosDb));
services.AddSingleton<UserState>();
services.AddSingleton<ConversationState>();
services.AddSingleton<ProactiveState>();
services.AddSingleton(sp =>
{
var userState = sp.GetService<UserState>();
var conversationState = sp.GetService<ConversationState>();
var proactiveState = sp.GetService<ProactiveState>();
return new BotStateSet(userState, conversationState);
});

Expand All @@ -102,18 +97,6 @@ public void ConfigureServices(IServiceCollection services)
new AutomotiveSkillSharedResponses(),
new VehicleSettingsResponses()));

// Configure Skill authentication
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddJwtBearer(options =>
{
options.Authority = "https://login.microsoftonline.com/microsoft.com";
options.Audience = settings.MicrosoftAppId;
options.TokenValidationParameters = new TokenValidationParameters
{
ValidIssuer = "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0",
};
});

// Configure adapters
services.AddTransient<IBotFrameworkHttpAdapter, DefaultAdapter>();
services.AddTransient<SkillWebSocketBotAdapter, AutomotiveSkillWebSocketBotAdapter>();
Expand All @@ -134,9 +117,9 @@ public void ConfigureServices(IServiceCollection services)
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
_isProduction = env.IsProduction();
app.UseDefaultFiles()
app.UseBotApplicationInsights()
.UseDefaultFiles()
.UseStaticFiles()
.UseAuthentication()
.UseWebSockets()
.UseMvc();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@
<PackageReference Include="Microsoft.Bot.Builder.Dialogs" Version="4.3.1" />
<PackageReference Include="Microsoft.Bot.Builder.Integration.ApplicationInsights.Core" Version="4.3.1" />
<PackageReference Include="Microsoft.Bot.Builder.Integration.AspNet.Core" Version="4.3.1" />
<PackageReference Include="Microsoft.Bot.Builder.Skills" Version="4.4.0-preview-19" />
<PackageReference Include="Microsoft.Bot.Builder.Skills" Version="4.4.0-preview41" />
<PackageReference Include="Microsoft.Bot.Builder.Solutions" Version="4.4.0-preview41" />
<PackageReference Include="Microsoft.Bot.Builder.TemplateManager" Version="4.3.1" />
<PackageReference Include="Microsoft.Bot.Configuration" Version="4.3.1" />
<PackageReference Include="Microsoft.Bot.Connector" Version="4.3.1" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
using System;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Bot.Builder;
using Microsoft.Bot.Builder.Integration.AspNet.Core;
using Microsoft.Bot.Builder.Skills;
using Microsoft.Bot.Builder.Solutions;
using Microsoft.Extensions.Configuration;

namespace CalendarSkill.Controllers
{
[ApiController]
public class BotController : SkillController
{
public BotController(IServiceProvider serviceProvider, BotSettingsBase botSettings)
: base(serviceProvider, botSettings)
public BotController(
IBotFrameworkHttpAdapter botFrameworkHttpAdapter,
SkillHttpAdapter skillHttpAdapter,
SkillWebSocketAdapter skillWebSocketAdapter,
IBot bot,
BotSettingsBase botSettings)
: base(botFrameworkHttpAdapter, skillHttpAdapter, skillWebSocketAdapter, bot, botSettings)
{
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Builder.Dialogs.Choices;
using Microsoft.Bot.Builder.Skills;
using Microsoft.Bot.Builder.Solutions;
using Microsoft.Bot.Builder.Solutions.Authentication;
using Microsoft.Bot.Builder.Solutions.Resources;
using Microsoft.Bot.Builder.Solutions.Responses;
Expand Down Expand Up @@ -54,7 +53,7 @@ public CalendarSkillDialog(
throw new Exception("You must configure an authentication connection in your bot file before using this component.");
}

AddDialog(new MultiProviderAuthDialog(ResponseManager, settings.OAuthConnections));
AddDialog(new MultiProviderAuthDialog(settings.OAuthConnections));
AddDialog(new TextPrompt(Actions.Prompt));
AddDialog(new ConfirmPrompt(Actions.TakeFurtherAction, null, Culture.English) { Style = ListStyle.SuggestedAction });
AddDialog(new DateTimePrompt(Actions.DateTimePrompt, DateTimeValidator, Culture.English));
Expand Down
17 changes: 1 addition & 16 deletions skills/src/csharp/calendarskill/calendarskill/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
using CalendarSkill.Responses.UpdateEvent;
using CalendarSkill.Services;
using Microsoft.ApplicationInsights;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Bot.Builder;
Expand All @@ -33,7 +32,6 @@
using Microsoft.Bot.Connector.Authentication;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.IdentityModel.Tokens;

namespace CalendarSkill
{
Expand Down Expand Up @@ -84,7 +82,7 @@ public void ConfigureServices(IServiceCollection services)
var userState = sp.GetService<UserState>();
var conversationState = sp.GetService<ConversationState>();
var proactiveState = sp.GetService<ProactiveState>();
return new BotStateSet(userState, conversationState);
return new BotStateSet(userState, conversationState, proactiveState);
});

// Configure telemetry
Expand Down Expand Up @@ -112,18 +110,6 @@ public void ConfigureServices(IServiceCollection services)
new TimeRemainingResponses(),
new UpdateEventResponses()));

// Configure Skill authentication
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddJwtBearer(options =>
{
options.Authority = "https://login.microsoftonline.com/microsoft.com";
options.Audience = settings.MicrosoftAppId;
options.TokenValidationParameters = new TokenValidationParameters
{
ValidIssuer = "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0",
};
});

// Configure adapters
services.AddTransient<IBotFrameworkHttpAdapter, DefaultAdapter>();
services.AddTransient<SkillWebSocketBotAdapter, CalendarSkillWebSocketBotAdapter>();
Expand All @@ -147,7 +133,6 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
app.UseBotApplicationInsights()
.UseDefaultFiles()
.UseStaticFiles()
.UseAuthentication()
.UseWebSockets()
.UseMvc();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Bot.Builder;
using Microsoft.Bot.Builder.Integration.AspNet.Core;
using Microsoft.Bot.Builder.Skills;
using Microsoft.Bot.Builder.Solutions;

Expand All @@ -8,8 +9,13 @@ namespace EmailSkill.Controllers
[ApiController]
public class BotController : SkillController
{
public BotController(IServiceProvider serviceProvider, BotSettingsBase botSettings)
: base(serviceProvider, botSettings)
public BotController(
IBotFrameworkHttpAdapter botFrameworkHttpAdapter,
SkillHttpAdapter skillHttpAdapter,
SkillWebSocketAdapter skillWebSocketAdapter,
IBot bot,
BotSettingsBase botSettings)
: base(botFrameworkHttpAdapter, skillHttpAdapter, skillWebSocketAdapter, bot, botSettings)
{
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public EmailSkillDialogBase(
throw new Exception("You must configure an authentication connection in your bot file before using this component.");
}

AddDialog(new MultiProviderAuthDialog(ResponseManager, settings.OAuthConnections));
AddDialog(new MultiProviderAuthDialog(settings.OAuthConnections));
AddDialog(new TextPrompt(Actions.Prompt));
AddDialog(new ConfirmPrompt(Actions.TakeFurtherAction, null, Culture.English) { Style = ListStyle.SuggestedAction });
}
Expand Down
3 changes: 2 additions & 1 deletion skills/src/csharp/emailskill/emailskill/EmailSkill.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
<PackageReference Include="Microsoft.Bot.Builder.Dialogs" Version="4.3.1" />
<PackageReference Include="Microsoft.Bot.Builder.Integration.ApplicationInsights.Core" Version="4.3.1" />
<PackageReference Include="Microsoft.Bot.Builder.Integration.AspNet.Core" Version="4.3.1" />
<PackageReference Include="Microsoft.Bot.Builder.Skills" Version="4.4.0-preview-19" />
<PackageReference Include="Microsoft.Bot.Builder.Skills" Version="4.4.0-preview41" />
<PackageReference Include="Microsoft.Bot.Builder.Solutions" Version="4.4.0-preview41" />
<PackageReference Include="Microsoft.Bot.Builder.TemplateManager" Version="4.3.1" />
<PackageReference Include="Microsoft.Bot.Configuration" Version="4.3.1" />
<PackageReference Include="Microsoft.Bot.Connector" Version="4.3.1" />
Expand Down
18 changes: 0 additions & 18 deletions skills/src/csharp/emailskill/emailskill/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
using EmailSkill.ServiceClients;
using EmailSkill.Services;
using Microsoft.ApplicationInsights;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Bot.Builder;
Expand All @@ -27,13 +26,11 @@
using Microsoft.Bot.Builder.Integration.AspNet.Core;
using Microsoft.Bot.Builder.Skills;
using Microsoft.Bot.Builder.Solutions;
using Microsoft.Bot.Builder.Solutions.Proactive;
using Microsoft.Bot.Builder.Solutions.Responses;
using Microsoft.Bot.Builder.Solutions.TaskExtensions;
using Microsoft.Bot.Connector.Authentication;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.IdentityModel.Tokens;

namespace EmailSkill
{
Expand Down Expand Up @@ -78,12 +75,10 @@ public void ConfigureServices(IServiceCollection services)
services.AddSingleton<IStorage>(new CosmosDbStorage(settings.CosmosDb));
services.AddSingleton<UserState>();
services.AddSingleton<ConversationState>();
services.AddSingleton<ProactiveState>();
services.AddSingleton(sp =>
{
var userState = sp.GetService<UserState>();
var conversationState = sp.GetService<ConversationState>();
var proactiveState = sp.GetService<ProactiveState>();
return new BotStateSet(userState, conversationState);
});

Expand Down Expand Up @@ -111,18 +106,6 @@ public void ConfigureServices(IServiceCollection services)
new EmailSharedResponses(),
new ShowEmailResponses()));

// Configure Skill authentication
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddJwtBearer(options =>
{
options.Authority = "https://login.microsoftonline.com/microsoft.com";
options.Audience = settings.MicrosoftAppId;
options.TokenValidationParameters = new TokenValidationParameters
{
ValidIssuer = "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0",
};
});

// Configure adapters
services.AddTransient<IBotFrameworkHttpAdapter, DefaultAdapter>();
services.AddTransient<SkillWebSocketBotAdapter, EmailSkillWebSocketBotAdapter>();
Expand All @@ -146,7 +129,6 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
app.UseBotApplicationInsights()
.UseDefaultFiles()
.UseStaticFiles()
.UseAuthentication()
.UseWebSockets()
.UseMvc();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Bot.Builder;
using Microsoft.Bot.Builder.Integration.AspNet.Core;
using Microsoft.Bot.Builder.Skills;
using Microsoft.Bot.Builder.Solutions;

Expand All @@ -8,8 +9,13 @@ namespace NewsSkill.Controllers
[ApiController]
public class BotController : SkillController
{
public BotController(IServiceProvider serviceProvider, BotSettingsBase botSettings)
: base(serviceProvider, botSettings)
public BotController(
IBotFrameworkHttpAdapter botFrameworkHttpAdapter,
SkillHttpAdapter skillHttpAdapter,
SkillWebSocketAdapter skillWebSocketAdapter,
IBot bot,
BotSettingsBase botSettings)
: base(botFrameworkHttpAdapter, skillHttpAdapter, skillWebSocketAdapter, bot, botSettings)
{
}
}
Expand Down
3 changes: 2 additions & 1 deletion skills/src/csharp/experimental/newsskill/NewsSkill.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
<PackageReference Include="Microsoft.Bot.Builder.Dialogs" Version="4.3.1" />
<PackageReference Include="Microsoft.Bot.Builder.Integration.ApplicationInsights.Core" Version="4.3.1" />
<PackageReference Include="Microsoft.Bot.Builder.Integration.AspNet.Core" Version="4.3.1" />
<PackageReference Include="Microsoft.Bot.Builder.Skills" Version="4.4.0-preview-19" />
<PackageReference Include="Microsoft.Bot.Builder.Skills" Version="4.4.0-preview41" />
<PackageReference Include="Microsoft.Bot.Builder.Solutions" Version="4.4.0-preview41" />
<PackageReference Include="Microsoft.Bot.Builder.TemplateManager" Version="4.3.1" />
<PackageReference Include="Microsoft.Bot.Configuration" Version="4.3.1" />
<PackageReference Include="Microsoft.Bot.Connector" Version="4.3.1" />
Expand Down
Loading