@nsshunt/stsdatamanagement 1.12.6 → 1.12.9
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/databaseutils.js +25 -0
- package/db-scripts/apis.json +15 -0
- package/db-scripts/applications.json +8 -1
- package/db-scripts/user-role.json +0 -14
- package/package.json +1 -1
package/databaseutils.js
CHANGED
|
@@ -58,6 +58,28 @@ class DatabaseUtils
|
|
|
58
58
|
return true;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
#_RegisterTestingUsersAndRoles = async(blcauth) => {
|
|
62
|
+
this.#debug(`Registering Test Users and Roles.`.yellow);
|
|
63
|
+
console.log(`Registering Test Users and Roles.`.yellow);
|
|
64
|
+
for (let i=0; i < 10; i++) {
|
|
65
|
+
let userNoStr = i.toString().padStart(2, '0');
|
|
66
|
+
let user = {
|
|
67
|
+
name: `Test User ${userNoStr}`,
|
|
68
|
+
email: `user${userNoStr}@stsmda.com.au`,
|
|
69
|
+
password: `user${userNoStr}password`,
|
|
70
|
+
roles: [ ]
|
|
71
|
+
}
|
|
72
|
+
let retVal = await blcauth.AddUser(user);
|
|
73
|
+
if (retVal.status !== 200) {
|
|
74
|
+
console.log(`User NOT registered: ${JSON.stringify(retVal)}`.red);
|
|
75
|
+
return false;
|
|
76
|
+
} else {
|
|
77
|
+
console.log(`User registered: ${JSON.stringify(retVal)}`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
|
|
61
83
|
#_RegisterApplications = async(blcauth) => {
|
|
62
84
|
this.#debug(`Registering Applications.`.yellow);
|
|
63
85
|
console.log(`Registering Applications.`.yellow);
|
|
@@ -141,6 +163,9 @@ class DatabaseUtils
|
|
|
141
163
|
if (status) {
|
|
142
164
|
status = await this.#_RegisterRolesAndPermissions(blcauth);
|
|
143
165
|
}
|
|
166
|
+
if (status) {
|
|
167
|
+
status = await this.#_RegisterTestingUsersAndRoles(blcauth);
|
|
168
|
+
}
|
|
144
169
|
if (status) {
|
|
145
170
|
status = await this.#_RegisterApplications(blcauth);
|
|
146
171
|
}
|
package/db-scripts/apis.json
CHANGED
|
@@ -61,6 +61,14 @@
|
|
|
61
61
|
"permissions": [
|
|
62
62
|
"session.read"
|
|
63
63
|
]
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"clientName": "STSTestingService",
|
|
67
|
+
"clientId": "4Mtb3ABdSzZvSz4T51HPJhT14znVnqVDRFiZsvDNAOg=",
|
|
68
|
+
"permissions": [
|
|
69
|
+
"session.read",
|
|
70
|
+
"session.update"
|
|
71
|
+
]
|
|
64
72
|
}
|
|
65
73
|
]
|
|
66
74
|
},
|
|
@@ -82,6 +90,13 @@
|
|
|
82
90
|
"permissions": [
|
|
83
91
|
"token"
|
|
84
92
|
]
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"clientName": "STSTestingService",
|
|
96
|
+
"clientId": "4Mtb3ABdSzZvSz4T51HPJhT14znVnqVDRFiZsvDNAOg=",
|
|
97
|
+
"permissions": [
|
|
98
|
+
"token"
|
|
99
|
+
]
|
|
85
100
|
}
|
|
86
101
|
]
|
|
87
102
|
},
|
|
@@ -59,13 +59,20 @@
|
|
|
59
59
|
"clientSecret": "bJzwAHA+U1Pn7ya9lWEH80a03Ic9tVlQ+OfHrc5ydqI4MNlWWvPPvK+c7Q==",
|
|
60
60
|
"type": "Service"
|
|
61
61
|
},
|
|
62
|
+
"STSTestingService": {
|
|
63
|
+
"clientName": "STSTestingService",
|
|
64
|
+
"clientId": "4Mtb3ABdSzZvSz4T51HPJhT14znVnqVDRFiZsvDNAOg=",
|
|
65
|
+
"clientSecret": "4jdqBshjc9+XADMyIemoHTwHqVI1//UcSK/gL20rPUrvy2P+78auYEH2ng==",
|
|
66
|
+
"type": "Service"
|
|
67
|
+
},
|
|
62
68
|
"STSAuthenticate": {
|
|
63
69
|
"clientName": "STSAuthenticateSPA",
|
|
64
70
|
"clientId": "v4qBrds3Autl/i86xT+5z0K53kJ/2hHTfxNo0QO/0Jk=",
|
|
65
71
|
"type": "SPA",
|
|
66
72
|
"callBackURI": [
|
|
67
73
|
"https://stsmda.com.au/stsauthenticate/",
|
|
68
|
-
"https://stsmda.com.au/stsauthenticate/admin"
|
|
74
|
+
"https://stsmda.com.au/stsauthenticate/admin/",
|
|
75
|
+
"https://192.168.14.1:3010/"
|
|
69
76
|
]
|
|
70
77
|
},
|
|
71
78
|
"STSClientApp01": {
|
|
@@ -71,19 +71,5 @@
|
|
|
71
71
|
"password": "STSTestRunnerServiceUserPassword",
|
|
72
72
|
"roles": [
|
|
73
73
|
]
|
|
74
|
-
},
|
|
75
|
-
"user01": {
|
|
76
|
-
"name": "Test User 01",
|
|
77
|
-
"email": "user01@stsmda.com.au",
|
|
78
|
-
"password": "user01password",
|
|
79
|
-
"roles": [
|
|
80
|
-
]
|
|
81
|
-
},
|
|
82
|
-
"user02": {
|
|
83
|
-
"name": "Test User 02",
|
|
84
|
-
"email": "user02@stsmda.com.au",
|
|
85
|
-
"password": "user02password",
|
|
86
|
-
"roles": [
|
|
87
|
-
]
|
|
88
74
|
}
|
|
89
75
|
}
|