aotrautils 0.0.156 → 0.0.159
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 -21
- 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-14:02:07)»*/
|
|
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-14:02:07)»*/
|
|
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-14:02:07)»*/
|
|
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-14:02:07)»*/
|
|
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 :
|
|
@@ -13825,7 +13823,7 @@ WebsocketImplementation={
|
|
|
13825
13823
|
|
|
13826
13824
|
launchNodeHTTPServer=function(port, doOnConnect=null, doOnFinalizeServer=null, /*OPTIONAL*/sslOptions=null){
|
|
13827
13825
|
|
|
13828
|
-
const EXCLUDED_FILENAMES_PARTS=[".
|
|
13826
|
+
const EXCLUDED_FILENAMES_PARTS=[".keyHash."];
|
|
13829
13827
|
|
|
13830
13828
|
|
|
13831
13829
|
if(typeof(https)==="undefined"){
|
|
@@ -13960,7 +13958,7 @@ initNodeServer=function(doOnClientConnection=null, doOnFinalizeServer=null, /*OP
|
|
|
13960
13958
|
console.log("Server launched.");
|
|
13961
13959
|
console.log("Usage : node <server.js> conf {port:[port], sslCertPath:[ssl certificate path | unsecure ], sslKeyPath:[ssl key path], serverConfig:[JSON server configuration]}");
|
|
13962
13960
|
console.log("Or (to generate password hash) : node <server.js> hash <clientId@repositoryName> <clearTextSecretString>");
|
|
13963
|
-
// EXAMPLE : node orita-srv.js hash orita.global@
|
|
13961
|
+
// EXAMPLE : node orita-srv.js hash orita.global@keyHash 1234567890
|
|
13964
13962
|
console.log("Server launched.");
|
|
13965
13963
|
|
|
13966
13964
|
// We read the command-line arguments if needed :
|
|
@@ -14005,41 +14003,41 @@ initNodeServer=function(doOnClientConnection=null, doOnFinalizeServer=null, /*OP
|
|
|
14005
14003
|
aotraNodeServer.serverManager={ start:()=>{/*DEFAULT START FUNCTION, WILL BE OVERRIDEN LATER*/}};
|
|
14006
14004
|
|
|
14007
14005
|
if(isHashAsked){
|
|
14008
|
-
// We
|
|
14006
|
+
// We instanciate a temporary persister just to read the key hash file:
|
|
14009
14007
|
const persister=getPersister("./");
|
|
14010
14008
|
let persisterIdSplits=persisterId.split("@");
|
|
14011
14009
|
if(empty(persisterIdSplits) || persisterIdSplits.length!=2){
|
|
14012
14010
|
// TRACE
|
|
14013
|
-
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.");
|
|
14014
14012
|
return aotraNodeServer;
|
|
14015
14013
|
}
|
|
14016
14014
|
const persisterClientId=persisterIdSplits[0];
|
|
14017
14015
|
const persisterRepositoryName=persisterIdSplits[1];
|
|
14018
|
-
let
|
|
14019
|
-
if(!
|
|
14016
|
+
let globalKeyHashObject=persister.readTreeObjectFromFile(persisterClientId, persisterRepositoryName);
|
|
14017
|
+
if(!globalKeyHashObject || !globalKeyHashObject.keyHash){
|
|
14020
14018
|
// TRACE
|
|
14021
|
-
console.log("WARN : No
|
|
14022
|
-
|
|
14023
|
-
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,()=>{
|
|
14024
14022
|
// TRACE
|
|
14025
|
-
console.log("INFO :
|
|
14023
|
+
console.log("INFO : Key hash generated and saved successfully.");
|
|
14026
14024
|
});
|
|
14027
14025
|
}
|
|
14028
|
-
const
|
|
14026
|
+
const globalKeyHash=globalKeyHashObject.keyHash;
|
|
14029
14027
|
|
|
14030
14028
|
let firstHash=getHashedString(clearTextParam);
|
|
14031
14029
|
|
|
14032
|
-
let generatedHash=getHashedString( firstHash +
|
|
14033
|
-
|
|
14030
|
+
let generatedHash=getHashedString( firstHash + globalKeyHash, true);// (we use the heavy treatment thing.)
|
|
14031
|
+
globalKeyHashObject.hashes.push(generatedHash);
|
|
14034
14032
|
|
|
14035
14033
|
// We update the repository :
|
|
14036
|
-
persister.saveDataToFileForClient(persisterClientId,persisterRepositoryName,
|
|
14034
|
+
persister.saveDataToFileForClient(persisterClientId,persisterRepositoryName,globalKeyHashObject,false,()=>{
|
|
14037
14035
|
// TRACE
|
|
14038
14036
|
console.log("INFO : Hash added to repository and saved successfully.");
|
|
14039
14037
|
});
|
|
14040
14038
|
|
|
14041
14039
|
// OUTPUT
|
|
14042
|
-
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");
|
|
14043
14041
|
|
|
14044
14042
|
return aotraNodeServer;
|
|
14045
14043
|
}
|
aotrautils/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aotrautils",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.159",
|
|
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)",
|