Produced by Araxis Merge on 10/4/2017 8:04:36 AM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | rdk.zip\rdk\product\production\rdk\src\subsystems\pep | policy-itest-spec.js | Mon Aug 21 12:51:00 2017 UTC |
| 2 | rdk.zip\rdk\product\production\rdk\src\subsystems\pep | policy-itest-spec.js | Tue Oct 3 18:42:27 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 13 | 294 |
| Changed | 12 | 34 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | 'use stric t'; | |
| 2 | ||
| 3 | var httpMo cks = requ ire('node- mocks-http '); | |
| 4 | var pep = require('. ./../inter ceptors/au thorizatio n/pep'); | |
| 5 | var rdk = require('. ./../core/ rdk'); | |
| 6 | var nock = require(' nock'); | |
| 7 | ||
| 8 | function b uildReques t() { | |
| 9 | var re q = { | |
| 10 | au dit: { | |
| 11 | patientId: ' R E D A CTED ;18' | |
| 12 | }, | |
| 13 | se ssion: { | |
| 14 | user: { | |
| 15 | accessCode : ' REDACT ', | |
| 16 | verifyCode : ' REDACTED ', | |
| 17 | ssn: ' REDACTED ', | |
| 18 | brea kglass: tr ue, | |
| 19 | sens itive: fal se, | |
| 20 | hasS SN: true, | |
| 21 | rptT abs: true, | |
| 22 | cors Tabs: true , | |
| 23 | dgRe cordAccess : true, | |
| 24 | dgSe nsitiveAcc ess: true | |
| 25 | } | |
| 26 | }, | |
| 27 | _r esourceCon figItem: { | |
| 28 | required Permission s: [], | |
| 29 | isPatien tCentric: true | |
| 30 | }, | |
| 31 | qu ery: { | |
| 32 | pid: ' R E D A CTED ;18' | |
| 33 | }, | |
| 34 | lo gger: { | |
| 35 | info: fu nction() { }, | |
| 36 | debug: f unction() {}, | |
| 37 | error: f unction() {}, | |
| 38 | warn: fu nction() { } | |
| 39 | }, | |
| 40 | ap p: { | |
| 41 | config: { | |
| 42 | inte rceptors: { | |
| 43 | pep: { | |
| 44 | disabl ed: false | |
| 45 | } | |
| 46 | }, | |
| 47 | jdsS erver: { | |
| 48 | baseUrl: ' http://loc alhost: PORT ' | |
| 49 | }, | |
| 50 | vist aSites: { | |
| 51 | ' R E D A CTED ': { | |
| 52 | name: 'PANORAMA' , | |
| 53 | host: ' IP ' | |
| 54 | } | |
| 55 | } | |
| 56 | } | |
| 57 | } | |
| 58 | }; | |
| 59 | return req; | |
| 60 | } | |
| 61 | var jdsRes ponse = { | |
| 62 | btg: { | |
| 63 | da ta: { | |
| 64 | items: [ { | |
| 65 | ssn: ' REDACTED ', | |
| 66 | pid: ' R E D A CTED ;18', | |
| 67 | sens itive: tru e | |
| 68 | }] | |
| 69 | } | |
| 70 | }, | |
| 71 | permit : { | |
| 72 | da ta: { | |
| 73 | items: [ { | |
| 74 | ssn: ' REDACTED ', | |
| 75 | pid: ' R E D A CTED ;18', | |
| 76 | sens itive: fal se | |
| 77 | }] | |
| 78 | } | |
| 79 | }, | |
| 80 | deny: { | |
| 81 | da ta: { | |
| 82 | items: [ { | |
| 83 | ssn: ' REDACTED ', | |
| 84 | pid: ' R E D A CTED ;18', | |
| 85 | sens itive: fal se | |
| 86 | }] | |
| 87 | } | |
| 88 | } | |
| 89 | }; | |
| 90 | var req; | |
| 91 | var res; | |
| 92 | var spySta tus; | |
| 93 | var spyHea der; | |
| 94 | var jdsPat h = '/data /index/pt- select-pid ?range= R E D A CTED ;18'; | |
| 95 | ||
| 96 | describe(' PEP Policy ', functio n() { | |
| 97 | before Each(funct ion() { | |
| 98 | re q = buildR equest(); | |
| 99 | re s = httpMo cks.create Response() ; | |
| 100 | sp yStatus = sinon.spy( res, 'stat us'); | |
| 101 | sp yHeader = sinon.spy( res, 'head er'); | |
| 102 | }); | |
| 103 | afterE ach(functi on() { | |
| 104 | sp yStatus.re set(); | |
| 105 | sp yHeader.re set(); | |
| 106 | }); | |
| 107 | ||
| 108 | //NOTE : THIS WAS FAILING B EFORE OUR MIGRATION FROM JDS T O AN RPC C ALL SO IT HAS BEEN C OMMENTED O UT. | |
| 109 | it.ski p('PEP pol icy return s expected result fo r Breakgla ss policy' , function (done) { | |
| 110 | re q.session. user.dgSen sitiveAcce ss = false ; | |
| 111 | th is.timeout (15000); | |
| 112 | nock('http ://localho st: PORT ') | |
| 113 | .get(jds Path) | |
| 114 | .reply(2 00, jdsRes ponse.btg) ; | |
| 115 | ||
| 116 | fu nction tes ter() { | |
| 117 | expect(s pyStatus.w ithArgs(rd k.httpstat us.permane nt_redirec t).called) .to.be.tru e(); | |
| 118 | expect(s pyHeader.w ithArgs('B TG', 'Sens itiveAcces sRequired' ).called). to.be.true (); | |
| 119 | done(); | |
| 120 | } | |
| 121 | re s.rdkSend = tester; | |
| 122 | va r next = t ester; | |
| 123 | ||
| 124 | pe p(req, res , next); | |
| 125 | ||
| 126 | }); | |
| 127 | //NOTE : THIS WAS FAILING B EFORE OUR MIGRATION FROM JDS T O AN RPC C ALL SO IT HAS BEEN C OMMENTED O UT. | |
| 128 | it.ski p('PEP pol icy return s expected result - permit', f unction(do ne) { | |
| 129 | ||
| 130 | re q.app.conf ig.jdsServ er.baseUrl = 'http:/ /localhost :8085'; | |
| 131 | th is.timeout (15000); | |
| 132 | no ck('http:/ /localhost :8085') | |
| 133 | .get(jds Path) | |
| 134 | .reply(2 00, jdsRes ponse.perm it); | |
| 135 | ||
| 136 | fu nction tes ter() { | |
| 137 | expect(s pyStatus.w ithArgs(rd k.httpstat us.ok).cal led).to.be .true(); | |
| 138 | done(); | |
| 139 | } | |
| 140 | re s.rdkSend = tester; | |
| 141 | va r next = t ester; | |
| 142 | ||
| 143 | pe p(req, res , next); | |
| 144 | ||
| 145 | }); | |
| 146 | it('PE P policy r eturns exp ected resu lt - deny' , function (done) { | |
| 147 | re q.session. user.corsT abs = fals e; | |
| 148 | re q.session. user.rptTa bs = false ; | |
| 149 | th is.timeout (15000); | |
| 150 | nock('http ://localho st: PORT ') | |
| 151 | .get(jds Path) | |
| 152 | .reply(2 00, jdsRes ponse.deny ); | |
| 153 | ||
| 154 | fu nction tes ter() { | |
| 155 | expect(s pyStatus.w ithArgs(rd k.httpstat us.forbidd en).called ).to.be.tr ue(); | |
| 156 | done(); | |
| 157 | } | |
| 158 | re s.rdkSend = tester; | |
| 159 | va r next = t ester; | |
| 160 | ||
| 161 | pe p(req, res , next); | |
| 162 | ||
| 163 | }); | |
| 164 | }); |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.