Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jun 30, 2022. It is now read-only.

Commit25c80c0

Browse files
authored
Merge pull request#3830 from southworks/internal/feature/southworks/virtual-assistant/allowedCallersClaimsValidator-issue
[TypeScript][Virtual Assistant] Add claim's validation if the VA is not connected to Skills
2 parents60f6ed7 +005d25d commit25c80c0

File tree

2 files changed

+18
-10
lines changed
  • templates/typescript
    • generator-bot-virtualassistant/generators/app/templates/sample-assistant/src
    • samples/sample-assistant/src

2 files changed

+18
-10
lines changed

‎templates/typescript/generator-bot-virtualassistant/generators/app/templates/sample-assistant/src/index.ts‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,16 @@ const credentialProvider: SimpleCredentialProvider = new SimpleCredentialProvide
7777
// Register the skills configuration class.
7878
constskillsConfig:SkillsConfiguration=newSkillsConfiguration(appsettings.botFrameworkSkillsasIEnhancedBotFrameworkSkill[],appsettings.skillHostEndpoint);
7979

80+
letauthenticationConfiguration=newAuthenticationConfiguration();
81+
8082
// Register AuthConfiguration to enable custom claim validation.
81-
constallowedCallers:string[]=[...skillsConfig.skills.values()].map(skill=>skill.appId);
82-
constauthenticationConfiguration=newAuthenticationConfiguration(
83-
undefined,
84-
allowedCallersClaimsValidator(allowedCallers)
85-
);
83+
if(skillsConfig.skills.size>0){
84+
constallowedCallers:string[]=[...skillsConfig.skills.values()].map(skill=>skill.appId);
85+
authenticationConfiguration=newAuthenticationConfiguration(
86+
undefined,
87+
allowedCallersClaimsValidator(allowedCallers)
88+
);
89+
}
8690

8791
// Configure telemetry
8892
consttelemetryClient:BotTelemetryClient=getTelemetryClient(settings);

‎templates/typescript/samples/sample-assistant/src/index.ts‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,16 @@ const credentialProvider: SimpleCredentialProvider = new SimpleCredentialProvide
7777
// Register the skills configuration class.
7878
constskillsConfig:SkillsConfiguration=newSkillsConfiguration(appsettings.botFrameworkSkillsasIEnhancedBotFrameworkSkill[],appsettings.skillHostEndpoint);
7979

80+
letauthenticationConfiguration=newAuthenticationConfiguration();
81+
8082
// Register AuthConfiguration to enable custom claim validation.
81-
constallowedCallers:string[]=[...skillsConfig.skills.values()].map(skill=>skill.appId);
82-
constauthenticationConfiguration=newAuthenticationConfiguration(
83-
undefined,
84-
allowedCallersClaimsValidator(allowedCallers)
85-
);
83+
if(skillsConfig.skills.size>0){
84+
constallowedCallers:string[]=[...skillsConfig.skills.values()].map(skill=>skill.appId);
85+
authenticationConfiguration=newAuthenticationConfiguration(
86+
undefined,
87+
allowedCallersClaimsValidator(allowedCallers)
88+
);
89+
}
8690

8791
// Configure telemetry
8892
consttelemetryClient:BotTelemetryClient=getTelemetryClient(settings);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp