aotrautils 0.0.155 → 0.0.158
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.
- aotrautils/aotrautils.build.js +19 -27
- aotrautils/package.json +1 -1
aotrautils/aotrautils.build.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
/*utils COMMONS library associated with aotra version : «1.0.0.000 (17/07/2022-
|
|
3
|
+
/*utils COMMONS library associated with aotra version : «1.0.0.000 (17/07/2022-13:56:47)»*/
|
|
4
4
|
/*-----------------------------------------------------------------------------*/
|
|
5
5
|
|
|
6
6
|
|
|
@@ -4828,7 +4828,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
|
|
|
4828
4828
|
|
|
4829
4829
|
|
|
4830
4830
|
|
|
4831
|
-
/*utils CLIENT library associated with aotra version : «1.0.0.000 (17/07/2022-
|
|
4831
|
+
/*utils CLIENT library associated with aotra version : «1.0.0.000 (17/07/2022-13:56:47)»*/
|
|
4832
4832
|
/*-----------------------------------------------------------------------------*/
|
|
4833
4833
|
/* ## Utility global methods in a browser (htmljs) client environment.
|
|
4834
4834
|
*
|
|
@@ -11678,7 +11678,7 @@ createFusrodaClient=function(doOnClientReady, doOnDataReception, urlParam=null,
|
|
|
11678
11678
|
|
|
11679
11679
|
|
|
11680
11680
|
|
|
11681
|
-
/*utils GEOMETRY library associated with aotra version : «1.0.0.000 (17/07/2022-
|
|
11681
|
+
/*utils GEOMETRY library associated with aotra version : «1.0.0.000 (17/07/2022-13:56:47)»*/
|
|
11682
11682
|
/*-----------------------------------------------------------------------------*/
|
|
11683
11683
|
|
|
11684
11684
|
|
|
@@ -12884,7 +12884,7 @@ function rayVsUnitSphereClosestPoint(p, r) {
|
|
|
12884
12884
|
// MUST REMAIN AT THE END OF THIS LIBRARY FILE !
|
|
12885
12885
|
|
|
12886
12886
|
AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
|
|
12887
|
-
/*utils SERVER library associated with aotra version : «1.0.0.000 (17/07/2022-
|
|
12887
|
+
/*utils SERVER library associated with aotra version : «1.0.0.000 (17/07/2022-13:56:47)»*/
|
|
12888
12888
|
/*-----------------------------------------------------------------------------*/
|
|
12889
12889
|
|
|
12890
12890
|
|
|
@@ -13252,8 +13252,6 @@ WebsocketImplementation={
|
|
|
13252
13252
|
const clientSocket=clientSocketParam;
|
|
13253
13253
|
|
|
13254
13254
|
|
|
13255
|
-
// DBG
|
|
13256
|
-
lognow(" receptionEntryPoint.clientsRoomsTag:",receptionEntryPoint.clientsRoomsTag);
|
|
13257
13255
|
|
|
13258
13256
|
// TODO : FIXME : Use one single interface !
|
|
13259
13257
|
// Room information is stored in client socket object :
|
|
@@ -13303,12 +13301,6 @@ WebsocketImplementation={
|
|
|
13303
13301
|
else serverClients=nodeServerInstance.serverSocket.sockets.sockets;
|
|
13304
13302
|
|
|
13305
13303
|
|
|
13306
|
-
// DBG
|
|
13307
|
-
lognow("nodeServerInstance.serverSocket:",nodeServerInstance.serverSocket);
|
|
13308
|
-
lognow("nodeServerInstance.serverSocket.sockets:",nodeServerInstance.serverSocket.sockets);
|
|
13309
|
-
lognow("serverClients:",serverClients);
|
|
13310
|
-
|
|
13311
|
-
|
|
13312
13304
|
|
|
13313
13305
|
serverClients.forEach((clientSocket)=>{
|
|
13314
13306
|
|
|
@@ -13831,7 +13823,7 @@ WebsocketImplementation={
|
|
|
13831
13823
|
|
|
13832
13824
|
launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=null, /*OPTIONAL*/sslOptions=null){
|
|
13833
13825
|
|
|
13834
|
-
const EXCLUDED_FILENAMES_PARTS=[".
|
|
13826
|
+
const EXCLUDED_FILENAMES_PARTS=[".keyHash."];
|
|
13835
13827
|
|
|
13836
13828
|
|
|
13837
13829
|
if(typeof(https)==="undefined"){
|
|
@@ -13966,7 +13958,7 @@ initNodeServer=function(doOnClientConnection=null, doOnFinalizeServer=null, /*OP
|
|
|
13966
13958
|
console.log("Server launched.");
|
|
13967
13959
|
console.log("Usage : node <server.js> conf {port:[port], sslCertPath:[ssl certificate path | unsecure ], sslKeyPath:[ssl key path], serverConfig:[JSON server configuration]}");
|
|
13968
13960
|
console.log("Or (to generate password hash) : node <server.js> hash <clientId@repositoryName> <clearTextSecretString>");
|
|
13969
|
-
// EXAMPLE : node orita-srv.js hash orita.global@
|
|
13961
|
+
// EXAMPLE : node orita-srv.js hash orita.global@keyHash 1234567890
|
|
13970
13962
|
console.log("Server launched.");
|
|
13971
13963
|
|
|
13972
13964
|
// We read the command-line arguments if needed :
|
|
@@ -14011,41 +14003,41 @@ initNodeServer=function(doOnClientConnection=null, doOnFinalizeServer=null, /*OP
|
|
|
14011
14003
|
aotraNodeServer.serverManager={ start:()=>{/*DEFAULT START FUNCTION, WILL BE OVERRIDEN LATER*/}};
|
|
14012
14004
|
|
|
14013
14005
|
if(isHashAsked){
|
|
14014
|
-
// We
|
|
14006
|
+
// We instanciate a temporary persister just to read the key hash file:
|
|
14015
14007
|
const persister=getPersister("./");
|
|
14016
14008
|
let persisterIdSplits=persisterId.split("@");
|
|
14017
14009
|
if(empty(persisterIdSplits) || persisterIdSplits.length!=2){
|
|
14018
14010
|
// TRACE
|
|
14019
|
-
console.log("ERROR : No persister repository IDs provided correctly. Cannot read
|
|
14011
|
+
console.log("ERROR : No persister repository IDs provided correctly. Cannot read key hash. Aborting hash generation.");
|
|
14020
14012
|
return aotraNodeServer;
|
|
14021
14013
|
}
|
|
14022
14014
|
const persisterClientId=persisterIdSplits[0];
|
|
14023
14015
|
const persisterRepositoryName=persisterIdSplits[1];
|
|
14024
|
-
let
|
|
14025
|
-
if(!
|
|
14016
|
+
let globalKeyHashObject=persister.readTreeObjectFromFile(persisterClientId, persisterRepositoryName);
|
|
14017
|
+
if(!globalKeyHashObject || !globalKeyHashObject.keyHash){
|
|
14026
14018
|
// TRACE
|
|
14027
|
-
console.log("WARN : No
|
|
14028
|
-
|
|
14029
|
-
persister.saveDataToFileForClient(persisterClientId,persisterRepositoryName,
|
|
14019
|
+
console.log("WARN : No key hash found. Generating one now.");
|
|
14020
|
+
globalKeyHashObject={keyHash:getUUID(), hashes:[]};
|
|
14021
|
+
persister.saveDataToFileForClient(persisterClientId,persisterRepositoryName,globalKeyHashObject,false,()=>{
|
|
14030
14022
|
// TRACE
|
|
14031
|
-
console.log("INFO :
|
|
14023
|
+
console.log("INFO : Key hash generated and saved successfully.");
|
|
14032
14024
|
});
|
|
14033
14025
|
}
|
|
14034
|
-
const
|
|
14026
|
+
const globalKeyHash=globalKeyHashObject.keyHash;
|
|
14035
14027
|
|
|
14036
14028
|
let firstHash=getHashedString(clearTextParam);
|
|
14037
14029
|
|
|
14038
|
-
let generatedHash=getHashedString( firstHash +
|
|
14039
|
-
|
|
14030
|
+
let generatedHash=getHashedString( firstHash + globalKeyHash, true);// (we use the heavy treatment thing.)
|
|
14031
|
+
globalKeyHashObject.hashes.push(generatedHash);
|
|
14040
14032
|
|
|
14041
14033
|
// We update the repository :
|
|
14042
|
-
persister.saveDataToFileForClient(persisterClientId,persisterRepositoryName,
|
|
14034
|
+
persister.saveDataToFileForClient(persisterClientId,persisterRepositoryName,globalKeyHashObject,false,()=>{
|
|
14043
14035
|
// TRACE
|
|
14044
14036
|
console.log("INFO : Hash added to repository and saved successfully.");
|
|
14045
14037
|
});
|
|
14046
14038
|
|
|
14047
14039
|
// OUTPUT
|
|
14048
|
-
console.log("Here is your key : share it with your clients but DO NOT LEAK IT !\n********************\n"+clearTextParam+"\n********************\n");
|
|
14040
|
+
console.log("Here is your key : share it with your main clients but DO NOT LEAK IT !\n********************\n"+clearTextParam+"\n********************\n");
|
|
14049
14041
|
|
|
14050
14042
|
return aotraNodeServer;
|
|
14051
14043
|
}
|
aotrautils/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aotrautils",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.158",
|
|
4
4
|
"main": "aotrautils.build.js",
|
|
5
5
|
"description": "A library for vanilla javascript utils (client-side) used in aotra javascript CMS",
|
|
6
6
|
"author": "Jeremie Ratomposon <info@alqemia.com> (https://alqemia.com)",
|