-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
62 lines (57 loc) · 2.65 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/* variable initilization */
strDefaultResponseArr = {'statusCode':401,'message':'Unauthorized access'};
function doAuthentication (pStrAuthrizationCollection, pStrHeaderCollection, callback){
console.log("Node Module doAuthentication Method");
console.log(pStrAuthrizationCollection);
console.log(pStrHeaderCollection);
return callback(doBasicAuth(this.strDefaultResponseArr));
}
module.exports = doAuthentication;
/***********************************************************************/
/*Purpose : This Module Process the Auth Request of each API
/*Created By: Jaiswar Vipin Kumar R.
/*Chaneg Log
/*-----------------------------------------------------------------------
/*Publish Date by Whome Changes Description
/*-----------------------------------------------------------------------
/*14-03-2020 Jaisawr Vipin Kumar R. Created
/*************************************************************************/
class apigatewayAuthProcess{
/***************************************************************************/
/*Purpose : Default method.
/*Input : None.
/*Response : None.
/*Created By: Jaiswar Vipin Kumar R.
/***************************************************************************/
constructor(){
/* variable initilization */
this.strDefaultResponseArr = {'statusCode':401,'message':'Unauthorized access'}
}
/***************************************************************************/
/*Purpose : Default method.
/*Input : None.
/*Response : None.
/*Created By: Jaiswar Vipin Kumar R.
/***************************************************************************/
doAuthentication(pStrAuthrizationCollection, pStrHeaderCollection, callback){
console.log("Node Module doAuthentication Method");
console.log(pStrAuthrizationCollection);
console.log(pStrHeaderCollection);
return callback(doBasicAuth(this.strDefaultResponseArr));
}
/***********************************************************************/
/*Purpose : Perform the basic key and value authrization.
/*Inputs : pIntApiCode : API Code,
/*Returns : Return the Authrization Status: Description.
/*Created By: Jaiswar Vipin Kumar R.
/***********************************************************************/
doBasicAuth(pStrCollection){
console.log("Node Module doBasicAuth Method");
console(pStrCollection[0]);
return (JSON.stringify(pStrCollection));
/* Checking for slug validation
if(pStrCollection.length == 0){
return (strDefaultResponseArr);
} */
}
}