@nsshunt/stsdatamanagement 1.12.4 → 1.12.7
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/blcauth.js +27 -0
- package/db-scripts/applications.json +6 -1
- package/package.json +2 -2
- package/pgaccesslayer.js +2 -2
package/blcauth.js
CHANGED
|
@@ -270,6 +270,33 @@ class BLCAuth
|
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
272
|
|
|
273
|
+
GetResourcesFromPermissions = (permissions) => {
|
|
274
|
+
let sep = '';
|
|
275
|
+
let resource = '';
|
|
276
|
+
let resourcesArr = [ ];
|
|
277
|
+
let resources = '';
|
|
278
|
+
let scopes = '';
|
|
279
|
+
permissions.forEach(permission => {
|
|
280
|
+
scopes += sep + permission;
|
|
281
|
+
sep = ' ';
|
|
282
|
+
let resourceParts = permission.split('.');
|
|
283
|
+
if (resourceParts.length !== 2) {
|
|
284
|
+
throw new STSResourceMalformedError('permission', 'N/A', permission);
|
|
285
|
+
}
|
|
286
|
+
resource = resourceParts[0];
|
|
287
|
+
if (!resourcesArr.includes(resource)) {
|
|
288
|
+
resourcesArr.push(resource);
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
if (resourcesArr.length !== 0) {
|
|
292
|
+
resources = resourcesArr.join(' ');
|
|
293
|
+
}
|
|
294
|
+
return {
|
|
295
|
+
scopes,
|
|
296
|
+
resources
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
273
300
|
#GetResourcesForApplication = (clientId, audience, app) => {
|
|
274
301
|
const permissions = app.permissions;
|
|
275
302
|
let sep = '';
|
|
@@ -62,7 +62,12 @@
|
|
|
62
62
|
"STSAuthenticate": {
|
|
63
63
|
"clientName": "STSAuthenticateSPA",
|
|
64
64
|
"clientId": "v4qBrds3Autl/i86xT+5z0K53kJ/2hHTfxNo0QO/0Jk=",
|
|
65
|
-
"type": "SPA"
|
|
65
|
+
"type": "SPA",
|
|
66
|
+
"callBackURI": [
|
|
67
|
+
"https://stsmda.com.au/stsauthenticate/",
|
|
68
|
+
"https://stsmda.com.au/stsauthenticate/admin/",
|
|
69
|
+
"https://192.168.14.1:3010/"
|
|
70
|
+
]
|
|
66
71
|
},
|
|
67
72
|
"STSClientApp01": {
|
|
68
73
|
"clientName": "STSClientApp01SPA",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nsshunt/stsdatamanagement",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.7",
|
|
4
4
|
"description": "STS Data Management Modules, Utilities and Services",
|
|
5
5
|
"main": "dbaccess.js",
|
|
6
6
|
"dependencies": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"cli-progress": "^3.10.0",
|
|
13
13
|
"colors": "^1.4.0",
|
|
14
14
|
"debug": "^4.3.4",
|
|
15
|
-
"ioredis": "^5.0.
|
|
15
|
+
"ioredis": "^5.0.4",
|
|
16
16
|
"pg": "^8.7.3",
|
|
17
17
|
"pg-copy-streams": "^6.0.2",
|
|
18
18
|
"prompts": "^2.4.2",
|
package/pgaccesslayer.js
CHANGED
|
@@ -126,10 +126,10 @@ class PGAccessLayer
|
|
|
126
126
|
let retVal = await this.getLatestResource(resid);
|
|
127
127
|
if (retVal.status !== status.success)
|
|
128
128
|
{
|
|
129
|
-
await this.createResource(userid, resid, data);
|
|
129
|
+
return await this.createResource(userid, resid, data);
|
|
130
130
|
} else {
|
|
131
131
|
let vnum = retVal.detail.vnum;
|
|
132
|
-
await this.updateResource(userid, resid, vnum, data);
|
|
132
|
+
return await this.updateResource(userid, resid, vnum, data);
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
|