Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"use strict";
var fluid = require("infusion"),
kettle = fluid.registerNamespace("kettle");
kettle.loadTestingSupport();
// Some definitions to make sure that errors during request get logged to the console. This should really be
// a default
fluid.defaults("gpii.test.errorLoggingRequest", {
listeners: {
"onRequestError.log": "fluid.logUncaughtException",
"onRequestError.logActivity": {
funcName: "fluid.logActivity",
args: [null],
priority: "after:log"
}
}
});
Seventh Framework Programme (FP7/2007-2013) under grant agreement no. 289016.
You may obtain a copy of the License at
https://github.com/GPII/universal/blob/master/LICENSE.txt
*/
"use strict";
var fluid = require("infusion"),
kettle = fluid.registerNamespace("kettle"),
path = require("path"),
jqUnit = jqUnit || fluid.require("jqUnit"),
gpii = fluid.registerNamespace("gpii");
fluid.registerNamespace("gpii.tests.multiUserSupport");
require("../index.js");
gpii.loadTestingSupport();
/*
* Initial function to be called when the user hits the /match URL. Simply calls the
* gpii.flatMatchMaker.match function and fires the 'onSuccess' event when it returns
*/
gpii.tests.multiUserSupport.flatMatchMakerMockMatch = function (ontologyHandler, body) {
// fake a matchmaking process and return a payload dependent on users/preferences:
var responseOptions = {
"multiuser1": {
"inferredConfiguration": {
"gpii-default": {
"applications": {
*
* Licensed under the New BSD license. You may not use this file except in
* compliance with this License.
*
* The research leading to these results has received funding from the European Union's
* Seventh Framework Programme (FP7/2007-2013)
* under grant agreement no. 289016.
*
* You may obtain a copy of the License at
* https://github.com/GPII/universal/blob/master/LICENSE.txt
*/
"use strict";
var fluid = require("infusion"),
gpii = fluid.registerNamespace("gpii");
require("./shared/UserLogonRequestTestDefs.js");
// With all-in-local config, nonexistent GPII keys are able to key in and key out.
// Note that with untrusted config, nonexistent GPII keys can only key in with client credentials that have privilege
// to create nonexistent GPII keys and prefs safes.
gpii.tests.userLogonRequest.nonexistentKeyInTestDefs = [{
name: "Testing login and logout with a nonexistent GPII key",
expect: 2,
gpiiKey: "bogusToken",
sequence: [
{
// login with a non-existing GPII key
task: "{lifecycleManager}.performLogin",
args: ["{testCaseHolder}.options.gpiiKey"],
resolve: "gpii.tests.userLogonRequest.testLoginResponse",
*
* Copyright 2018 OCAD University
*
* Licensed under the New BSD license. You may not use this file except in
* compliance with this License.
*
* You may obtain a copy of the License at
* https://github.com/GPII/universal/blob/master/LICENSE.txt
*/
"use strict";
var fluid = require("infusion"),
gpii = fluid.registerNamespace("gpii");
fluid.registerNamespace("gpii.flowManager.prefsServerDataSource");
// "gpii.flowManager.prefsServerDataSource" is used by the cloud based flow manager to communicate with the
// preferences server.
fluid.defaults("gpii.flowManager.prefsServerDataSource", {
gradeNames: ["fluid.component"],
// This option should be distributed down from, e.g., gpii.flowManager.config.cloud.base
prefsServerURL: null,
preferencesUrlTemplate: "%prefsServerURL/preferences/%gpiiKey?merge=%merge",
prefsServerReadyUrlTemplate: "%prefsServerURL/ready",
// The URLs below are calculated from the flow manager base URL and their templates.
preferencesUrl: {
expander: {
funcName: "fluid.stringTemplate",
Licensed under the New BSD license. You may not use this file except in
compliance with this License.
You may obtain a copy of the License at
https://github.com/GPII/universal/blob/master/LICENSE.txt
*/
// This shared script defines migrated values for the GPII-4014 deployment.
"use strict";
var fluid = require("infusion"),
gpii = fluid.registerNamespace("gpii");
fluid.registerNamespace("gpii.migration.GPII4014");
// Migrated values
gpii.migration.GPII4014.oldSchemaVersion = "0.1";
gpii.migration.GPII4014.newSchemaVersion = "0.2";
gpii.migration.GPII4014.newValuesForNovaClientCredential = {
"allowedIPBlocks": null,
"allowedPrefsToWrite": [
"http://registry.gpii.net/common/language",
"http://registry.gpii.net/common/DPIScale",
"http://registry.gpii.net/common/highContrast/enabled",
"http://registry.gpii.net/common/highContrastTheme",
"http://registry.gpii.net/common/selfVoicing/enabled",
"http://registry.gpii.net/applications/com.microsoft.office"
],
"isCreateGpiiKeyAllowed": true,
"use strict";
var fluid = require("infusion");
var gpii = fluid.registerNamespace("gpii");
var jqUnit = require("node-jqunit");
require("json5/lib/register");
var fs = require("fs");
var path = require("path");
require("gpii-json-schema");
var solutionSchema = require("./data/schemas/solution-schema.json5");
jqUnit.module("Sanity checks for Solutions Registry data.");
fluid.registerNamespace("gpii.tests.universal.solutionsRegistry");
gpii.tests.universal.solutionsRegistry.checkAll = function (that) {
*
* Licensed under the New BSD license. You may not use this file except in
* compliance with this License.
*
* The research leading to these results has received funding from the European Union's
* Seventh Framework Programme (FP7/2007-2013)
* under grant agreement no. 289016.
*
* You may obtain a copy of the License at
* https://github.com/GPII/universal/blob/master/LICENSE.txt
*/
"use strict";
var fluid = require("infusion"),
gpii = fluid.registerNamespace("gpii");
fluid.require("%gpii-universal");
gpii.loadTestingSupport();
fluid.defaults("gpii.tests.deviceReporterErrorTests.testCaseHolder", {
gradeNames: ["gpii.test.common.testCaseHolder"],
distributeOptions: {
"development.installedSolutionsPath": {
"record": "%gpii-universal/tests/data/faultyDeviceReport.jsonx",
"target": "{that deviceReporter installedSolutionsDataSource}.options.path"
}
},
components: {
deviceRequest: {
type: "kettle.test.request.http",
/*!
Copyright 2018 OCAD university
Licensed under the New BSD license. You may not use this file except in
compliance with this License.
You may obtain a copy of the License at
https://github.com/GPII/universal/blob/master/LICENSE.txt
*/
"use strict";
var fluid = require("infusion"),
gpii = fluid.registerNamespace("gpii"),
jqUnit = fluid.registerNamespace("jqUnit");
fluid.require("%gpii-universal");
gpii.loadTestingSupport();
fluid.registerNamespace("gpii.tests.cloudStatus");
gpii.tests.cloudStatus.configs = {
allLocalWithPrefsServer: {
configName: "gpii.config.cloudBased.development",
configPath: "%gpii-universal/gpii/configs"
},
allLocalWithoutPrefsServer: {
configName: "gpii.flowManager.config.cloud.base",
configPath: "%flowManager/configs"
},
(function () {
"use strict";
var fluid = require("infusion"),
gpii = fluid.registerNamespace("gpii");
fluid.registerNamespace("gpii.flowManager");
gpii.logFully = function () {
var oldRenderChars = fluid.logObjectRenderChars;
fluid.logObjectRenderChars = 2 << 20;
fluid.log.apply(null, arguments);
fluid.logObjectRenderChars = oldRenderChars;
};
/** Render an instance of the "megapayload" which circulates amongst the FlowManager, MatchMaker, LifecycleManager etc. methods.
* This builds up incrementally starting with the GPII key during logon until we reach the "finalPayload" dispatched to the
* lifecycleManager. This method transforms the payload into a form appropriate for logging to the console as an aid
* to diagnosing and debugging issues encountered in the field. Currently it only performs the action of suppressing the
* body of any entries of `solutionsRegistryEntries` since these are bulky and can easily be recovered from the
* solutions registry itself.
/*!
GPII Cloud Based Flow Manager Ready Check Handler
Copyright 2018 OCAD University
Licensed under the New BSD license. You may not use this file except in
compliance with this License.
You may obtain a copy of the License at
https://github.com/GPII/universal/blob/master/LICENSE.txt
*/
"use strict";
var fluid = require("infusion"),
gpii = fluid.registerNamespace("gpii");
fluid.defaults("gpii.flowManager.cloudBased.ready.handler", {
gradeNames: ["kettle.request.http"],
invokers: {
handleRequest: {
funcName: "gpii.flowManager.cloudBased.ready.handler.isLive",
args: ["{gpii.flowManager.cloudBased}.prefsServerDataSource", "{that}"]
}
}
});
gpii.flowManager.cloudBased.ready.handler.reportError = function (that, prefsServerURL) {
fluid.log ("Error connecting to Preferences Sever: '" + prefsServerURL + "'");
that.events.onError.fire({
isError: true,
message: "Error connecting to Preferences Server",