diff --git a/.nycrc b/.nycrc
index 147cb57c0..819bc23f1 100644
--- a/.nycrc
+++ b/.nycrc
@@ -75,12 +75,14 @@
"!**/gpii/node_modules/ontologyHandler/src/ontologyHandler.js",
"!**/gpii/node_modules/ontologyHandler/src/ontologyHandlerUtilities.js",
"!**/gpii/node_modules/preferencesServer/index.js",
+ "!**/gpii/node_modules/preferencesServer/src/cloudSafeCredHandlers.js",
"!**/gpii/node_modules/preferencesServer/src/preferencesGetHandler.js",
"!**/gpii/node_modules/preferencesServer/src/preferencesPostHandler.js",
"!**/gpii/node_modules/preferencesServer/src/preferencesPutHandler.js",
"!**/gpii/node_modules/preferencesServer/src/preferencesServer.js",
"!**/gpii/node_modules/preferencesServer/src/preferencesServerConst.js",
"!**/gpii/node_modules/preferencesServer/src/preferencesService.js",
+ "!**/gpii/node_modules/preferencesServer/src/prefsSafesHandlers.js",
"!**/gpii/node_modules/preferencesServer/src/readyGetHandler.js",
"!**/gpii/node_modules/processReporter/index.js",
"!**/gpii/node_modules/processReporter/src/ProcessReporter.js",
diff --git a/documentation/AuthorizationService.md b/documentation/AuthorizationService.md
index 4709486c5..112f0fc29 100644
--- a/documentation/AuthorizationService.md
+++ b/documentation/AuthorizationService.md
@@ -21,7 +21,7 @@ Grant](https://wiki.gpii.net/w/GPII_OAuth_2_Guide#Resource_Owner_GPII_Key_Grant)
"accessToken": "gpii-app-installation-accessToken-1",
"clientCredential": {
"type": "clientCredential",
- "schemaVersion": "0.2",
+ "schemaVersion": "0.3",
"clientId": "gpiiAppInstallationClient-1",
"oauth2ClientId": "net.gpii.ajc.bakersfield",
"oauth2ClientSecret": "client_secret_ajc_bakersfield",
@@ -37,7 +37,7 @@ Grant](https://wiki.gpii.net/w/GPII_OAuth_2_Guide#Resource_Owner_GPII_Key_Grant)
},
"authorization": {
"type": "gpiiAppInstallationAuthorization",
- "schemaVersion": "0.2",
+ "schemaVersion": "0.3",
"clientId": "gpiiAppInstallationClient-1",
"gpiiKey": "chrome_high_contrast",
"accessToken": "gpii-app-installation-accessToken-1",
diff --git a/documentation/DataModel.md b/documentation/DataModel.md
index 455ea3bc8..3ed8e0228 100644
--- a/documentation/DataModel.md
+++ b/documentation/DataModel.md
@@ -4,3 +4,124 @@ GPII uses CouchDB to store data in JSON documents. The two GPII components that
storage are the Preferences Server and the Authorization Server.
The details of the GPII data model can be found [here](https://wiki.gpii.net/w/Keys,_KeyTokens,_and_Preferences).
+
+## Preference Safes Overview
+
+In this section we discuss the CouchDB documents for all the data associated with a users preferences safe. This
+includes their preference sets, keys, full login credentials, and a minimal amount of metadata for the user,
+such as name and email. Currently, this consists of three document types: `prefsSafe`, `gpiiKey`,
+`gpiiCloudSafeCredential`.
+
+### Preference Safes
+
+Preference Safes consist of a single primary document of type `prefsSafe`. These contain some optional metadata such
+as `name` and `email`, and the `preferences` section which contains the users preference sets. This is the central
+document for a safe, any documents relating to a safe should have a property `prefsSafeId` which contains the id of
+the preferences safe.
+
+An example document:
+
+```json
+ {
+ "_id": "prefsSafe-7",
+ "type": "prefsSafe",
+ "schemaVersion": "0.3",
+ "prefsSafeType": "user",
+ "name": null,
+ "email": null,
+ "preferences": {
+ "flat": {
+ "name": "bit of stuff",
+ "contexts": {
+ "gpii-default": {
+ "name": "Default preferences",
+ "preferences": {
+ "http://registry.gpii.net/common/onScreenKeyboard/enabled": true
+ },
+ "metadata": []
+ }
+ },
+ "metadata": []
+ }
+ },
+ "timestampCreated": "2017-12-14T19:55:11.641Z",
+ "timestampUpdated": null
+ }
+```
+
+### Key-in Documents
+
+When users key-in to the GPII using a USB stick, NFC card, or other mechanism, the unique `gpiiKey` on the device will
+be matched to the CouchDB `_id` on a document with type `gpiiKey`. This document contains the important fields `prefsSafeId`
+and `prefsSetId` linking it to the safe, and to a specific preference set within that safe to key in with.
+
+An example document:
+
+```json
+ {
+ "_id": "np_tiny",
+ "type": "gpiiKey",
+ "schemaVersion": "0.3",
+ "prefsSafeId": "prefsSafe-7",
+ "prefsSetId": "gpii-default",
+ "revoked": false,
+ "revokedReason": null,
+ "timestampCreated": "2017-12-14T19:55:11.641Z",
+ "timestampUpdated": null,
+ "timestampRevoked": null
+ }
+```
+
+### Login Documents
+
+In order to have full permissions to edit all aspects of their preferences safe, users must login to their safe using a
+username and password. The current implementation of this is backed by the `gpii-express-user` library which creates
+records in the same format as native CouchDB accounts and manages password hashing, unlocking, etc. In order to avoid
+making changes to this external library, we introduce a document type 'gpiiCloudSafeCredential' which tracks the native
+record that is created by `gpii-express-user`. Note that the `gpiiExpressuserId` entries are prefixed with `org.couch.db.user:`
+which is the convention for both internal CouchDB users and users created with gpii-express-user.
+
+An example document:
+
+```json
+ {
+ "_id": "8f3085a7-b65b-4648-9a78-8ac7de766997",
+ "type": "gpiiCloudSafeCredential",
+ "schemaVersion": "0.3",
+ "prefsSafeId": "prefsSafe-7",
+ "gpiiExpressUserId": "org.couch.db.user:prefs7user"
+ }
+```
+
+For reference, the internal account record for the above looks as follows:
+
+```json
+ {
+ "_id": "org.couch.db.user:prefs7user",
+ "name": "prefs7user",
+ "type": "user",
+ "email": null,
+ "roles": [],
+ "username": "prefs7user",
+ "verified": true,
+ "iterations": 10,
+ "password_scheme": "pbkdf2",
+ "salt": "7cf6961e6ded3bd25732e5466512d116bf9908ba9629d4ed060a03a965e5341d",
+ "derived_key": "e8bd265e7d82fd0f662e9ddaaf2e75acb294da1b",
+ "verification_code": "618fa72aa62af282704b556e34957a79"
+ }
+```
+
+`gpii-express-user` handles the lookup of unique names when attempting to unlock a user with a password.
+This means that in the above example, the login username for preferences safe `prefsSafe-7` would be `prefs7user`.
+This also means that it could be possible for a preferences safe to have more than one `gpiiCloudSafeCredential`
+similar to how it can have more than one `gpiiKey`. This allows flexibility for the addition, management, and revokation
+of key-in and log-in methods.
+
+### Future Document Types
+
+In the future we may add additional document types, or sub-types for other features such as CAS or single sign-on
+authentication. For any documents that add information to a preferences safe, the most important thing is that they
+have a `prefsSafeId` attribute. In general, we want to avoid having documents several linkages away from the primary
+preferences safe document. In the case of `gpii-express-user` above we have 1 extra hop to avoid modifying the external
+library, but in general, the document relations should be kept as simple as possible.
diff --git a/documentation/PreferencesServer.md b/documentation/PreferencesServer.md
index 00a94a8a1..4491ac07f 100644
--- a/documentation/PreferencesServer.md
+++ b/documentation/PreferencesServer.md
@@ -341,6 +341,434 @@ There are two important things to note here:
to `http://registry.gpii.net/common/fontSize`. Since we do not allow the same setting to be present multiple times in
the NP set, the fontSize has been stored in the flat ontology and removed from the ISO24751 block.
+### GET /prefsSafe/:prefsSafeId
+
+This end point will return the entire preferences safe, including the embedded preference sets. The URL param is the
+`id` of the preferences safe. This will not return any attached keys, credentials, or other records.
+
+#### Example GET
+
+URL: `http://preferences.gpii.net/prefsSafe/prefsSafe-alice`
+
+Example Success Payload:
+
+```json
+{
+ "id": "prefsSafe-alice",
+ "type": "prefsSafe",
+ "schemaVersion": "0.3",
+ "prefsSafeType": "user",
+ "name": "alice",
+ "email": null,
+ "preferences": {
+ "flat": {
+ "name": "Alice",
+ "contexts": {
+ "gpii-default": {
+ "name": "Default preferences",
+ "preferences": {
+ "http://registry.gpii.net/applications/com.microsoft.windows.onscreenKeyboard": {}
+ }
+ }
+ }
+ }
+ },
+ "timestampCreated": "2019-01-14T23:48:03.221Z",
+ "timestampUpdated": null
+}
+```
+
+If the preferences safe with the `prefsSafeId` does not exist, the following error payload will be
+returned:
+
+```json
+{
+ "isError": true,
+ "errorCode": "GPII_ERR_NO_PREFSSAFE",
+ "message": "Missing prefsSafe"
+}
+```
+
+### GET /prefsSafe-with-keys/:prefsSafeId
+
+This endpoint will return the entire preferences safe structure, along with records directory related to it, such
+as keys and credentials. A top level object will contain the preferences safe under key `prefsSafe`, and the related
+documents under key `keys`.
+
+#### Example GET
+
+URL: `http://preferences.gpii.net/prefsSafe-with-keys/prefsSafe-alice`
+
+Example returned item:
+
+```json
+{
+ "prefsSafe": {
+ "id": "prefsSafe-alice",
+ "type": "prefsSafe",
+ "schemaVersion": "0.3",
+ "prefsSafeType": "user",
+ "name": "alice",
+ "email": null,
+ "preferences": {
+ "flat": {
+ "name": "Alice",
+ "contexts": {
+ "gpii-default": {
+ "name": "Default preferences",
+ "preferences": {
+ "http://registry.gpii.net/applications/com.microsoft.windows.onscreenKeyboard": {}
+ }
+ }
+ }
+ }
+ },
+ "timestampCreated": "2019-01-14T23:48:03.221Z",
+ "timestampUpdated": null
+ },
+ "keys": [
+ {
+ "id": "8f3085a7-b65b-4648-9a78-8ac7de766997",
+ "type": "gpiiCloudSafeCredential",
+ "schemaVersion": "0.3",
+ "prefsSafeId": "prefsSafe-alice",
+ "gpiiExpressUserId": "org.couch.db.user:alice"
+ },
+ {
+ "id": "57A68E84-03A9-4ADD-9365-11C75E4F1B0E",
+ "type": "gpiiKey",
+ "schemaVersion": "0.3",
+ "prefsSafeId": "prefsSafe-alice",
+ "prefsSetId": "gpii-default",
+ "revoked": false,
+ "revokedReason": null,
+ "timestampCreated": "2017-12-14T19:55:11.640Z",
+ "timestampUpdated": null
+ }
+ ]
+}
+```
+
+If the safe with the specified `prefsSafeId` does not exist, the following error payload will be returned:
+
+```json
+{
+ "isError": true,
+ "errorCode": "GPII_ERR_NO_PREFSSAFE",
+ "message": "Missing prefsSafe"
+}
+```
+
+### POST /prefsSafe
+
+Creates a new preferences safe in the system. Takes a full preferences safe JSON payload, albiet without a `id`.
+The returned payload will include the entire preferences safe, including the updated `timestampCreated` field,
+and a newly provisioned `id`.
+
+#### Example POST
+
+URL: `http://preferences.gpii.net/prefsSafe`
+
+The POST payload should be a full preferences safe without an `id`:
+
+```json
+{
+ "type": "prefsSafe",
+ "schemaVersion": "0.3",
+ "prefsSafeType": "user",
+ "name": "Steve",
+ "email": null,
+ "preferences": {
+ "flat": {
+ "name": "bit of stuff",
+ "contexts": {
+ "gpii-default": {
+ "name": "Default preferences",
+ "preferences": {
+ "http://registry.gpii.net/common/onScreenKeyboard/enabled": false
+ },
+ "metadata": []
+ }
+ },
+ "metadata": []
+ }
+ }
+}
+```
+
+A successful return payload will consist of the same payload with the addition of timestamps and a
+freshly generated `id` field. In the event of an error, a payload similar to the following will be returned
+with the contents of the system error:
+
+```json
+{
+ "isError": true,
+ "errorCode": "GPII_ERR_APPLICABLE_MESSAGE",
+ "message": "System error described here."
+}
+```
+
+### PUT /prefsSafe/:prefsSafeId
+
+Updates an existing preferences safe in the database, using the full preferences safe format. Will return the
+updated safe, which should include an updated `timestampUpdated` field.
+
+#### Example PUT
+
+URL: `http://preferences.gpii.net/prefsSafe/prefsSafe-alice`
+
+Example PUT body:
+
+```json
+{
+ "id": "prefsSafe-alice",
+ "type": "prefsSafe",
+ "schemaVersion": "0.3",
+ "prefsSafeType": "user",
+ "name": "alice",
+ "email": null,
+ "preferences": {
+ "flat": {
+ "name": "Alice",
+ "contexts": {
+ "gpii-default": {
+ "name": "Default preferences",
+ "preferences": {
+ "http://registry.gpii.net/applications/com.microsoft.windows.onscreenKeyboard": {}
+ }
+ }
+ }
+ }
+ },
+ "timestampCreated": "2019-01-14T23:48:03.221Z",
+ "timestampUpdated": null
+}
+```
+
+On a successfull save, the same payload from the PUT operation will be returned, with an updated
+`timestampUpdated` field with the time of save. In the event of a failed save an error payload with a
+suitable message will be returned.
+
+```json
+{
+ "isError": true,
+ "errorCode": "APPROPRIATE_ERROR_CODE",
+ "message": "System error described here."
+}
+```
+
+### GET /prefsSafes
+
+Returns a list of preferences safes, including only basic information about each one. Ideal for building a table
+or listing of preferences safes. Each item in the list representing a preferences safe will include `id`, `name`,
+`email`, `created`, and `updated`. This endpoint will likely have more options in the future, such as sorting,
+paging, etc.
+
+#### Example GET
+
+URL: `http://preferences.gpii.net/prefsSafes`
+
+Example return payload:
+
+```json
+{
+ "total_rows": 2,
+ "offset": 0,
+ "rows": [
+ {
+ "name": "Alice",
+ "email": "alice@gpii.net",
+ "created": "2017-12-14T19:55:11.640Z",
+ "updated": null,
+ "id": "prefsSafe-1"
+ },
+ {
+ "name": null,
+ "email": null,
+ "created": "2017-12-14T19:55:11.640Z",
+ "updated": null,
+ "id": "prefsSafe-2"
+ }
+ ]
+}
+```
+
+There should never be an error payload for this endpoint. In the situation where there are no preferences
+safes stored in the system it will merely contain zero rows.
+
+### GET /prefsSafe-keys/:prefsSafeId
+
+This will return the associated keys and credentials documents for a given preferences safe, in a `rows` field.
+Also included is a `total_rows` and `offset` field, but do note that the `total_rows` field is not accurate as
+of the time of writing, and should be ignored.
+
+#### Example GET
+
+URL: `http://preferences.gpii.net/prefsSafe-keys/prefsSafe-alice`
+
+An example payload for a particlar safe may be:
+
+```json
+{
+ "total_rows": 2,
+ "offset": 0,
+ "rows": [
+ {
+ "id": "8f3085a7-b65b-4648-9a78-8ac7de766997",
+ "type": "gpiiCloudSafeCredential",
+ "schemaVersion": "0.3",
+ "prefsSafeId": "prefsSafe-alice",
+ "gpiiExpressUserId": "org.couch.db.user:alice"
+ },
+ {
+ "id": "57A68E84-03A9-4ADD-9365-11C75E4F1B0E",
+ "type": "gpiiKey",
+ "schemaVersion": "0.3",
+ "prefsSafeId": "prefsSafe-alice",
+ "prefsSetId": "gpii-default",
+ "revoked": false,
+ "revokedReason": null,
+ "timestampCreated": "2017-12-14T19:55:11.640Z",
+ "timestampUpdated": null
+ }
+ ]
+}
+```
+
+### POST /prefsSafe-key-create
+
+This endpoint will add a new `gpiiKey` document to the system. There are no URL parameters, but the JSON body takes
+3 fields, one of them optional. Required are the `prefsSafeId` and `prefsSetId`. These indicate the preferences safe,
+and the respective preferences set that this key will operate upon. Optionally you can pass in a unique
+unused `gpiiKey` to use, otherwise a new one will be generated as part of the process. The new document is returned
+upon success. In event of a failure, a standard error document is returned with `isError` true, and a message
+detailing the failure.
+
+#### Example POST:
+
+URL: `http://preferences.gpii.net/prefsSafe-key-create`
+
+Example POST Body:
+
+```json
+{
+ "prefsSafeId": "prefsSafe-alice",
+ "prefsSetId": "gpii-lowlight"
+}
+```
+
+Example successful return payload:
+
+```json
+{
+ "id": "3B3D3003-9F5F-4B66-98C1-1380EC86DDB1",
+ "type": "gpiiKey",
+ "schemaVersion": "0.3",
+ "prefsSafeId": "prefsSafe-alice",
+ "prefsSetId": "gpii-lowlight",
+ "revoked": false,
+ "revokedReason": null,
+ "timestampCreated": "2017-12-14T19:55:11.640Z",
+ "timestampUpdated": null
+}
+```
+
+In the event of any system error, an error payload with a suitable `message` is returned.
+
+```json
+{
+ "isError": true,
+ "errorCode": "GPII_ERR_APPLICABLE_MESSAGE",
+ "message": "System error described here."
+}
+```
+
+### PUT /add-cloud-credentials/:prefsSafeId
+
+This endpoint will add a new username and password credential set to the preferences safe whose id is specified
+in the URL parameter `prefsSafeId`. The body is a JSON payload containing the username and password for the new
+credential set.
+
+#### Example PUT
+
+URL: `http://preferences.gpii.net/add-cloud-credentials/prefsSafe-1`
+
+The above indicates that the credentials will be added to preferences safe with `id` `prefsSafe-1`.
+
+putBody:
+
+```json
+{
+ "username": "NewLoginUsername",
+ "password": "v3ry$ecu4e"
+}
+```
+
+Example successful return payload:
+
+```json
+{
+ "_id": "8f3085a7-b65b-4648-9a78-8ac7de766997",
+ "type": "gpiiCloudSafeCredential",
+ "schemaVersion": "0.3",
+ "prefsSafeId": "prefsSafe-1",
+ "gpiiExpressUserId": "org.couch.db.user:prefs1user"
+}
+```
+
+In the event of any system error, an error payload with a suitable `message` is returned.
+
+```json
+{
+ "isError": true,
+ "errorCode": "GPII_ERR_APPLICABLE_MESSAGE",
+ "message": "System error described here."
+}
+```
+
+### POST /unlock-cloud-safe
+
+This endpoint allows you to verify if a username and password combination will unclock a preferences safe that
+has a matching cloud credential. It requires a username and password, but not a preferences safe ID. If the
+unique combination unlocks a particular safe, that preferences safes `prefsSafe` document will be returned.
+
+#### Example post
+
+Using the `http://preferences.gpii.net/unlock-cloud-safe` with no parameters we can pass in the username and
+password via the body.
+
+Example POST body:
+
+```json
+{
+ "username": "NewLoginUsername",
+ "password": "v3ry$ecu4e"
+}
+```
+
+If successful this will return the preferences safe:
+
+```json
+{
+ "id": "prefsSafe-1",
+ "type": "prefsSafe",
+ "etc etc": "..."
+}
+```
+
+If the username and password do not match a record the following error is returned:
+
+```json
+{
+ "isError": true,
+ "errorCode": "GPII_ERR_UNLOCKING_PREFSSAFE_CREDENTIALS",
+ "message": "Unable to unlock a Preferences Safe with the supplied credentials."
+}
+```
+
+Any other system errors will return a similar `isError` payload with a suitable message for the failure
+condition.
+
## Other relevant documentation:
* [The Preferences Server Framework](PreferencesServerFramework.md)
diff --git a/gpii/node_modules/gpii-db-operation/src/DbConst.js b/gpii/node_modules/gpii-db-operation/src/DbConst.js
index b00ce58a5..563cb73c8 100644
--- a/gpii/node_modules/gpii-db-operation/src/DbConst.js
+++ b/gpii/node_modules/gpii-db-operation/src/DbConst.js
@@ -15,13 +15,15 @@ var gpii = fluid.registerNamespace("gpii");
fluid.registerNamespace("gpii.dbOperation");
// The current version of schemas that document structures correspond with.
-gpii.dbOperation.schemaVersion = "0.2";
+gpii.dbOperation.schemaVersion = "0.3";
// All doc types used for saving different documents into CouchDB
// See [GPII Data Model](https://wiki.gpii.net/w/Keys,_KeyTokens,_and_Preferences#Data_Model)
// regarding accepted fields for each document type.
gpii.dbOperation.docTypes = fluid.freezeRecursive({
gpiiKey: "gpiiKey",
+ user: "user", // This is the CouchDB compatible record type gpii-express-user creates
+ gpiiCloudSafeCredential: "gpiiCloudSafeCredential",
prefsSafe: "prefsSafe",
clientCredential: "clientCredential",
gpiiAppInstallationClient: "gpiiAppInstallationClient",
diff --git a/gpii/node_modules/gpii-db-operation/src/DbDataStore.js b/gpii/node_modules/gpii-db-operation/src/DbDataStore.js
index 5888e4700..07c38f549 100644
--- a/gpii/node_modules/gpii-db-operation/src/DbDataStore.js
+++ b/gpii/node_modules/gpii-db-operation/src/DbDataStore.js
@@ -97,6 +97,45 @@ fluid.defaults("gpii.dbOperation.dbDataStore", {
}
}
},
+ expressUserSafeLoginLookup: {
+ type: "gpii.dbOperation.dbDataSource",
+ options: {
+ requestUrl: "/_design/views/_view/expressUserSafeLoginLookup?include_docs=true&key=%22%gpiiExpressUserId%22",
+ termMap: {
+ gpiiExpressUserId: "%gpiiExpressUserId"
+ },
+ rules: {
+ readPayload: {
+ "": "rows.0.doc"
+ }
+ }
+ }
+ },
+ listPrefsSafesDataSource: {
+ type: "gpii.dbOperation.dbDataSource",
+ options: {
+ requestUrl: "/_design/views/_view/listPrefsSafes",
+ rules: {
+ readPayload: {
+ "": ""
+ }
+ }
+ }
+ },
+ findRelatedDocsForPrefsSafeDataSource: {
+ type: "gpii.dbOperation.dbDataSource",
+ options: {
+ requestUrl: "/_design/views/_view/findRelatedDocsForPrefsSafe?include_docs=true&key=%22%prefsSafeId%22",
+ termMap: {
+ prefsSafeId: "%prefsSafeId"
+ },
+ rules: {
+ readPayload: {
+ "": ""
+ }
+ }
+ }
+ },
findPrefsSafeByGpiiKeyDataSource: {
type: "gpii.dbOperation.dbDataSource",
options: {
@@ -167,6 +206,22 @@ fluid.defaults("gpii.dbOperation.dbDataStore", {
]
// id
},
+ findPrefsSafeList: {
+ funcName: "gpii.dbOperation.dbDataStore.findRecordList",
+ args: [
+ "{that}.listPrefsSafesDataSource",
+ {}
+ ]
+ },
+ findRelatedDocsForPrefsSafe: {
+ funcName: "gpii.dbOperation.dbDataStore.findRecordList",
+ args: [
+ "{that}.findRelatedDocsForPrefsSafeDataSource",
+ {
+ prefsSafeId: "{arguments}.0"
+ }
+ ]
+ },
findGpiiKey: {
func: "{that}.findById"
// gpiiKey
@@ -191,6 +246,16 @@ fluid.defaults("gpii.dbOperation.dbDataStore", {
]
// gpiiKey
},
+ findSafeByExpressUserLookup: {
+ funcName: "gpii.dbOperation.dbDataStore.findRecord",
+ args: [
+ "{that}.expressUserSafeLoginLookup",
+ {
+ gpiiExpressUserId: "{arguments}.0"
+ },
+ "gpiiExpressUserId"
+ ]
+ },
findClientByOauth2ClientId: {
funcName: "gpii.dbOperation.dbDataStore.findRecord",
args: [
diff --git a/gpii/node_modules/gpii-db-operation/src/DbDataStoreUtils.js b/gpii/node_modules/gpii-db-operation/src/DbDataStoreUtils.js
index 1fb7fd042..b725ae721 100644
--- a/gpii/node_modules/gpii-db-operation/src/DbDataStoreUtils.js
+++ b/gpii/node_modules/gpii-db-operation/src/DbDataStoreUtils.js
@@ -74,6 +74,37 @@ gpii.dbOperation.dbDataStore.findRecord = function (dataSource, directModel, val
return promiseTogo;
};
+/**
+ * Similar to `gpii.dbOperation.dbDataStore.findRecord` but for CouchDB dataSources meant to return
+ * a list of records.
+ *
+ * Eventually this method, and the related CouchDB dataSources will take a standard set of options
+ * for paging and sorting. Because the dataProcessFunc can be operating on each record, ideally this
+ * should always return a reasonable amount of records you'd want to display say, on a page.
+ *
+ * @param {Component} dataSource - An instance of gpii.dbOperation.dbDataSource.
+ * @param {Object} directModel - The direct model expressing the "coordinates" of the model to be fetched.
+ * @param {Function} dataProcessFunc - The function to further process the retrieved record when the returned
+ * record is not empty.
+ * @return {Promise} A promise for the retrieved record.
+ */
+gpii.dbOperation.dbDataStore.findRecordList = function (dataSource, directModel, dataProcessFunc) {
+ dataProcessFunc = dataProcessFunc || gpii.dbOperation.dbDataStore.cleanUpDocList;
+ var promiseTogo = fluid.promise();
+
+ var finalDirectModel = fluid.extend(true, {}, dataSource.options.directModel, directModel);
+ var promise = dataSource.get(finalDirectModel);
+ promise.then(function (data) {
+ dataProcessFunc(data);
+ promiseTogo.resolve(data);
+ }, function (error) {
+ fluid.log("gpii-db-operation, findRecordList(), error occurs: ", error);
+ promiseTogo.reject(error);
+ });
+
+ return promiseTogo;
+};
+
/**
* Filter the given array valueNotEmpty to return elements that satisfy:
* 1. the element isn't used as a path name in the object;
@@ -113,6 +144,39 @@ gpii.dbOperation.dbDataStore.cleanUpDoc = function (data) {
return data;
};
+/**
+ * Modifies a list of records from CouchDB, such that the rows entry will now
+ * contain a list of the regular documents, rather than a key/id/doc entry.
+ * This will look for both options from a view, using first the `value` entry
+ * if it's available, and then checking for the `doc` entry on each item. The
+ * `doc` is what is available when your map view emits a `null` reference but
+ * the query is run to retrieve the document references.
+ *
+ * @param {Object} data - A CouchDB record list to transform.
+ * @return {Object} An object with CouchDB/PouchDB specific internal fields being transformed.
+ */
+gpii.dbOperation.dbDataStore.cleanUpDocList = function (data) {
+ if (data.rows) {
+ fluid.each(data.rows, function (item, idx) {
+ var toProcess;
+ if (item.value && item.value !== null) {
+ toProcess = item.value;
+ }
+ else if (item.doc) {
+ toProcess = item.doc;
+ }
+ else {
+ fluid.fail("Missing both the value or doc for record: ", item.key);
+ }
+ toProcess.id = item.id;
+ delete toProcess._id;
+ delete toProcess._rev;
+ data.rows[idx] = toProcess;
+ });
+ }
+ return data;
+};
+
/** Use the kettle dataSource `set` method to create a new record. Before sending the input data to
* CouchDB, it is modified by adding an unique _id field and a proper document type.
* @param {Component} dataSource - An instance of gpii.dbOperation.dbDataSource that handles the record creation.
@@ -287,7 +351,6 @@ gpii.dbOperation.dbDataStore.updateGpiiKey = function (saveDataSource, gpiiKey,
* type: {String},
* schemaVersion: {String},
* name: {String},
- * password: {String},
* email: {String},
* preferences: {Object},
* timestampCreated: {Date},
@@ -324,7 +387,6 @@ gpii.dbOperation.dbDataStore.findPrefsSafeByGpiiKeyPostProcess = function (data)
* {
* prefsSafeType: {String},
* name: {String},
- * password: {String},
* email: {String},
* preferences: {Object}
* }
@@ -344,7 +406,6 @@ gpii.dbOperation.dbDataStore.addPrefsSafe = function (saveDataSource, prefsSafeD
schemaVersion: gpii.dbOperation.schemaVersion,
prefsSafeType: prefsSafeData.prefsSafeType,
name: prefsSafeData.name,
- password: prefsSafeData.password,
email: prefsSafeData.email,
preferences: prefsSafeData.preferences,
timestampCreated: gpii.dbOperation.getCurrentTimestamp(),
@@ -366,7 +427,6 @@ gpii.dbOperation.dbDataStore.addPrefsSafe = function (saveDataSource, prefsSafeD
* schemaVersion: {String},
* prefsSafeType: {String},
* name: {String},
- * password: {String},
* email: {String},
* preferences: {Object},
* timestampCreated: {Date}
@@ -391,7 +451,6 @@ gpii.dbOperation.dbDataStore.updatePrefsSafe = function (saveDataSource, prefsSa
schemaVersion: prefsSafeData.schemaVersion,
prefsSafeType: prefsSafeData.prefsSafeType,
name: prefsSafeData.name || null,
- password: prefsSafeData.password || null,
email: prefsSafeData.email || null,
preferences: prefsSafeData.preferences,
timestampCreated: prefsSafeData.timestampCreated,
diff --git a/gpii/node_modules/gpii-db-operation/src/DbUtils.js b/gpii/node_modules/gpii-db-operation/src/DbUtils.js
index 4113d1bc7..13dcea0b4 100644
--- a/gpii/node_modules/gpii-db-operation/src/DbUtils.js
+++ b/gpii/node_modules/gpii-db-operation/src/DbUtils.js
@@ -36,3 +36,40 @@ gpii.dbOperation.composeError = function (error, termMap) {
gpii.dbOperation.getCurrentTimestamp = function () {
return new Date().toISOString();
};
+
+/**
+ * This function looks at an item to make sure it exists properly, useful for
+ * looking at the results of a `{dataStore}.findById` or similar operation. If
+ * the item exists as it should, a promise resolved with the item is
+ * returned, otherwise a rejected promise is returned with the supplied `errorMessage`.
+ *
+ * The current criteria for validity is that the item is not undefined and has
+ * the `type` that is supplied in the arguments.
+ *
+ * @param {Object} item - Item, mostly a return from another API or CouchDB call
+ * that we are checking to make sure it's of the appropriate type.
+ * @param {String} type - The `type` that the item should be of. This is to
+ * follow the convention we have for CouchDB records where each record has a `type`
+ * member.
+ * @param {String} errorMessage - If this isn't the appropriate type, this message will be
+ * included in the promise rejection payload.
+ * @param {String} errorCode - If this isn't the appropriate type, this error code will be
+ * included in the promise rejection payload.
+ * @return {fluid.promise} Promise, when the item is valid, it resolves with the
+ * original item. When the item is not valid, it rejects with an error payload including
+ * the supplied `errorMessage`.
+ */
+gpii.dbOperation.verifyExists = function (item, type, errorMessage, errorCode) {
+ var togo = fluid.promise();
+ if (item && item.type === type) {
+ togo.resolve(item);
+ }
+ else {
+ togo.reject({
+ isError: true,
+ errorCode: errorCode,
+ message: errorMessage
+ });
+ }
+ return togo;
+};
diff --git a/gpii/node_modules/gpii-db-operation/test/DbDataStoreTests.js b/gpii/node_modules/gpii-db-operation/test/DbDataStoreTests.js
index 466f6a9f7..b1d2eef2e 100644
--- a/gpii/node_modules/gpii-db-operation/test/DbDataStoreTests.js
+++ b/gpii/node_modules/gpii-db-operation/test/DbDataStoreTests.js
@@ -510,6 +510,54 @@ fluid.defaults("gpii.tests.dbDataStore.addAuthorization", {
}]
});
+fluid.defaults("gpii.tests.dbDataStore.findPrefsSafeList", {
+ gradeNames: ["gpii.tests.dbDataStore.environment"],
+ rawModules: [{
+ name: "Test findPrefsSafeList()",
+ tests: [{
+ name: "List prefs safes",
+ sequence: [{
+ task: "{dbDataStore}.findPrefsSafeList",
+ args: [undefined],
+ resolve: "jqUnit.assertDeepEq",
+ resolveArgs: ["Expecing a list of all the safes.", gpii.tests.dbDataStore.testData.findPrefsSafeList_listing, "{arguments}.0"]
+ }]
+ }]
+ }]
+});
+
+fluid.defaults("gpii.tests.dbDataStore.findRelatedDocsForPrefsSafe", {
+ gradeNames: ["gpii.tests.dbDataStore.environment"],
+ rawModules: [{
+ name: "Test findRelatedDocsForPrefsSafe()",
+ tests: [{
+ name: "List prefs safes",
+ sequence: [{
+ task: "{dbDataStore}.findRelatedDocsForPrefsSafe",
+ args: ["prefsSafe-1"],
+ resolve: "jqUnit.assertLeftHand",
+ resolveArgs: ["Expecting a list of keys for prefsSafe-1.", gpii.tests.dbDataStore.testData.findRelatedDocsForPrefsSafe_prefsSafe1, "{arguments}.0"]
+ }]
+ }]
+ }]
+});
+
+fluid.defaults("gpii.tests.dbDataStore.findSafeByExpressUserLookup", {
+ gradeNames: ["gpii.tests.dbDataStore.environment"],
+ rawModules: [{
+ name: "Test findSafeByExpressUserLookup()",
+ tests: [{
+ name: "List prefs safes",
+ sequence: [{
+ task: "{dbDataStore}.findSafeByExpressUserLookup",
+ args: ["org.couch.db.user:prefs1user"],
+ resolve: "jqUnit.assertDeepEq",
+ resolveArgs: ["Expecting a safe from the express lookup.", gpii.tests.dbDataStore.testData.findSafeByExpressUserLookup_credential, "{arguments}.0"]
+ }]
+ }]
+ }]
+});
+
fluid.test.runTests([
"gpii.tests.dbDataStore.findGpiiKey",
"gpii.tests.dbDataStore.findClientById",
@@ -522,5 +570,8 @@ fluid.test.runTests([
"gpii.tests.dbDataStore.updateGpiiKey",
"gpii.tests.dbDataStore.addPrefsSafe",
"gpii.tests.dbDataStore.updatePrefsSafe",
- "gpii.tests.dbDataStore.addAuthorization"
+ "gpii.tests.dbDataStore.addAuthorization",
+ "gpii.tests.dbDataStore.findPrefsSafeList",
+ "gpii.tests.dbDataStore.findRelatedDocsForPrefsSafe",
+ "gpii.tests.dbDataStore.findSafeByExpressUserLookup"
]);
diff --git a/gpii/node_modules/gpii-db-operation/test/DbDataStoreTestsUtils.js b/gpii/node_modules/gpii-db-operation/test/DbDataStoreTestsUtils.js
index 318770bf3..ba019ad0c 100644
--- a/gpii/node_modules/gpii-db-operation/test/DbDataStoreTestsUtils.js
+++ b/gpii/node_modules/gpii-db-operation/test/DbDataStoreTestsUtils.js
@@ -27,6 +27,7 @@ fluid.defaults("gpii.tests.dbDataStore.environment", {
"%gpii-db-operation/test/data/clientCredentials.json",
"%gpii-db-operation/test/data/gpiiAppInstallationAuthorizations.json",
"%gpii-db-operation/test/data/gpiiAppInstallationClients.json",
+ "%gpii-db-operation/test/data/gpiiCloudSafeCred.json",
"%gpii-db-operation/test/data/gpiiKeys.json",
"%gpii-db-operation/test/data/prefsSafes.json",
"%gpii-universal/testData/dbData/views.json"
@@ -134,7 +135,7 @@ gpii.tests.dbDataStore.testData = {
gpiiKeyChromehcDefault: {
"id": "chrome_high_contrast",
"type": "gpiiKey",
- "schemaVersion": "0.2",
+ "schemaVersion": "0.3",
"prefsSafeId": "prefsSafe-1",
"prefsSetId": "gpii-default",
"revoked": false,
@@ -145,7 +146,7 @@ gpii.tests.dbDataStore.testData = {
client1: {
"id": "gpiiAppInstallationClient-1",
"type": "gpiiAppInstallationClient",
- "schemaVersion": "0.2",
+ "schemaVersion": "0.3",
"name": "AJC-Bakersfield",
"computerType": "public",
"timestampCreated": "2017-11-21T18:11:22.101Z",
@@ -154,7 +155,7 @@ gpii.tests.dbDataStore.testData = {
clientCredential1: {
"id": "clientCredential-1",
"type": "clientCredential",
- "schemaVersion": "0.2",
+ "schemaVersion": "0.3",
"clientId": "gpiiAppInstallationClient-1",
"oauth2ClientId": "net.gpii.ajc.bakersfield",
"oauth2ClientSecret": "client_secret_ajc_bakersfield",
@@ -168,7 +169,7 @@ gpii.tests.dbDataStore.testData = {
"gpiiKeyDetails": {
"id": "chrome_high_contrast",
"type": "gpiiKey",
- "schemaVersion": "0.2",
+ "schemaVersion": "0.3",
"prefsSafeId": "prefsSafe-1",
"prefsSetId": "gpii-default",
"revoked": false,
@@ -179,10 +180,9 @@ gpii.tests.dbDataStore.testData = {
"prefsSafe": {
"id": "prefsSafe-1",
"type": "prefsSafe",
- "schemaVersion": "0.2",
+ "schemaVersion": "0.3",
"prefsSafeType": "user",
"name": null,
- "password": null,
"email": null,
"preferences": {
"flat": {
@@ -213,7 +213,7 @@ gpii.tests.dbDataStore.testData = {
"gpiiKeyDetails": {
"id": "chrome_high_contrast_dark",
"type": "gpiiKey",
- "schemaVersion": "0.2",
+ "schemaVersion": "0.3",
"prefsSafeId": null,
"prefsSetId": null,
"revoked": false,
@@ -227,7 +227,7 @@ gpii.tests.dbDataStore.testData = {
"oauth2ClientId": "net.gpii.ajc.bakersfield",
"client": {
"type": "gpiiAppInstallationClient",
- "schemaVersion": "0.2",
+ "schemaVersion": "0.3",
"name": "AJC-Bakersfield",
"computerType": "public",
"timestampCreated": "2017-11-21T18:11:22.101Z",
@@ -236,7 +236,7 @@ gpii.tests.dbDataStore.testData = {
},
"clientCredential": {
"type": "clientCredential",
- "schemaVersion": "0.2",
+ "schemaVersion": "0.3",
"clientId": "gpiiAppInstallationClient-1",
"oauth2ClientId": "net.gpii.ajc.bakersfield",
"oauth2ClientSecret": "client_secret_ajc_bakersfield",
@@ -258,7 +258,7 @@ gpii.tests.dbDataStore.testData = {
},
gpiiKeyToUpdate: {
"type": "gpiiKey",
- "schemaVersion": "0.2",
+ "schemaVersion": "0.3",
"prefsSafeId": "prefsSafe-1",
"prefsSetId": "updated_name",
"revoked": false,
@@ -269,7 +269,6 @@ gpii.tests.dbDataStore.testData = {
prefsSafeToCreate: {
"prefsSafeType": "user",
"name": null,
- "password": null,
"email": null,
"preferences": {
"test": "test"
@@ -277,10 +276,9 @@ gpii.tests.dbDataStore.testData = {
},
prefsSafeToUpdate: {
"type": "prefsSafe",
- "schemaVersion": "0.2",
+ "schemaVersion": "0.3",
"prefsSafeType": "snapset",
"name": "updated_name",
- "password": "updated_password",
"email": "updated_email",
"preferences": {
"test": "test"
@@ -298,7 +296,7 @@ gpii.tests.dbDataStore.testData = {
"accessToken": "gpii-app-installation-accessToken-1",
"clientCredential": {
"type": "clientCredential",
- "schemaVersion": "0.2",
+ "schemaVersion": "0.3",
"clientId": "gpiiAppInstallationClient-1",
"oauth2ClientId": "net.gpii.ajc.bakersfield",
"oauth2ClientSecret": "client_secret_ajc_bakersfield",
@@ -310,7 +308,7 @@ gpii.tests.dbDataStore.testData = {
},
"authorization": {
"type": "gpiiAppInstallationAuthorization",
- "schemaVersion": "0.2",
+ "schemaVersion": "0.3",
"clientId": "gpiiAppInstallationClient-1",
"gpiiKey": "chrome_high_contrast",
"clientCredentialId": "clientCredential-1",
@@ -322,5 +320,47 @@ gpii.tests.dbDataStore.testData = {
"timestampExpires": "3020-05-30T17:54:00.000Z",
"id": "gpiiAppInstallationAuthorization-1"
}
+ },
+ findPrefsSafeList_listing: {
+ "total_rows": 1,
+ "offset": 0,
+ "rows": [
+ {
+ "name": null,
+ "email": null,
+ "created": "2017-12-01T18:43:32.889Z",
+ "updated": null,
+ "id": "prefsSafe-1"
+ }
+ ]
+ },
+ findRelatedDocsForPrefsSafe_prefsSafe1: {
+ "rows": [
+ {
+ "type": "gpiiCloudSafeCredential",
+ "schemaVersion": "0.3",
+ "prefsSafeId": "prefsSafe-1",
+ "gpiiExpressUserId": "org.couch.db.user:prefs1user",
+ "id": "8f3085a7-b65b-4648-9a78-8ac7de766997"
+ },
+ {
+ "type": "gpiiKey",
+ "schemaVersion": "0.3",
+ "prefsSafeId": "prefsSafe-1",
+ "prefsSetId": "gpii-default",
+ "revoked": false,
+ "revokedReason": null,
+ "timestampCreated": "2017-11-21T18:11:22.101Z",
+ "timestampUpdated": null,
+ "id": "chrome_high_contrast"
+ }
+ ]
+ },
+ findSafeByExpressUserLookup_credential: {
+ "type": "gpiiCloudSafeCredential",
+ "schemaVersion": "0.3",
+ "prefsSafeId": "prefsSafe-1",
+ "gpiiExpressUserId": "org.couch.db.user:prefs1user",
+ "id": "8f3085a7-b65b-4648-9a78-8ac7de766997"
}
};
diff --git a/gpii/node_modules/gpii-db-operation/test/data/clientCredentials.json b/gpii/node_modules/gpii-db-operation/test/data/clientCredentials.json
index 312503480..642176f6d 100644
--- a/gpii/node_modules/gpii-db-operation/test/data/clientCredentials.json
+++ b/gpii/node_modules/gpii-db-operation/test/data/clientCredentials.json
@@ -2,7 +2,7 @@
{
"_id": "clientCredential-1",
"type": "clientCredential",
- "schemaVersion": "0.2",
+ "schemaVersion": "0.3",
"clientId": "gpiiAppInstallationClient-1",
"oauth2ClientId": "net.gpii.ajc.bakersfield",
"oauth2ClientSecret": "client_secret_ajc_bakersfield",
@@ -14,7 +14,7 @@
{
"_id": "clientCredential-2",
"type": "clientCredential",
- "schemaVersion": "0.2",
+ "schemaVersion": "0.3",
"clientId": "gpiiAppInstallationClient-2",
"oauth2ClientId": "net.gpii.ajc.richmond",
"oauth2ClientSecret": "client_secret_ajc_richmond",
diff --git a/gpii/node_modules/gpii-db-operation/test/data/gpiiAppInstallationAuthorizations.json b/gpii/node_modules/gpii-db-operation/test/data/gpiiAppInstallationAuthorizations.json
index 2a2453459..b9ce8228e 100644
--- a/gpii/node_modules/gpii-db-operation/test/data/gpiiAppInstallationAuthorizations.json
+++ b/gpii/node_modules/gpii-db-operation/test/data/gpiiAppInstallationAuthorizations.json
@@ -2,7 +2,7 @@
{
"_id": "gpiiAppInstallationAuthorization-1",
"type": "gpiiAppInstallationAuthorization",
- "schemaVersion": "0.2",
+ "schemaVersion": "0.3",
"clientId": "gpiiAppInstallationClient-1",
"gpiiKey": "chrome_high_contrast",
"clientCredentialId": "clientCredential-1",
@@ -16,7 +16,7 @@
{
"_id": "gpiiAppInstallationAuthorization-2",
"type": "gpiiAppInstallationAuthorization",
- "schemaVersion": "0.2",
+ "schemaVersion": "0.3",
"clientId": "gpiiAppInstallationClient-2",
"gpiiKey": "chrome_high_contrast",
"clientCredentialId": "clientCredential-2",
@@ -30,7 +30,7 @@
{
"_id": "gpiiAppInstallationAuthorization-3",
"type": "gpiiAppInstallationAuthorization",
- "schemaVersion": "0.2",
+ "schemaVersion": "0.3",
"clientId": "gpiiAppInstallationClient-2",
"gpiiKey": "chrome_high_contrast",
"clientCredentialId": "clientCredential-2",
diff --git a/gpii/node_modules/gpii-db-operation/test/data/gpiiAppInstallationClients.json b/gpii/node_modules/gpii-db-operation/test/data/gpiiAppInstallationClients.json
index adf2efc56..18024d6c4 100644
--- a/gpii/node_modules/gpii-db-operation/test/data/gpiiAppInstallationClients.json
+++ b/gpii/node_modules/gpii-db-operation/test/data/gpiiAppInstallationClients.json
@@ -2,7 +2,7 @@
{
"_id": "gpiiAppInstallationClient-1",
"type": "gpiiAppInstallationClient",
- "schemaVersion": "0.2",
+ "schemaVersion": "0.3",
"name": "AJC-Bakersfield",
"computerType": "public",
"timestampCreated": "2017-11-21T18:11:22.101Z",
@@ -11,7 +11,7 @@
{
"_id": "gpiiAppInstallationClient-2",
"type": "gpiiAppInstallationClient",
- "schemaVersion": "0.2",
+ "schemaVersion": "0.3",
"name": "AJC-Richmond",
"computerType": "public",
"timestampCreated": "2017-11-21T18:11:22.101Z",
diff --git a/gpii/node_modules/gpii-db-operation/test/data/gpiiCloudSafeCred.json b/gpii/node_modules/gpii-db-operation/test/data/gpiiCloudSafeCred.json
new file mode 100644
index 000000000..826148920
--- /dev/null
+++ b/gpii/node_modules/gpii-db-operation/test/data/gpiiCloudSafeCred.json
@@ -0,0 +1,23 @@
+[
+ {
+ "name": "prefs1user",
+ "type": "user",
+ "email": "prefs1user@gpii.org",
+ "roles": [],
+ "username": "prefs1user",
+ "verified": true,
+ "iterations": 10,
+ "password_scheme": "pbkdf2",
+ "salt": "7cf6961e6ded3bd25732e5466512d116bf9908ba9629d4ed060a03a965e5341d",
+ "derived_key": "e8bd265e7d82fd0f662e9ddaaf2e75acb294da1b",
+ "verification_code": "618fa72aa62af282704b556e34957a79",
+ "_id": "org.couch.db.user:prefs7user"
+ },
+ {
+ "type": "gpiiCloudSafeCredential",
+ "schemaVersion": "0.3",
+ "prefsSafeId": "prefsSafe-1",
+ "gpiiExpressUserId": "org.couch.db.user:prefs1user",
+ "_id": "8f3085a7-b65b-4648-9a78-8ac7de766997"
+ }
+]
diff --git a/gpii/node_modules/gpii-db-operation/test/data/gpiiKeys.json b/gpii/node_modules/gpii-db-operation/test/data/gpiiKeys.json
index 3b318f739..50cbba643 100644
--- a/gpii/node_modules/gpii-db-operation/test/data/gpiiKeys.json
+++ b/gpii/node_modules/gpii-db-operation/test/data/gpiiKeys.json
@@ -2,7 +2,7 @@
{
"_id": "chrome_high_contrast",
"type": "gpiiKey",
- "schemaVersion": "0.2",
+ "schemaVersion": "0.3",
"prefsSafeId": "prefsSafe-1",
"prefsSetId": "gpii-default",
"revoked": false,
@@ -13,7 +13,7 @@
{
"_id": "chrome_high_contrast_dark",
"type": "gpiiKey",
- "schemaVersion": "0.2",
+ "schemaVersion": "0.3",
"prefsSafeId": null,
"prefsSetId": null,
"revoked": false,
diff --git a/gpii/node_modules/gpii-db-operation/test/data/prefsSafes.json b/gpii/node_modules/gpii-db-operation/test/data/prefsSafes.json
index 9fd2dfc47..e82a56b67 100644
--- a/gpii/node_modules/gpii-db-operation/test/data/prefsSafes.json
+++ b/gpii/node_modules/gpii-db-operation/test/data/prefsSafes.json
@@ -2,10 +2,9 @@
{
"_id": "prefsSafe-1",
"type": "prefsSafe",
- "schemaVersion": "0.2",
+ "schemaVersion": "0.3",
"prefsSafeType": "user",
"name": null,
- "password": null,
"email": null,
"preferences": {
"flat": {
diff --git a/gpii/node_modules/gpii-oauth2/gpii-oauth2-authz-server/test/data/authorizationServiceTests-data.json b/gpii/node_modules/gpii-oauth2/gpii-oauth2-authz-server/test/data/authorizationServiceTests-data.json
index 476d31065..202d605b1 100644
--- a/gpii/node_modules/gpii-oauth2/gpii-oauth2-authz-server/test/data/authorizationServiceTests-data.json
+++ b/gpii/node_modules/gpii-oauth2/gpii-oauth2-authz-server/test/data/authorizationServiceTests-data.json
@@ -2,7 +2,7 @@
{
"_id": "alice_gpii_key",
"type": "gpiiKey",
- "schemaVersion": "0.2",
+ "schemaVersion": "0.3",
"prefsSafeId": "prefsSafe-1",
"prefsSetId": "gpii-default",
"revoked": false,
@@ -13,7 +13,7 @@
{
"_id": "gpiiAppInstallationClient-1",
"type": "gpiiAppInstallationClient",
- "schemaVersion": "0.2",
+ "schemaVersion": "0.3",
"name": "AJC1",
"computerType": "public",
"timestampCreated": "2017-11-21T18:11:22.101Z",
@@ -22,7 +22,7 @@
{
"_id": "clientCredential-1",
"type": "clientCredential",
- "schemaVersion": "0.2",
+ "schemaVersion": "0.3",
"clientId": "gpiiAppInstallationClient-1",
"oauth2ClientId": "client_id_AJC1",
"oauth2ClientSecret": "client_secret_AJC1",
@@ -34,7 +34,7 @@
{
"_id": "gpiiAppInstallationClient-2",
"type": "unknownClient",
- "schemaVersion": "0.2",
+ "schemaVersion": "0.3",
"name": "test",
"computerType": "public",
"timestampCreated": "2017-11-21T18:11:22.101Z",
@@ -43,7 +43,7 @@
{
"_id": "clientCredential-2",
"type": "clientCredential",
- "schemaVersion": "0.2",
+ "schemaVersion": "0.3",
"clientId": "gpiiAppInstallationClient-2",
"oauth2ClientId": "client_id_test",
"oauth2ClientSecret": "client_secret_test",
@@ -55,7 +55,7 @@
{
"_id": "clientCredential-3",
"type": "unknownClientCredential",
- "schemaVersion": "0.2",
+ "schemaVersion": "0.3",
"clientId": "gpiiAppInstallationClient-2",
"oauth2ClientId": "client_id_test-3",
"oauth2ClientSecret": "client_secret_test-3",
diff --git a/gpii/node_modules/lifecycleManager/test/html/LifecycleManagerUtilsTest.html b/gpii/node_modules/lifecycleManager/test/html/LifecycleManagerUtilsTest.html
deleted file mode 100644
index bb79b1b11..000000000
--- a/gpii/node_modules/lifecycleManager/test/html/LifecycleManagerUtilsTest.html
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-