From 596d68e22c7ff3d247e1bf4fefee20b0155715c3 Mon Sep 17 00:00:00 2001 From: yzt Date: Wed, 8 Jun 2022 11:27:14 +0800 Subject: [PATCH 1/5] Update `Serverless.Protocols` version to 1.9.0 (#1628) The next function extensions version is 1.9.0 . Skip 1.8.0 and 1.7.0 --- .../Microsoft.Azure.SignalR.Serverless.Protocols.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.Azure.SignalR.Serverless.Protocols/Microsoft.Azure.SignalR.Serverless.Protocols.csproj b/src/Microsoft.Azure.SignalR.Serverless.Protocols/Microsoft.Azure.SignalR.Serverless.Protocols.csproj index 066bab94c..76fdbef89 100644 --- a/src/Microsoft.Azure.SignalR.Serverless.Protocols/Microsoft.Azure.SignalR.Serverless.Protocols.csproj +++ b/src/Microsoft.Azure.SignalR.Serverless.Protocols/Microsoft.Azure.SignalR.Serverless.Protocols.csproj @@ -5,7 +5,7 @@ netstandard2.0 Microsoft.Azure.SignalR.Serverless.Protocols - 1.7.0 + 1.9.0 $(VersionPrefix) From 1a5ecc45f43247acfbc79debb0ea43a4a030193e Mon Sep 17 00:00:00 2001 From: Eric Xing <87063252+xingsy97@users.noreply.github.com> Date: Wed, 8 Jun 2022 13:13:44 +0800 Subject: [PATCH 2/5] Obsolete UseAzureSignalR (#1605) * Obsolete `IApplicationBuilder.UseAzureSignalR`. Tell user Use `IApplicationBuilder.UseEndpoints()` instead Co-authored-by: Liangying.Wei --- src/Microsoft.Azure.SignalR/ApplicationBuilderExtensions.cs | 3 +++ test/Microsoft.Azure.SignalR.E2ETests/SignalR/TestStartup.cs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.Azure.SignalR/ApplicationBuilderExtensions.cs b/src/Microsoft.Azure.SignalR/ApplicationBuilderExtensions.cs index c3fcab4de..4f651a4c2 100644 --- a/src/Microsoft.Azure.SignalR/ApplicationBuilderExtensions.cs +++ b/src/Microsoft.Azure.SignalR/ApplicationBuilderExtensions.cs @@ -19,6 +19,9 @@ public static class AzureSignalRApplicationBuilderExtensions /// The . /// A callback to configure the . /// The same instance of the for chaining. +#if !NETSTANDARD2_0 + [Obsolete("IApplicationBuilder.UseAzureSignalR is obsoleted, please use IApplicationBuilder.UseEndpoints() instead.")] +#endif public static IApplicationBuilder UseAzureSignalR(this IApplicationBuilder app, Action configure) { var marker = app.ApplicationServices.GetService(); diff --git a/test/Microsoft.Azure.SignalR.E2ETests/SignalR/TestStartup.cs b/test/Microsoft.Azure.SignalR.E2ETests/SignalR/TestStartup.cs index cc1dbe1b6..7edf5d6e9 100644 --- a/test/Microsoft.Azure.SignalR.E2ETests/SignalR/TestStartup.cs +++ b/test/Microsoft.Azure.SignalR.E2ETests/SignalR/TestStartup.cs @@ -24,7 +24,7 @@ public TestStartup(IConfiguration configuration) public void Configure(IApplicationBuilder app) { - app.UseAzureSignalR(configure => + app.UseEndpoints(configure => { configure.MapHub($"/{nameof(TestHub)}"); }); From c87f2dac7f285dac69b7a0434d95015648ea752e Mon Sep 17 00:00:00 2001 From: "Liangying.Wei" Date: Tue, 21 Jun 2022 17:29:42 +0800 Subject: [PATCH 3/5] Update rest-api.md to redirect to docs (#1630) * Update rest-api.md * Update v1-preview.md * Update v1.md --- docs/rest-api.md | 142 +----------------- docs/swagger/v1-preview.md | 131 +--------------- docs/swagger/v1.md | 297 +------------------------------------ 3 files changed, 3 insertions(+), 567 deletions(-) diff --git a/docs/rest-api.md b/docs/rest-api.md index adba1dbc5..cc4781fd7 100644 --- a/docs/rest-api.md +++ b/docs/rest-api.md @@ -1,143 +1,3 @@ # REST API in Azure SignalR Service -> **NOTE** -> -> Azure SignalR Service only supports using REST API to manage clients connected using ASP.NET Core SignalR. Clients connected using ASP.NET SignalR use a different data protocol and is now not supported. - -- [REST API in Azure SignalR Service](#rest-api-in-azure-signalr-service) - - [Typical Server-less Architecture with Azure Functions](#typical-server-less-architecture-with-azure-functions) - - [API](#api) - - [Using REST API](#using-rest-api) - - [Authenticate via Azure SignalR Service AccessKey](#authenticate-via-azure-signalr-service-accesskey) - - [Signing Algorithm and Signature](#signing-algorithm-and-signature) - - [Claims](#claims) - - [Authenticate via Azure Active Directory Token (AAD Token)](#authenticate-via-azure-active-directory-token-aad-token) - - [Implement Negotiate Endpoint](#implement-negotiate-endpoint) - - [User-related REST API](#user-related-rest-api) - - [Sample](#sample) - - [Limitation](#limitation) - -On top of classical client-server pattern, Azure SignalR Service provides a set of REST APIs, so that you can easily integrate real-time functionality into your server-less architecture. - - -## Typical Server-less Architecture with Azure Functions - -The following diagram shows a typical server-less architecture of using Azure SignalR Service with Azure Functions. - -![Typical Serverless Architecture](./images/serverless-arch.png) - -- `negotiate` function will return negotiation response and redirect all clients to Azure SignalR Service. -- `broadcast` function will call Azure SignalR Service's REST API. Then SignalR Service will broadcast the message to all connected clients. - -In server-less architecture, clients still have persistent connections to Azure SignalR Service. -Since there are no application server to handle traffic, clients are in `LISTEN` mode, which means they can only receive messages but can't send messages. -SignalR Service will disconnect any client who sends messages because it is an invalid operation. - -You can find a complete sample of using Azure SignalR Service with Azure Functions at [here](https://github.com/aspnet/AzureSignalR-samples/tree/master/samples/RealtimeSignIn). - -## API - -The following table shows all versions of REST API we have for now. You can also find the swagger file for each version of REST API. - -API Version | Status | Port | Doc | Spec ----|---|---|---|--- -`1.0-preview` | Obsolete | Standard | [Doc](./swagger/v1-preview.md) | [swagger](./swagger/v1-preview.json) -`1.0` | Available | Standard | [Doc](./swagger/v1.md) | [swagger](./swagger/v1.json) - -The latest available APIs are listed as following. - - -| API | Path | -| ---- | ---------- | -| [Broadcast a message to all clients connected to target hub.](./swagger/v1.md#post-broadcast-a-message-to-all-clients-connected-to-target-hub.) | `POST /api/v1/hubs/{hub}` | -| [Broadcast a message to all clients belong to the target user.](./swagger/v1.md#post-broadcast-a-message-to-all-clients-belong-to-the-target-user.) | `POST /api/v1/hubs/{hub}/users/{id}` | -| [Send message to the specific connection.](./swagger/v1.md#post-send-message-to-the-specific-connection.) | `POST /api/v1/hubs/{hub}/connections/{connectionId}` | -| [Check if the connection with the given connectionId exists](./swagger/v1.md#get-check-if-the-connection-with-the-given-connectionid-exists) | `GET /api/v1/hubs/{hub}/connections/{connectionId}` | -| [Close the client connection](./swagger/v1.md#delete-close-the-client-connection) | `DELETE /api/v1/hubs/{hub}/connections/{connectionId}` | -| [Broadcast a message to all clients within the target group.](./swagger/v1.md#post-broadcast-a-message-to-all-clients-within-the-target-group.) | `POST /api/v1/hubs/{hub}/groups/{group}` | -| [Check if there are any client connections inside the given group](./swagger/v1.md#get-check-if-there-are-any-client-connections-inside-the-given-group) | `GET /api/v1/hubs/{hub}/groups/{group}` | -| [Check if there are any client connections connected for the given user](./swagger/v1.md#get-check-if-there-are-any-client-connections-connected-for-the-given-user) | `GET /api/v1/hubs/{hub}/users/{user}` | -| [Add a connection to the target group.](./swagger/v1.md#put-add-a-connection-to-the-target-group.) | `PUT /api/v1/hubs/{hub}/groups/{group}/connections/{connectionId}` | -| [Remove a connection from the target group.](./swagger/v1.md#delete-remove-a-connection-from-the-target-group.) | `DELETE /api/v1/hubs/{hub}/groups/{group}/connections/{connectionId}` | -| [Check whether a user exists in the target group.](./swagger/v1.md#get-check-whether-a-user-exists-in-the-target-group.) | `GET /api/v1/hubs/{hub}/groups/{group}/users/{user}` | -| [Add a user to the target group.](./swagger/v1.md#put-add-a-user-to-the-target-group.) | `PUT /api/v1/hubs/{hub}/groups/{group}/users/{user}` | -| [Remove a user from the target group.](./swagger/v1.md#delete-remove-a-user-from-the-target-group.) | `DELETE /api/v1/hubs/{hub}/groups/{group}/users/{user}` | -| [Remove a user from all groups.](./swagger/v1.md#delete-remove-a-user-from-all-groups.) | `DELETE /api/v1/hubs/{hub}/users/{user}/groups` | - -## Using REST API - -### Authenticate via Azure SignalR Service AccessKey - -In each HTTP request, an authorization header with a [JSON Web Token (JWT)](https://en.wikipedia.org/wiki/JSON_Web_Token) is required to authenticate with Azure SignalR Service. - - -#### Signing Algorithm and Signature - -`HS256`, namely HMAC-SHA256, is used as the signing algorithm. - -You should use the `AccessKey` in Azure SignalR Service instance's connection string to sign the generated JWT token. - -#### Claims - -Below claims are required to be included in the JWT token. - -Claim Type | Is Required | Description ----|---|--- -`aud` | true | Should be the **SAME** as your HTTP request url, trailing slash and query parameters not included. For example, a broadcast request's audience should look like: `https://example.service.signalr.net/api/v1/hubs/myhub`. -`exp` | true | Epoch time when this token will be expired. - -### Authenticate via Azure Active Directory Token (AAD Token) - -Like using `AccessKey`, a [JSON Web Token (JWT)](https://en.wikipedia.org/wiki/JSON_Web_Token) is also required to authenticate the HTTP request. - -**The difference is**, in this scenario, JWT Token is generated by Azure Active Directory. - -[Learn how to generate AAD Tokens](https://docs.microsoft.com/en-us/azure/active-directory/develop/reference-v2-libraries) - -You could also leverage from **Role Based Access Control (RBAC)** to authorize the request from your client/server to Azure SignalR Service. - -[Learn how to configure RBAC roles for your resource](https://docs.microsoft.com/en-us/azure/azure-signalr/authorize-access-azure-active-directory) - -### Implement Negotiate Endpoint - -As shown in the [architecture section](#serverless), you should implement a `negotiate` function that returns a redirect negotiation response so that client can connect to the service. -A typical negotiation response looks like as following: - -```json -{ - "url":"https://.service.signalr.net/client/?hub=", - "accessToken":"" -} -``` - -The `accessToken` is generated using the same algorithm described in [authentication section](#authentication). The only difference is the `aud` claim should be same as `url`. - -You should host your negotiate API in `https:///negotiate` so you can still use SignalR client to connect to the hub url. - -Read more about redirecting client to Azure SignalR Service at [here](./internal.md#client-connections). - - - -### User-related REST API - -In order to call user-related REST API, each of your clients should identify itself to Azure SignalR Service. -Otherwise SignalR Service can't find target connections from a given user id. - -This can be achieved by including a `nameid` claim in each client's JWT token when they are connecting to Azure SignalR Service. -Then SignalR Service will use the value of `nameid` claim as the user id of each client connection. - -### Sample - -You can find a complete console app to demonstrate how to manually build REST API HTTP request in Azure SignalR Service [here](https://github.com/aspnet/AzureSignalR-samples/tree/master/samples/Serverless). - -You can also use [Microsoft.Azure.SignalR.Management]() to publish messages to Azure SignalR Service using the similar interfaces of `IHubContext`. Samples can be found [here](). For more information, see [here](management-sdk-guide.md). - - -## Limitation - -Currently, we have following limitation for REST API request: - -* Header size, we only support up to 16KB. -* Body size, we only support up to 1MB. - -If you want to send message than 1MB, please use management SDK with persistent connection. +This article has been moved to [here](https://docs.microsoft.com/azure/azure-signalr/signalr-reference-data-plane-rest-api). diff --git a/docs/swagger/v1-preview.md b/docs/swagger/v1-preview.md index 05f377553..21bf89814 100644 --- a/docs/swagger/v1-preview.md +++ b/docs/swagger/v1-preview.md @@ -1,132 +1,3 @@ # Azure SignalR Service REST API ## Version: v1-preview - -### Available APIs - -| API | Path | -| ---- | ---------- | -| [post /api/v1-preview/hub/{hub}/user/{id}](#post-post-api-v1-preview-hub-hub-user-id) | `POST /api/v1-preview/hub/{hub}/user/{id}` | -| [post /api/v1-preview/hub/{hub}/users/{userList}](#post-post-api-v1-preview-hub-hub-users-userlist) | `POST /api/v1-preview/hub/{hub}/users/{userList}` | -| [post /api/v1-preview/hub/{hub}](#post-post-api-v1-preview-hub-hub) | `POST /api/v1-preview/hub/{hub}` | -| [post /api/v1-preview/hub/{hub}/group/{group}](#post-post-api-v1-preview-hub-hub-group-group) | `POST /api/v1-preview/hub/{hub}/group/{group}` | -| [post /api/v1-preview/hub/{hub}/groups/{groupList}](#post-post-api-v1-preview-hub-hub-groups-grouplist) | `POST /api/v1-preview/hub/{hub}/groups/{groupList}` | - -### post /api/v1-preview/hub/{hub}/user/{id} - -`POST /api/v1-preview/hub/{hub}/user/{id}` -##### Description: - -Send a message to a single user. - -##### Parameters - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| hub | path | Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. | Yes | string | -| id | path | Target user Id. | Yes | string | -| message | body | | Yes | [Message](#message) | - -##### Responses - -| Code | Description | -| ---- | ----------- | -| 202 | Accepted | - - -### post /api/v1-preview/hub/{hub}/users/{userList} - -`POST /api/v1-preview/hub/{hub}/users/{userList}` -##### Description: - -Send a message to multiple users. - -##### Parameters - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| hub | path | Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. | Yes | string | -| userList | path | Comma-separated list of user Ids. | Yes | string | -| message | body | | Yes | [Message](#message) | - -##### Responses - -| Code | Description | -| ---- | ----------- | -| 202 | Accepted | - - -### post /api/v1-preview/hub/{hub} - -`POST /api/v1-preview/hub/{hub}` -##### Description: - -Broadcast a message to all clients connected to target hub. - -##### Parameters - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| hub | path | Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. | Yes | string | -| message | body | | Yes | [Message](#message) | - -##### Responses - -| Code | Description | -| ---- | ----------- | -| 202 | Accepted | - - -### post /api/v1-preview/hub/{hub}/group/{group} - -`POST /api/v1-preview/hub/{hub}/group/{group}` -##### Description: - -Broadcast a message to all clients within the target group. - -##### Parameters - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| hub | path | Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. | Yes | string | -| group | path | Target group name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. | Yes | string | -| message | body | | Yes | [Message](#message) | - -##### Responses - -| Code | Description | -| ---- | ----------- | -| 202 | Accepted | - - -### post /api/v1-preview/hub/{hub}/groups/{groupList} - -`POST /api/v1-preview/hub/{hub}/groups/{groupList}` -##### Description: - -Broadcast a message to all clients within the target groups. - -##### Parameters - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| hub | path | Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. | Yes | string | -| groupList | path | Comma-separated list of group names. Each group name should start with alphabetic characters and only contain alpha-numeric characters or underscore. | Yes | string | -| message | body | | Yes | [Message](#message) | - -##### Responses - -| Code | Description | -| ---- | ----------- | -| 202 | Accepted | - -### Models - - -#### Message - -Method invocation message. - -| Name | Type | Description | Required | -| ---- | ---- | ----------- | -------- | -| target | string | Target method name. | No | -| arguments | [ object ] | Target method arguments. | No | \ No newline at end of file +This article has been moved to [here](https://docs.microsoft.com/azure/azure-signalr/swagger/signalr-data-plane-rest-v1-preview) diff --git a/docs/swagger/v1.md b/docs/swagger/v1.md index c3d9b9ad9..920efb304 100644 --- a/docs/swagger/v1.md +++ b/docs/swagger/v1.md @@ -1,298 +1,3 @@ # Azure SignalR Service REST API ## Version: v1 - -### Available APIs - -| API | Path | -| ---- | ---------- | -| [Broadcast a message to all clients connected to target hub.](#post-broadcast-a-message-to-all-clients-connected-to-target-hub.) | `POST /api/v1/hubs/{hub}` | -| [Broadcast a message to all clients belong to the target user.](#post-broadcast-a-message-to-all-clients-belong-to-the-target-user.) | `POST /api/v1/hubs/{hub}/users/{id}` | -| [Send message to the specific connection.](#post-send-message-to-the-specific-connection.) | `POST /api/v1/hubs/{hub}/connections/{connectionId}` | -| [Check if the connection with the given connectionId exists](#get-check-if-the-connection-with-the-given-connectionid-exists) | `GET /api/v1/hubs/{hub}/connections/{connectionId}` | -| [Close the client connection](#delete-close-the-client-connection) | `DELETE /api/v1/hubs/{hub}/connections/{connectionId}` | -| [Broadcast a message to all clients within the target group.](#post-broadcast-a-message-to-all-clients-within-the-target-group.) | `POST /api/v1/hubs/{hub}/groups/{group}` | -| [Check if there are any client connections inside the given group](#get-check-if-there-are-any-client-connections-inside-the-given-group) | `GET /api/v1/hubs/{hub}/groups/{group}` | -| [Check if there are any client connections connected for the given user](#get-check-if-there-are-any-client-connections-connected-for-the-given-user) | `GET /api/v1/hubs/{hub}/users/{user}` | -| [Add a connection to the target group.](#put-add-a-connection-to-the-target-group.) | `PUT /api/v1/hubs/{hub}/groups/{group}/connections/{connectionId}` | -| [Remove a connection from the target group.](#delete-remove-a-connection-from-the-target-group.) | `DELETE /api/v1/hubs/{hub}/groups/{group}/connections/{connectionId}` | -| [Check whether a user exists in the target group.](#get-check-whether-a-user-exists-in-the-target-group.) | `GET /api/v1/hubs/{hub}/groups/{group}/users/{user}` | -| [Add a user to the target group.](#put-add-a-user-to-the-target-group.) | `PUT /api/v1/hubs/{hub}/groups/{group}/users/{user}` | -| [Remove a user from the target group.](#delete-remove-a-user-from-the-target-group.) | `DELETE /api/v1/hubs/{hub}/groups/{group}/users/{user}` | -| [Remove a user from all groups.](#delete-remove-a-user-from-all-groups.) | `DELETE /api/v1/hubs/{hub}/users/{user}/groups` | - - -### Broadcast a message to all clients connected to target hub. - -`POST /api/v1/hubs/{hub}` -##### Parameters - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| hub | path | Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. | Yes | string | -| excluded | query | Excluded connection Ids | No | [ string ] | - -##### Responses - -| Code | Description | -| ---- | ----------- | -| 202 | Success | -| 400 | Bad Request | - - -### Broadcast a message to all clients belong to the target user. - -`POST /api/v1/hubs/{hub}/users/{id}` -##### Parameters - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| hub | path | Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. | Yes | string | -| id | path | The user Id. | Yes | string | - -##### Responses - -| Code | Description | -| ---- | ----------- | -| 202 | Success | -| 400 | Bad Request | - - -### Send message to the specific connection. - -`POST /api/v1/hubs/{hub}/connections/{connectionId}` -##### Parameters - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| hub | path | Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. | Yes | string | -| connectionId | path | The connection Id. | Yes | string | - -##### Responses - -| Code | Description | -| ---- | ----------- | -| 202 | Success | -| 400 | Bad Request | - - -### Check if the connection with the given connectionId exists - -`GET /api/v1/hubs/{hub}/connections/{connectionId}` -##### Parameters - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| hub | path | | Yes | string | -| connectionId | path | | Yes | string | - -##### Responses - -| Code | Description | -| ---- | ----------- | -| 200 | Success | -| 400 | Bad Request | -| 404 | Not Found | - - -### Close the client connection - -`DELETE /api/v1/hubs/{hub}/connections/{connectionId}` -##### Parameters - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| hub | path | | Yes | string | -| connectionId | path | | Yes | string | -| reason | query | | No | string | - -##### Responses - -| Code | Description | -| ---- | ----------- | -| 202 | Success | -| 400 | Bad Request | - - -### Broadcast a message to all clients within the target group. - -`POST /api/v1/hubs/{hub}/groups/{group}` -##### Parameters - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| hub | path | Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. | Yes | string | -| group | path | Target group name, which length should be greater than 0 and less than 1025. | Yes | string | -| excluded | query | Excluded connection Ids | No | [ string ] | - -##### Responses - -| Code | Description | -| ---- | ----------- | -| 202 | Success | -| 400 | Bad Request | - - -### Check if there are any client connections inside the given group - -`GET /api/v1/hubs/{hub}/groups/{group}` -##### Parameters - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| hub | path | | Yes | string | -| group | path | | Yes | string | - -##### Responses - -| Code | Description | -| ---- | ----------- | -| 200 | Success | -| 400 | Bad Request | -| 404 | Not Found | - - -### Check if there are any client connections connected for the given user - -`GET /api/v1/hubs/{hub}/users/{user}` -##### Parameters - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| hub | path | | Yes | string | -| user | path | | Yes | string | - -##### Responses - -| Code | Description | -| ---- | ----------- | -| 200 | Success | -| 400 | Bad Request | -| 404 | Not Found | - - -### Add a connection to the target group. - -`PUT /api/v1/hubs/{hub}/groups/{group}/connections/{connectionId}` -##### Parameters - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| hub | path | Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. | Yes | string | -| group | path | Target group name, which length should be greater than 0 and less than 1025. | Yes | string | -| connectionId | path | Target connection Id | Yes | string | - -##### Responses - -| Code | Description | -| ---- | ----------- | -| 200 | Success | -| 400 | Bad Request | -| 404 | Not Found | - - -### Remove a connection from the target group. - -`DELETE /api/v1/hubs/{hub}/groups/{group}/connections/{connectionId}` -##### Parameters - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| hub | path | Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. | Yes | string | -| group | path | Target group name, which length should be greater than 0 and less than 1025. | Yes | string | -| connectionId | path | Target connection Id | Yes | string | - -##### Responses - -| Code | Description | -| ---- | ----------- | -| 200 | Success | -| 400 | Bad Request | -| 404 | Not Found | - - -### Check whether a user exists in the target group. - -`GET /api/v1/hubs/{hub}/groups/{group}/users/{user}` -##### Parameters - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| hub | path | Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. | Yes | string | -| group | path | Target group name, which length should be greater than 0 and less than 1025. | Yes | string | -| user | path | Target user Id | Yes | string | - -##### Responses - -| Code | Description | -| ---- | ----------- | -| 200 | Success | -| 400 | Bad Request | -| 404 | Not Found | - - -### Add a user to the target group. - -`PUT /api/v1/hubs/{hub}/groups/{group}/users/{user}` -##### Parameters - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| hub | path | Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. | Yes | string | -| group | path | Target group name, which length should be greater than 0 and less than 1025. | Yes | string | -| user | path | Target user Id | Yes | string | -| ttl | query | Specifies the seconds that the user exists in the group. If not set, the user lives in the group for at most 1 year. | No | integer | - -##### Responses - -| Code | Description | -| ---- | ----------- | -| 202 | Success | -| 400 | Bad Request | - - -### Remove a user from the target group. - -`DELETE /api/v1/hubs/{hub}/groups/{group}/users/{user}` -##### Parameters - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| hub | path | Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. | Yes | string | -| group | path | Target group name, which length should be greater than 0 and less than 1025. | Yes | string | -| user | path | Target user Id | Yes | string | - -##### Responses - -| Code | Description | -| ---- | ----------- | -| 202 | Success | -| 400 | Bad Request | - - -### Remove a user from all groups. - -`DELETE /api/v1/hubs/{hub}/users/{user}/groups` -##### Parameters - -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ---- | -| hub | path | Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. | Yes | string | -| user | path | Target user Id | Yes | string | - -##### Responses - -| Code | Description | -| ---- | ----------- | -| 200 | The user is deleted | -| 202 | The delete request is accepted and service is handling the request int the background | -| 400 | Bad Request | - -### Models - - -#### PayloadMessage - -| Name | Type | Description | Required | -| ---- | ---- | ----------- | -------- | -| Target | string | | No | -| Arguments | [ object ] | | No | +This article has been moved to [here](https://docs.microsoft.com/azure/azure-signalr/swagger/signalr-data-plane-rest-v1) From 3616e9845c27f6af800d92b813a75f9b5233e4e9 Mon Sep 17 00:00:00 2001 From: "Liangying.Wei" Date: Tue, 28 Jun 2022 10:59:15 +0800 Subject: [PATCH 4/5] When it is NotActive no need to log error (#1631) --- .../ServerConnections/ServiceConnection.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Microsoft.Azure.SignalR/ServerConnections/ServiceConnection.cs b/src/Microsoft.Azure.SignalR/ServerConnections/ServiceConnection.cs index e766c8f35..8273472bc 100644 --- a/src/Microsoft.Azure.SignalR/ServerConnections/ServiceConnection.cs +++ b/src/Microsoft.Azure.SignalR/ServerConnections/ServiceConnection.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Connections; using Microsoft.AspNetCore.Http; +using Microsoft.Azure.SignalR.Common; using Microsoft.Azure.SignalR.Protocol; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Primitives; @@ -337,6 +338,11 @@ private async Task ProcessOutgoingMessagesAsync(ClientConnectionContext connecti // Forward the message to the service await WriteAsync(new ConnectionDataMessage(connection.ConnectionId, buffer)); } + catch (ServiceConnectionNotActiveException) + { + // Service connection not active means the transport layer for this connection is closed, no need to continue processing + break; + } catch (Exception ex) { Log.ErrorSendingMessage(Logger, ex); From 0ac1694f3a72b96acdf121506348bfd03fc100cb Mon Sep 17 00:00:00 2001 From: "Liangying.Wei" Date: Tue, 28 Jun 2022 13:25:28 +0800 Subject: [PATCH 5/5] Update version.props (#1634) --- version.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.props b/version.props index 30b43161b..89eb1124c 100644 --- a/version.props +++ b/version.props @@ -1,6 +1,6 @@ - 1.18.0 + 1.18.1 preview1 $(VersionPrefix) $(VersionPrefix)-$(VersionSuffix)-final