@fluidframework/azure-end-to-end-tests 1.1.0 → 1.2.0-106934
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/test/AzureClientFactory.js +3 -2
- package/dist/test/AzureClientFactory.js.map +1 -1
- package/dist/test/AzureTokenFactory.js +21 -7
- package/dist/test/AzureTokenFactory.js.map +1 -1
- package/package.json +5 -5
- package/src/packageVersion.ts +1 -1
- package/src/test/AzureClientFactory.ts +3 -2
- package/src/test/AzureTokenFactory.ts +19 -12
package/dist/packageVersion.js
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.pkgVersion = exports.pkgName = void 0;
|
|
10
10
|
exports.pkgName = "@fluidframework/azure-end-to-end-tests";
|
|
11
|
-
exports.pkgVersion = "1.
|
|
11
|
+
exports.pkgVersion = "1.2.0-106934";
|
|
12
12
|
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,wCAAwC,CAAC;AACnD,QAAA,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,wCAAwC,CAAC;AACnD,QAAA,UAAU,GAAG,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/azure-end-to-end-tests\";\nexport const pkgVersion = \"1.2.0-106934\";\n"]}
|
|
@@ -22,14 +22,15 @@ function createAzureClient(userID, userName) {
|
|
|
22
22
|
id: userID !== null && userID !== void 0 ? userID : (0, uuid_1.v4)(),
|
|
23
23
|
name: userName !== null && userName !== void 0 ? userName : (0, uuid_1.v4)(),
|
|
24
24
|
};
|
|
25
|
+
const endPoint = process.env.azure__fluid__relay__service__endpoint;
|
|
25
26
|
// use AzureClient remote mode will run against live Azure Fluid Relay.
|
|
26
27
|
// Default to running Tinylicious for PR validation
|
|
27
28
|
// and local testing so it's not hindered by service availability
|
|
28
29
|
const connectionProps = useAzure
|
|
29
30
|
? {
|
|
30
31
|
tenantId,
|
|
31
|
-
tokenProvider: (0, AzureTokenFactory_1.createAzureTokenProvider)(userID, userName),
|
|
32
|
-
endpoint: "https://alfred.westus2.fluidrelay.azure.com",
|
|
32
|
+
tokenProvider: (0, AzureTokenFactory_1.createAzureTokenProvider)(userID !== null && userID !== void 0 ? userID : "foo", userName !== null && userName !== void 0 ? userName : "bar"),
|
|
33
|
+
endpoint: endPoint !== null && endPoint !== void 0 ? endPoint : "https://alfred.westus2.fluidrelay.azure.com",
|
|
33
34
|
type: "remote",
|
|
34
35
|
}
|
|
35
36
|
: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AzureClientFactory.js","sourceRoot":"","sources":["../../src/test/AzureClientFactory.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,+BAAkC;AAElC,+DAIsC;AACtC,yEAA0E;AAE1E,2DAA+D;AAE/D;;;GAGG;AACH,SAAgB,iBAAiB,CAAC,MAAe,EAAE,QAAiB;IAChE,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,KAAK,OAAO,CAAC;IACtD,MAAM,QAAQ,GAAG,QAAQ;QACrB,CAAC,CAAE,OAAO,CAAC,GAAG,CAAC,sCAAiD;QAChE,CAAC,CAAC,mBAAmB,CAAC;IAC1B,MAAM,IAAI,GAAG;QACT,EAAE,EAAE,MAAM,aAAN,MAAM,cA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AuB;YACjC,IAAI,EAAE,OAAO;SAChB,CAAC;IACR,OAAO,IAAI,0BAAW,CAAC,EAAE,UAAU,EAAE,eAAe,EAAE,CAAC,CAAC;AAC5D,CAAC;AA3BD,8CA2BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { v4 as uuid } from \"uuid\";\n\nimport {\n AzureClient,\n AzureLocalConnectionConfig,\n AzureRemoteConnectionConfig,\n} from \"@fluidframework/azure-client\";\nimport { InsecureTokenProvider } from \"@fluidframework/test-client-utils\";\n\nimport { createAzureTokenProvider } from \"./AzureTokenFactory\";\n\n/**\n * This function will determine if local or remote mode is required (based on FLUID_CLIENT), and return a new\n * {@link AzureClient} instance based on the mode by setting the Connection config accordingly.\n */\nexport function createAzureClient(userID?: string, userName?: string): AzureClient {\n const useAzure = process.env.FLUID_CLIENT === \"azure\";\n const tenantId = useAzure\n ? (process.env.azure__fluid__relay__service__tenantId as string)\n : \"frs-client-tenant\";\n const user = {\n id: userID ?? uuid(),\n name: userName ?? uuid(),\n };\n const endPoint = process.env.azure__fluid__relay__service__endpoint as string;\n\n // use AzureClient remote mode will run against live Azure Fluid Relay.\n // Default to running Tinylicious for PR validation\n // and local testing so it's not hindered by service availability\n const connectionProps: AzureRemoteConnectionConfig | AzureLocalConnectionConfig = useAzure\n ? {\n tenantId,\n tokenProvider: createAzureTokenProvider(userID ?? \"foo\", userName ?? \"bar\"),\n endpoint: endPoint ?? \"https://alfred.westus2.fluidrelay.azure.com\",\n type: \"remote\",\n }\n : {\n tokenProvider: new InsecureTokenProvider(\"fooBar\", user),\n endpoint: \"http://localhost:7071\",\n type: \"local\",\n };\n return new AzureClient({ connection: connectionProps });\n}\n"]}
|
|
@@ -1,17 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createAzureTokenProvider = void 0;
|
|
2
4
|
/*!
|
|
3
5
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
6
|
* Licensed under the MIT License.
|
|
5
7
|
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.createAzureTokenProvider = void 0;
|
|
8
8
|
const azure_client_1 = require("@fluidframework/azure-client");
|
|
9
|
-
|
|
9
|
+
const test_client_utils_1 = require("@fluidframework/test-client-utils");
|
|
10
|
+
function createAzureTokenProvider(userId, userName) {
|
|
10
11
|
const fnUrl = process.env.azure__fluid__relay__service__function__url;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const key = process.env.azure__fluid__relay__service__key;
|
|
13
|
+
if (fnUrl) {
|
|
14
|
+
return new azure_client_1.AzureFunctionTokenProvider(`${fnUrl}/api/GetFrsToken`, {
|
|
15
|
+
userId,
|
|
16
|
+
userName,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
else if (key) {
|
|
20
|
+
const userConfig = {
|
|
21
|
+
id: userId,
|
|
22
|
+
name: userName,
|
|
23
|
+
};
|
|
24
|
+
return new test_client_utils_1.InsecureTokenProvider(key, userConfig);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
throw new Error("Cannot create token provider.");
|
|
28
|
+
}
|
|
15
29
|
}
|
|
16
30
|
exports.createAzureTokenProvider = createAzureTokenProvider;
|
|
17
31
|
//# sourceMappingURL=AzureTokenFactory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AzureTokenFactory.js","sourceRoot":"","sources":["../../src/test/AzureTokenFactory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AzureTokenFactory.js","sourceRoot":"","sources":["../../src/test/AzureTokenFactory.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,+DAA0F;AAC1F,yEAA0E;AAE1E,SAAgB,wBAAwB,CAAC,MAAc,EAAE,QAAgB;IACrE,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,2CAAqD,CAAC;IAChF,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,iCAA2C,CAAC;IAEpE,IAAI,KAAK,EAAE;QACP,OAAO,IAAI,yCAA0B,CAAC,GAAG,KAAK,kBAAkB,EAAE;YAC9D,MAAM;YACN,QAAQ;SACX,CAAC,CAAC;KACN;SAAM,IAAI,GAAG,EAAE;QACZ,MAAM,UAAU,GAAG;YACf,EAAE,EAAE,MAAM;YACV,IAAI,EAAE,QAAQ;SACjB,CAAC;QACF,OAAO,IAAI,yCAAqB,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;KACrD;SAAM;QACH,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;KACpD;AACL,CAAC;AAlBD,4DAkBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { AzureFunctionTokenProvider, ITokenProvider } from \"@fluidframework/azure-client\";\nimport { InsecureTokenProvider } from \"@fluidframework/test-client-utils\";\n\nexport function createAzureTokenProvider(userId: string, userName: string): ITokenProvider {\n const fnUrl = process.env.azure__fluid__relay__service__function__url as string;\n const key = process.env.azure__fluid__relay__service__key as string;\n\n if (fnUrl) {\n return new AzureFunctionTokenProvider(`${fnUrl}/api/GetFrsToken`, {\n userId,\n userName,\n });\n } else if (key) {\n const userConfig = {\n id: userId,\n name: userName,\n };\n return new InsecureTokenProvider(key, userConfig);\n } else {\n throw new Error(\"Cannot create token provider.\");\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/azure-end-to-end-tests",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0-106934",
|
|
4
4
|
"description": "Azure client end to end tests",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@fluidframework/aqueduct": "^1.3.0",
|
|
59
|
-
"@fluidframework/azure-client": "
|
|
59
|
+
"@fluidframework/azure-client": "1.2.0-106934",
|
|
60
60
|
"@fluidframework/container-definitions": "^1.3.0",
|
|
61
61
|
"@fluidframework/core-interfaces": "^1.3.0",
|
|
62
62
|
"@fluidframework/counter": "^1.3.0",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"@fluidframework/sequence": "^1.3.0",
|
|
68
68
|
"@fluidframework/server-services-client": "^0.1036.5000",
|
|
69
69
|
"@fluidframework/telemetry-utils": "^1.3.0",
|
|
70
|
-
"@fluidframework/test-client-utils": "
|
|
70
|
+
"@fluidframework/test-client-utils": "1.4.0-106438",
|
|
71
71
|
"@fluidframework/test-runtime-utils": "^1.3.0",
|
|
72
72
|
"@fluidframework/test-utils": "^1.3.0",
|
|
73
73
|
"cross-env": "^7.0.2",
|
|
@@ -79,8 +79,8 @@
|
|
|
79
79
|
"uuid": "^8.3.1"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
|
-
"@fluidframework/build-common": "^1.
|
|
83
|
-
"@fluidframework/eslint-config-fluid": "^1.
|
|
82
|
+
"@fluidframework/build-common": "^1.1.0",
|
|
83
|
+
"@fluidframework/eslint-config-fluid": "^1.1.0",
|
|
84
84
|
"@rushstack/eslint-config": "^2.5.1",
|
|
85
85
|
"@types/mocha": "^9.1.1",
|
|
86
86
|
"@types/nock": "^9.3.0",
|
package/src/packageVersion.ts
CHANGED
|
@@ -26,6 +26,7 @@ export function createAzureClient(userID?: string, userName?: string): AzureClie
|
|
|
26
26
|
id: userID ?? uuid(),
|
|
27
27
|
name: userName ?? uuid(),
|
|
28
28
|
};
|
|
29
|
+
const endPoint = process.env.azure__fluid__relay__service__endpoint as string;
|
|
29
30
|
|
|
30
31
|
// use AzureClient remote mode will run against live Azure Fluid Relay.
|
|
31
32
|
// Default to running Tinylicious for PR validation
|
|
@@ -33,8 +34,8 @@ export function createAzureClient(userID?: string, userName?: string): AzureClie
|
|
|
33
34
|
const connectionProps: AzureRemoteConnectionConfig | AzureLocalConnectionConfig = useAzure
|
|
34
35
|
? {
|
|
35
36
|
tenantId,
|
|
36
|
-
tokenProvider: createAzureTokenProvider(userID, userName),
|
|
37
|
-
endpoint: "https://alfred.westus2.fluidrelay.azure.com",
|
|
37
|
+
tokenProvider: createAzureTokenProvider(userID ?? "foo", userName ?? "bar"),
|
|
38
|
+
endpoint: endPoint ?? "https://alfred.westus2.fluidrelay.azure.com",
|
|
38
39
|
type: "remote",
|
|
39
40
|
}
|
|
40
41
|
: {
|
|
@@ -2,18 +2,25 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
+
import { AzureFunctionTokenProvider, ITokenProvider } from "@fluidframework/azure-client";
|
|
6
|
+
import { InsecureTokenProvider } from "@fluidframework/test-client-utils";
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
AzureFunctionTokenProvider
|
|
8
|
-
} from "@fluidframework/azure-client";
|
|
9
|
-
|
|
10
|
-
export function createAzureTokenProvider(
|
|
11
|
-
userID?: string,
|
|
12
|
-
userName?: string,
|
|
13
|
-
): AzureFunctionTokenProvider {
|
|
8
|
+
export function createAzureTokenProvider(userId: string, userName: string): ITokenProvider {
|
|
14
9
|
const fnUrl = process.env.azure__fluid__relay__service__function__url as string;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
const key = process.env.azure__fluid__relay__service__key as string;
|
|
11
|
+
|
|
12
|
+
if (fnUrl) {
|
|
13
|
+
return new AzureFunctionTokenProvider(`${fnUrl}/api/GetFrsToken`, {
|
|
14
|
+
userId,
|
|
15
|
+
userName,
|
|
16
|
+
});
|
|
17
|
+
} else if (key) {
|
|
18
|
+
const userConfig = {
|
|
19
|
+
id: userId,
|
|
20
|
+
name: userName,
|
|
21
|
+
};
|
|
22
|
+
return new InsecureTokenProvider(key, userConfig);
|
|
23
|
+
} else {
|
|
24
|
+
throw new Error("Cannot create token provider.");
|
|
25
|
+
}
|
|
19
26
|
}
|