Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getErrorMessage(code) { | |
if ( | |
code === 702 || | |
code === 1082 || | |
code === 1083 || | |
code === 1114 || | |
code === 1184 || | |
code === 1266 || | |
code === 12403 | |
) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Model.prototype.createKey = function (req) { | |
let key = req.url.split('/')[1] | |
if (req.params.host) key = `${key}::${req.params.host}` | |
if (req.params.id) key = `${key}::${req.params.id}` | |
key = (req.query.startdate && req.query.enddate) ? `${key}::${req.params.startdate}::${req.params.enddate}` : '' | |
return key | |
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Authenticate a user's submitted credentials | |
* @param {string} username requester's username | |
* @param {strting} password requester's password | |
* @returns {Promise} | |
*/ | |
function authenticate (username, password) { | |
return new Promise((resolve, reject) => { | |
// Validate user's credentials | |
validateCredentials(username, password, _userStoreFilePath) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
token: String, // token that can be added to resource requests, and decoded and verified by the "authorization" function | |
expires: Number, // number seconds until token expires | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
useHttp: Boolean // boolean flag indicating if HTTP (rather than HTTPS) should be used for the authentication endpoint | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
type: 'auth', | |
getAuthenticationSpecification: Function, | |
authenticate: Function, | |
authorize: Function | |
} |
NewerOlder