-
Notifications
You must be signed in to change notification settings - Fork 953
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BE-719 Fix parameter tampering (#68)
* BE-719 Fix parameter tampering Signed-off-by: nfrunza <[email protected]> * BE-719 Exclude warning * added js/superfluous-trailing-arguments to lgtm.yml config Signed-off-by: nfrunza <[email protected]> * BE-719 Fix parameter tampering * added tests, removed console.debug statements Signed-off-by: nfrunza <[email protected]> * BE-719 Fix parameter tampering * removed console.debug staement Signed-off-by: nfrunza <[email protected]>
- Loading branch information
Showing
9 changed files
with
100 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"from": "Sun Dec 08 2019 22:22:00 GMT-0500 (Eastern Standard Time)", | ||
"to": "Mon Dec 09 2019 22:22:00 GMT-0500 (Eastern Standard Time)", | ||
"orgs": ["OrdererMSP", "Org2MSP"] | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"from": "Sun Dec 08 2019 22:22:00 GMT-0500 (Eastern Standard Time)", | ||
"to": "Mon Dec 09 2019 22:22:00 GMT-0500 (Eastern Standard Time)" | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"from": "Sun Dec 08 2019 22:22:00 GMT-0500 (Eastern Standard Time)", | ||
"to": "Mon Dec 09 2019 22:22:00 GMT-0500 (Eastern Standard Time)", | ||
"orgs": "OrgOne" | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
const expect = require('chai').expect; | ||
const assert = require('assert'); | ||
const chai = require('chai'); | ||
const chaiHttp = require('chai-http'); | ||
const helper = require('../common/helper'); | ||
const reqMultiOrgs = require('./fixtures/reqMultiOrgs.json'); | ||
const reqOneOrg = require('./fixtures/reqOneOrg.json'); | ||
const reqNoOrgs = require('./fixtures/reqNoOrgs.json'); | ||
|
||
const should = chai.should(); | ||
chai.use(chaiHttp); | ||
const requestutils = require('../rest/requestutils.js'); | ||
|
||
describe('requestutils().orgsArrayToString should return empty string', () => { | ||
const emptyString = requestutils.orgsArrayToString(reqNoOrgs); | ||
it('requestutils().orgsArrayToString should return empty string', () => { | ||
assert.equal('', emptyString); | ||
}); | ||
}); | ||
|
||
describe('requestutils().orgsArrayToString should return single quotes value', () => { | ||
const oneOrgString = requestutils.orgsArrayToString(reqOneOrg); | ||
it('requestutils().orgsArrayToString should return single quotes value', () => { | ||
assert.equal("'OrgOne'", oneOrgString); | ||
}); | ||
}); | ||
|
||
describe('requestutils().orgsArrayToString should return comma separated single quotes values ', () => { | ||
const multiOrgsString = requestutils.orgsArrayToString(reqMultiOrgs); | ||
const multiOrgs = "'OrdererMSP','Org2MSP'"; | ||
it('requestutils().orgsArrayToString should return comma separated single quotes values ', () => { | ||
assert.equal(multiOrgs, multiOrgsString); | ||
}); | ||
}); |
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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