This commit is contained in:
Terence Fan 2020-10-20 17:12:43 +08:00 коммит произвёл GitHub
Родитель da11b0346a
Коммит ad26a704c0
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 39 добавлений и 7 удалений

Просмотреть файл

@ -4,16 +4,48 @@ The project to provide automation E2E test on SignalR sdk and service runtime.
## How to build and run
First check the SDK version needed. Each SDKVerison will build a separate docker image and the tag is the sdk version.
```bash
# build-image.sh
declare -a SDKVersion=("1.0.0-preview1-10009" "1.0.0-preview1-10011")
declare -a SDKVersion=("1.5.0" "1.5.1")
```
### Run tests for Server SDK
```bash
./build-image.sh
./build-sdk-image.sh
```
Then you can run the test with Azure SignalR Service
```bash
docker run -e Azure__SignalR__ConnectionString="<your connection string>" signalr-test:<sdk version>
docker run -e Azure__SignalR__ConnectionString="<your connection string>" signalr-test:<sdk version>
```
#### Run tests with app server AAD Auth
This test case is for a specific scenario, in which our customer used AAD Auth to authenticate their incoming requests.
Our SDK will simply pass most of the claims in the given JWT Token (for accessing their app server) to the newly generated JWT Token (for connecting to our service).
However, there are still some internal claims that will not be passed.
This test is to check if any of these unpassed claims will cause problems while connecting to ASRS.
```bash
docker run -e Azure__SignalR__ConnectionString="<your connection string>" -e signalr-test:<sdk version> -e clientId="<clientId>" -e clientSecret="<clientSecret>" -e tenantId="<tenantId>" run-server-aad.sh
```
> The `clientId`, `clientSecret`, `tenantId` here could be any valid [AAD Application](https://ms.portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps).
### Run tests for Management SDK
```bash
./build-management-image.sh
```
Then you can run the test with Azure SignalR Service
```bash
docker run -e Azure__SignalR__ConnectionString="<your connection string>" signalr-management-sdk-test:<sdk version>
```
## How to upload images to private container registry

Просмотреть файл

@ -47,4 +47,4 @@
"tslib": "^1.9.3",
"typescript": "^2.9.0"
}
}
}

Просмотреть файл

@ -13,9 +13,9 @@
"environmentVariables": {
"clientSecret": "gWq=wErBFjDA.HkhSteqx--44CsRg4Z4",
"clientId": "7421186e-2541-48ca-ac95-9065858b11a5",
"SERVER_AAD": "1",
"Azure__SignalR__ConnectionString": "Endpoint=https://azure-signalr-sdk-e2e-test.service.signalr.net;AccessKey=eG5PtBhU/TRF/p9YbusQ+6KvZqg5v9OBzqaw13ojR28=;Version=1.0;",
"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47",
"connect-with-aad": "1",
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://localhost:5000/"

Просмотреть файл

@ -43,7 +43,7 @@ namespace Microsoft.Azure.SignalR.Test.Server
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddJwtBearer(option =>
{
var tenantId = Environment.GetEnvironmentVariable("tenantId") ?? "";
var tenantId = Environment.GetEnvironmentVariable("tenantId") ?? throw new ArgumentNullException();
option.Authority = $"https://login.microsoftonline.com/{tenantId}";
option.TokenValidationParameters = new TokenValidationParameters