@microsoft/windows-admin-center-sdk 6.0.0 → 6.1.0
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/3rdPartyDisclosure.html +10 -13
- package/README.md +110 -33
- package/angular/fesm2022/msft-sme-angular.mjs +1235 -1213
- package/angular/fesm2022/msft-sme-angular.mjs.map +1 -1
- package/angular/index.d.ts +29 -14
- package/angular/package.json +1 -1
- package/core/azure/azure-manager.d.ts +15 -3
- package/core/azure/azure-manager.d.ts.map +1 -1
- package/core/azure/azure-manager.js +29 -10
- package/core/azure/azure-manager.js.map +1 -1
- package/core/azure/models/aadAppConfig-data.d.ts +16 -0
- package/core/azure/models/aadAppConfig-data.d.ts.map +1 -1
- package/core/azure/models/aadAppConfig-data.js.map +1 -1
- package/core/base/environment.d.ts +1 -1
- package/core/base/environment.d.ts.map +1 -1
- package/core/base/environment.js.map +1 -1
- package/core/base/utilities.d.ts +10 -2
- package/core/base/utilities.d.ts.map +1 -1
- package/core/base/utilities.js +45 -25
- package/core/base/utilities.js.map +1 -1
- package/core/data/gateway-connection.d.ts.map +1 -1
- package/core/data/gateway-connection.js +1 -0
- package/core/data/gateway-connection.js.map +1 -1
- package/core/diagnostics/sme-web-telemetry.d.ts +17 -1
- package/core/diagnostics/sme-web-telemetry.d.ts.map +1 -1
- package/core/diagnostics/sme-web-telemetry.js +16 -0
- package/core/diagnostics/sme-web-telemetry.js.map +1 -1
- package/core/enterprise/enterprise-models.d.ts +10 -4
- package/core/enterprise/enterprise-models.d.ts.map +1 -1
- package/core/enterprise/enterprise-models.js +9 -4
- package/core/enterprise/enterprise-models.js.map +1 -1
- package/core/index.d.ts +5 -3
- package/core/index.d.ts.map +1 -1
- package/core/index.js +2 -1
- package/core/index.js.map +1 -1
- package/core/manifest/environment-modules.d.ts +2 -2
- package/core/manifest/environment-modules.d.ts.map +1 -1
- package/core/manifest/environment-modules.js.map +1 -1
- package/core/manifest/gateway-url-validator.d.ts +17 -0
- package/core/manifest/gateway-url-validator.d.ts.map +1 -0
- package/core/manifest/gateway-url-validator.js +56 -0
- package/core/manifest/gateway-url-validator.js.map +1 -0
- package/core/manifest/manifest-loader.d.ts +47 -11
- package/core/manifest/manifest-loader.d.ts.map +1 -1
- package/core/manifest/manifest-loader.js +141 -72
- package/core/manifest/manifest-loader.js.map +1 -1
- package/core/manifest/module-schema.json +1 -1
- package/core/performance/performance-tracker.d.ts +2 -0
- package/core/performance/performance-tracker.d.ts.map +1 -1
- package/core/performance/performance-tracker.js +18 -0
- package/core/performance/performance-tracker.js.map +1 -1
- package/core/rpc/azure/rpc-azure-model.d.ts +19 -1
- package/core/rpc/azure/rpc-azure-model.d.ts.map +1 -1
- package/core/rpc/azure/rpc-azure-model.js.map +1 -1
- package/core/rpc/forward/rpc-forward-auto-client.d.ts +5 -0
- package/core/rpc/forward/rpc-forward-auto-client.d.ts.map +1 -1
- package/core/rpc/forward/rpc-forward-auto-client.js +13 -0
- package/core/rpc/forward/rpc-forward-auto-client.js.map +1 -1
- package/core/rpc/resource-data-changed/rpc-resource-data-changed-client.d.ts +16 -0
- package/core/rpc/resource-data-changed/rpc-resource-data-changed-client.d.ts.map +1 -0
- package/core/rpc/resource-data-changed/rpc-resource-data-changed-client.js +18 -0
- package/core/rpc/resource-data-changed/rpc-resource-data-changed-client.js.map +1 -0
- package/core/rpc/resource-data-changed/rpc-resource-data-changed-handler.d.ts +8 -0
- package/core/rpc/resource-data-changed/rpc-resource-data-changed-handler.d.ts.map +1 -0
- package/core/rpc/resource-data-changed/rpc-resource-data-changed-handler.js +2 -0
- package/core/rpc/resource-data-changed/rpc-resource-data-changed-handler.js.map +1 -0
- package/core/rpc/resource-data-changed/rpc-resource-data-changed-model.d.ts +18 -0
- package/core/rpc/resource-data-changed/rpc-resource-data-changed-model.d.ts.map +1 -0
- package/core/rpc/resource-data-changed/rpc-resource-data-changed-model.js +8 -0
- package/core/rpc/resource-data-changed/rpc-resource-data-changed-model.js.map +1 -0
- package/core/rpc/resource-data-changed/rpc-resource-data-changed-subject-server.d.ts +27 -0
- package/core/rpc/resource-data-changed/rpc-resource-data-changed-subject-server.d.ts.map +1 -0
- package/core/rpc/resource-data-changed/rpc-resource-data-changed-subject-server.js +23 -0
- package/core/rpc/resource-data-changed/rpc-resource-data-changed-subject-server.js.map +1 -0
- package/core/rpc/rpc-forwarder.d.ts +16 -2
- package/core/rpc/rpc-forwarder.d.ts.map +1 -1
- package/core/rpc/rpc-forwarder.js +50 -6
- package/core/rpc/rpc-forwarder.js.map +1 -1
- package/core/security/authorization-manager.d.ts +126 -4
- package/core/security/authorization-manager.d.ts.map +1 -1
- package/core/security/authorization-manager.js +381 -49
- package/core/security/authorization-manager.js.map +1 -1
- package/core/security/connection-manager.d.ts +2 -1
- package/core/security/connection-manager.d.ts.map +1 -1
- package/core/security/connection-manager.js +10 -6
- package/core/security/connection-manager.js.map +1 -1
- package/core/security/tool-condition-validator.d.ts +8 -3
- package/core/security/tool-condition-validator.d.ts.map +1 -1
- package/core/security/tool-condition-validator.js +43 -28
- package/core/security/tool-condition-validator.js.map +1 -1
- package/core/version.js +1 -1
- package/core/version.js.map +1 -1
- package/core/virtualization/virtualization-client.d.ts +47 -78
- package/core/virtualization/virtualization-client.d.ts.map +1 -1
- package/core/virtualization/virtualization-client.js +57 -77
- package/core/virtualization/virtualization-client.js.map +1 -1
- package/core/virtualization/virtualization-models.d.ts +9 -8
- package/core/virtualization/virtualization-models.d.ts.map +1 -1
- package/core/virtualization/virtualization-models.js +7 -5
- package/core/virtualization/virtualization-models.js.map +1 -1
- package/core/virtualization/virtualization-unavailable-error.d.ts +1 -1
- package/core/virtualization/virtualization-unavailable-error.js +1 -1
- package/core/virtualization/virtualization-unavailable-error.js.map +1 -1
- package/package.json +12 -17
- package/{react-sdk-core → react}/hooks/useAppContextInit.d.ts +2 -0
- package/react/hooks/useAppContextInit.d.ts.map +1 -0
- package/{react-sdk-core → react}/hooks/useAppContextInit.js +18 -2
- package/{react-sdk-core → react}/index.js +1 -1
- package/react/services/BaseNavigationService.d.ts.map +1 -0
- package/{react-sdk-core → react}/services/BaseNavigationService.js +4 -0
- package/{react-sdk-core → react}/version.d.ts.map +1 -1
- package/react/version.js +3 -0
- package/{react-sdk-core → react}/vite/smeCoreStringsPlugin.d.ts +1 -1
- package/{react-sdk-core → react}/vite/smeCoreStringsPlugin.js +1 -1
- package/{react-sdk-core → react}/vite/smeManifestResourcesPlugin.d.ts +1 -1
- package/{react-sdk-core → react}/vite/smeManifestResourcesPlugin.js +1 -1
- package/{react-sdk-core → react}/vite/smePowerShellPlugin.d.ts +1 -1
- package/{react-sdk-core → react}/vite/smePowerShellPlugin.js +1 -1
- package/styles/css/main-v2.css +1 -1
- package/styles/package.json +1 -1
- package/wac-cli/dist/angular20/configs/ci-build-yml-config.js +3 -2
- package/wac-cli/dist/angular20/configs/ci-build-yml-config.js.map +1 -1
- package/wac-cli/dist/angular20/upgrader/nvmrc-engines-upgrader.js +2 -2
- package/wac-cli/dist/create-react/main.js +3 -2
- package/wac-cli/dist/create-react/main.js.map +1 -1
- package/wac-cli/module-template/build/pipelines/ci-build.yml +2 -2
- package/wac-cli/module-template/build/pipelines/pull-request.yml +2 -2
- package/wac-cli/templates/internal/main.ts +2 -2
- package/wac-cli/templates/internal/package.json +26 -14
- package/wac-cli/templates/react-template/package.json +3 -2
- package/wac-cli/templates/react-template/src/App.tsx +1 -1
- package/wac-cli/templates/react-template/src/hooks/useServicesData.ts +1 -1
- package/wac-cli/templates/react-template/vite.config.ts +1 -1
- package/wac-cli/templates/wac-template/angular.json +8 -13
- package/wac-cli/templates/wac-template/package.json +26 -14
- package/wac-cli/templates/wac-template/src/main.ts +2 -2
- package/react-sdk-core/hooks/useAppContextInit.d.ts.map +0 -1
- package/react-sdk-core/services/BaseNavigationService.d.ts.map +0 -1
- package/react-sdk-core/version.js +0 -3
- /package/{react-sdk-core → react}/components/SplashScreen.d.ts +0 -0
- /package/{react-sdk-core → react}/components/SplashScreen.d.ts.map +0 -0
- /package/{react-sdk-core → react}/components/SplashScreen.js +0 -0
- /package/{react-sdk-core → react}/context/AppContextProvider.d.ts +0 -0
- /package/{react-sdk-core → react}/context/AppContextProvider.d.ts.map +0 -0
- /package/{react-sdk-core → react}/context/AppContextProvider.js +0 -0
- /package/{react-sdk-core → react}/hooks/useAppContext.d.ts +0 -0
- /package/{react-sdk-core → react}/hooks/useAppContext.d.ts.map +0 -0
- /package/{react-sdk-core → react}/hooks/useAppContext.js +0 -0
- /package/{react-sdk-core → react}/hooks/useSkeletonStyles.d.ts +0 -0
- /package/{react-sdk-core → react}/hooks/useSkeletonStyles.d.ts.map +0 -0
- /package/{react-sdk-core → react}/hooks/useSkeletonStyles.js +0 -0
- /package/{react-sdk-core → react}/hooks/useWacTheme.d.ts +0 -0
- /package/{react-sdk-core → react}/hooks/useWacTheme.d.ts.map +0 -0
- /package/{react-sdk-core → react}/hooks/useWacTheme.js +0 -0
- /package/{react-sdk-core → react}/index.d.ts +0 -0
- /package/{react-sdk-core → react}/index.d.ts.map +0 -0
- /package/{react-sdk-core → react}/services/AppContextService.d.ts +0 -0
- /package/{react-sdk-core → react}/services/AppContextService.d.ts.map +0 -0
- /package/{react-sdk-core → react}/services/AppContextService.js +0 -0
- /package/{react-sdk-core → react}/services/BaseNavigationService.d.ts +0 -0
- /package/{react-sdk-core → react}/services/NavigationService.d.ts +0 -0
- /package/{react-sdk-core → react}/services/NavigationService.d.ts.map +0 -0
- /package/{react-sdk-core → react}/services/NavigationService.js +0 -0
- /package/{react-sdk-core → react}/services/Polyfills.d.ts +0 -0
- /package/{react-sdk-core → react}/services/Polyfills.d.ts.map +0 -0
- /package/{react-sdk-core → react}/services/Polyfills.js +0 -0
- /package/{react-sdk-core → react}/version.d.ts +0 -0
- /package/{react-sdk-core → react}/vite/index.d.ts +0 -0
- /package/{react-sdk-core → react}/vite/index.d.ts.map +0 -0
- /package/{react-sdk-core → react}/vite/index.js +0 -0
- /package/{react-sdk-core → react}/vite/log.d.ts +0 -0
- /package/{react-sdk-core → react}/vite/log.d.ts.map +0 -0
- /package/{react-sdk-core → react}/vite/log.js +0 -0
- /package/{react-sdk-core → react}/vite/smeCoreStringsPlugin.d.ts.map +0 -0
- /package/{react-sdk-core → react}/vite/smeManifestResourcesPlugin.d.ts.map +0 -0
- /package/{react-sdk-core → react}/vite/smePowerShellPlugin.d.ts.map +0 -0
|
@@ -123,9 +123,9 @@ export class RpcServiceForwarder {
|
|
|
123
123
|
const fromRpc = this.rpc.isShell ? 1 /* RpcRelationshipType.Child */ : 0 /* RpcRelationshipType.Parent */;
|
|
124
124
|
switch (data.type) {
|
|
125
125
|
case 2 /* RpcForwardType.Init */:
|
|
126
|
-
return this.onForwardInit();
|
|
126
|
+
return this.onForwardInit(data.sourceName);
|
|
127
127
|
case 0 /* RpcForwardType.Execute */:
|
|
128
|
-
return this.onForwardExecute(fromRpc, data.name, data.arguments);
|
|
128
|
+
return this.onForwardExecute(fromRpc, data.name, data.arguments, data.sourceName);
|
|
129
129
|
case 1 /* RpcForwardType.Notify */:
|
|
130
130
|
return this.onForwardNotify(fromRpc, data.name, data.value);
|
|
131
131
|
default: {
|
|
@@ -182,16 +182,16 @@ export class RpcServiceForwarder {
|
|
|
182
182
|
// we can only forward if the rpc is active
|
|
183
183
|
if (this.rpc.stateActive) {
|
|
184
184
|
if (to === 0 /* RpcRelationshipType.Parent */) {
|
|
185
|
-
//
|
|
185
|
+
// Only child windows have a parent RPC connection.
|
|
186
186
|
return MsftSme.isExtension();
|
|
187
187
|
}
|
|
188
188
|
else if (to === 1 /* RpcRelationshipType.Child */) {
|
|
189
|
-
//
|
|
190
|
-
// rpc.
|
|
189
|
+
// Forwarding to a child requires a ready outbound RPC connection.
|
|
190
|
+
// rpc.stateActive always reports true for the shell.
|
|
191
191
|
if (!this.rpc.rpcManager || !this.rpc.rpcManager.rpcOutbound) {
|
|
192
192
|
return false;
|
|
193
193
|
}
|
|
194
|
-
//
|
|
194
|
+
// Only a shell with child windows can forward to children.
|
|
195
195
|
return MsftSme.isShell() && window.frames.length > 0;
|
|
196
196
|
}
|
|
197
197
|
}
|
|
@@ -224,6 +224,50 @@ export class RpcServiceForwarder {
|
|
|
224
224
|
}
|
|
225
225
|
}));
|
|
226
226
|
}
|
|
227
|
+
/**
|
|
228
|
+
* Executes a method in all child frames with the given RPC name and waits for their responses.
|
|
229
|
+
*/
|
|
230
|
+
forwardExecuteToChildren(childName, name, args) {
|
|
231
|
+
if (!childName || !this.canForward(1 /* RpcRelationshipType.Child */)) {
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
const data = {
|
|
235
|
+
arguments: args,
|
|
236
|
+
name: name,
|
|
237
|
+
service: this.serviceId,
|
|
238
|
+
type: 0 /* RpcForwardType.Execute */
|
|
239
|
+
};
|
|
240
|
+
return from(RpcForwardAutoClient.forwardToChildren(this.rpc, childName, data)).pipe(map(response => {
|
|
241
|
+
if (response && response.error) {
|
|
242
|
+
throw response.error;
|
|
243
|
+
}
|
|
244
|
+
return response ? response.result : null;
|
|
245
|
+
}));
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Forwards a notification from the shell to all child frames with the given RPC name.
|
|
249
|
+
* @param childName The RPC name of the child frames to notify
|
|
250
|
+
* @param name The name of the state change
|
|
251
|
+
* @param value The new value of some state
|
|
252
|
+
* @returns an observable that completes when the state has been changed, or nothing if the message cannot be forwarded.
|
|
253
|
+
*/
|
|
254
|
+
forwardNotifyToChildren(childName, name, value) {
|
|
255
|
+
if (!childName || !this.canForward(1 /* RpcRelationshipType.Child */)) {
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
const data = {
|
|
259
|
+
value: value,
|
|
260
|
+
name: name,
|
|
261
|
+
service: this.serviceId,
|
|
262
|
+
type: 1 /* RpcForwardType.Notify */
|
|
263
|
+
};
|
|
264
|
+
return from(RpcForwardAutoClient.forwardToChildren(this.rpc, childName, data)).pipe(map(response => {
|
|
265
|
+
if (response && response.error) {
|
|
266
|
+
throw response.error;
|
|
267
|
+
}
|
|
268
|
+
return response ? response.result : null;
|
|
269
|
+
}));
|
|
270
|
+
}
|
|
227
271
|
/**
|
|
228
272
|
* Forwards a notification of some state change to the target relationship type
|
|
229
273
|
* @param to The RpcRelationshipType that this request is intended for
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-forwarder.js","sourceRoot":"","sources":["../../src/rpc/rpc-forwarder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAc,EAAE,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAqH,MAAM,6BAA6B,CAAC;AACnL,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AAIpF;;;GAGG;AACH,MAAM,OAAO,YAAY;IACb,MAAM,CAAC,yBAAyB,CAAiC;IACjE,MAAM,CAAC,KAAK,CAAmB;IAC/B,MAAM,CAAC,UAAU,GAAqC,IAAI,GAAG,EAA+B,CAAC;IAC9F,MAAM,CAAC,YAAY,CAAC,GAAQ;QAC/B,yDAAyD;QACzD,IAAI,GAAG,CAAC,WAAW,IAAI,YAAY,CAAC,KAAK,EAAE,CAAC;YACxC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC;QAED,qEAAqE;QACrE,IAAI,YAAY,CAAC,KAAK,EAAE,CAAC;YACrB,OAAO,YAAY,CAAC,KAAK,CAAC;QAC9B,CAAC;QAED,wGAAwG;QACxG,IAAI,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;YACpB,wDAAwD;YACxD,YAAY,CAAC,yBAAyB,GAAG,IAAI,yBAAyB,CAAC,GAAG,CAAC,CAAC;YAC5E,YAAY,CAAC,yBAA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,CACL,CAAC;IACN,CAAC;CACJ","sourcesContent":["import { from, Observable, of, throwError } from 'rxjs';\r\nimport { catchError, filter, map, mergeMap, take } from 'rxjs/operators';\r\nimport { Strings } from '../generated/strings';\r\nimport { RpcForwardAutoClient } from './forward/rpc-forward-auto-client';\r\nimport { RpcForwardDownKey, RpcForwardExecuteReportData, RpcForwardNotifyReportData, RpcForwardReportData, RpcForwardResponse, RpcForwardType } from './forward/rpc-forward-model';\r\nimport { RpcForwardUpSubjectServer } from './forward/rpc-forward-up-subject-server';\r\nimport { Rpc } from './rpc';\r\nimport { RpcRelationshipType } from './rpc-base';\r\n\r\n/**\r\n * RPC forwarder class.\r\n * @dynamic\r\n */\r\nexport class RpcForwarder {\r\n private static rpcForwardUpSubjectServer: RpcForwardUpSubjectServer<any>;\r\n private static ready: Observable<void>;\r\n private static forwardMap: Map<string, RpcServiceForwarder> = new Map<string, RpcServiceForwarder>();\r\n public static waitForReady(rpc: Rpc) {\r\n // if we are ready to forward, just return an observable.\r\n if (rpc.stateActive && RpcForwarder.ready) {\r\n return of(null);\r\n }\r\n\r\n // if we are already waiting for the rpc, then return that observable\r\n if (RpcForwarder.ready) {\r\n return RpcForwarder.ready;\r\n }\r\n\r\n // if we are not ready to forward, then set up forwarding based on our window type and current rpc state\r\n if (MsftSme.isShell()) {\r\n // If we are shell then setup the the rpc subject server\r\n RpcForwarder.rpcForwardUpSubjectServer = new RpcForwardUpSubjectServer(rpc);\r\n RpcForwarder.rpcForwardUpSubjectServer.subject.subscribe(data => {\r\n RpcForwarder.onForwardReceived(data.data).then(data.deferred.resolve, data.deferred.reject);\r\n });\r\n } else {\r\n if (!rpc.stateActive) {\r\n // return the first rpc state change that sets the state to active.\r\n // then register our rpc command before returning\r\n RpcForwarder.ready = rpc.stateChanged.pipe(\r\n filter(active => active),\r\n take(1),\r\n map(() => rpc.register(RpcForwardDownKey.command, RpcForwarder.onForwardReceived))\r\n );\r\n return RpcForwarder.ready;\r\n } else {\r\n // If we are not shell, then setup rpc registration for forwarded messages\r\n rpc.register(RpcForwardDownKey.command, RpcForwarder.onForwardReceived);\r\n }\r\n }\r\n\r\n RpcForwarder.ready = of(null);\r\n return RpcForwarder.ready;\r\n }\r\n\r\n public static register(serviceId: string, forwarder: RpcServiceForwarder): void {\r\n // throw an error if the service has already been registered\r\n if (RpcForwarder.forwardMap.has(serviceId)) {\r\n const message = MsftSme.getStrings<Strings>().MsftSmeShell.Core.Error.ForwarderIdConflict.message;\r\n throw new Error(message.format(serviceId));\r\n }\r\n\r\n // register the forwarder using the serviceId\r\n RpcForwarder.forwardMap.set(serviceId, forwarder);\r\n }\r\n\r\n private static onForwardReceived(data: RpcForwardReportData): Promise<RpcForwardResponse<any>> {\r\n if (!RpcForwarder.forwardMap.has(data.service)) {\r\n const message = MsftSme.getStrings<Strings>().MsftSmeShell.Core.Error.ForwarderIdNotFound.message;\r\n return Promise.reject(message.format(data.service));\r\n } else {\r\n const target = RpcForwarder.forwardMap.get(data.service);\r\n return target\r\n .handleForwardedMessage(data)\r\n .pipe(\r\n map(result => <RpcForwardResponse<any>>{ result: result }),\r\n catchError(error => {\r\n // on error, make sure the error is serializable and return it as an observable\r\n return of({ error: RpcForwarder.ensureSerializable(error) });\r\n })\r\n )\r\n .toPromise();\r\n }\r\n }\r\n\r\n /**\r\n * Transform object into something that can be serializable by dropping\r\n * any non-serializable properties\r\n *\r\n * @param obj the object to make serializable.\r\n * @return a new object that is serializable\r\n */\r\n public static ensureSerializable(obj: any): any {\r\n const type = typeof obj;\r\n if (type === 'string' || type === 'number' || type === 'boolean') {\r\n return obj;\r\n }\r\n if (obj && type === 'object') {\r\n if (Array.isArray(obj)) {\r\n return (<Array<any>>obj).map(v => RpcForwarder.ensureSerializable(v));\r\n }\r\n\r\n const keys = Object.keys(obj);\r\n const result = {};\r\n keys.forEach(key => {\r\n result[key] = RpcForwarder.ensureSerializable(obj[key]);\r\n });\r\n return result;\r\n }\r\n\r\n // We will return null for symbol, function, null, undefined\r\n return null;\r\n }\r\n}\r\n\r\n/**\r\n * Base class to allow 2+ instances of a service to behave as one across the iframe boundary\r\n * three mechanisms are surfaced for communication:\r\n * - Execute: expects a response with data from the receiver\r\n * - Notify: expects a response with no data from the receiver just for confirmation that it was received\r\n * - Init: always called from a child instance, used to synchronize parent and child as the child starts up\r\n */\r\nexport abstract class RpcServiceForwarder {\r\n /**\r\n * Instantiates a new instance of the RpcServiceForwarder\r\n */\r\n constructor(\r\n private serviceId: string,\r\n protected rpc: Rpc\r\n ) {\r\n RpcForwarder.register(this.serviceId, this);\r\n }\r\n\r\n /**\r\n * Called when a forwarded message is received from the rpc.\r\n * @param data The RpcForwardReportData of the request\r\n * @returns an observable for the result of the request call\r\n */\r\n public handleForwardedMessage(data: RpcForwardReportData): Observable<any> {\r\n // in the future Rpc should have no knowledge of shell an module. Only child/parent.\r\n const fromRpc = this.rpc.isShell ? RpcRelationshipType.Child : RpcRelationshipType.Parent;\r\n switch (data.type) {\r\n case RpcForwardType.Init:\r\n return this.onForwardInit();\r\n case RpcForwardType.Execute:\r\n return this.onForwardExecute(fromRpc, data.name, (<RpcForwardExecuteReportData>data).arguments);\r\n case RpcForwardType.Notify:\r\n return this.onForwardNotify(fromRpc, data.name, (<RpcForwardNotifyReportData>data).value);\r\n default: {\r\n const message = MsftSme.getStrings<Strings>().MsftSmeShell.Core.Error.ForwarderUnknownType.message;\r\n return throwError(() => message.format(data.type));\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Initializes the service. The serviceReady observable is assigned to the output of this function.\r\n */\r\n public initialize(): Observable<boolean> {\r\n return RpcForwarder.waitForReady(this.rpc).pipe(\r\n mergeMap(() => {\r\n if (!this.canForward(RpcRelationshipType.Parent)) {\r\n // since we dont have a parent we can stop here\r\n return of(null);\r\n }\r\n\r\n // other wise we have a parent and should forward an init message\r\n const data: RpcForwardReportData = {\r\n service: this.serviceId,\r\n type: RpcForwardType.Init\r\n };\r\n\r\n return from(RpcForwardAutoClient.forward<any>(this.rpc, data));\r\n }),\r\n map(result => (result ? this.onForwardInitResponse(result) : null)),\r\n map(() => true),\r\n take(1)\r\n );\r\n }\r\n\r\n /**\r\n * Reinitialize the forwarded service. This should poll any important data from parents.\r\n */\r\n public reinitializeForwardedData(): Observable<void> {\r\n if (!this.canForward(RpcRelationshipType.Parent)) {\r\n // since we dont have a parent we can stop here\r\n return of(null);\r\n }\r\n\r\n // other wise we have a parent and should forward an init message\r\n const data: RpcForwardReportData = {\r\n service: this.serviceId,\r\n type: RpcForwardType.Init\r\n };\r\n\r\n return from(RpcForwardAutoClient.forward<any>(this.rpc, data)).pipe(map(result => (result ? this.onForwardInitResponse(result) : null)));\r\n }\r\n\r\n /**\r\n * Called on a child service instance when onForwardInit returns from the parent\r\n * @param data The response from the forwardInit call\r\n */\r\n protected abstract onForwardInitResponse(data: RpcForwardResponse<any>): void;\r\n\r\n /**\r\n * Called when a new instance of the service in another window is initialized and needs to synchronize with its parent\r\n * @param from The RpcRelationshipType that this request is from\r\n * @returns an observable for the all the values needed to initialize the service\r\n */\r\n protected abstract onForwardInit(): Observable<any>;\r\n\r\n /**\r\n * Called when the forwarded services counterpart wants to get data from the parent\r\n * @param from The RpcRelationshipType that this request is from\r\n * @param name The name of the method to forward to\r\n * @param args The arguments of the method\r\n * @returns an observable for the result of the method call\r\n */\r\n protected abstract onForwardExecute(from: RpcRelationshipType, name: string, args: any[]): Observable<any>;\r\n\r\n /**\r\n * Called when the forwarded services counterpart sends a notify message\r\n * @param from The RpcRelationshipType that this request is from\r\n * @param name The name of the property to change\r\n * @param value The new value of the property\r\n * @returns an observable that completes when the property has been changed.\r\n */\r\n protected abstract onForwardNotify(from: RpcRelationshipType, name: string, value: any): Observable<void>;\r\n\r\n /**\r\n * Creates an observable that errors with name not found\r\n * @returns an observable that will error with a name not found message\r\n */\r\n protected nameNotFound(name: string): Observable<any> {\r\n return throwError(() => new Error(`${name} not found in forwarded service: ${this.serviceId}`));\r\n }\r\n\r\n /**\r\n * Determines if a message can be forwarded to the specified RpcRelationshipType\r\n * @param to The RpcRelationshipType that needs to be checked\r\n * @returns true if messages can be forwarded to the specified RpcRelationshipType\r\n */\r\n protected canForward(to: RpcRelationshipType) {\r\n // we can only forward if the rpc is active\r\n if (this.rpc.stateActive) {\r\n if (to === RpcRelationshipType.Parent) {\r\n // we can only forward to parents if we are an extension window\r\n return MsftSme.isExtension();\r\n } else if (to === RpcRelationshipType.Child) {\r\n // when trying to forward to a child, we have to make sure that the rpc outbound is actually ready.\r\n // rpc.StateActive will report true always fro the shell\r\n if (!this.rpc.rpcManager || !this.rpc.rpcManager.rpcOutbound) {\r\n return false;\r\n }\r\n\r\n // we can only forward to parents if we have child windows\r\n return MsftSme.isShell() && window.frames.length > 0;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * Forwards a execution of some named method to the target relationship type\r\n * @param to The RpcRelationshipType that this request is intended for\r\n * @param name The name of the method to execute\r\n * @param value The arguments for the method\r\n * @returns an observable for the result of the method call\r\n */\r\n protected forwardExecute<T>(to: RpcRelationshipType, name: string, args: any[]): Observable<T> | void {\r\n // if we cant forward then just return\r\n if (!this.canForward(to)) {\r\n return;\r\n }\r\n\r\n const data: RpcForwardExecuteReportData = {\r\n arguments: args,\r\n name: name,\r\n service: this.serviceId,\r\n type: RpcForwardType.Execute\r\n };\r\n\r\n return from(RpcForwardAutoClient.forward<any>(this.rpc, data)).pipe(\r\n map(response => {\r\n if (response.error) {\r\n throw response.error;\r\n } else {\r\n return response.result;\r\n }\r\n })\r\n );\r\n }\r\n\r\n /**\r\n * Forwards a notification of some state change to the target relationship type\r\n * @param to The RpcRelationshipType that this request is intended for\r\n * @param name The name of the state change\r\n * @param value The new value of some state\r\n * @returns an observable that completes when the state has been changed on the target instance.\r\n */\r\n protected forwardNotify(to: RpcRelationshipType, name: string, value: any, noPrimaryFrame = false): Observable<void> | void {\r\n // if we cant forward then just return\r\n if (!noPrimaryFrame && !this.canForward(to)) {\r\n return;\r\n }\r\n\r\n const data: RpcForwardNotifyReportData = {\r\n value: value,\r\n name: name,\r\n service: this.serviceId,\r\n type: RpcForwardType.Notify\r\n };\r\n\r\n return from(RpcForwardAutoClient.forward<any>(this.rpc, data)).pipe(\r\n map(response => {\r\n if (response.error) {\r\n throw response.error;\r\n } else {\r\n return response.result;\r\n }\r\n })\r\n );\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"rpc-forwarder.js","sourceRoot":"","sources":["../../src/rpc/rpc-forwarder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAc,EAAE,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAqH,MAAM,6BAA6B,CAAC;AACnL,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AAIpF;;;GAGG;AACH,MAAM,OAAO,YAAY;IACb,MAAM,CAAC,yBAAyB,CAAiC;IACjE,MAAM,CAAC,KAAK,CAAmB;IAC/B,MAAM,CAAC,UAAU,GAAqC,IAAI,GAAG,EAA+B,CAAC;IAC9F,MAAM,CAAC,YAAY,CAAC,GAAQ;QAC/B,yDAAyD;QACzD,IAAI,GAAG,CAAC,WAAW,IAAI,YAAY,CAAC,KAAK,EAAE,CAAC;YACxC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC;QAED,qEAAqE;QACrE,IAAI,YAAY,CAAC,KAAK,EAAE,CAAC;YACrB,OAAO,YAAY,CAAC,KAAK,CAAC;QAC9B,CAAC;QAED,wGAAwG;QACxG,IAAI,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;YACpB,wDAAwD;YACxD,YAAY,CAAC,yBAAyB,GAAG,IAAI,yBAAyB,CAAC,GAAG,CAAC,CAAC;YAC5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CAAC,IAAI,CAC/D,GAAG,CAAC,QAAQ,CAAC,EAAE;YACX,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;gBACjB,MAAM,QAAQ,CAAC,KAAK,CAAC;YACzB,CAAC;iBAAM,CAAC;gBACJ,OAAO,QAAQ,CAAC,MAAM,CAAC;YAC3B,CAAC;QACL,CAAC,CAAC,CACL,CAAC;IACN,CAAC;CACJ","sourcesContent":["import { from, Observable, of, throwError } from 'rxjs';\r\nimport { catchError, filter, map, mergeMap, take } from 'rxjs/operators';\r\nimport { Strings } from '../generated/strings';\r\nimport { RpcForwardAutoClient } from './forward/rpc-forward-auto-client';\r\nimport { RpcForwardDownKey, RpcForwardExecuteReportData, RpcForwardNotifyReportData, RpcForwardReportData, RpcForwardResponse, RpcForwardType } from './forward/rpc-forward-model';\r\nimport { RpcForwardUpSubjectServer } from './forward/rpc-forward-up-subject-server';\r\nimport { Rpc } from './rpc';\r\nimport { RpcBaseData, RpcRelationshipType } from './rpc-base';\r\n\r\n/**\r\n * RPC forwarder class.\r\n * @dynamic\r\n */\r\nexport class RpcForwarder {\r\n private static rpcForwardUpSubjectServer: RpcForwardUpSubjectServer<any>;\r\n private static ready: Observable<void>;\r\n private static forwardMap: Map<string, RpcServiceForwarder> = new Map<string, RpcServiceForwarder>();\r\n public static waitForReady(rpc: Rpc) {\r\n // if we are ready to forward, just return an observable.\r\n if (rpc.stateActive && RpcForwarder.ready) {\r\n return of(null);\r\n }\r\n\r\n // if we are already waiting for the rpc, then return that observable\r\n if (RpcForwarder.ready) {\r\n return RpcForwarder.ready;\r\n }\r\n\r\n // if we are not ready to forward, then set up forwarding based on our window type and current rpc state\r\n if (MsftSme.isShell()) {\r\n // If we are shell then setup the the rpc subject server\r\n RpcForwarder.rpcForwardUpSubjectServer = new RpcForwardUpSubjectServer(rpc);\r\n RpcForwarder.rpcForwardUpSubjectServer.subject.subscribe(data => {\r\n RpcForwarder.onForwardReceived(data.data).then(data.deferred.resolve, data.deferred.reject);\r\n });\r\n } else {\r\n if (!rpc.stateActive) {\r\n // return the first rpc state change that sets the state to active.\r\n // then register our rpc command before returning\r\n RpcForwarder.ready = rpc.stateChanged.pipe(\r\n filter(active => active),\r\n take(1),\r\n map(() => rpc.register(RpcForwardDownKey.command, RpcForwarder.onForwardReceived))\r\n );\r\n return RpcForwarder.ready;\r\n } else {\r\n // If we are not shell, then setup rpc registration for forwarded messages\r\n rpc.register(RpcForwardDownKey.command, RpcForwarder.onForwardReceived);\r\n }\r\n }\r\n\r\n RpcForwarder.ready = of(null);\r\n return RpcForwarder.ready;\r\n }\r\n\r\n public static register(serviceId: string, forwarder: RpcServiceForwarder): void {\r\n // throw an error if the service has already been registered\r\n if (RpcForwarder.forwardMap.has(serviceId)) {\r\n const message = MsftSme.getStrings<Strings>().MsftSmeShell.Core.Error.ForwarderIdConflict.message;\r\n throw new Error(message.format(serviceId));\r\n }\r\n\r\n // register the forwarder using the serviceId\r\n RpcForwarder.forwardMap.set(serviceId, forwarder);\r\n }\r\n\r\n private static onForwardReceived(data: RpcForwardReportData): Promise<RpcForwardResponse<any>> {\r\n if (!RpcForwarder.forwardMap.has(data.service)) {\r\n const message = MsftSme.getStrings<Strings>().MsftSmeShell.Core.Error.ForwarderIdNotFound.message;\r\n return Promise.reject(message.format(data.service));\r\n } else {\r\n const target = RpcForwarder.forwardMap.get(data.service);\r\n return target\r\n .handleForwardedMessage(data)\r\n .pipe(\r\n map(result => <RpcForwardResponse<any>>{ result: result }),\r\n catchError(error => {\r\n // on error, make sure the error is serializable and return it as an observable\r\n return of({ error: RpcForwarder.ensureSerializable(error) });\r\n })\r\n )\r\n .toPromise();\r\n }\r\n }\r\n\r\n /**\r\n * Transform object into something that can be serializable by dropping\r\n * any non-serializable properties\r\n *\r\n * @param obj the object to make serializable.\r\n * @return a new object that is serializable\r\n */\r\n public static ensureSerializable(obj: any): any {\r\n const type = typeof obj;\r\n if (type === 'string' || type === 'number' || type === 'boolean') {\r\n return obj;\r\n }\r\n if (obj && type === 'object') {\r\n if (Array.isArray(obj)) {\r\n return (<Array<any>>obj).map(v => RpcForwarder.ensureSerializable(v));\r\n }\r\n\r\n const keys = Object.keys(obj);\r\n const result = {};\r\n keys.forEach(key => {\r\n result[key] = RpcForwarder.ensureSerializable(obj[key]);\r\n });\r\n return result;\r\n }\r\n\r\n // We will return null for symbol, function, null, undefined\r\n return null;\r\n }\r\n}\r\n\r\n/**\r\n * Base class to allow 2+ instances of a service to behave as one across the iframe boundary\r\n * three mechanisms are surfaced for communication:\r\n * - Execute: expects a response with data from the receiver\r\n * - Notify: expects a response with no data from the receiver just for confirmation that it was received\r\n * - Init: always called from a child instance, used to synchronize parent and child as the child starts up\r\n */\r\nexport abstract class RpcServiceForwarder {\r\n /**\r\n * Instantiates a new instance of the RpcServiceForwarder\r\n */\r\n constructor(\r\n private serviceId: string,\r\n protected rpc: Rpc\r\n ) {\r\n RpcForwarder.register(this.serviceId, this);\r\n }\r\n\r\n /**\r\n * Called when a forwarded message is received from the rpc.\r\n * @param data The RpcForwardReportData of the request\r\n * @returns an observable for the result of the request call\r\n */\r\n public handleForwardedMessage(data: RpcForwardReportData): Observable<any> {\r\n // in the future Rpc should have no knowledge of shell an module. Only child/parent.\r\n const fromRpc = this.rpc.isShell ? RpcRelationshipType.Child : RpcRelationshipType.Parent;\r\n switch (data.type) {\r\n case RpcForwardType.Init:\r\n return this.onForwardInit((<RpcBaseData>data).sourceName);\r\n case RpcForwardType.Execute:\r\n return this.onForwardExecute(fromRpc, data.name, (<RpcForwardExecuteReportData>data).arguments, (<RpcBaseData>data).sourceName);\r\n case RpcForwardType.Notify:\r\n return this.onForwardNotify(fromRpc, data.name, (<RpcForwardNotifyReportData>data).value);\r\n default: {\r\n const message = MsftSme.getStrings<Strings>().MsftSmeShell.Core.Error.ForwarderUnknownType.message;\r\n return throwError(() => message.format(data.type));\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Initializes the service. The serviceReady observable is assigned to the output of this function.\r\n */\r\n public initialize(): Observable<boolean> {\r\n return RpcForwarder.waitForReady(this.rpc).pipe(\r\n mergeMap(() => {\r\n if (!this.canForward(RpcRelationshipType.Parent)) {\r\n // since we dont have a parent we can stop here\r\n return of(null);\r\n }\r\n\r\n // other wise we have a parent and should forward an init message\r\n const data: RpcForwardReportData = {\r\n service: this.serviceId,\r\n type: RpcForwardType.Init\r\n };\r\n\r\n return from(RpcForwardAutoClient.forward<any>(this.rpc, data));\r\n }),\r\n map(result => (result ? this.onForwardInitResponse(result) : null)),\r\n map(() => true),\r\n take(1)\r\n );\r\n }\r\n\r\n /**\r\n * Reinitialize the forwarded service. This should poll any important data from parents.\r\n */\r\n public reinitializeForwardedData(): Observable<void> {\r\n if (!this.canForward(RpcRelationshipType.Parent)) {\r\n // since we dont have a parent we can stop here\r\n return of(null);\r\n }\r\n\r\n // other wise we have a parent and should forward an init message\r\n const data: RpcForwardReportData = {\r\n service: this.serviceId,\r\n type: RpcForwardType.Init\r\n };\r\n\r\n return from(RpcForwardAutoClient.forward<any>(this.rpc, data)).pipe(map(result => (result ? this.onForwardInitResponse(result) : null)));\r\n }\r\n\r\n /**\r\n * Called on a child service instance when onForwardInit returns from the parent\r\n * @param data The response from the forwardInit call\r\n */\r\n protected abstract onForwardInitResponse(data: RpcForwardResponse<any>): void;\r\n\r\n /**\r\n * Called when a new instance of the service in another window is initialized and needs to synchronize with its parent\r\n * @param from The RpcRelationshipType that this request is from\r\n * @param sourceName The name of the remote RPC that sent the request, when known\r\n * @returns an observable for the all the values needed to initialize the service\r\n */\r\n protected abstract onForwardInit(sourceName?: string): Observable<any>;\r\n\r\n /**\r\n * Called when the forwarded services counterpart wants to get data from the parent\r\n * @param from The RpcRelationshipType that this request is from\r\n * @param name The name of the method to forward to\r\n * @param args The arguments of the method\r\n * @param sourceName The name of the remote RPC that sent the request, when known\r\n * @returns an observable for the result of the method call\r\n */\r\n protected abstract onForwardExecute(from: RpcRelationshipType, name: string, args: any[], sourceName?: string): Observable<any>;\r\n\r\n /**\r\n * Called when the forwarded services counterpart sends a notify message\r\n * @param from The RpcRelationshipType that this request is from\r\n * @param name The name of the property to change\r\n * @param value The new value of the property\r\n * @returns an observable that completes when the property has been changed.\r\n */\r\n protected abstract onForwardNotify(from: RpcRelationshipType, name: string, value: any): Observable<void>;\r\n\r\n /**\r\n * Creates an observable that errors with name not found\r\n * @returns an observable that will error with a name not found message\r\n */\r\n protected nameNotFound(name: string): Observable<any> {\r\n return throwError(() => new Error(`${name} not found in forwarded service: ${this.serviceId}`));\r\n }\r\n\r\n /**\r\n * Determines if a message can be forwarded to the specified RpcRelationshipType\r\n * @param to The RpcRelationshipType that needs to be checked\r\n * @returns true if messages can be forwarded to the specified RpcRelationshipType\r\n */\r\n protected canForward(to: RpcRelationshipType) {\r\n // we can only forward if the rpc is active\r\n if (this.rpc.stateActive) {\r\n if (to === RpcRelationshipType.Parent) {\r\n // Only child windows have a parent RPC connection.\r\n return MsftSme.isExtension();\r\n } else if (to === RpcRelationshipType.Child) {\r\n // Forwarding to a child requires a ready outbound RPC connection.\r\n // rpc.stateActive always reports true for the shell.\r\n if (!this.rpc.rpcManager || !this.rpc.rpcManager.rpcOutbound) {\r\n return false;\r\n }\r\n\r\n // Only a shell with child windows can forward to children.\r\n return MsftSme.isShell() && window.frames.length > 0;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * Forwards a execution of some named method to the target relationship type\r\n * @param to The RpcRelationshipType that this request is intended for\r\n * @param name The name of the method to execute\r\n * @param value The arguments for the method\r\n * @returns an observable for the result of the method call\r\n */\r\n protected forwardExecute<T>(to: RpcRelationshipType, name: string, args: any[]): Observable<T> | void {\r\n // if we cant forward then just return\r\n if (!this.canForward(to)) {\r\n return;\r\n }\r\n\r\n const data: RpcForwardExecuteReportData = {\r\n arguments: args,\r\n name: name,\r\n service: this.serviceId,\r\n type: RpcForwardType.Execute\r\n };\r\n\r\n return from(RpcForwardAutoClient.forward<any>(this.rpc, data)).pipe(\r\n map(response => {\r\n if (response.error) {\r\n throw response.error;\r\n } else {\r\n return response.result;\r\n }\r\n })\r\n );\r\n }\r\n\r\n /**\r\n * Executes a method in all child frames with the given RPC name and waits for their responses.\r\n */\r\n protected forwardExecuteToChildren<T>(childName: string, name: string, args: unknown[]): Observable<T> | void {\r\n if (!childName || !this.canForward(RpcRelationshipType.Child)) {\r\n return;\r\n }\r\n\r\n const data: RpcForwardExecuteReportData = {\r\n arguments: args,\r\n name: name,\r\n service: this.serviceId,\r\n type: RpcForwardType.Execute\r\n };\r\n\r\n return from(RpcForwardAutoClient.forwardToChildren<T>(this.rpc, childName, data)).pipe(\r\n map(response => {\r\n if (response && response.error) {\r\n throw response.error;\r\n }\r\n\r\n return response ? response.result : null;\r\n })\r\n );\r\n }\r\n\r\n /**\r\n * Forwards a notification from the shell to all child frames with the given RPC name.\r\n * @param childName The RPC name of the child frames to notify\r\n * @param name The name of the state change\r\n * @param value The new value of some state\r\n * @returns an observable that completes when the state has been changed, or nothing if the message cannot be forwarded.\r\n */\r\n protected forwardNotifyToChildren(childName: string, name: string, value: any): Observable<void> | void {\r\n if (!childName || !this.canForward(RpcRelationshipType.Child)) {\r\n return;\r\n }\r\n\r\n const data: RpcForwardNotifyReportData = {\r\n value: value,\r\n name: name,\r\n service: this.serviceId,\r\n type: RpcForwardType.Notify\r\n };\r\n\r\n return from(RpcForwardAutoClient.forwardToChildren<any>(this.rpc, childName, data)).pipe(\r\n map(response => {\r\n if (response && response.error) {\r\n throw response.error;\r\n }\r\n\r\n return response ? response.result : null;\r\n })\r\n );\r\n }\r\n\r\n /**\r\n * Forwards a notification of some state change to the target relationship type\r\n * @param to The RpcRelationshipType that this request is intended for\r\n * @param name The name of the state change\r\n * @param value The new value of some state\r\n * @returns an observable that completes when the state has been changed on the target instance.\r\n */\r\n protected forwardNotify(to: RpcRelationshipType, name: string, value: any, noPrimaryFrame = false): Observable<void> | void {\r\n // if we cant forward then just return\r\n if (!noPrimaryFrame && !this.canForward(to)) {\r\n return;\r\n }\r\n\r\n const data: RpcForwardNotifyReportData = {\r\n value: value,\r\n name: name,\r\n service: this.serviceId,\r\n type: RpcForwardType.Notify\r\n };\r\n\r\n return from(RpcForwardAutoClient.forward<any>(this.rpc, data)).pipe(\r\n map(response => {\r\n if (response.error) {\r\n throw response.error;\r\n } else {\r\n return response.result;\r\n }\r\n })\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -17,6 +17,11 @@ export interface AuthorizationCredentials {
|
|
|
17
17
|
applyToAllNodes?: boolean;
|
|
18
18
|
useLaps?: boolean;
|
|
19
19
|
lapsLocalAdminName?: string;
|
|
20
|
+
/**
|
|
21
|
+
* When true, the credentials apply only to the RPC requester identified by errorData.requesterName,
|
|
22
|
+
* instead of to every tool. Honored only when requester scoping is enabled on the AuthorizationManager.
|
|
23
|
+
*/
|
|
24
|
+
scopeToRequester?: boolean;
|
|
20
25
|
}
|
|
21
26
|
/**
|
|
22
27
|
* Defines the response the AuthorizationManager returns from getToken
|
|
@@ -24,6 +29,15 @@ export interface AuthorizationCredentials {
|
|
|
24
29
|
export interface AuthorizationTokenResponse {
|
|
25
30
|
token: AuthorizationToken;
|
|
26
31
|
appliesTo?: string | string[];
|
|
32
|
+
/**
|
|
33
|
+
* The requester name the token is scoped to. When set, only child frames with that RPC name receive the token.
|
|
34
|
+
*/
|
|
35
|
+
scope?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Set by the shell on shared tokens sent to child frames: the names of requesters whose own credential request is still pending.
|
|
38
|
+
* Those child instances save the shared token but keep waiting for their own result.
|
|
39
|
+
*/
|
|
40
|
+
pendingRequesters?: string[];
|
|
27
41
|
}
|
|
28
42
|
/**
|
|
29
43
|
* Defines an authorizationToken
|
|
@@ -50,25 +64,62 @@ export interface NodeAuthorizationErrorData {
|
|
|
50
64
|
statusCode: HttpStatusCode;
|
|
51
65
|
errorCode: string;
|
|
52
66
|
errorMessage: string;
|
|
67
|
+
/**
|
|
68
|
+
* The RPC name of the child that originated the credential request.
|
|
69
|
+
* Set by the shell-side AuthorizationManager from the RPC source; values supplied by the child itself are ignored.
|
|
70
|
+
*/
|
|
71
|
+
requesterName?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Effective requester scope supplied to the authorize callback by this manager.
|
|
74
|
+
* Null when the request cannot be scoped. Only populated by shells that enable requester scoping.
|
|
75
|
+
*/
|
|
76
|
+
requesterScope?: string | null;
|
|
53
77
|
}
|
|
54
78
|
/**
|
|
55
79
|
* Defines a handler that takes a nodeName and returns authorization credentials
|
|
56
80
|
*/
|
|
57
81
|
export type NodeAuthorizationHandler = (nodeName?: string | string[], errorData?: NodeAuthorizationErrorData) => Observable<AuthorizationCredentials>;
|
|
82
|
+
/**
|
|
83
|
+
* A global token and node-specific tokens that form one authorization state layer.
|
|
84
|
+
*/
|
|
85
|
+
export interface AuthorizationTokenSet {
|
|
86
|
+
manageAsToken?: AuthorizationToken;
|
|
87
|
+
nodeTokens: MsftSme.StringMap<AuthorizationToken>;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Options for the AuthorizationManager.
|
|
91
|
+
*/
|
|
92
|
+
export interface AuthorizationManagerOptions {
|
|
93
|
+
/**
|
|
94
|
+
* Returns true when credential requests from child frames are tracked separately per requester,
|
|
95
|
+
* so that credentials returned with scopeToRequester apply only to that requester.
|
|
96
|
+
* Evaluated on each request. Defaults to off.
|
|
97
|
+
*/
|
|
98
|
+
isRequesterScopingEnabled?: () => boolean;
|
|
99
|
+
}
|
|
58
100
|
/**
|
|
59
101
|
* Defines properties that will be provided to child instances on a forward init request
|
|
60
102
|
*/
|
|
61
103
|
export interface AuthorizationManagerInitProperties {
|
|
62
104
|
manageAsToken: AuthorizationToken;
|
|
63
105
|
nodeTokens: MsftSme.StringMap<AuthorizationToken>;
|
|
106
|
+
/**
|
|
107
|
+
* Shared credentials retained by scoped-aware child instances so they can be restored when scoped credentials clear.
|
|
108
|
+
*/
|
|
109
|
+
sharedTokens?: AuthorizationTokenSet;
|
|
64
110
|
nodePowershellEndpoints: MsftSme.StringMap<string>;
|
|
65
111
|
signOnToken: SignedHttpRequestToken;
|
|
112
|
+
/**
|
|
113
|
+
* The credentials scoped to the initializing child.
|
|
114
|
+
*/
|
|
115
|
+
scopedTokens?: AuthorizationTokenSet;
|
|
66
116
|
}
|
|
67
117
|
/**
|
|
68
118
|
* Authorization Manager class. Handles SME authentication for service requests.
|
|
69
119
|
*/
|
|
70
120
|
export declare class AuthorizationManager extends RpcServiceForwarder {
|
|
71
121
|
private authorize;
|
|
122
|
+
private options;
|
|
72
123
|
/**
|
|
73
124
|
* Cache key for session storage of authorization cache
|
|
74
125
|
*/
|
|
@@ -94,6 +145,10 @@ export declare class AuthorizationManager extends RpcServiceForwarder {
|
|
|
94
145
|
* The JSON Web Key. Single string with JSON.stringify format.
|
|
95
146
|
*/
|
|
96
147
|
private jwk;
|
|
148
|
+
/**
|
|
149
|
+
* The canonical origin that owns the cached credentials.
|
|
150
|
+
*/
|
|
151
|
+
private gatewayOrigin;
|
|
97
152
|
/**
|
|
98
153
|
* Credentials expiration time, used to determine the lifetime of new tokens. Value in milliseconds.
|
|
99
154
|
*/
|
|
@@ -127,6 +182,21 @@ export declare class AuthorizationManager extends RpcServiceForwarder {
|
|
|
127
182
|
* The token awaiter subject.
|
|
128
183
|
*/
|
|
129
184
|
private tokenAwaiter;
|
|
185
|
+
/** Direct child frames participating in the current shared credential request. */
|
|
186
|
+
private sharedTokenRequesters;
|
|
187
|
+
/**
|
|
188
|
+
* Token awaiters for credential requests from specific child requesters, keyed by requester RPC name.
|
|
189
|
+
* Used only when requester scoping is enabled, so one requester's prompt is never shared with another.
|
|
190
|
+
*/
|
|
191
|
+
private requesterTokenAwaiters;
|
|
192
|
+
/**
|
|
193
|
+
* Shell instance only: credentials that apply to a single requester, keyed by requester RPC name.
|
|
194
|
+
*/
|
|
195
|
+
private scopedTokens;
|
|
196
|
+
/** Child-only scoped tokens that currently take precedence over shared tokens in the effective public state. */
|
|
197
|
+
private scopedTokenState;
|
|
198
|
+
/** Child-only shared tokens retained beneath scoped tokens and restored when scoped state clears. */
|
|
199
|
+
private sharedTokenState;
|
|
130
200
|
/**
|
|
131
201
|
* The subject observable of sign on token awaiter.
|
|
132
202
|
*/
|
|
@@ -157,6 +227,11 @@ export declare class AuthorizationManager extends RpcServiceForwarder {
|
|
|
157
227
|
* Gets the gateway encryption certificate JWK.
|
|
158
228
|
*/
|
|
159
229
|
get gatewayJwk(): string;
|
|
230
|
+
/**
|
|
231
|
+
* Binds cached credentials to a canonical gateway origin.
|
|
232
|
+
* Credentials and gateway encryption state are cleared before a changed origin is recorded.
|
|
233
|
+
*/
|
|
234
|
+
setGatewayOrigin(origin: string): void;
|
|
160
235
|
/**
|
|
161
236
|
* Gets an observable the emits when the authorization token is ready
|
|
162
237
|
*/
|
|
@@ -165,8 +240,17 @@ export declare class AuthorizationManager extends RpcServiceForwarder {
|
|
|
165
240
|
* Initializes a new instance of the Authorization Manager class
|
|
166
241
|
* @param authorize An AuthorizationHandler with which to retrieve user credentials
|
|
167
242
|
* @param rpc The rpc to forward auth requests to a parent window
|
|
243
|
+
* @param options Optional behavior switches
|
|
168
244
|
*/
|
|
169
|
-
constructor(authorize: NodeAuthorizationHandler, rpc: Rpc);
|
|
245
|
+
constructor(authorize: NodeAuthorizationHandler, rpc: Rpc, options?: AuthorizationManagerOptions);
|
|
246
|
+
/**
|
|
247
|
+
* Attributes requests to direct children, preserving requester names relayed by hosted shells.
|
|
248
|
+
* Creates requester-only error data when the caller supplies none.
|
|
249
|
+
*
|
|
250
|
+
* @param errorData the error data received from the child, if any.
|
|
251
|
+
* @param sourceName the RPC name of the direct child that sent the request.
|
|
252
|
+
*/
|
|
253
|
+
static withRequesterName(errorData: NodeAuthorizationErrorData, sourceName: string): NodeAuthorizationErrorData;
|
|
170
254
|
/**
|
|
171
255
|
* defines the conditions under which the AuthorizationManager can handle an ajax error
|
|
172
256
|
*/
|
|
@@ -199,6 +283,7 @@ export declare class AuthorizationManager extends RpcServiceForwarder {
|
|
|
199
283
|
getNewToken(nodeNames: string[]): Observable<AuthorizationTokenResponse>;
|
|
200
284
|
getNewToken(nodeName: string, errorData: NodeAuthorizationErrorData): Observable<AuthorizationTokenResponse>;
|
|
201
285
|
getNewToken(nodeNames: string[], errorData: NodeAuthorizationErrorData): Observable<AuthorizationTokenResponse>;
|
|
286
|
+
private requestNewToken;
|
|
202
287
|
refreshSignOnToken(): Observable<SignOnTokenResponse>;
|
|
203
288
|
/**
|
|
204
289
|
* Forward Sign On Token to child frame.
|
|
@@ -260,10 +345,10 @@ export declare class AuthorizationManager extends RpcServiceForwarder {
|
|
|
260
345
|
protected onForwardInitResponse(data: RpcForwardResponse<AuthorizationManagerInitProperties>): void;
|
|
261
346
|
/**
|
|
262
347
|
* Called when a new instance of the service in another window is initialized and needs to synchronize with its parent
|
|
263
|
-
* @param
|
|
348
|
+
* @param sourceName The RPC name of the initializing child, used to include the credentials scoped to it
|
|
264
349
|
* @returns an observable for the all the values needed to initialize the service
|
|
265
350
|
*/
|
|
266
|
-
protected onForwardInit(): Observable<AuthorizationManagerInitProperties>;
|
|
351
|
+
protected onForwardInit(sourceName?: string): Observable<AuthorizationManagerInitProperties>;
|
|
267
352
|
/**
|
|
268
353
|
* Called when the forwarded services counterpart wants to get data from the parent
|
|
269
354
|
* @param from The RpcRelationshipType that this request is from
|
|
@@ -271,7 +356,7 @@ export declare class AuthorizationManager extends RpcServiceForwarder {
|
|
|
271
356
|
* @param args The arguments of the method
|
|
272
357
|
* @returns an observable for the result of the method call
|
|
273
358
|
*/
|
|
274
|
-
protected onForwardExecute(from: RpcRelationshipType, name: string, args: any[]): Observable<any>;
|
|
359
|
+
protected onForwardExecute(from: RpcRelationshipType, name: string, args: any[], sourceName?: string): Observable<any>;
|
|
275
360
|
/**
|
|
276
361
|
* Called when the forwarded services counterpart sends a notify message
|
|
277
362
|
* @param from The RpcRelationshipType that this request is from
|
|
@@ -290,6 +375,43 @@ export declare class AuthorizationManager extends RpcServiceForwarder {
|
|
|
290
375
|
* Completes the token awaiter
|
|
291
376
|
*/
|
|
292
377
|
private completeTokenAwaiter;
|
|
378
|
+
/**
|
|
379
|
+
* Adds a token response to a set of scoped credentials.
|
|
380
|
+
*/
|
|
381
|
+
private static addToScope;
|
|
382
|
+
/**
|
|
383
|
+
* Shell instance: saves a token that applies only to the requester named by result.scope.
|
|
384
|
+
* The tokens shared by every tool are left unchanged.
|
|
385
|
+
*/
|
|
386
|
+
private saveScopedToken;
|
|
387
|
+
/**
|
|
388
|
+
* Child instance: re-applies requester-scoped credentials over the shared ones.
|
|
389
|
+
*/
|
|
390
|
+
private recomputeEffectiveTokenState;
|
|
391
|
+
/**
|
|
392
|
+
* Child instance: forgets requester-scoped credentials.
|
|
393
|
+
*/
|
|
394
|
+
private clearScopedOverlay;
|
|
395
|
+
/**
|
|
396
|
+
* Child instance: saves a shared token update without allowing it to replace scoped effective credentials.
|
|
397
|
+
*/
|
|
398
|
+
private applyChildSharedTokenResponse;
|
|
399
|
+
/**
|
|
400
|
+
* Returns the key of the token awaiter for a request: the requester RPC name when requester scoping is
|
|
401
|
+
* enabled on this shell instance, otherwise an empty string for the shared awaiter.
|
|
402
|
+
*/
|
|
403
|
+
private getRequesterAwaiterKey;
|
|
404
|
+
private isRequesterScopingEnabled;
|
|
405
|
+
/**
|
|
406
|
+
* Returns the scope for authorized credentials, or null when they apply to every tool.
|
|
407
|
+
*/
|
|
408
|
+
private getCredentialScope;
|
|
409
|
+
private getPendingAwaiter;
|
|
410
|
+
private setPendingAwaiter;
|
|
411
|
+
/**
|
|
412
|
+
* Routes failures to the requesting frames. Legacy shells retain shared error broadcasts.
|
|
413
|
+
*/
|
|
414
|
+
private notifyTokenError;
|
|
293
415
|
/**
|
|
294
416
|
* Completes the sign on token awaiter
|
|
295
417
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorization-manager.d.ts","sourceRoot":"","sources":["../../src/security/authorization-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,U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