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