sample_app/lib/authorization_request_registrar_module/index.js
function get_authorization_request(authorization_request_id) {
    return new Promise((resolve, reject) => {
        dbMgr
            .find("authorization_request", {
                _id: {
                    $eq: authorization_request_id
                }
            }, {limit: 1})
            .then((authorize_requests) => {
                if (authorize_requests.length > 0) {
                    return resolve(authorize_requests[0]);
                } else {
                    return reject(new Error("No authorization request records found!"));
                }
            }, reject);
    });
}
function get_authorization_request(authorization_request_id) {
    return new Promise((resolve, reject) => {
        dbMgr
            .find("authorization_request", {
                _id: {
                    $eq: authorization_request_id
                }
            }, {limit: 1})
            .then((authorize_requests) => {
                if (authorize_requests.length > 0) {
                    return resolve(authorize_requests[0]);
                } else {
                    return reject(new Error("No authorization request records found!"));
                }
            }, reject);
    });
}
function get_authorization_request ( authorization_request_id ) { return new Promise ( ( resolve , reject ) => { dbMgr . find ( "authorization_request" , { _id : { $eq : authorization_request_id } } , { limit : 1 } ) . then ( ( authorize_requests ) => { if ( authorize_requests . length > 0 ) { return resolve ( authorize_requests [ 0 ] ) ; } else { return reject ( new Error ( "No authorization request records found!" ) ) ; } } , reject ) ; } ) ; }
This function must return a promise, which resolves with the
authorization_request associated with the authorization_request_id argument.

Also, the implementation must check for the time the respective
authorization_request was granted, and reject the promise if the persisted
and/or granted authorizeRequest is older than some configurable duration.

@param  authorization_request_id: the authorization_code is used as the id
in this implementation.
@return {[object]}
This function must return a promise which resolves with the authorization_request associated with the authorization_request_id argument .