-
Notifications
You must be signed in to change notification settings - Fork 213
[JS] feat: Authentication #670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Linked issues closes: #611 ## Details Implement fluent APIs in new Application class. #### Change details New APIs: - OnActivity(string, Handler); - OnActivity(Regex, Handler); - OnActivity(Router, Handler); - OnActivity(MultiRouter, Handler); - OnConversationUpdate(string, Handler); - OnConversationUpdate(string[], Handler); - OnMessage(string, Handler); - OnMessage(Regex, Handler); - OnMessage(Router, Handler); - OnMessage(MultiRouter, Handler); - OnMessageReactionsAdded(Handler); - OnMessageReactionsRemoved(Handler); - OnBeforeTurn(Handler); - OnAfterTurn(Handler); ## Attestation Checklist - [X] My code follows the style guidelines of this project - I have checked for/fixed spelling, linting, and other errors - I have commented my code for clarity - I have made corresponding changes to the documentation (we use [TypeDoc](https://typedoc.org/) to document our code) - My changes generate no new warnings - I have added tests that validates my changes, and provides sufficient test coverage. I have tested with: - Local testing - E2E testing in Teams - New and existing unit tests pass locally with my changes ### Additional information > Feel free to add other relevant information below
) ## Linked issues closes: #601 ## Details #### Change details - use `AdaptiveCardInvokeResponse` as return type of `ActionExecuteHandler`. The change is because the original style cannot meet the following requirement: return values with different types in one handler. For example, if I'd like to return Adaptive Card or text message by some cases in `OnActionExecute("verb")`, I have to define `OnActionExecute("verb", ActionExecuteAdaptiveCardHandler)` and `OnActionExecute("verb", ActionExecuteTextHandler)` respectively. Although the two handlers will be hit, only one result will be returned. A concrete example is `SubmitAction` in gptME sample. ## Attestation Checklist - [x] My code follows the style guidelines of this project - I have checked for/fixed spelling, linting, and other errors - I have commented my code for clarity - I have made corresponding changes to the documentation (we use [TypeDoc](https://typedoc.org/) to document our code) - My changes generate no new warnings - I have added tests that validates my changes, and provides sufficient test coverage. I have tested with: - Local testing - E2E testing in Teams - New and existing unit tests pass locally with my changes ### Additional information > Feel free to add other relevant information below
## Linked issues closes: #602 ## Details #### Change details Delegates: - Task\<MessagingExtensionActionResponse> SubmitActionHandler\<TState>(ITurnContext, TState, object, CancellationToken) - Task\<MessagingExtensionActionResponse> BotMessagePreviewEditHandler\<TState>(ITurnContext, TState, Activity, CancellationToken) - Task BotMessagePreviewSendHandler\<TState>(ITurnContext, TState, Activity, CancellationToken) - Task\<TaskModuleResponse> FetchTaskHandler\<TState>(ITurnContext, TState, CancellationToken) - Task\<MessagingExtensionResult> QueryHandler\<TState>(ITurnContext, TState, Query<Dictionary<string, object>>, CancellationToken) - Task\<MessagingExtensionResult> SelectItemHandler\<TState>(ITurnContext, TState, object, CancellationToken) - Task\<MessagingExtensionResult> QueryLinkHandler\<TState>(ITurnContext, TState, string, CancellationToken) APIs: - OnSubmitAction(string, SubmitActionHandler<TState>) - OnSubmitAction(Regex, SubmitActionHandler<TState>) - OnSubmitAction(RouteSelector, SubmitActionHandler<TState>) - OnSubmitAction(MultipleRouteSelector, SubmitActionHandler<TState>) - OnBotMessagePreviewEdit(string, BotMessagePreviewEditHandler<TState>) - OnBotMessagePreviewEdit(Regex, BotMessagePreviewEditHandler<TState>) - OnBotMessagePreviewEdit(RouteSelector, BotMessagePreviewEditHandler<TState>) - OnBotMessagePreviewEdit(MultipleRouteSelector, BotMessagePreviewEditHandler<TState>) - OnBotMessagePreviewSend(string, BotMessagePreviewSendHandler<TState>) - OnBotMessagePreviewSend(Regex, BotMessagePreviewSendHandler<TState>) - OnBotMessagePreviewSend(RouteSelector, BotMessagePreviewSendHandler<TState>) - OnBotMessagePreviewSend(MultipleRouteSelector, BotMessagePreviewSendHandler<TState>) - OnFetchTask(string, FetchTaskHandler<TState>) - OnFetchTask(Regex, FetchTaskHandler<TState>) - OnFetchTask(RouteSelector, FetchTaskHandler<TState>) - OnFetchTask(MultipleRouteSelector, FetchTaskHandler<TState>) - OnQuery(string, QueryHandler<TState>) - OnQuery(Regex, QueryHandler<TState>) - OnQuery(RouteSelector, QueryHandler<TState>) - OnQuery(MultipleRouteSelector, QueryHandler<TState>) - OnSelectItem(SelectItemHandler<TState>) - OnQueryLink(QueryLinkHandler<TState>) - OnAnonymousQueryLink(QueryLinkHandler<TState>) ## Attestation Checklist - [x] My code follows the style guidelines of this project - I have checked for/fixed spelling, linting, and other errors - I have commented my code for clarity - I have made corresponding changes to the documentation (we use [TypeDoc](https://typedoc.org/) to document our code) - My changes generate no new warnings - I have added tests that validates my changes, and provides sufficient test coverage. I have tested with: - Local testing - E2E testing in Teams - New and existing unit tests pass locally with my changes ### Additional information > Feel free to add other relevant information below
## Linked issues closes: #601 #602 ## Details #### Change details - add AdaptiveCardInvokeResponseFactory - improve xml doc ## Attestation Checklist - [x] My code follows the style guidelines of this project - I have checked for/fixed spelling, linting, and other errors - I have commented my code for clarity - I have made corresponding changes to the documentation (we use [TypeDoc](https://typedoc.org/) to document our code) - My changes generate no new warnings - I have added tests that validates my changes, and provides sufficient test coverage. I have tested with: - Local testing - E2E testing in Teams - New and existing unit tests pass locally with my changes ### Additional information > Feel free to add other relevant information below
## Linked issues closes: #601 #602 ## Details #### Change details - move adaptive card handlers and message extension handlers to separate files - add type constraint for TState in handlers ## Attestation Checklist - [x] My code follows the style guidelines of this project - I have checked for/fixed spelling, linting, and other errors - I have commented my code for clarity - I have made corresponding changes to the documentation (we use [TypeDoc](https://typedoc.org/) to document our code) - My changes generate no new warnings - I have added tests that validates my changes, and provides sufficient test coverage. I have tested with: - Local testing - E2E testing in Teams - New and existing unit tests pass locally with my changes ### Additional information > Feel free to add other relevant information below
## Linked issues closes: #604 ## Details #### Change details - update echoBot to use fluent api ## Attestation Checklist - [ ] My code follows the style guidelines of this project - I have checked for/fixed spelling, linting, and other errors - I have commented my code for clarity - I have made corresponding changes to the documentation (we use [TypeDoc](https://typedoc.org/) to document our code) - My changes generate no new warnings - I have added tests that validates my changes, and provides sufficient test coverage. I have tested with: - Local testing - E2E testing in Teams - New and existing unit tests pass locally with my changes ### Additional information > Feel free to add other relevant information below
…#690) ## Linked issues closes: #601 #602 ## Details #### Change details - add AdaptiveCards and MessageExtensions in Application ## Attestation Checklist - [x] My code follows the style guidelines of this project - I have checked for/fixed spelling, linting, and other errors - I have commented my code for clarity - I have made corresponding changes to the documentation (we use [TypeDoc](https://typedoc.org/) to document our code) - My changes generate no new warnings - I have added tests that validates my changes, and provides sufficient test coverage. I have tested with: - Local testing - E2E testing in Teams - New and existing unit tests pass locally with my changes ### Additional information > Feel free to add other relevant information below
## Linked issues closes: #600 ## Details Replace legacy application with new fluent one (keep in root namespace) #### Change details - Remove the legacy application - Make new application under root namespace (same as the legacy one, as well as JS/PYTHON) - Refine the folder structure of application/adaptivecards/messagextensions/... - Update unit tests ## Attestation Checklist - [X] My code follows the style guidelines of this project - I have checked for/fixed spelling, linting, and other errors - I have commented my code for clarity - I have made corresponding changes to the documentation (we use [TypeDoc](https://typedoc.org/) to document our code) - My changes generate no new warnings - I have added tests that validates my changes, and provides sufficient test coverage. I have tested with: - Local testing - E2E testing in Teams - New and existing unit tests pass locally with my changes ### Additional information > Feel free to add other relevant information below
## Linked issues closes: #604 ## Details #### Change details - update 02.messageExtensions.a.searchCommand sample to use fluent api ## Attestation Checklist - [x] My code follows the style guidelines of this project - I have checked for/fixed spelling, linting, and other errors - I have commented my code for clarity - I have made corresponding changes to the documentation (we use [TypeDoc](https://typedoc.org/) to document our code) - My changes generate no new warnings - I have added tests that validates my changes, and provides sufficient test coverage. I have tested with: - Local testing - E2E testing in Teams - New and existing unit tests pass locally with my changes ### Additional information > Feel free to add other relevant information below
## Linked issues closes: #604 ## Details #### Change details - update 03.adaptiveCards.a.typeAheadBot sample to use fluent api ## Attestation Checklist - [x] My code follows the style guidelines of this project - I have checked for/fixed spelling, linting, and other errors - I have commented my code for clarity - I have made corresponding changes to the documentation (we use [TypeDoc](https://typedoc.org/) to document our code) - My changes generate no new warnings - I have added tests that validates my changes, and provides sufficient test coverage. I have tested with: - Local testing - E2E testing in Teams - New and existing unit tests pass locally with my changes ### Additional information > Feel free to add other relevant information below
## Linked issues closes: #604 ## Details Update dotnet samples to use fluent api #### Change details - List Bot - DevOps Bot - Twenty Questions Bot - Quest Bot ## Attestation Checklist - [X] My code follows the style guidelines of this project - I have checked for/fixed spelling, linting, and other errors - I have commented my code for clarity - I have made corresponding changes to the documentation (we use [TypeDoc](https://typedoc.org/) to document our code) - My changes generate no new warnings - I have added tests that validates my changes, and provides sufficient test coverage. I have tested with: - Local testing - E2E testing in Teams - New and existing unit tests pass locally with my changes ### Additional information > Feel free to add other relevant information below
## Linked issues closes: #604 ## Details #### Change details - 04.ai.a.teamsChefBot - 04.ai.b.messageExtensions.gptME ## Attestation Checklist - [x] My code follows the style guidelines of this project - I have checked for/fixed spelling, linting, and other errors - I have commented my code for clarity - I have made corresponding changes to the documentation (we use [TypeDoc](https://typedoc.org/) to document our code) - My changes generate no new warnings - I have added tests that validates my changes, and provides sufficient test coverage. I have tested with: - Local testing - E2E testing in Teams - New and existing unit tests pass locally with my changes ### Additional information > Feel free to add other relevant information below
corinagum
reviewed
Nov 9, 2023
This was referenced Nov 9, 2023
Co-authored-by: Corina <[email protected]>
Co-authored-by: Corina <[email protected]>
corinagum
reviewed
Nov 9, 2023
Co-authored-by: Corina <[email protected]>
corinagum
reviewed
Nov 9, 2023
corinagum
reviewed
Nov 9, 2023
corinagum
reviewed
Nov 9, 2023
corinagum
reviewed
Nov 9, 2023
corinagum
reviewed
Nov 9, 2023
corinagum
reviewed
Nov 9, 2023
corinagum
reviewed
Nov 9, 2023
corinagum
approved these changes
Nov 11, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Linked issues
closes: #738, #739
Details
Foundations of handling user authentication.
Authentication
class encapsulates logic to authentication for a single connection.AuthenticationManager
class handles multiple user configured connections and exposessignInUser
andsignOutUser
methods for application code initiate authentication.AuthenticationOptions
object to configure authentication:settings
: contains one or more user authentication settingsdefault
: the default setting to use in the auto sign in flow.autoSignIn
: whether to sign user in by default at the start of every turn. Set to true by default.Public api:
Authentication.ts
AuthenticationManager.ts
AuthenticationOptions
Task list