From 8842134252e4a3e4bd497fe5de743d2151dc6bbb Mon Sep 17 00:00:00 2001 From: Vyacheslav V Sokolov Date: Fri, 16 Jun 2017 06:05:09 +0700 Subject: [PATCH 1/6] IMPROVE CHALLENGE VISIBILITY CONTROL (https://www.topcoder.com/challenge-details/30057891/?type=develop) Verification guide: docs/Verification_Guide-Improve Challenge Visibility Control.doc --- actions/challenges.js | 59 +- db_scripts/test_eligibility.delete.sql | 22 + db_scripts/test_eligibility.insert.sql | 133 ++ ...e-Improve Challenge Visibility Control.doc | Bin 0 -> 49664 bytes initializers/middleware.js | 7 +- initializers/v3client.js | 143 ++ package.json | 2 + .../get_challenge_accessibility_and_groups | 21 + ...et_challenge_accessibility_and_groups.json | 5 + ...Visibility_Control.postman_collection.json | 226 ++ ...isibility_Control.postman_environment.json | 34 + test/postman/Reviewer_Management_API.json | 1892 +++++++++-------- test/scripts/mock_v3.js | 73 + 13 files changed, 1726 insertions(+), 891 deletions(-) create mode 100644 db_scripts/test_eligibility.delete.sql create mode 100644 db_scripts/test_eligibility.insert.sql create mode 100644 docs/Verification_Guide-Improve Challenge Visibility Control.doc create mode 100644 initializers/v3client.js create mode 100644 queries/get_challenge_accessibility_and_groups create mode 100644 queries/get_challenge_accessibility_and_groups.json create mode 100644 test/postman/New_Challenge_Visibility_Control.postman_collection.json create mode 100644 test/postman/New_Challenge_Visibility_Control.postman_environment.json create mode 100644 test/scripts/mock_v3.js diff --git a/actions/challenges.js b/actions/challenges.js index 0c40bbf2b..f47bbe7a6 100755 --- a/actions/challenges.js +++ b/actions/challenges.js @@ -1,9 +1,9 @@ /* * Copyright (C) 2013 - 2014 TopCoder Inc., All Rights Reserved. * - * @version 1.31 + * @version 1.32 * @author Sky_, mekanizumu, TCSASSEMBLER, freegod, Ghost_141, kurtrips, xjtufreeman, ecnu_haozi, hesibo, LazyChild, - * @author isv, muzehyun, bugbuka + * @author isv, muzehyun, bugbuka, GFalcon * @changes from 1.0 * merged with Member Registration API * changes in 1.1: @@ -79,9 +79,12 @@ * - Update challenge type filter. * Changes in 1.31: * - Remove screeningScorecardId and reviewScorecardId from search challenges api. + * Changes in 1.32: + * - validateChallenge function now checks if an user belongs to a group via + * user_group_xref for old challenges and by calling V3 API for new ones. */ "use strict"; -/*jslint stupid: true, unparam: true, continue: true */ +/*jslint stupid: true, unparam: true, continue: true, nomen: true */ require('datejs'); var fs = require('fs'); @@ -851,7 +854,7 @@ var addFilter = function (sql, filter, isMyChallenges, helper, caller) { * @since 1.10 */ function validateChallenge(api, connection, dbConnectionMap, challengeId, isStudio, callback) { - var error, sqlParams, helper = api.helper; + var error, sqlParams, helper = api.helper, userId = (connection.caller.userId || 0); async.waterfall([ function (cb) { error = helper.checkPositiveInteger(challengeId, 'challengeId') || @@ -862,31 +865,47 @@ function validateChallenge(api, connection, dbConnectionMap, challengeId, isStud } sqlParams = { challengeId: challengeId, - user_id: connection.caller.userId || 0 + user_id: userId }; - async.parallel({ - accessibility: function (cbx) { - api.dataAccess.executeQuery('check_user_challenge_accessibility', sqlParams, dbConnectionMap, cbx); - }, - exists: function (cbx) { - api.dataAccess.executeQuery('check_challenge_exists', sqlParams, dbConnectionMap, cbx); - } - }, cb); + api.dataAccess.executeQuery('get_challenge_accessibility_and_groups', sqlParams, dbConnectionMap, cb); }, function (res, cb) { - if (res.exists.length === 0 || Boolean(res.exists[0].is_studio) !== isStudio) { + // If the record with this callengeId doesn't exist in contest_eligibility table + // or there's a studio/software mismatch + if (res.length === 0 || Boolean(res[0].is_studio) !== isStudio) { cb(new NotFoundError("Challenge not found.")); return; } - var access = res.accessibility[0]; - if (access.is_private && !access.has_access && connection.caller.accessLevel !== "admin") { - if (connection.caller.accessLevel === "anon") { + // If there's no corresponding record in group_contest_eligibility + // or the user is an admin + if (_.isNull(res[0].challenge_group_ind) || _.isUndefined(res[0].challenge_group_ind) || connection.caller.accessLevel === 'admin') { + cb(); + return; + } + error = false; + async.some(res, function (record, cbx) { + if (record.challenge_group_ind === 0) { + cbx(!(_.isNull(record.user_group_xref_found) || _.isUndefined(record.user_group_xref_found))); + } else { + api.v3client.isUserInGroup(connection, userId, record.group_id, function (err, result) { + if (err) { + error = err; + cbx(true); + } else { + cbx(result); + } + }); + } + }, function (eligible) { + if (error) { + cb(error); + } else if (eligible) { + cb(); + } else if (connection.caller.accessLevel === "anon") { cb(new UnauthorizedError()); } else { cb(new ForbiddenError()); } - return; - } - cb(); + }); } ], callback); } diff --git a/db_scripts/test_eligibility.delete.sql b/db_scripts/test_eligibility.delete.sql new file mode 100644 index 000000000..c6a88def0 --- /dev/null +++ b/db_scripts/test_eligibility.delete.sql @@ -0,0 +1,22 @@ +DATABASE common_oltp; + +DELETE FROM user_group_xref WHERE group_id > 3330000 AND group_id < 3330100; +DELETE FROM security_groups WHERE group_id > 3330000 AND group_id < 3330100; +DELETE FROM group_contest_eligibility WHERE contest_eligibility_id > 1110000 AND contest_eligibility_id < 1110100; +DELETE FROM contest_eligibility WHERE contest_eligibility_id > 1110000 AND contest_eligibility_id < 1110100; + +DATABASE tcs_catalog; + +DELETE FROM review_item_comment WHERE review_item_comment_id > 7770000 AND review_item_id < 7770100; +DELETE FROM review_item WHERE review_item_id > 5550000 AND review_item_id < 5550100; +DELETE FROM review WHERE review_id > 4440000 AND review_id < 4440100; +DELETE FROM scorecard_question WHERE scorecard_question_id = 3330333; +DELETE FROM scorecard_section WHERE scorecard_section_id = 3330333; +DELETE FROM scorecard_group WHERE scorecard_group_id = 3330333; +DELETE FROM scorecard WHERE scorecard_id = 3330333; +DELETE FROM submission WHERE submission_id > 2220000 AND submission_id < 2220100; +DELETE FROM prize WHERE project_id > 2220000 AND project_id < 2220100; +DELETE FROM upload WHERE project_id > 2220000 AND project_id < 2220100; +DELETE FROM resource WHERE project_id > 2220000 AND project_id < 2220100; +DELETE FROM project_phase WHERE project_id > 2220000 AND project_id < 2220100; +DELETE FROM project WHERE project_id > 2220000 AND project_id < 2220100; diff --git a/db_scripts/test_eligibility.insert.sql b/db_scripts/test_eligibility.insert.sql new file mode 100644 index 000000000..05d827c15 --- /dev/null +++ b/db_scripts/test_eligibility.insert.sql @@ -0,0 +1,133 @@ +DATABASE tcs_catalog; + +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date) + VALUES (2220001, 1, 14, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date) + VALUES (2220002, 1, 14, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date) + VALUES (2220003, 1, 14, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date) + VALUES (2220004, 1, 14, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date) + VALUES (2220005, 1, 14, "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (7770001, 2220001, 17, 3, CURRENT, CURRENT, 0, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (7770002, 2220002, 17, 3, CURRENT, CURRENT, 0, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (7770003, 2220003, 17, 3, CURRENT, CURRENT, 0, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (7770004, 2220004, 17, 3, CURRENT, CURRENT, 0, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (7770005, 2220005, 17, 3, CURRENT, CURRENT, 0, "132456", CURRENT, "132456", CURRENT); + +INSERT INTO resource (resource_id, resource_role_id, project_id, project_phase_id, user_id, create_user, create_date, modify_user, modify_date) + VALUES (8880001, 20, 2220001, 7770001, 132456, "132456", CURRENT, "132456", CURRENT); +INSERT INTO resource (resource_id, resource_role_id, project_id, project_phase_id, user_id, create_user, create_date, modify_user, modify_date) + VALUES (8880002, 20, 2220002, 7770002, 132456, "132456", CURRENT, "132456", CURRENT); +INSERT INTO resource (resource_id, resource_role_id, project_id, project_phase_id, user_id, create_user, create_date, modify_user, modify_date) + VALUES (8880003, 20, 2220003, 7770003, 132456, "132456", CURRENT, "132456", CURRENT); +INSERT INTO resource (resource_id, resource_role_id, project_id, project_phase_id, user_id, create_user, create_date, modify_user, modify_date) + VALUES (8880004, 20, 2220004, 7770004, 132456, "132456", CURRENT, "132456", CURRENT); +INSERT INTO resource (resource_id, resource_role_id, project_id, project_phase_id, user_id, create_user, create_date, modify_user, modify_date) + VALUES (8880005, 20, 2220005, 7770005, 132456, "132456", CURRENT, "132456", CURRENT); + +INSERT INTO upload (upload_id, project_id, resource_id, upload_type_id, upload_status_id, parameter, create_user, create_date, modify_user, modify_date) + VALUES (9990001, 2220001, 8880001, 1, 1, "---", "132456", CURRENT, "132456", CURRENT); +INSERT INTO upload (upload_id, project_id, resource_id, upload_type_id, upload_status_id, parameter, create_user, create_date, modify_user, modify_date) + VALUES (9990002, 2220002, 8880002, 1, 1, "---", "132456", CURRENT, "132456", CURRENT); +INSERT INTO upload (upload_id, project_id, resource_id, upload_type_id, upload_status_id, parameter, create_user, create_date, modify_user, modify_date) + VALUES (9990003, 2220003, 8880003, 1, 1, "---", "132456", CURRENT, "132456", CURRENT); +INSERT INTO upload (upload_id, project_id, resource_id, upload_type_id, upload_status_id, parameter, create_user, create_date, modify_user, modify_date) + VALUES (9990004, 2220004, 8880004, 1, 1, "---", "132456", CURRENT, "132456", CURRENT); +INSERT INTO upload (upload_id, project_id, resource_id, upload_type_id, upload_status_id, parameter, create_user, create_date, modify_user, modify_date) + VALUES (9990005, 2220005, 8880005, 1, 1, "---", "132456", CURRENT, "132456", CURRENT); + +INSERT INTO prize (prize_id, project_id, place, prize_amount, prize_type_id, number_of_submissions, create_user, create_date, modify_user, modify_date) + VALUES (1110001, 2220001, 1, 1000, 14, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO prize (prize_id, project_id, place, prize_amount, prize_type_id, number_of_submissions, create_user, create_date, modify_user, modify_date) + VALUES (1110002, 2220002, 1, 1000, 14, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO prize (prize_id, project_id, place, prize_amount, prize_type_id, number_of_submissions, create_user, create_date, modify_user, modify_date) + VALUES (1110003, 2220003, 1, 1000, 14, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO prize (prize_id, project_id, place, prize_amount, prize_type_id, number_of_submissions, create_user, create_date, modify_user, modify_date) + VALUES (1110004, 2220004, 1, 1000, 14, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO prize (prize_id, project_id, place, prize_amount, prize_type_id, number_of_submissions, create_user, create_date, modify_user, modify_date) + VALUES (1110005, 2220005, 1, 1000, 14, 1, "132456", CURRENT, "132456", CURRENT); + +INSERT INTO submission (submission_id, upload_id, submission_status_id, submission_type_id, create_user, create_date, modify_user, modify_date, prize_id) + VALUES (2220001, 9990001, 1, 3, "132456", CURRENT, "132456", CURRENT, 1110001); +INSERT INTO submission (submission_id, upload_id, submission_status_id, submission_type_id, create_user, create_date, modify_user, modify_date, prize_id) + VALUES (2220002, 9990002, 1, 3, "132456", CURRENT, "132456", CURRENT, 1110002); +INSERT INTO submission (submission_id, upload_id, submission_status_id, submission_type_id, create_user, create_date, modify_user, modify_date, prize_id) + VALUES (2220003, 9990003, 1, 3, "132456", CURRENT, "132456", CURRENT, 1110003); +INSERT INTO submission (submission_id, upload_id, submission_status_id, submission_type_id, create_user, create_date, modify_user, modify_date, prize_id) + VALUES (2220004, 9990004, 1, 3, "132456", CURRENT, "132456", CURRENT, 1110004); +INSERT INTO submission (submission_id, upload_id, submission_status_id, submission_type_id, create_user, create_date, modify_user, modify_date, prize_id) + VALUES (2220005, 9990005, 1, 3, "132456", CURRENT, "132456", CURRENT, 1110005); + +INSERT INTO scorecard (scorecard_id, scorecard_status_id, scorecard_type_id, project_category_id, name, version, min_score, max_score, create_user, create_date, modify_user, modify_date, version_number) + VALUES (3330333, 1, 7, 14, "---", "---", 0, 100, "132456", CURRENT, "132456", CURRENT, 1); + +INSERT INTO scorecard_group (scorecard_group_id, scorecard_id, name, weight, sort, create_user, create_date, modify_user, modify_date, version) + VALUES (3330333, 3330333, "---", 100, 1, "132456", CURRENT, "132456", CURRENT, 1); + +INSERT INTO scorecard_section (scorecard_section_id, scorecard_group_id, name, weight, sort, create_user, create_date, modify_user, modify_date, version) + VALUES (3330333, 3330333, "---", 100, 1, "132456", CURRENT, "132456", CURRENT, 1); + +INSERT INTO scorecard_question (scorecard_question_id, scorecard_question_type_id, scorecard_section_id, description, weight, sort, upload_document, upload_document_required, create_user, create_date, modify_user, modify_date, version) + VALUES (3330333, 1, 3330333, '---', 100, 1, 0, 0, "132456", CURRENT, "132456", CURRENT, 1); + +INSERT INTO review (review_id, resource_id, submission_id, project_phase_id, scorecard_id, committed, create_user, create_date, modify_user, modify_date) + VALUES (4440001, 8880001, 2220001, 7770001, 3330333, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO review (review_id, resource_id, submission_id, project_phase_id, scorecard_id, committed, create_user, create_date, modify_user, modify_date) + VALUES (4440002, 8880002, 2220002, 7770002, 3330333, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO review (review_id, resource_id, submission_id, project_phase_id, scorecard_id, committed, create_user, create_date, modify_user, modify_date) + VALUES (4440003, 8880003, 2220003, 7770003, 3330333, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO review (review_id, resource_id, submission_id, project_phase_id, scorecard_id, committed, create_user, create_date, modify_user, modify_date) + VALUES (4440004, 8880004, 2220004, 7770004, 3330333, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO review (review_id, resource_id, submission_id, project_phase_id, scorecard_id, committed, create_user, create_date, modify_user, modify_date) + VALUES (4440005, 8880005, 2220005, 7770005, 3330333, 1, "132456", CURRENT, "132456", CURRENT); + +INSERT INTO review_item (review_item_id, review_id, scorecard_question_id, upload_id, answer, sort, create_user, create_date, modify_user, modify_date) + VALUES (5550001, 4440001, 3330333, 9990001, "---", 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO review_item (review_item_id, review_id, scorecard_question_id, upload_id, answer, sort, create_user, create_date, modify_user, modify_date) + VALUES (5550002, 4440002, 3330333, 9990002, "---", 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO review_item (review_item_id, review_id, scorecard_question_id, upload_id, answer, sort, create_user, create_date, modify_user, modify_date) + VALUES (5550003, 4440003, 3330333, 9990003, "---", 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO review_item (review_item_id, review_id, scorecard_question_id, upload_id, answer, sort, create_user, create_date, modify_user, modify_date) + VALUES (5550004, 4440004, 3330333, 9990004, "---", 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO review_item (review_item_id, review_id, scorecard_question_id, upload_id, answer, sort, create_user, create_date, modify_user, modify_date) + VALUES (5550005, 4440005, 3330333, 9990005, "---", 1, "132456", CURRENT, "132456", CURRENT); + + +INSERT INTO review_item_comment (review_item_comment_id, resource_id, review_item_id, comment_type_id, content, sort, create_user, create_date, modify_user, modify_date) + VALUES (7770001, 8880001, 5550001, 1, "The current user has the right to view this challenge", 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO review_item_comment (review_item_comment_id, resource_id, review_item_id, comment_type_id, content, sort, create_user, create_date, modify_user, modify_date) + VALUES (7770002, 8880002, 5550002, 1, "The current user has the right to view this challenge", 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO review_item_comment (review_item_comment_id, resource_id, review_item_id, comment_type_id, content, sort, create_user, create_date, modify_user, modify_date) + VALUES (7770003, 8880003, 5550003, 1, "The current user has the right to view this challenge", 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO review_item_comment (review_item_comment_id, resource_id, review_item_id, comment_type_id, content, sort, create_user, create_date, modify_user, modify_date) + VALUES (7770004, 8880004, 5550004, 1, "The current user has the right to view this challenge", 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO review_item_comment (review_item_comment_id, resource_id, review_item_id, comment_type_id, content, sort, create_user, create_date, modify_user, modify_date) + VALUES (7770005, 8880005, 5550005, 1, "The current user has the right to view this challenge", 1, "132456", CURRENT, "132456", CURRENT); + +DATABASE common_oltp; + +INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110001, 2220001, 0); +INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110002, 2220002, 0); +INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110003, 2220003, 0); +INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110004, 2220004, 0); +INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110005, 2220005, 0); + +INSERT INTO security_groups (group_id, description, challenge_group_ind) VALUES (3330001, "Eligibility - Old logic - with user", 0); +INSERT INTO security_groups (group_id, description, challenge_group_ind) VALUES (3330002, "Eligibility - Old logic - no users", 0); +INSERT INTO security_groups (group_id, description, challenge_group_ind) VALUES (3330003, "Eligibility - New logic - with user", 1); +INSERT INTO security_groups (group_id, description, challenge_group_ind) VALUES (3330004, "Eligibility - New logic - no users", 1); + +INSERT INTO user_group_xref (user_group_id, login_id, group_id) VALUES (5550001, 132458, 3330001); + +INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110002, 3330001); +INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110003, 3330002); +INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110004, 3330003); +INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110005, 3330004); diff --git a/docs/Verification_Guide-Improve Challenge Visibility Control.doc b/docs/Verification_Guide-Improve Challenge Visibility Control.doc new file mode 100644 index 0000000000000000000000000000000000000000..5385983df3f5a6c74c77c93f4fa89de8b359be7d GIT binary patch literal 49664 zcmeHw2|!iF{{LLKz-1K>5e@Z%gh(!csHkaxJ8rn3=8k|$DInt7A{tqinVNgK=2B+v zR{E?oQ_B{&Ttai#QnS!Z%@qEh&zXC;=U(nb^u5=6zxVIJ=bmlmJ2T(;&Ue1^ojK?1 z-{*6B$@@S=?QpT2Pew?Ix*r#qYc9)q0)XKe=^b1 z0+n*F5Sm11g9PRJ^oxtG|IulP_j}U~;;|YVzh{5Z2RGP<@qQM-#K!=Rz&iljz;=M` z;5)z>xB;*~WF+>9e%P~LG-A)bu@?4hA2Haok8FWG(@4ag^e^3$eIEO?xU8(9=_$!M z>6sbEE@{I@re~*-pCgQ2v(i%12bpfk@a$tBPt4AIDlH|)*fDun8agiaolLu1W>)je z)U<3ID%aTOc11OfPR>rVAZ)sitSB4fGmjlJvxg-Qt&{32=A#Tc^iSoAxi|n_`?Vqm zfj!FK5&c897$%a%P@F6MeQE)YB11%Yh%OGDc3lx4E;=RXMQ5OSLVy_7##KK8NK9}M z8Ey229H1ZWCF5TIHafi+B6QxYwIQJ6E-LCH^!4=3^i6;$pt0U)>eqE5HdMHU3innz zb?3R;N$A$;M8CXsy1scr49H6?EWd1w@LTq{a1POVDH*75&@rt(23=3#;O&Ey*caPQ ziPl36goq8*xrORvO3F@2Db@ig#X888w%M#~}I%y^;!T2HW|k)l&m<8yo8A z7V0QdQFcly100dc07ses#dl%5F%?r1px;wCDK%lAKeVXoqCLch>fJ*1lD@K2=ogTF zfr-BN-SW!{l$t=Ce!^LyY(M9;)9OOPVndzWLY*XKWv5Wi)q`@bUgkXa&tl5Xuc8#VyoDQdV{f z<;A4D*hG1NnX;Pmp~6+6&-P@yPHDB)MLUlTHMoTuBzAldYqK)9E-KunZSv z3g?05?u_P+i~usckB#v4N(moiCp;~B(l>xUs-;+Brxf-$z1~iEYGT&BD{9^q zHSdZM8%w=I$B~;q#%F2ZVlpIlD7a|E_=`MF7K4@FEb!Tgv0J7xj$!WlDX|aesDZq| z!8C+TMNMQN274GIMtwsR8XQA*N^nEEZfHZs;tmY`NV_&VVcCzlKs_7Tw+v9|pTXW1 z{U{6i(Hi=J#qx|tg#3HzILRI-EZe!yPq9&RUm$<{4(-~=1t*>BhjKix)n_5=39FR>B6A;Po2 zv(=BSw-er8d3V?eZ!bRwY=m!AN`B7R32!ey*X)EZnV$$nB6W`BgqxK;5MeV%GKP=c z7$x&0V+7faVJ}yaHe;xEieWu$QaOc4OGfRkF<(wyh$WtKoKI*vr)fyD{wL zYP!uBwrwMst0i`0*vr*=yD{wLYKP4jwk#@Vv_qF*Br?=HUVoGZtc4Me%m~C5`Mv&bY_R0}yGlp$FBGZVo8^d0%I@^t5FIUMnVnm^K zZE0JXtKoKI*vr)fyD{wLYP!uBw#OziS4-^1u$Qa#c4OGf)ef66N^7+T?8dN{t21_E z*vr*5n=!PlwnY1ID%n1wFb8A5&VB60uvd;CyD{vQBhqFJ+x@<&eb|j*FIS!I#;}*G zWScQc(qXO*7+#_Zd~c8I>+56Te~Z({V;`Y!s*lmP(zk0%>}~v*?foFJX~r7Oo?a_M$uD?{I1l>i(h{avX=4 zZS|c&sVU-gLf-2k&rc{+OH%X58j>q=Rcehz4^TVc)ELyfg)dT$M!Y5f%UvI|8ekub zvv%MNtt5d>13(%g8~_bC91jyQ2p4h@|AGA;9Dv338@) z#JzabP3~yN+ok7AdRQV&G&rW`9OZ-2=&qD4&Y82ZKHz*N!1M zyz&I6Ju%AlE*>YE`Q-@__7;f>-OkR5pzEvn8<;n>4LnROv{xu5J5#11@iywy(w9&= z@8mdhxHHG~6>U;$i`=Fb^Wi~gOP)?J@iZPB9Ev~IP6jw>Oa98nQ|afK?o2BI(SdbC_^%qCE_pAyndI);-3 zSeei%p&V$GQ~Vi;sMUT6KB(P5$ZI@&vl~opt141$s?198w-NF}ZPgf8$Ax1hx=S*L%J5XU-uwb{0XGk0+UZJsU5(o@NL$P~V*sR-j3qDz)DD$q6CUf0FAC zF66og%8_P8LDhPmXk~Uv;HQ>=x)fz|p)Pf|qf1$e;l-u!6|qX3V3%0Lae*g~t(m%u zvPiyV+e_6~O_g2~orrRwpT`aD+S;4Q+ytUjjvSoQP_sUWpIav40X&7ao}N zf|eEuiUd(VcqlzoH0soPhKnsd$HZAFG>@Y{YYx_`giy!iH0rmplFu$K?4>*{=HrZ5 zpJHyyth14r8ptzE$2@zNYgo!7HxAe{H&rpu)&zNpvgqSzNmLc1gfh7>EyST;9@cqb zYH9%X#ghx*x1T~OwiHU_n7|e!-Z6Q(PvXjv{d?Qw$H|BVVp;#T@eE`#~HacR#H6ey*)_hfSB>Z2r5fm z*h~4K-Non|+?U2UD;l(gpetNx3%P(I{nG3=bCj`U74eKvrY;>2O`Wq;=lc>15l2e! zXC?{O#wQ;uh-YPd&akPoNplOK;o`$xDRa5>S~CX+m3HF_{hN%oEOQ_&0hatZ>L`s~ zlI`}asomP^7rCPAc~QHCQP*KN=eRM=j`XC*O!kre&`-_~RlvpTE;De4I*wXW)zbsS zc&QzSnC5BcVxBe(%_dBQq>@xeRIzD$RJqW}d?7T|S*H_;@`AGtGn`6@&gKwM<9^WM z6`;i{DE)Om?AbqeRCwZG=m^?wN-s~3KYJ(DuAz+PTIja&%TDV!flTdcq>iK4-{j?I z-vr%cVBcg*OR)9$iwVW_s4L1Zllp<}kFkRdY=5?5Q{IEcM2pz{^6r=>583`KDMi_( z6s=Ht!HUvegPbPRQi>7&N;~8%rahfNYF;7_qSwZkD(5W8|^G@diH)3ZuDr5#j~Q`)}GsQCB2#8eBq zT6&US*A;%z9S@7e{FDp;g90``Ti5i;jt=|A!pGi5iq@e#Lv zdB3@;T1%i80!`G~^9bdR+;xJjXGA;G&gOD$@GRL|qA{iVq3=Ma2i}E;KwfCgaG?-& zAS;Wjij_XJLI3Fx1a&ej5Ce*eSg+)x&jF;zB9N2|tF3n)=voWudtj|^GI%IQk*qm0 zKOMwugpj>OwkvxJU-XF06punItcw_U5SqbS;TR%99|^le^{hCFIi{Lug|vpdPITo8 zWFH$NnUZnc#avSz(7speK}y05MG}1MKwW%mXjuGYqhC2!9rUnA` zR+lr*MZh0R=Bfgrz&e;S-OD3>0D9i4LfpZ!yc3|cA6;=OXaymuV4yk>0z3*Z|6IKn z2Gj(?fyV&K1o^cOxCC4Q0(6K2gaTcG?!YwQ7oeE~S}B$qW&v*jtz5ttU@1VJm+$FU zR3W$Y-_A&b8l4r;A7EP^1>^$dgOvD{`HR(q1+lmW-CtnDuMT`blB`qIwp;S@!ACeRC-enmj83=~kbt`Ba*K)x z2jQl~W6Dmr$?&<@$Lr*EtOulRBz6k-f;Kp8pR7zaQj2MhEa-IQc!qL}j5rib z!9}CCU??FA7J=(!E*Rpd1(WUGR4`mew}6be7ce8+nNh=6%(IZ$)j5#MXzK;!fpPAP_h$~_&bs?`u!Gh_J{-8ddiQxQ83=oZH zB1(@{4lxAlD!6}}wh6MWOveR@_D3WSXIqN^O#<9Lr1eL`c5Vr0q^l;C#F~iEHhoXSx z4}&$aumXqL$UM7mSuTuR)y*nKEIb_B?>$J2{fH6qKrse54#-=4_d(JqKn(8(ijk`y zkeB=CgQVf@G$60w&V$5Qj2HtRC`N?yfV};Glr0Sp8#Sn1VXErJ;tEu2RLGby;J{p2 z_c3~BZA=HOV$vznDCMp=qH-W(vuvi=i=9fucDPS$gG+I2gG-6nvL)D0JIhcUJIhca zw*Ee8A9F2^eay8)Y^5cjoc6dD>s}l?*1be*=li7njz@9qcRWhOcDYY%Z?EFm-d-hQ z8*0Q3F z?Rej`tz|_UTYul!*0Q3F?R4MR*0Q3F%@yFKbIn>-w6VF~y!6=CvZ9U6)#2teA6E(*P$c8z>JQ4~uGw9dFWKxZi%FC@x-QhDUHwLi`M`)_ne zav(WE7~u>_gWKE)gDz8XJY*nxebBKkhApaH;oKeu$8RPE_IMCBv}~zs-3{qTN#|pW zw&k_<$g!L(l8y^G?bj7~mkZp5;$$tYOs$zaS{C=&w7H{sJ5+HW&{>j#0XQD-buL>e zIW06)$u)B*d0LjrvE*r2)~H(DrR4m6HEO<(2au!7T7pbC)tGxZ{VgR04>W@VWs!~^ zh{@##>caOCg$~Mt*Y(SoFHVpQF|{xZp7r41zcE)`kt;Eb`j| zb(RTErGiIYQEF1+!x7RcIuQF5OkU&h_%hOK1$t@tQ)wY)8F_9aW=Pq}U^`~6NmfeR zm5izA9gdstv)R%$TK>nCvE|U6oe2)ptt(x~!_kV9k$NYz``j|*gpzH(eN7l3vk_wAvzXtQ&NqW#!cwHvg7$QJUGeiD(-ptaZuL} zXL|9%H0~|0@(Q;ajv$Ur#^ll8+rx0cH{xMpl^(}R;~QC*MR>gUKHCH5Bv(VQs0ecl z$`%S~&cYviRQAK{kEIPjM-(MIUC|TjA}i{gu8K}i!JR=?vAp0cPgL~OQ;3}cYP5sc z<1`X`N^j(qQ{iI}TP~5{0<<<*Y)8#U zi{kGM9GC;N_$N7G*#G6_v43p+)@RB@u}ZXi*PT*I6-T#xY0ffxPQd?gw(NQS{%f=4 z16BRcR-&*~i5wT5wyNC4xHbgMG6&6V1m3Mv7k`7%wAoE@{b(IDFb-nsqTx|lP$f`J z)J6z4^C7sCgMDpNxM8@Lq1+vb>wMRMoCO`Bgp+1RUC>KLYH|%|T{Lm7=43O@MkpG% zoPXw93fMIY@g?w=F{J0ej3H!LItnxzzfS|0|M)8l($Pji$bTA*b(Gpn$DRf>Yod-) zTUkmiN|kG_`BCuy*9A2p?!f?Vf%^Kydw^Bng_&K~Cv_Jcf3hB$EAg~HoQI*h-k`TV zVKhMrJW=_5LHW&7e)Vx^7lNyYFx*mpC+INl7Za7^7nI*mVWE3tHb#!$y_IWWnWxUNLzWo(OERVnbnHS3T?MaPOx3-5$hZCeQ) z%=Q8J6Gg|-Nx8YWz*p#IFc{q3+}ynayuCamuxYaYbcj46bhO2(Z~(IOrT59rTV)PI^5;KZpB5 z@8jef6dC7SzH_om@NmDV3DcJts>iS2QK8F$f{=OxvnRT``Bx06RQb`+8euiVqw60^U%UR>jo)wHy8Xu;mP;obWwDA&W>qdMGSE5b^^STMmP_X_8gTT{I|W5L z`^I&4NgiH4IBJ5yFMj%x^*dav*XvSHVPN(FH~*06GmlMR?f}$hjl%>aL%&J4I9+^ z>CRUlZ<;dYTK>eBs_gjT;Jkv&!nPm3esAQPMWT8ABbP5fvHsVoE_a{#vPdkRFU|(t zKCq-u=oAt@O5!XIUc%f(SQR|1rjGcHocR||j5x>47ZY;XpHm7R-$puAX zLgym!TCX<~H-7Lz#U2$Cn`aE4oH{K$@W%OT{YISqq1>4pRecYK9$I{0SAMT8dAq_Z zdQOde;mEqpg9hDOFtnZT@Q{>6og((TtRDYahsERfkLXw=wtrM4cCXla_~&7p-mTwY zLCEIUMvtBDefssGBiGj4P;m0yX47@ApZRuj!+8!@7p#e`JL}KSQ`U|i^BU8;2A2zwrI0Pi|(sKDk$K&o7hT*|0D#K4N^Y zPv0JMy#0~2g*)B)#AS8cu-ydMFD+ZpbN9?SwSWI~@ISU5 zyL9nz^q=V-T~GD?{M@Q-t5#kQoxAnhIo0zzv^qR*swiKx#_wxfI&M1f>$9WRtl99v z)yi9H{`gVn1;@@UN_c$u$}vyvi*K8gx3Tx@P2(cIa38i~-}vQTo3`}X^lQU~hCk}fKXCZQBFDJpCz{pjoR_*}Qs$yjG230lb~t@_2)T?Ut;) zIkdWKLUw+K^b08mKiyR8lW%UW-Mr)c;HsH(8x%elUROhYOJ+d+r4JU0k6uscIs4ex zd4@N$f6V%3#L!DCh8+2@;zF;@Gis(J)|s->qs`^4m~R>#89wTIjdFA1H#f`q;l%uQ zEpD{?NB`lMuYKio;*q7(ADz6rVReUcXCM1&aKXYkE1vE4!NE;Er!J^+WO~g(ljlzR zeEPzU&y0KJ@+Vc(Z#91Yg&O&86&7|4c_zf`A8o4asnGFS-0kBl%O7tw?e#x@KC(Zf zbBBc)!EdD}%?$qKjT6(GRr?`0{B`d>7?Ig6 zc0HFp_w(ep${%|CyT4aH=;Yo_RF6;czfX^HJ`12m8&UN2ZBs_k~Pui1TYjw(`K0e!g zJ6&m6A>5}^i_BUr(_6mVVe{qP{cd+{{#{0|i@$b!rR}0$pD-?36Yf;ddeVUx>ddLy z`n`s?53~%N{>f)O=kIOMb=2=^KeUcLxH)xl-PH#>8$KU!epuCGcamc6Rygy;+^9>P zQ^(C1|Gr=1nMY3UsQi0M)uhll?=By){MZl29&x=o{r#7#ZQbn>cyslqx8t@&kH1*4 z+Pxd6&b9PA5qvBD#c}Jp=gsf8d{@EAY4dwudNp-X>Zp?keB10>d#U@;PMdrCq@1t$ zf$PSvlBa)oXnxp|kaq7j{Ks>J&wY_|ujSoU@3K}IGhv=%061p!utB=w-+;Fcx%E58Id*klz!tW+RRlJFi^^agC&+!XS z?9n6LaL3-k5uq^n-zBZ9{n0JM)!tg&U#oJf;x7Hi=%GvBXk86L5NqpdBUY`%dU8_A-ZVWBCgw*{GacQo>ryDxYO$B5F@DM8DOuOXJo}I1u}c!eX72Iav!Pa;p?aQoupy||iVK5RZ@cQbIIY+7 zche?%ue`E#z3aSBR^YVN-s2|)?hmUuB5!WPE@6Id7j|sFwf9Jk<+@vK#!pK24l<-H zy)rl15R_PR_pv^$3_kG#st4sI2fUqYIN+Kb5o!pEkJ#P#YTq!wy@y_1bH&(TPP6h8 zD>*+>t>IUFmu$_yIqT1qDLtCjJTNjb^K6BrdCQ&%TAtw4tXD1ncl%5#KO%7D7g2p4 z*%>i^Rq&KXQ@bY3Iu|qbT*C4h+ke|;^n11Cq~z7zpMJN`ph}a{o=i%r?f=!Cv*X`= zdcvsk6Mwmy(*23ljZJIszP&JE$(UbjKjZO3Ouz084^5pO|73-YGw%3wd-0m{tiW=2 zx(}Svv}(DpHnh6uu@fZQ&gedCmvQ3$UOieH;$Gg-v&QF7t&e%@+dd86OP?R~wjt>8 zeN7g8J8RaQuhKgEeRDi+O|M}MW+!*+P`;&4?N__!4jVRXmmz&?#>VdpcaFbZ?o{E; z51Urq_x_nP<8NgaUH$a#oT8{jU+p?~t?2fr_cBl2`(^ao2Yz}p^OHXooGQFp_qj{$ z9^doaty|B(p7Q;e;A^J}kB>hTef8ouZx&rZ%&9kT{`TX(qLoEA76p2}wCkzouDt(Y zvnJygp8Ml)lgILM;=3iK1++@?>w9$ank#t&^8AtxM|-Xfo#Ps`bzf z)ob4qBi6QPUhqLi&&73QtyqBiW-*Ya`Fzc(dMf-Y$&kDbA zeeVykKfSkVRo$+eUB24zyQk;Y6-g~Rd*|JmG%0&apYS=JkuUok9Qi}?hb|7fwFdf&No zr|{=}g+DL4`^NaQ*;{(`>Rog(v+&~aPYbV9S+Jnr+FQRC{_<04>eIiNT)sxau7Sbx9v@S1`tW-_u3Wi1wQAG+0|%}(9RFLxXKwy{>GI_}mpYB# z`pm6gmZu+hrJ7syWtX=eI%CkkaOlvXrcIk}U9<8~`jp|#7M(hDv_~!f^4C6Eab;;( z{9wax#`ks&+}!KXJdZuYSFK2%QfW&4zOA2b|Ll}EU#+xa<;vEpyA2vVce7E{acDrGg}LqftzE*!&F>wIuI=YGcH7ACWlXEe!qM3a^-pj1;jYN5Etit@Y1G`wslq>x|IFLy}~h%Pp#x!XVS3r z^f<$%`GYq1`t;`JwLbAf8}xp++l)sqtu4B|_W64apFel+)~WFqX7xyYvT)J(YZZ6y z+_~t_yFc!Gt69?q%?h{dd#+B^*Z=X>x0817exzZ>?Pr^H_IqqrLimDTE?*w_CnKL3^DD^@+V{nv6w52r=Vi#09|f92?v!_gg*{9ZNA+QG8!xdM~WF4z!`0nV@r&r~lJXxo0m*@KSZJzS>id9u#U)i(Pn*6>gQ!2E?a?|M* z(w=|5S)U$9Po7-!&MKoJV)e1_kAD?4W#5m#{dw=3+O_Ae+7Nj3*mtQP9)EK7)vH(2 zo@_9y{mq|GDBT3B5$`wV;Qg(&{#erj*PN`b z^})3OfQb`u!wAOZJ6G*p$L+s269;}?uG4iey6T0v?Mr7PHW)$JuUa^}$F zj2L-UxuyQN>ixwgyt) z`~}Yj)RNBy)B+t!;)8BG8sV7+M63?u^JheE3_7M|x(`Z92|o?_3x24WmXY$ohYudA zja$3e-#Hj z@rHo5m^bBniZYc&mg-x2;D99^oFnE8WHwgkmJBc7W-XVfx?tXs zOH|Sj(gh2tF1j=E&aq2bm*#HC*A}nyM>oJC@Az0XZULm{$uJ!8g94VN-b>7lvbA=i)U!5l>CQ zGp5G%Byy=Vuk(Fs^37J}tE6ns8}q|Aijh9GVSi{!>Oo2t^Ca!i zfVQ}9*($mf^WT>C;j%n)$|?m}Gje5)`8{j0ekAAY>B)apTe4n0^RH|J*0iPU^38Pe z4QPCLgL1$+8;IIst;rhVJLkFhUe(fO&T-9>8e2+UW2H{`t_b#%b@0|QN|JnY0()Qf zU92^=eo7C?958+c;z=oz{fDHZtr@l*uIizzWt=Z~-`3q$a(Wo|x~sOUjqj znxjE28|}%cTprN||#tzq~gZSLBxj$b05U+C=h=O2d#6+hMYz8Q7o5wl73!n9P`q%LJ@s(vD+WPtZ+V@hqP)ylFp$b73(!&qU(+?VgP8mqh`!T5hZp_BHH92BRb_8+#?Wo{{NhfD^;8XWCo{EkmeM z!UfXOUXf+t<1v(DrefCJTro-8nwp=>q*Y6@4ydx%Bz1F7DP_6?Lb6Y!Ol#YwRCc7A-}#YFQgnO86Ev%7f&&tXpk(b4|0{Y^M)bYwUkn zzW(3~%lE%fZz?BMS=CxbYCEBYC3T6GtK=hPg!TbjifotMcf)$c{-)aRuhd+BJch+_ z4mqEpXdu>WMzK^;+f!1xj#p|=RnMyO!Mvz)YHrEpLDAMYs-%6Omf>MmrP{U%{uzoD zkZ;R2Yuy%0wqe=EJnfE`+0MFyzvQCzgA>%~S__QzMf-!gSL!OYH!|s*DyGlk`CUThhQDbUlrDS-Sb2*A=f;i-o?Gc(~?%7vTCunoZ-0=|}_PwlADKXN< z;QL$nr5@EnYXplh(o~0*yrmpS3z{5FSKg6LPSjO&cZzb2^tmdXF|F%H)rTefZp&Uk zjU5J04(pQ~)3!BfZK~rpv+S@JC676-l3oO}wH0U#Q(7?PfbV&eHhCv_h^iPVuVroJ z*7l9LjVB^)woEC_^l7kOXvb4~sMY}cRN7*)ZK-X;ddw;Nch)1r$uuq7g|vbwV_J&R z?zczPT*s^{_CKoCCCBo-Z?o-+Kp|OF*zb;4Y2koO)AGrmrRZcZ0SsSO|2iTOsXX@=gRCyDk(WK^%mfQ z`eac}rS7{ad6fPmdZE}$NgLN(LT$ce`<4jMtYqrym|do2&V?#D zQdclv9FdrLV6Cyt9u4YN*=L%2Q*)UpDV!m&wl`@Zk)M=J*{1n*K&@6J4N9A}{!^v8 zE~L>iyd2-!8mp;20-s@1{X*0d-B2&={g{fH8v8zKQ*#a*QIc=6H=0&83D%D$OU_9@=1ELDI*L=-BroRdT51n=2ZGAEyvBI-Cm)swh?MOX?3#| z&;uoX6{@~q`jmF*BO+Dp7~eXl(h8TnGPjlt#Ieo?+luUoEUC-Z%@#n}xqpeJE>P=- zCCNZqlsfi4@=Vro7mHFb9a)o7QXeKQTI6zsrPAOxVr9RfdIPO}Bw7tgjY(?a)RS&oNEqdWt-|b^mZL_>n%N$dIW|ktzfLlkdpWX|{I*rw z!HV`_>rv~Z720n$YKpZ=osxk&wrV#RWgu_p#g=iSG3!vzPFPaXTK96ML`}1siBpsS zt#s{WR?$ z%Q@08l+jwJS(lcUI{O1!_8dX8*RdRLQ-?@yF)ey5ENh6oW6PAI5wlze7%jOhb*su( zreoO)um_YHytMSqeKONj?G@V2>am#)dwJ>-Ih)ITTIWg1HZ^ssjgoWJK+9M5VzM=> zo-uW9L+#aNS)}xtEp>GcEnA^(_RyEsdsC_r6Oz$5zeW+}xW|?xmGR8+Z)vNa+kPYS%c? z)5Ysj4>6yN#k^5#TFYmEv5n>~Z9b+)AG}Q8oVsQEpan*IgIY_@sMxPvj^U(TqspGy zYO(I~A5OFL6>s!r%GSfS&#&sSKQFs}kF*n(e6z3LRnE))-Fp2ReLl>GdY3$6i=`Ik z9r{VBr#W_$<6WuAdB%1wEeDQjA5>%8<4D=`cBoPI^|Z3tqi`*ZSrW7w+?Fn8El9~U z*Sw{^E!lP$hy1Wb&$1`8)a|ykn502|l45|7{HImI{x8cU;p|uB9rAuK_)W=|`cBP@ zI%6fr?i>xvF@U*E%5kM-%aCgzBn^gF+l84I|E^ZR-jemi-db7~4R7nFUqZzgZ0T_wF#Qqomk+lt3)w8g0p<$49x-Za}alu*jYgSU|8ij+#fkt!>y zwZw6!`RayB{SNaj2jh%By`58hh)uiVotaTV3z!0{@s?=OfoRCSr!SHS9nm)|@uL zN=voJD37C#@PBtecp0KAuJpkdFt{S13lInz04mbiF1M1)b{Rkimz*lxe zd!Qq*3|IlY1FQzt02=_lBDN}E1cHHl-~@0IcovVyJP%9+8sjT4J%JqH6@Xub5xTIy~NH&?Omk4h9{<1t_G2 z|FAYfKLWsKk}|N%0r0sbff#kPF>uZo@)c9iM>k0e@g9kO7FEQMZ5*=mzi$JUxLyKsK-x_yEWU40utg zKTsKn0HT3|z<0nA;0|EGBXJ&p7vK$41;T+|Kn5@a*bW5a<=l@0Q-GLBJSb9PljgJP?3~XTyLPpgq8^B_#sgfkD8tz!YFMup0OR z_!ig?90a}t0xIDvNI+xYaiABF0gM9105kDjo7uozUA zffm5?KrZkd;0?*IQw4bkHUNB>xhh};_;shAMx+b$0iFVe0y)6#g4=ky^335gVlRI7 zp4p3kv5P-v&YTe+@|OoV5PasZ6An8AnmPlu0DQoYLHMC!)BTE!t47QWD~_n7tzItA(XXbiLgMgbRr0$?B>AI%1q0#&PnuRu3o1K{u|`VYVv=!qw3djWlbe!w7L1~3y? z2CM+y0k#9DfnR_E;5y)jr%R^+Gk~SQGGGO;2H+F8n}BV=Przm1I&d4{*Sqclg+O)~ z>J}IUi~(|inZRsd1@JAfA2h@+5kr;ZDNwhZp?2Y&;{rPWB^$}F0ckz2W$uO0e&Uz zXJA}iw0~duK#--=yg+lTnuv~Cl!<`R+cq=0TlPyQs@ zIDh-0Ulu;}i zVj86e(`cAtIcUkUwg)-_iNHYM&)a_@=YMbiiyV-0s7j^K^F0p^0LK8d|3?91fN{XH z!1F*ZFcHWDCIK%4uK*k)aD1>0I05iWi+^aDc1wG5Nqcf$dvaELa$0+GQhV~f_T;Gc zQt{Zo8&TsIA`P?=`>4k}(SQJ!`76L1@Vqe1yn z=3s3J`fE>mXiqw6PyS8EE*kc<24C)XK1T^({Ej`tkygTSXwiB1J^>*xP$1?yT`|-w z-|rglyB^`^u<+-51V*JOI(_=Ij9%g>>wW>ENlNDkQ-TK$jzi^vUcF+#6~|~XC|cA# z;w~I?Oh=Dj<;=n240T?7&%sd}(!o(167TP|2+6uuXbL^Qj2Zw`1_A+oCH3$6FP0Hi zHdz14W~zT2gb&ZpXwkF_TjasHvb^MUqcllEkT_Qc|t zJu`t`*fGR0ImG;VT#GC2j-r1%-*{VJHNPF_W_M}Y5Xi2`QLts2=8L!kP zWC7pEu~TF2#rC^}aYg^)vrsRF8#Um3^r+oj!N^+v#gx1*`_v0Q9w&(H^)}%pV+B zh|6!3DiL}OkC=nnJ* zdI5cae!u{L^8$Py@J%(_+*>eylJ*YsU%X8$KEgq+_T+i($+Oy%aoUqH+7no<54)Ah zEu=WehWBu0Q6JC5N|(X)hu{7q-Xm9yTsej~B!@UyUQs;A?lGd;y8U&H>rOWfTDRCK z7^t{zzeDwDi=6_n55Ybv5pM&ZHbfVZRdlMTs2a2%Z<&;*;R2oi|vw1D_g`Ic~SYHl539i`EICA zSf~D!t>C3z^Mx{GicSD?QEFh#O*JJQ(&dxG54*V`b*9VWlr??k*Uyw-B%Ur)-;(n% zdGJE|dQ;kEO`qY*HI=EgK} callback - the callback function. + * It will get either an Error object or a response body. + */ +function callService(params, callback) { + params.json = true; + request(params, function (err, response, body) { + if (err) { + callback(err); + return; + } + /*jslint eqeq: true*/ + if (response.statusCode != 200) { + /*jslint eqeq: false*/ + callback(new Error('API V3 returned ' + response.statusCode + ' ' + (response.statusMessage || ''))); + return; + } + callback(null, body); + }); +} + +/** + * Get the V3 API authorization token to use in subsequent calls + * + * @param {Object} connection - the connection object provided by ActionHero + * @param {Function} callback - this function receives either an error, + * a V3 token or nothing at all (if the current connection's user is anonymous) + */ +function getToken(connection, callback) { + // Anonymous + if (_.isUndefined(connection.authToken)) { + callback(); + return; + } + // Cached token + if (!_.isUndefined(tokens[connection.authToken])) { + callback(null, tokens[connection.authToken]); + return; + } + // Get the token by calling the API + callService({ + url: v3url + 'authorizations', + method: 'POST', + body: { + param: { + token: connection.authToken + } + } + }, function (err, body) { + if (err) { + callback(err); + } else { + tokens[connection.authToken] = body.result.content.token; + callback(null, body.result.content.token); + } + }); +} + +/** + * Get IDs of users in the specified group + * + * @param {Object} connection - the connection object provided by ActionHero + * @param {Number} groupId - the group ID + * @param {Function} callback - the callback. Receives either an error + * or the list of group's users an array of numeric IDs + */ +function getGroupMembers(connection, groupId, callback) { + getToken(connection, function (err, token) { + if (err) { + callback(err); + return; + } + callService({ + url: v3url + 'groups/' + groupId + '/members', + method: 'GET', + headers: { + 'Authorization': 'Bearer ' + token + } + }, function (err, body) { + if (err) { + callback(err); + } else { + callback(null, body.result.content.map(function (item) { + return item.memberId; + })); + } + }); + }); +} + +exports.v3client = function (api, next) { + api.v3client = { + /** + * Check if the user belongs to the group + * + * @param {Object} connection - the connection object provided by ActionHero + * @param {Number} userId - the user ID + * @param {Number} groupId - the group ID + * @param {Function} callback - the callback. The second parameter + * is boolean vwhich is true if the user is found in the group. + */ + isUserInGroup: function (connection, userId, groupId, callback) { + getGroupMembers(connection, groupId, function (err, members) { + if (err) { + callback(err); + } else { + callback(null, members.indexOf(userId) >= 0); + } + }); + } + }; + next(); +}; diff --git a/package.json b/package.json index b9daa5614..c3e6dfc2a 100644 --- a/package.json +++ b/package.json @@ -21,9 +21,11 @@ "bcrypt": "0.7.x", "bigdecimal": "0.6.x", "bignum": "0.6.x", + "body-parser": "^1.17.2", "crypto": "0.0.x", "datejs": "0.0.x", "email-templates": "0.1.x", + "express": "^4.15.3", "forums-wrapper": "git://github.com/cloudspokes/forums-wrapper.git#12b57be495c2e10431173522bc9eff60e0575959", "heapdump": "^0.3.6", "highlight.js": ">= 8.3.0", diff --git a/queries/get_challenge_accessibility_and_groups b/queries/get_challenge_accessibility_and_groups new file mode 100644 index 000000000..6ca557db3 --- /dev/null +++ b/queries/get_challenge_accessibility_and_groups @@ -0,0 +1,21 @@ +SELECT + ce.is_studio, + sg.challenge_group_ind, + ugx.group_id AS user_group_xref_found, + sg.group_id AS group_id +FROM + ( + ( + contest_eligibility ce + LEFT JOIN group_contest_eligibility gce + ON ce.contest_eligibility_id = gce.contest_eligibility_id + ) + LEFT JOIN security_groups sg + ON gce.group_id = sg.group_id + ) + LEFT JOIN ( + SELECT group_id FROM user_group_xref WHERE login_id=@user_id@ + ) ugx + ON ugx.group_id = gce.group_id +WHERE ce.contest_id = @challengeId@ + diff --git a/queries/get_challenge_accessibility_and_groups.json b/queries/get_challenge_accessibility_and_groups.json new file mode 100644 index 000000000..218f37428 --- /dev/null +++ b/queries/get_challenge_accessibility_and_groups.json @@ -0,0 +1,5 @@ +{ + "name" : "get_challenge_accessibility_and_groups", + "db" : "tcs_catalog", + "sqlfile" : "get_challenge_accessibility_and_groups" +} \ No newline at end of file diff --git a/test/postman/New_Challenge_Visibility_Control.postman_collection.json b/test/postman/New_Challenge_Visibility_Control.postman_collection.json new file mode 100644 index 000000000..521f5e6a2 --- /dev/null +++ b/test/postman/New_Challenge_Visibility_Control.postman_collection.json @@ -0,0 +1,226 @@ +{ + "id": "ba962be9-0d58-f187-8809-008a39bc2240", + "name": "New Challenge Visibility Control", + "description": "", + "order": [], + "folders": [ + { + "id": "712ffa63-a959-e4a3-6af9-84d4f236b2f3", + "name": "Get checkpoints", + "description": "", + "order": [ + "7c7643c6-89ab-641e-b67a-32b3ac91e09e", + "d830ec36-eb8e-9586-c546-14af77cec152", + "2af8f0d9-f3e8-c58a-ca3d-1130e4b07371", + "f545bbfc-36d7-6567-25a8-b4d6634575e7", + "a3ae5124-2077-4ff2-4e02-afae7670bbe5" + ], + "owner": "316251" + }, + { + "id": "0eeb693c-c6b6-e23b-156d-cff5f21dbb27", + "name": "login", + "description": "", + "order": [ + "6bed8920-6800-0ae0-e63d-b39b05c7f50c", + "fd4cd936-2d4d-a272-f402-d0f7b6cab82f" + ], + "owner": "316251", + "collectionId": "6369974d-65cc-d819-459b-0026549ddb47" + } + ], + "timestamp": 1474156790593, + "owner": "316251", + "public": false, + "requests": [ + { + "id": "2af8f0d9-f3e8-c58a-ca3d-1130e4b07371", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/challenges/checkpoint/2220003", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497550652259, + "name": "Old logic, access denied", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [], + "folder": "712ffa63-a959-e4a3-6af9-84d4f236b2f3" + }, + { + "id": "6bed8920-6800-0ae0-e63d-b39b05c7f50c", + "headers": "Content-Type: application/json\n", + "url": "{{url}}/auth", + "preRequestScript": null, + "pathVariables": {}, + "method": "POST", + "data": [], + "dataMode": "raw", + "version": 2, + "tests": "var authResponse = JSON.parse(responseBody);\npostman.setEnvironmentVariable(\"authToken\", authResponse.token);\ntests[\"Status code is 200\"] = responseCode.code === 200;\nvar jsonData = JSON.parse(responseBody);\ntests[\"A valid token is returned\"] = !!jsonData.token;", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1474159263289, + "name": "Login as admin user", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [], + "rawModeData": "{\n \"username\": \"heffan\", \n \"password\": \"password\"\n}", + "folder": "0eeb693c-c6b6-e23b-156d-cff5f21dbb27" + }, + { + "id": "7c7643c6-89ab-641e-b67a-32b3ac91e09e", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/challenges/checkpoint/2220001", + "queryParams": [], + "pathVariables": {}, + "pathVariableData": [], + "preRequestScript": null, + "method": "GET", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "data": null, + "dataMode": "params", + "name": "No groups (challenge is not private)", + "description": "", + "descriptionFormat": "html", + "time": 1497550504090, + "version": 2, + "responses": [], + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "folder": "712ffa63-a959-e4a3-6af9-84d4f236b2f3" + }, + { + "id": "a3ae5124-2077-4ff2-4e02-afae7670bbe5", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/challenges/checkpoint/2220005", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497550755372, + "name": "New logic, access denied", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [], + "folder": "712ffa63-a959-e4a3-6af9-84d4f236b2f3" + }, + { + "id": "d830ec36-eb8e-9586-c546-14af77cec152", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/challenges/checkpoint/2220002", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497550612717, + "name": "Old logic, access allowed", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [], + "folder": "712ffa63-a959-e4a3-6af9-84d4f236b2f3" + }, + { + "id": "f545bbfc-36d7-6567-25a8-b4d6634575e7", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/challenges/checkpoint/2220004", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497550705028, + "name": "New logic, access allowed", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [], + "folder": "712ffa63-a959-e4a3-6af9-84d4f236b2f3" + }, + { + "id": "fd4cd936-2d4d-a272-f402-d0f7b6cab82f", + "headers": "Content-Type: application/json\n", + "url": "{{url}}/auth", + "preRequestScript": null, + "pathVariables": {}, + "method": "POST", + "data": [], + "dataMode": "raw", + "version": 2, + "tests": "var authResponse = JSON.parse(responseBody);\npostman.setEnvironmentVariable(\"authToken\", authResponse.token);\ntests[\"Status code is 200\"] = responseCode.code === 200;\nvar jsonData = JSON.parse(responseBody);\ntests[\"A valid token is returned\"] = !!jsonData.token;", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1474159245944, + "name": "Log in as ordinary user", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [], + "rawModeData": "{\n \"username\": \"user\", \n \"password\": \"password\"\n}", + "folder": "0eeb693c-c6b6-e23b-156d-cff5f21dbb27" + } + ] +} \ No newline at end of file diff --git a/test/postman/New_Challenge_Visibility_Control.postman_environment.json b/test/postman/New_Challenge_Visibility_Control.postman_environment.json new file mode 100644 index 000000000..143271c12 --- /dev/null +++ b/test/postman/New_Challenge_Visibility_Control.postman_environment.json @@ -0,0 +1,34 @@ +{ + "id": "d761e292-418f-09b5-8b27-9d93eae42f1e", + "name": "New Challenge Visibility Control", + "values": [ + { + "enabled": true, + "key": "url", + "value": "http://localhost:8080/api/v2", + "type": "text" + }, + { + "enabled": true, + "key": "adminToken", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3NtYS5hdXRoMC5jb20vIiwic3ViIjoiYWR8MTMyNDU2IiwiYXVkIjoiQ01hQnV3U25ZMFZ1NjhQTHJXYXR2dnUzaUlpR1BoN3QiLCJleHAiOjE1MTAxNTkyNjgsImlhdCI6MTQ3NDE1OTI2OH0.KRgW9TxNOEiEu5YdQnXQO1nKFULIuy7JlzDZdq9QFQY", + "type": "text" + }, + { + "enabled": true, + "key": "userToken", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3NtYS5hdXRoMC5jb20vIiwic3ViIjoiYWR8MTMyNDU4IiwiYXVkIjoiQ01hQnV3U25ZMFZ1NjhQTHJXYXR2dnUzaUlpR1BoN3QiLCJleHAiOjE1MTAxNzI0MDgsImlhdCI6MTQ3NDE3MjQwOH0.sIG2FoNiCldizzcTMQ9iAFh-PCigNGBAlicxms6uTkk", + "type": "text" + }, + { + "enabled": true, + "key": "authToken", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3NtYS5hdXRoMC5jb20vIiwic3ViIjoiYWR8MTMyNDU4IiwiYXVkIjoiQ01hQnV3U25ZMFZ1NjhQTHJXYXR2dnUzaUlpR1BoN3QiLCJleHAiOjE1MTAyODI4MDMsImlhdCI6MTQ3NDI4MjgwM30.s6q_FRFryMslkWCkR0wPSWwTopkZhHH8g9R_4GPf9m4", + "type": "text" + } + ], + "timestamp": 1497565761064, + "_postman_variable_scope": "environment", + "_postman_exported_at": "2017-06-15T22:29:38.942Z", + "_postman_exported_using": "Postman/5.0.1" +} \ No newline at end of file diff --git a/test/postman/Reviewer_Management_API.json b/test/postman/Reviewer_Management_API.json index cd7d0837e..b58200657 100755 --- a/test/postman/Reviewer_Management_API.json +++ b/test/postman/Reviewer_Management_API.json @@ -1,203 +1,214 @@ { - "id": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "id": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "name": "Admin App - TC API Reviewer Management API", "description": "", "order": [], "folders": [ { - "id": "142d5b1b-b304-bced-c1f3-b59e8187d2aa", + "id": "498ee2d2-174c-7049-3cc4-43b4e330083b", + "name": "Get checkpoints", + "description": "", + "order": [ + "8db48405-6ba0-f116-06c6-cc34cffd77c1", + "03badc56-40a6-750a-a0fa-937d6af188b8", + "76441abd-9a70-5fe9-93e1-59dd0318384f", + "60330c29-7ed3-b453-8d01-652084ca19b1", + "46fea4dc-9708-763b-c0cc-713ac9c1a9eb" + ], + "owner": "316251" + }, + { + "id": "305f84dd-24a3-cbe7-97f1-7063b14a5f42", "name": "create admin", "description": "", "order": [ - "17cd6d9b-17b2-1f5c-a0d8-e0948c718d26", - "fc7d7ac4-d1e1-a441-6717-ecb50b9ad7f6", - "9bccd2a2-8aac-1931-b78e-8b61a99415a4", - "8b843cb6-1fc6-8c0b-1d6d-f54d9470cf76", - "88ae8323-4232-1675-8796-e06c6997f3f9", - "2297e0e7-4871-b68e-6258-b59a1da3acd4", - "59d2ab3f-1ef2-3925-42c4-754eced98658", - "43dbe6f5-32e5-f0f0-5735-42a3a9f08120" + "2dc63d17-e288-5432-1e70-ea3b38dbd939", + "13cfe266-39c7-4139-4526-0f45743c1ec1", + "9ddc746e-591c-69e7-2326-a05aa52f7109", + "e498adc6-5df6-ea02-491f-de46950eff67", + "0dc9a5b6-60b7-0006-30f3-a93f6a23efee", + "b762147c-aae5-9630-dfe7-d6468a8a3843", + "e5179ef5-cef4-a08b-9fbf-cd63b4a4066d", + "4b62272c-8167-0310-930a-d5f0526c52a8" ], - "owner": 0, + "owner": "316251", "collectionId": "6369974d-65cc-d819-459b-0026549ddb47" }, { - "id": "8052cbf5-e206-af03-0392-e853f3f06bf4", + "id": "1438537c-a455-8206-0b64-bcb6e98cb447", "name": "create copilot", "description": "", "order": [ - "3a87b2a7-3761-5089-38d9-6c7d3796e984", - "2cb65342-ba7f-b473-6afc-8a729da04563", - "e058d344-3c5d-951a-c86e-ebfeba41bab8", - "42fc7559-c2a2-8b85-67e3-3812ae0d5998", - "518db876-c166-6aa7-d484-b8b778297b4e", - "9fb05ea1-f85e-209e-7619-e40450acd7f3", - "79444594-2c40-1e6e-9f71-f22d57828026", - "26e53a5b-bef9-17f2-fb02-34595bf8a8c4", - "9ff114f0-56ca-f56c-08e4-3bb4dcaac10f", - "6727946e-aa76-0996-e734-800bb07cf5c6", - "49c5d6f4-5b86-3e9f-8c82-ef7430411264", - "858050d9-d3f2-900f-79a8-4a56c7ca586b", - "68d189c2-eb05-ded4-1e97-414ebde03ab8", - "34ac4817-1082-2274-ed98-f17b63e62786", - "477195d0-14ca-6a6e-274f-513e7d50a45c" + "597e4417-c496-e48d-801c-5504e9201d18", + "16572157-2b12-830a-35df-e87fee271e02", + "121ce835-ccff-770b-cf19-d4c8715734ee", + "e3c87489-0dac-48e0-869b-117743e7fb01", + "7667b82b-d891-3959-4469-2b6e3673ed03", + "1a4b8b23-8b80-aaf8-5350-63d6e573ef85", + "6fc730e8-851c-c0c0-4dbf-79a9fc7c67e1", + "4c54c5ab-5d8b-a873-49b0-0f3d63d6b42f", + "497b04d4-c729-3008-107e-b69aead7e3db", + "676c46be-e1bf-ba14-d357-1ca01119054b", + "d7913d8d-6c66-b1cd-62d5-c40393c22661", + "0303a184-79f4-7216-4ecc-797f324d6f3e", + "dcf543f4-41e0-0506-52a1-d9abc07132e2", + "216bd35b-31af-ba0a-497d-9b93576104b7", + "f6e293f3-5650-d73b-36e8-97d587604a4b" ], - "owner": 0, + "owner": "316251", "collectionId": "6369974d-65cc-d819-459b-0026549ddb47" }, { - "id": "7544e9b2-c615-4376-7145-511bb968c906", + "id": "ff6b7b38-7532-5c03-26db-c68f88696eb9", "name": "create reviewer", "description": "", "order": [ - "ebcf31ae-035b-49ac-41d4-fa4484eff6a1", - "b84bd2e1-cd0b-3489-3c11-917a1624249e", - "4a6e3f4b-cb9e-978d-281f-81a57545b0ac", - "ac18e672-1e47-37fa-1ae8-85eed1beab2d", - "202e4545-829b-f158-372f-206e632d609f", - "8679c69e-e94d-7188-60fd-bbe506b851d1", - "2f652b9b-7dc4-8140-9ac5-e6995f1a3fba", - "a8e7c6c2-1cfb-e3ad-af5c-9c27bd71924b", - "d0a6e94f-3c59-2398-f0f5-a1d54a6f4e15", - "03ce940d-9b2d-b46b-0f84-48da5529615c", - "24bc8058-d1ef-1f33-eb64-ede9b9663f49", - "84cd43c0-c407-365b-f1f4-07929e2876cc", - "8a43eff3-3f9a-83a2-6734-a683e29252c8", - "790064a6-e429-1f9c-24b5-7112ce1fb8b2", - "0865091c-8f04-f18c-f9e5-e5c182bc8ab3", - "9e458d5b-5aa5-05ec-6240-7d171c75cf5e", - "0e55b155-b8b7-ae58-5505-f1ff9ba0eb36", - "a466f2b7-2f9c-4a14-fc0e-eee7981cdb42", - "16044f47-5b3d-2ba2-1787-8e6f7e78af97" + "0b12cd19-4eda-4c11-e926-7f8c8920d2ab", + "1b4714ed-d2cb-cd10-98c3-4965448e6b17", + "617c7aa5-6a13-7f08-3621-050d7bb9fb42", + "32fd36b2-7397-5e93-8b6c-755557c77586", + "b557e83b-d42a-a7b8-8a9c-8fa2270188b1", + "39116742-fb19-f8ba-f177-1e1910b0dd50", + "f8efe766-a322-ee21-b4f5-78d78642af19", + "789c4564-2cb5-a4da-04f4-0d3a432950dd", + "38247541-c9f7-206a-f77a-2cdbd47c3968", + "5eee889a-83e0-96da-a476-ffd50ad66960", + "c3dcb7b2-c57c-398e-62d8-170db419f168", + "a407a482-48ea-5561-9158-71259c3e8a3b", + "c42386fb-4880-273c-5f56-514a24108ffc", + "7b7bc600-f9a9-e566-ccd3-4bff678d50da", + "37345c71-a682-1d40-ff87-7739450f0904", + "8b52ad5d-31a4-8a84-4d24-ceb91021a467", + "61f8c960-54fd-f1b3-0cc3-8ac89de6361a", + "0baebd12-e9e9-b75f-5409-4bdd22db26e1", + "12863b80-7674-2de7-7371-1921c77e6ad1" ], - "owner": 0, + "owner": "316251", "collectionId": "6369974d-65cc-d819-459b-0026549ddb47" }, { - "id": "2964b89d-893b-aada-2e0e-c4136b920508", + "id": "43eec092-7864-262f-fe9d-a2a416e1a2d8", "name": "get all admins", "description": "", "order": [ - "b0bfa529-5f58-d5a6-e1bc-2099abfa253f", - "b83cdcb1-5abe-0f73-1c9c-b558c0634baf", - "144d7cd5-cedb-1e15-fec5-27c5e56863df", - "e10c59ae-1669-54bd-03bb-4de19d51fb5e", - "828d7e47-ee45-5ed2-fe37-2114815e84f1" + "6ab91574-6c11-9d54-a6a3-a87304bec08b", + "c21ce35d-8558-ca77-c6af-8a6d930564b9", + "1739bc1d-f48e-2f66-c423-d56a7dd6925f", + "b5f484a7-b5e9-e763-97fb-5d750d08cd6d", + "1c6e9cc9-1d15-c2cb-0b7d-7b552558f26c" ], - "owner": 0, + "owner": "316251", "collectionId": "6369974d-65cc-d819-459b-0026549ddb47" }, { - "id": "1a80812c-dfa2-5dc4-aca7-299502bbc807", + "id": "2c775e97-29a3-c27d-abb5-e5dc6a5e05d9", "name": "get all copilots", "description": "", "order": [ - "67db2b5a-4b85-4e18-2709-5c475849329f", - "2d18170b-9631-3c97-fc68-51d0ed76766c", - "a47c9a54-d12a-6801-02a1-c57c420237cf", - "21bdc1e1-c5b2-d063-fd54-386ab396b224", - "897d4baa-72d5-1eca-ff61-51db0d14408c" + "0554d512-8935-33a8-6447-85eba32b8873", + "2e452537-8224-19aa-e79d-3bdd2d3d6092", + "62a5e348-741b-fd42-ed58-839def26d4bf", + "05f2c4f0-2f80-95ed-54f6-2b731960bdac", + "e1dd94fd-2dea-4082-61f8-a551fcf1d55f" ], - "owner": 0, + "owner": "316251", "collectionId": "6369974d-65cc-d819-459b-0026549ddb47" }, { - "id": "81516934-d74e-f97d-262f-21d87d5961d1", + "id": "790ca3b9-d88f-04e9-b65d-fd59442f3394", "name": "get all reviewers", "description": "", "order": [ - "08364378-8daf-8159-547e-fac22ca27847", - "c28b4a81-8ee7-24ba-fc8b-54b1b3642fab", - "8bd1727c-34f8-ced7-eb92-d50cc6e56772", - "fe0a03f9-4969-651a-5eed-01de9398498e", - "ddf839fa-733a-056a-8a2c-a1e56d0e9072", - "ef7fd1f5-a302-b7b6-a772-a43eb3b82062", - "c0db4362-622a-b556-1991-80df568707b7", - "f784d0d8-8645-7633-91c6-54ec81aa95ff", - "c1d0d1a9-a8b9-8ee7-c6e6-e539a52fbf35" + "f88f1d64-7461-652d-f3fb-6c48fa553e61", + "e61162b5-ccbd-79fc-7daa-ad1e9e71f8db", + "d0457f1e-5957-b83c-f603-aaf45690e622", + "fbdd77d2-d138-3a05-a543-d5302daeca50", + "c15dff6e-1a55-a875-3460-2d2097b2f960", + "4f247a99-8f61-47ea-3323-68ec5a7e7000", + "9308798f-cbfd-b44c-1d47-6ef6650424f0", + "4547a259-b0cf-c5e6-8d04-035b9ae443ce", + "52edc048-18d6-ce4d-5312-69286ce2e2f9" ], - "owner": 0, + "owner": "316251", "collectionId": "6369974d-65cc-d819-459b-0026549ddb47" }, { - "id": "fedff379-68f7-3322-d2e9-29471d82cc60", + "id": "14f4dd06-76e0-ca22-602f-0ad3974aa4fa", "name": "login", "description": "", "order": [ - "f6c44b3f-570d-e48f-3b7e-8419a9ebe9b6", - "a495567b-a450-037f-ca8e-c9da52116890" + "1b96aaf0-f11e-a4c3-4217-c0833e6c75ee", + "f901106d-47f8-080c-d56b-7badc5774481" ], - "owner": 0, + "owner": "316251", "collectionId": "6369974d-65cc-d819-459b-0026549ddb47" }, { - "id": "78aeaf8b-80c8-40df-6ed6-2af5acdbf2ea", + "id": "4ff79efc-3da3-8c10-cbf9-8a883260cc55", "name": "remove admin", "description": "", "order": [ - "d2bf20ce-e0ed-a347-69dc-577e34dbefd0", - "07358622-f7d4-9233-8dc1-204acb7b1ccf", - "3f0e98fb-e97a-e6ed-8dc7-e864b1447e03", - "c8075e84-bb8d-7596-ba92-5990705f93bc", - "b8d3fef6-214c-5032-3002-f6c16f3288e2", - "2f633003-2ac7-99ec-e52a-8b1f2e0534d4", - "600d723c-706d-42ca-9ecc-94a32e280063", - "1e4fffd8-a809-e9dc-0659-0df467954407" + "2c17ef61-6067-4da2-6125-3bf54a8d7526", + "972a47ef-1768-7d9b-f12c-df8c57cb5bf5", + "2f8eda4d-c65c-ba89-a38c-4f197342b382", + "e8a850e5-31bf-6c13-0e44-bc4583bca2cb", + "e766e9a8-dd56-26b0-5fa7-2e7e876001d7", + "35dea5ec-b89c-fe4f-9a74-4ed2637c3501", + "983e7dd1-673c-a1a9-81e9-4e81ff0ec74b", + "eb8f368e-9c8e-47b7-c70d-1cf7ac89c02c" ], - "owner": 0, + "owner": "316251", "collectionId": "6369974d-65cc-d819-459b-0026549ddb47" }, { - "id": "2afb4105-1932-6ef0-866c-43ecb13c0048", + "id": "dcec6b34-9127-b6df-bbd9-da6c35c739f8", "name": "remove copilot", "description": "", "order": [ - "ccc25e86-5365-aaf6-8ce8-9838898142eb", - "85022108-999a-7200-89cd-e6b11f66bcb8", - "357caf52-98e8-90a9-8d13-1bf8d330915e", - "34b27e13-3b96-0a9e-25e6-8a339c517518", - "49952d3d-864a-25ff-3648-abbb79550dc2", - "ad152575-1e23-f242-96d2-f4b49a616c56", - "538a99a4-4701-1ee0-527c-6d2db316dae6", - "19a2adaa-d44b-5fd7-9ee7-a6d3452e4492" + "4063d0fe-dc7b-03fd-1958-219c5d10b788", + "3347ecb1-015e-bd23-20ea-1e5c1bacf1ec", + "c2e943b2-f53d-6788-26e6-ca35b5a5fec7", + "eeabcbce-4ca9-88ce-ec1a-93e0729bad11", + "6a8ef947-840a-bf33-c225-be351341f914", + "ff7618ed-fc54-1b81-6129-8df5ac4e67a9", + "73994f91-2d50-2d6b-f808-5c8b5063d046", + "d0e8a5bc-f7c7-268b-5a66-37e90947dabc" ], - "owner": 0, + "owner": "316251", "collectionId": "6369974d-65cc-d819-459b-0026549ddb47" }, { - "id": "f11d599f-4472-bcef-b9e3-7c86ac139e35", + "id": "f51d9a83-9d4a-fa4d-a3a8-08c9a94a35b5", "name": "remove reviewer", "description": "", "order": [ - "49557532-d98e-55e3-5cc4-4c702b62e3ed", - "3453a16f-6a34-c92c-91ed-d2107b505e7a", - "c3383672-4018-ec1b-2688-515b73987d36", - "636f8c2c-7cc2-4d90-179e-7808ae8bbba1", - "a887c7eb-8b15-90aa-07ef-6d998297bcee", - "e6b6464b-da41-67ee-c2ca-53b1d5ba417d", - "4b8d4933-247c-d204-23c6-3acd8ec2e66a", - "da88d593-5117-3c1f-f56c-47ac74724c79", - "13c71689-cfe5-512d-f5b6-d971fa88129a", - "6fd784f5-bda9-b183-1d85-c30879a47427", - "37b02c2b-7018-6af5-4e3c-57b2abde2b0e", - "05ed43fe-61be-43b3-36c7-0c4a12f98efd", - "12d79b9a-e008-ea3d-6fa4-21c7e72e4e94", - "6fcaeb1e-8611-9adf-319f-92f61ac2d62d" + "a183318a-b246-f372-1b0e-2ff1ad2395c0", + "f9a913ac-f3b4-3cba-ad0d-41265aa5904b", + "5ebd6774-7f4f-df1a-86e7-f81966773ba8", + "5fcaab29-db1b-2b79-e6a0-ee0f19f60f58", + "7d7675c4-0334-9a22-beab-485f817fbbce", + "6116bd27-1dd4-0d0e-938b-26e50c622b75", + "2208a6ea-3cce-8bae-eb41-a7bc31f99e79", + "a6001143-99ca-b1ab-a1c9-58c3dc8b6fe0", + "5cf9ac97-40c2-128f-a531-982ec0dc1247", + "2fde5963-bef1-afc8-52ff-1b494e2dff11", + "30c5af89-92ae-3cb7-92dc-9c29a41d468a", + "d01d666a-59bc-e7e9-2fc1-435a1b4cee89", + "8bb4421e-098b-3ae7-59b7-869927cf659e", + "261b410d-a3bb-054a-de84-03487ed7b549" ], - "owner": 0, + "owner": "316251", "collectionId": "6369974d-65cc-d819-459b-0026549ddb47" } ], "timestamp": 1474156790593, - "owner": 0, + "owner": "316251", "public": false, - "published": false, - "hasRequests": true, "requests": [ { - "id": "03ce940d-9b2d-b46b-0f84-48da5529615c", + "id": "0303a184-79f4-7216-4ecc-797f324d6f3e", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers", + "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, "method": "POST", @@ -206,58 +217,65 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474188017748, - "name": "create reviewer with invalid categoryId", + "time": 1474179176872, + "name": "create copilot with not exist username", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": \"wrong number\"\n}", - "folder": "7544e9b2-c615-4376-7145-511bb968c906" - }, - { - "id": "05ed43fe-61be-43b3-36c7-0c4a12f98efd", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers", + "rawModeData": "{\n \"username\": \"notexist\",\n \"isSoftwareCopilot\": true,\n \"isStudioCopilot\":true\n}", + "folder": "1438537c-a455-8206-0b64-bcb6e98cb447" + }, + { + "id": "03badc56-40a6-750a-a0fa-937d6af188b8", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/challenges/checkpoint/2220002", + "queryParams": [], "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", - "data": [], - "dataMode": "raw", + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474189158880, - "name": "remove reviewer with non-integer categoryId", + "time": 1497550612717, + "name": "Old logic, access allowed", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", - "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 1.1\n}", - "folder": "f11d599f-4472-bcef-b9e3-7c86ac139e35" + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "responses": [] }, { - "id": "07358622-f7d4-9233-8dc1-204acb7b1ccf", - "headers": "Authorization: Bearer {{userToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/admins", + "id": "0554d512-8935-33a8-6447-85eba32b8873", + "headers": "Authorization: Bearer {{adminToken}}\n", + "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", - "data": [], - "dataMode": "raw", + "method": "GET", + "data": null, + "dataMode": "params", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474173280471, - "name": "remove admin with user token", + "time": 1474176736874, + "name": "get all copilots with admin token", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "78aeaf8b-80c8-40df-6ed6-2af5acdbf2ea" + "folder": "2c775e97-29a3-c27d-abb5-e5dc6a5e05d9" }, { - "id": "08364378-8daf-8159-547e-fac22ca27847", - "headers": "Authorization: Bearer {{adminToken}}\n", - "url": "{{url}}/admin/reviewers?categoryId=7", + "id": "05f2c4f0-2f80-95ed-54f6-2b731960bdac", + "headers": "Authorization: wrong\n", + "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, "method": "GET", @@ -266,15 +284,15 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474268286128, - "name": "get all reviewers with admin token", + "time": 1474176769090, + "name": "get all copilots without Bearer header", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "folder": "81516934-d74e-f97d-262f-21d87d5961d1" + "folder": "2c775e97-29a3-c27d-abb5-e5dc6a5e05d9" }, { - "id": "0865091c-8f04-f18c-f9e5-e5c182bc8ab3", + "id": "0b12cd19-4eda-4c11-e926-7f8c8920d2ab", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", "url": "{{url}}/admin/reviewers", "preRequestScript": null, @@ -285,16 +303,16 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474268192451, - "name": "create reviewer with invalid immune", + "time": 1474187872946, + "name": "create reviewer with admin token", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"Yoshi\",\n \"categoryId\": 14,\n \"immune\": \"invalid boolean\"\n}", - "folder": "7544e9b2-c615-4376-7145-511bb968c906" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", + "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" }, { - "id": "0e55b155-b8b7-ae58-5505-f1ff9ba0eb36", + "id": "0baebd12-e9e9-b75f-5409-4bdd22db26e1", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", "url": "{{url}}/admin/reviewers", "preRequestScript": null, @@ -305,77 +323,78 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474282763352, - "name": "create reviewer with code category id", + "time": 1474282767080, + "name": "create reviewer with f2f category id", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"Hung\",\n \"categoryId\": 39\n}", - "folder": "7544e9b2-c615-4376-7145-511bb968c906" + "rawModeData": "{\n \"username\": \"liquid_user\",\n \"categoryId\": 38\n}", + "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" }, { - "id": "12d79b9a-e008-ea3d-6fa4-21c7e72e4e94", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers", + "id": "0dc9a5b6-60b7-0006-30f3-a93f6a23efee", + "headers": "Authorization: Bearer wrong\nContent-Type: application/json\n", + "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", + "method": "POST", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474189177783, - "name": "remove reviewer without categoryId", + "time": 1474168987848, + "name": "create admin with wrong Bearer header", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "f11d599f-4472-bcef-b9e3-7c86ac139e35" + "folder": "305f84dd-24a3-cbe7-97f1-7063b14a5f42" }, { - "id": "13c71689-cfe5-512d-f5b6-d971fa88129a", + "id": "121ce835-ccff-770b-cf19-d4c8715734ee", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers", + "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", + "method": "POST", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474282495801, - "name": "remove reviewer with not exist username", + "time": 1474179507223, + "name": "create copilot with isStudioCopilot false", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"notexist\",\n \"categoryId\": 14\n}", - "folder": "f11d599f-4472-bcef-b9e3-7c86ac139e35" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isSoftwareCopilot\": 1,\n \"isStudioCopilot\":0\n}", + "folder": "1438537c-a455-8206-0b64-bcb6e98cb447" }, { - "id": "144d7cd5-cedb-1e15-fec5-27c5e56863df", - "headers": "", - "url": "{{url}}/admin/admins", + "id": "12863b80-7674-2de7-7371-1921c77e6ad1", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "url": "{{url}}/admin/reviewers?categoryId=14", "preRequestScript": null, "pathVariables": {}, - "method": "GET", - "data": null, - "dataMode": "params", + "method": "POST", + "data": [], + "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474174192935, - "name": "get all admins without Authorization header", + "time": 1474284611393, + "name": "create reviewer with categoryId in query and body at same time", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "folder": "2964b89d-893b-aada-2e0e-c4136b920508" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\":7\n}", + "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" }, { - "id": "16044f47-5b3d-2ba2-1787-8e6f7e78af97", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers?categoryId=14", + "id": "13cfe266-39c7-4139-4526-0f45743c1ec1", + "headers": "Authorization: Bearer {{userToken}}\nContent-Type: application/json\n", + "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, "method": "POST", @@ -384,18 +403,18 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474284611393, - "name": "create reviewer with categoryId in query and body at same time", + "time": 1474172375481, + "name": "create admin with user token", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\":7\n}", - "folder": "7544e9b2-c615-4376-7145-511bb968c906" + "rawModeData": "{\n \"username\": \"dok_tester\"\n}", + "folder": "305f84dd-24a3-cbe7-97f1-7063b14a5f42" }, { - "id": "17cd6d9b-17b2-1f5c-a0d8-e0948c718d26", + "id": "16572157-2b12-830a-35df-e87fee271e02", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/admins", + "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, "method": "POST", @@ -404,78 +423,98 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474168970336, - "name": "create admin with admin token", + "time": 1474179347234, + "name": "create copilot with isSoftwareCopilot false", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "142d5b1b-b304-bced-c1f3-b59e8187d2aa" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isSoftwareCopilot\": 0,\n \"isStudioCopilot\":true\n}", + "folder": "1438537c-a455-8206-0b64-bcb6e98cb447" }, { - "id": "19a2adaa-d44b-5fd7-9ee7-a6d3452e4492", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "id": "1739bc1d-f48e-2f66-c423-d56a7dd6925f", + "headers": "", + "url": "{{url}}/admin/admins", + "preRequestScript": null, + "pathVariables": {}, + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1474174192935, + "name": "get all admins without Authorization header", + "description": "", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "responses": [], + "folder": "43eec092-7864-262f-fe9d-a2a416e1a2d8" + }, + { + "id": "1a4b8b23-8b80-aaf8-5350-63d6e573ef85", + "headers": "Authorization: wrong\nContent-Type: application/json\n", "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", + "method": "POST", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474177129491, - "name": "remove copilot with not exist username", + "time": 1474178858906, + "name": "create copilot without Bearer header", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"notexist\"\n}", - "folder": "2afb4105-1932-6ef0-866c-43ecb13c0048" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isSoftwareCopilot\": true,\n \"isStudioCopilot\":true\n}", + "folder": "1438537c-a455-8206-0b64-bcb6e98cb447" }, { - "id": "1e4fffd8-a809-e9dc-0659-0df467954407", + "id": "1b4714ed-d2cb-cd10-98c3-4965448e6b17", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/admins", + "url": "{{url}}/admin/reviewers?categoryId=14", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", + "method": "POST", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474173533574, - "name": "remove admin with notexist username", + "time": 1474282455411, + "name": "create reviewer with categoryId in query", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"notexist\"\n}", - "folder": "78aeaf8b-80c8-40df-6ed6-2af5acdbf2ea" + "rawModeData": "{\n \"username\": \"dok_tester\"\n}", + "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" }, { - "id": "202e4545-829b-f158-372f-206e632d609f", - "headers": "Authorization: wrong\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers", + "id": "1b96aaf0-f11e-a4c3-4217-c0833e6c75ee", + "headers": "Content-Type: application/json\n", + "url": "{{url}}/auth", "preRequestScript": null, "pathVariables": {}, "method": "POST", "data": [], "dataMode": "raw", - "tests": null, + "version": 2, + "tests": "var authResponse = JSON.parse(responseBody);\npostman.setEnvironmentVariable(\"authToken\", authResponse.token);\ntests[\"Status code is 200\"] = responseCode.code === 200;\nvar jsonData = JSON.parse(responseBody);\ntests[\"A valid token is returned\"] = !!jsonData.token;", "currentHelper": "normal", "helperAttributes": {}, - "time": 1474187893955, - "name": "create reviewer without Bearer header", + "time": 1474159263289, + "name": "Login as admin user", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", - "folder": "7544e9b2-c615-4376-7145-511bb968c906" + "rawModeData": "{\n \"username\": \"heffan\", \n \"password\": \"password\"\n}", + "folder": "14f4dd06-76e0-ca22-602f-0ad3974aa4fa" }, { - "id": "21bdc1e1-c5b2-d063-fd54-386ab396b224", - "headers": "Authorization: wrong\n", - "url": "{{url}}/admin/copilots", + "id": "1c6e9cc9-1d15-c2cb-0b7d-7b552558f26c", + "headers": "Authorization: Bearer wrong\n", + "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, "method": "GET", @@ -484,17 +523,17 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474176769090, - "name": "get all copilots without Bearer header", + "time": 1474174234342, + "name": "get all admins with wrong Bearer header", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "folder": "1a80812c-dfa2-5dc4-aca7-299502bbc807" + "folder": "43eec092-7864-262f-fe9d-a2a416e1a2d8" }, { - "id": "2297e0e7-4871-b68e-6258-b59a1da3acd4", + "id": "216bd35b-31af-ba0a-497d-9b93576104b7", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/admins", + "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, "method": "POST", @@ -503,58 +542,78 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474169000065, - "name": "create admin without username", + "time": 1474179249694, + "name": "create copilot with invalid isStudioCopilot", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{}", - "folder": "142d5b1b-b304-bced-c1f3-b59e8187d2aa" + "rawModeData": "{\n \"username\": \"notexist\",\n \"isStudioCopilot\": \"invalid boolean\",\n \"isSoftwareCopilot\":true\n}", + "folder": "1438537c-a455-8206-0b64-bcb6e98cb447" }, { - "id": "24bc8058-d1ef-1f33-eb64-ede9b9663f49", + "id": "2208a6ea-3cce-8bae-eb41-a7bc31f99e79", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, - "method": "POST", + "method": "DELETE", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474188046380, - "name": "create reviewer with nagative categoryId", + "time": 1474189091821, + "name": "remove reviewer without username", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": -1\n}", - "folder": "7544e9b2-c615-4376-7145-511bb968c906" + "rawModeData": "{}", + "folder": "f51d9a83-9d4a-fa4d-a3a8-08c9a94a35b5" }, { - "id": "26e53a5b-bef9-17f2-fb02-34595bf8a8c4", + "id": "261b410d-a3bb-054a-de84-03487ed7b549", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/copilots", + "url": "{{url}}/admin/reviewers?categoryId=14", "preRequestScript": null, "pathVariables": {}, - "method": "POST", + "method": "DELETE", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474178883094, - "name": "create copilot without username", + "time": 1474284520276, + "name": "remove reviewer with categoryId in query and body at same time", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{}", - "folder": "8052cbf5-e206-af03-0392-e853f3f06bf4" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\":7\n}", + "folder": "f51d9a83-9d4a-fa4d-a3a8-08c9a94a35b5" }, { - "id": "2cb65342-ba7f-b473-6afc-8a729da04563", + "id": "2c17ef61-6067-4da2-6125-3bf54a8d7526", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/copilots", + "url": "{{url}}/admin/admins", + "preRequestScript": null, + "pathVariables": {}, + "method": "DELETE", + "data": [], + "dataMode": "raw", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1474173258538, + "name": "remove admin with admin token", + "description": "", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "responses": [], + "rawModeData": "{\n \"username\": \"dok_tester\"\n}", + "folder": "4ff79efc-3da3-8c10-cbf9-8a883260cc55" + }, + { + "id": "2dc63d17-e288-5432-1e70-ea3b38dbd939", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, "method": "POST", @@ -563,16 +622,16 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474179347234, - "name": "create copilot with isSoftwareCopilot false", + "time": 1474168970336, + "name": "create admin with admin token", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isSoftwareCopilot\": 0,\n \"isStudioCopilot\":true\n}", - "folder": "8052cbf5-e206-af03-0392-e853f3f06bf4" + "rawModeData": "{\n \"username\": \"dok_tester\"\n}", + "folder": "305f84dd-24a3-cbe7-97f1-7063b14a5f42" }, { - "id": "2d18170b-9631-3c97-fc68-51d0ed76766c", + "id": "2e452537-8224-19aa-e79d-3bdd2d3d6092", "headers": "Authorization: Bearer {{userToken}}\n", "url": "{{url}}/admin/copilots", "preRequestScript": null, @@ -586,13 +645,13 @@ "time": 1474176739711, "name": "get all copilots with user token", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "folder": "1a80812c-dfa2-5dc4-aca7-299502bbc807" + "folder": "2c775e97-29a3-c27d-abb5-e5dc6a5e05d9" }, { - "id": "2f633003-2ac7-99ec-e52a-8b1f2e0534d4", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "id": "2f8eda4d-c65c-ba89-a38c-4f197342b382", + "headers": "Content-Type: application/json\n", "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, @@ -602,37 +661,37 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474173290943, - "name": "remove admin without username", + "time": 1474173276705, + "name": "remove admin without Authorization header", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{}", - "folder": "78aeaf8b-80c8-40df-6ed6-2af5acdbf2ea" + "rawModeData": "{\n \"username\": \"dok_tester\"\n}", + "folder": "4ff79efc-3da3-8c10-cbf9-8a883260cc55" }, { - "id": "2f652b9b-7dc4-8140-9ac5-e6995f1a3fba", + "id": "2fde5963-bef1-afc8-52ff-1b494e2dff11", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, - "method": "POST", + "method": "DELETE", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474187901930, - "name": "create reviewer without username", + "time": 1474189135829, + "name": "remove reviewer with invalid categoryId", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{}", - "folder": "7544e9b2-c615-4376-7145-511bb968c906" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": \"wrong number\"\n}", + "folder": "f51d9a83-9d4a-fa4d-a3a8-08c9a94a35b5" }, { - "id": "3453a16f-6a34-c92c-91ed-d2107b505e7a", - "headers": "Authorization: Bearer {{userToken}}\nContent-Type: application/json\n", + "id": "30c5af89-92ae-3cb7-92dc-9c29a41d468a", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, @@ -642,18 +701,18 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474189053598, - "name": "remove reviewer with user token", + "time": 1474189145913, + "name": "remove reviewer with negative categoryId", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", - "folder": "f11d599f-4472-bcef-b9e3-7c86ac139e35" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": -1\n}", + "folder": "f51d9a83-9d4a-fa4d-a3a8-08c9a94a35b5" }, { - "id": "34ac4817-1082-2274-ed98-f17b63e62786", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/copilots", + "id": "32fd36b2-7397-5e93-8b6c-755557c77586", + "headers": "Content-Type: application/json\n", + "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, "method": "POST", @@ -662,17 +721,17 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474179249694, - "name": "create copilot with invalid isStudioCopilot", + "time": 1474187888883, + "name": "create reviewer without Authorization header", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"notexist\",\n \"isStudioCopilot\": \"invalid boolean\",\n \"isSoftwareCopilot\":true\n}", - "folder": "8052cbf5-e206-af03-0392-e853f3f06bf4" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", + "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" }, { - "id": "34b27e13-3b96-0a9e-25e6-8a339c517518", - "headers": "Authorization: wrong\nContent-Type: application/json\n", + "id": "3347ecb1-015e-bd23-20ea-1e5c1bacf1ec", + "headers": "Authorization: Bearer {{userToken}}\nContent-Type: application/json\n", "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, @@ -682,18 +741,18 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474177113168, - "name": "remove copilot without Bearer header", + "time": 1474177106806, + "name": "remove copilot with user token", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "2afb4105-1932-6ef0-866c-43ecb13c0048" + "folder": "dcec6b34-9127-b6df-bbd9-da6c35c739f8" }, { - "id": "357caf52-98e8-90a9-8d13-1bf8d330915e", - "headers": "Content-Type: application/json\n", - "url": "{{url}}/admin/copilots", + "id": "35dea5ec-b89c-fe4f-9a74-4ed2637c3501", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, "method": "DELETE", @@ -702,38 +761,38 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474177110084, - "name": "remove copilot without Authorization header", + "time": 1474173290943, + "name": "remove admin without username", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "2afb4105-1932-6ef0-866c-43ecb13c0048" + "rawModeData": "{}", + "folder": "4ff79efc-3da3-8c10-cbf9-8a883260cc55" }, { - "id": "37b02c2b-7018-6af5-4e3c-57b2abde2b0e", + "id": "37345c71-a682-1d40-ff87-7739450f0904", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", + "method": "POST", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474189145913, - "name": "remove reviewer with negative categoryId", + "time": 1474268192451, + "name": "create reviewer with invalid immune", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": -1\n}", - "folder": "f11d599f-4472-bcef-b9e3-7c86ac139e35" + "rawModeData": "{\n \"username\": \"Yoshi\",\n \"categoryId\": 14,\n \"immune\": \"invalid boolean\"\n}", + "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" }, { - "id": "3a87b2a7-3761-5089-38d9-6c7d3796e984", + "id": "38247541-c9f7-206a-f77a-2cdbd47c3968", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/copilots", + "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, "method": "POST", @@ -742,136 +801,143 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474272371352, - "name": "create copilot with admin token", + "time": 1474282659872, + "name": "create reviewer with not exist username", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isSoftwareCopilot\": true,\n \"isStudioCopilot\":true\n}", - "folder": "8052cbf5-e206-af03-0392-e853f3f06bf4" + "rawModeData": "{\n \"username\": \"notexist\",\n \"categoryId\": 14\n}", + "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" }, { - "id": "3f0e98fb-e97a-e6ed-8dc7-e864b1447e03", - "headers": "Content-Type: application/json\n", - "url": "{{url}}/admin/admins", + "id": "39116742-fb19-f8ba-f177-1e1910b0dd50", + "headers": "Authorization: Bearer wrong\nContent-Type: application/json\n", + "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", + "method": "POST", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474173276705, - "name": "remove admin without Authorization header", + "time": 1474187897602, + "name": "create reviewer with wrong Bearer header", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "78aeaf8b-80c8-40df-6ed6-2af5acdbf2ea" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", + "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" }, { - "id": "42fc7559-c2a2-8b85-67e3-3812ae0d5998", - "headers": "Authorization: Bearer {{userToken}}\nContent-Type: application/json\n", + "id": "4063d0fe-dc7b-03fd-1958-219c5d10b788", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, - "method": "POST", + "method": "DELETE", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474177780363, - "name": "create copilot with user token", + "time": 1474177185914, + "name": "remove copilot with admin token", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isSoftwareCopilot\": true,\n \"isStudioCopilot\":true\n}", - "folder": "8052cbf5-e206-af03-0392-e853f3f06bf4" + "rawModeData": "{\n \"username\": \"dok_tester\"\n}", + "folder": "dcec6b34-9127-b6df-bbd9-da6c35c739f8" }, { - "id": "43dbe6f5-32e5-f0f0-5735-42a3a9f08120", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/admins", + "id": "4547a259-b0cf-c5e6-8d04-035b9ae443ce", + "headers": "Authorization: Bearer {{adminToken}}\n", + "url": "{{url}}/admin/reviewers?categoryId=1.1", "preRequestScript": null, "pathVariables": {}, - "method": "POST", - "data": [], - "dataMode": "raw", + "method": "GET", + "data": null, + "dataMode": "params", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474173399023, - "name": "create admin with not exist username", + "time": 1474188155542, + "name": "get all reviewers with non-integer categoryId", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"notexist\"\n}", - "folder": "142d5b1b-b304-bced-c1f3-b59e8187d2aa" + "folder": "790ca3b9-d88f-04e9-b65d-fd59442f3394" }, { - "id": "477195d0-14ca-6a6e-274f-513e7d50a45c", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/copilots", + "id": "46fea4dc-9708-763b-c0cc-713ac9c1a9eb", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/challenges/checkpoint/2220005", + "queryParams": [], "preRequestScript": null, "pathVariables": {}, - "method": "POST", - "data": [], - "dataMode": "raw", + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474179290066, - "name": "create copilot with isStudioCopilot/isSoftwareCopilot false", + "time": 1497550755372, + "name": "New logic, access denied", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", - "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isStudioCopilot\": false,\n \"isSoftwareCopilot\":false\n}", - "folder": "8052cbf5-e206-af03-0392-e853f3f06bf4" + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "responses": [] }, { - "id": "49557532-d98e-55e3-5cc4-4c702b62e3ed", + "id": "497b04d4-c729-3008-107e-b69aead7e3db", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers", + "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", + "method": "POST", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474266891365, - "name": "remove reviewer with admin token", + "time": 1474189226479, + "name": "create copilot without isSoftwareCopilot", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", - "folder": "f11d599f-4472-bcef-b9e3-7c86ac139e35" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isStudioCopilot\":true\n}", + "folder": "1438537c-a455-8206-0b64-bcb6e98cb447" }, { - "id": "49952d3d-864a-25ff-3648-abbb79550dc2", - "headers": "Authorization: Bearer wrong\nContent-Type: application/json\n", - "url": "{{url}}/admin/copilots", + "id": "4b62272c-8167-0310-930a-d5f0526c52a8", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", + "method": "POST", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474177116518, - "name": "remove copilot with wrong Bearer header", + "time": 1474173399023, + "name": "create admin with not exist username", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "2afb4105-1932-6ef0-866c-43ecb13c0048" + "rawModeData": "{\n \"username\": \"notexist\"\n}", + "folder": "305f84dd-24a3-cbe7-97f1-7063b14a5f42" }, { - "id": "49c5d6f4-5b86-3e9f-8c82-ef7430411264", + "id": "4c54c5ab-5d8b-a873-49b0-0f3d63d6b42f", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", "url": "{{url}}/admin/copilots", "preRequestScript": null, @@ -882,57 +948,55 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474179169639, - "name": "create copilot with empty username", + "time": 1474178883094, + "name": "create copilot without username", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \" \",\n \"isSoftwareCopilot\": true,\n \"isStudioCopilot\":true\n}", - "folder": "8052cbf5-e206-af03-0392-e853f3f06bf4" + "rawModeData": "{}", + "folder": "1438537c-a455-8206-0b64-bcb6e98cb447" }, { - "id": "4a6e3f4b-cb9e-978d-281f-81a57545b0ac", - "headers": "Authorization: Bearer {{userToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers", + "id": "4f247a99-8f61-47ea-3323-68ec5a7e7000", + "headers": "Authorization: Bearer {{adminToken}}\n", + "url": "{{url}}/admin/reviewers?categoryId=wrong", "preRequestScript": null, "pathVariables": {}, - "method": "POST", - "data": [], - "dataMode": "raw", + "method": "GET", + "data": null, + "dataMode": "params", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474187884890, - "name": "create reviewer with user token", + "time": 1474184004438, + "name": "get all reviewers with invalid categoryId", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", - "folder": "7544e9b2-c615-4376-7145-511bb968c906" + "folder": "790ca3b9-d88f-04e9-b65d-fd59442f3394" }, { - "id": "4b8d4933-247c-d204-23c6-3acd8ec2e66a", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "id": "52edc048-18d6-ce4d-5312-69286ce2e2f9", + "headers": "Authorization: Bearer {{adminToken}}\n", "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", - "data": [], - "dataMode": "raw", + "method": "GET", + "data": null, + "dataMode": "params", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474189091821, - "name": "remove reviewer without username", + "time": 1474189283486, + "name": "get all reviewers without categoryId", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{}", - "folder": "f11d599f-4472-bcef-b9e3-7c86ac139e35" + "folder": "790ca3b9-d88f-04e9-b65d-fd59442f3394" }, { - "id": "518db876-c166-6aa7-d484-b8b778297b4e", - "headers": "Content-Type: application/json\n", + "id": "597e4417-c496-e48d-801c-5504e9201d18", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, @@ -942,18 +1006,18 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474178853689, - "name": "create copilot without Authorization header", + "time": 1474272371352, + "name": "create copilot with admin token", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isSoftwareCopilot\": true,\n \"isStudioCopilot\":true\n}", - "folder": "8052cbf5-e206-af03-0392-e853f3f06bf4" + "folder": "1438537c-a455-8206-0b64-bcb6e98cb447" }, { - "id": "538a99a4-4701-1ee0-527c-6d2db316dae6", + "id": "5cf9ac97-40c2-128f-a531-982ec0dc1247", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/copilots", + "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, "method": "DELETE", @@ -962,56 +1026,56 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474177126290, - "name": "remove copilot with empty username", + "time": 1474282495801, + "name": "remove reviewer with not exist username", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \" \"\n}", - "folder": "2afb4105-1932-6ef0-866c-43ecb13c0048" + "rawModeData": "{\n \"username\": \"notexist\",\n \"categoryId\": 14\n}", + "folder": "f51d9a83-9d4a-fa4d-a3a8-08c9a94a35b5" }, { - "id": "59d2ab3f-1ef2-3925-42c4-754eced98658", + "id": "5ebd6774-7f4f-df1a-86e7-f81966773ba8", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/admins", + "url": "{{url}}/admin/reviewers?categoryId=14", "preRequestScript": null, "pathVariables": {}, - "method": "POST", + "method": "DELETE", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474169674465, - "name": "create admin with empty username", + "time": 1474273020582, + "name": "remove reviewer with categoryId in query", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \" \"\n}", - "folder": "142d5b1b-b304-bced-c1f3-b59e8187d2aa" + "rawModeData": "{\n \"username\": \"dok_tester\"\n}", + "folder": "f51d9a83-9d4a-fa4d-a3a8-08c9a94a35b5" }, { - "id": "600d723c-706d-42ca-9ecc-94a32e280063", + "id": "5eee889a-83e0-96da-a476-ffd50ad66960", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/admins", + "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", + "method": "POST", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474173326368, - "name": "remove admin without empty username", + "time": 1474188017748, + "name": "create reviewer with invalid categoryId", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \" \"\n}", - "folder": "78aeaf8b-80c8-40df-6ed6-2af5acdbf2ea" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": \"wrong number\"\n}", + "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" }, { - "id": "636f8c2c-7cc2-4d90-179e-7808ae8bbba1", + "id": "5fcaab29-db1b-2b79-e6a0-ee0f19f60f58", "headers": "Content-Type: application/json\n", "url": "{{url}}/admin/reviewers", "preRequestScript": null, @@ -1025,54 +1089,63 @@ "time": 1474189062608, "name": "remove reviewer without Authorization header", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", - "folder": "f11d599f-4472-bcef-b9e3-7c86ac139e35" - }, - { - "id": "6727946e-aa76-0996-e734-800bb07cf5c6", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/copilots", + "folder": "f51d9a83-9d4a-fa4d-a3a8-08c9a94a35b5" + }, + { + "id": "60330c29-7ed3-b453-8d01-652084ca19b1", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/challenges/checkpoint/2220004", + "queryParams": [], "preRequestScript": null, "pathVariables": {}, - "method": "POST", - "data": [], - "dataMode": "raw", + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474189246551, - "name": "create copilot without isStudioCopilot", + "time": 1497550705028, + "name": "New logic, access allowed", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", - "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isSoftwareCopilot\": true\n}", - "folder": "8052cbf5-e206-af03-0392-e853f3f06bf4" + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "responses": [] }, { - "id": "67db2b5a-4b85-4e18-2709-5c475849329f", - "headers": "Authorization: Bearer {{adminToken}}\n", - "url": "{{url}}/admin/copilots", + "id": "6116bd27-1dd4-0d0e-938b-26e50c622b75", + "headers": "Authorization: Bearer wrong\nContent-Type: application/json\n", + "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, - "method": "GET", - "data": null, - "dataMode": "params", + "method": "DELETE", + "data": [], + "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474176736874, - "name": "get all copilots with admin token", + "time": 1474189083334, + "name": "remove reviewer with wrong Bearer header", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "folder": "1a80812c-dfa2-5dc4-aca7-299502bbc807" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", + "folder": "f51d9a83-9d4a-fa4d-a3a8-08c9a94a35b5" }, { - "id": "68d189c2-eb05-ded4-1e97-414ebde03ab8", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/copilots", + "id": "617c7aa5-6a13-7f08-3621-050d7bb9fb42", + "headers": "Authorization: Bearer {{userToken}}\nContent-Type: application/json\n", + "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, "method": "POST", @@ -1081,58 +1154,57 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474179220315, - "name": "create copilot with invalid isSoftwareCopilot", + "time": 1474187884890, + "name": "create reviewer with user token", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"notexist\",\n \"isSoftwareCopilot\": \"invalid boolean\",\n \"isStudioCopilot\":true\n}", - "folder": "8052cbf5-e206-af03-0392-e853f3f06bf4" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", + "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" }, { - "id": "6fcaeb1e-8611-9adf-319f-92f61ac2d62d", + "id": "61f8c960-54fd-f1b3-0cc3-8ac89de6361a", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers?categoryId=14", + "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", + "method": "POST", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474284520276, - "name": "remove reviewer with categoryId in query and body at same time", + "time": 1474282763352, + "name": "create reviewer with code category id", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\":7\n}", - "folder": "f11d599f-4472-bcef-b9e3-7c86ac139e35" + "rawModeData": "{\n \"username\": \"Hung\",\n \"categoryId\": 39\n}", + "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" }, { - "id": "6fd784f5-bda9-b183-1d85-c30879a47427", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers", + "id": "62a5e348-741b-fd42-ed58-839def26d4bf", + "headers": "", + "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", - "data": [], - "dataMode": "raw", + "method": "GET", + "data": null, + "dataMode": "params", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474189135829, - "name": "remove reviewer with invalid categoryId", + "time": 1474176772030, + "name": "get all copilots without Authorization header", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": \"wrong number\"\n}", - "folder": "f11d599f-4472-bcef-b9e3-7c86ac139e35" + "folder": "2c775e97-29a3-c27d-abb5-e5dc6a5e05d9" }, { - "id": "790064a6-e429-1f9c-24b5-7112ce1fb8b2", + "id": "676c46be-e1bf-ba14-d357-1ca01119054b", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers", + "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, "method": "POST", @@ -1141,37 +1213,37 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474283473763, - "name": "create reviewer with immune", + "time": 1474189246551, + "name": "create copilot without isStudioCopilot", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"Yoshi\",\n \"categoryId\": 14,\n \"immune\":1\n}", - "folder": "7544e9b2-c615-4376-7145-511bb968c906" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isSoftwareCopilot\": true\n}", + "folder": "1438537c-a455-8206-0b64-bcb6e98cb447" }, { - "id": "79444594-2c40-1e6e-9f71-f22d57828026", + "id": "6a8ef947-840a-bf33-c225-be351341f914", "headers": "Authorization: Bearer wrong\nContent-Type: application/json\n", "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, - "method": "POST", + "method": "DELETE", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474178865110, - "name": "create copilot with wrong Bearer header", + "time": 1474177116518, + "name": "remove copilot with wrong Bearer header", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isSoftwareCopilot\": true,\n \"isStudioCopilot\":true\n}", - "folder": "8052cbf5-e206-af03-0392-e853f3f06bf4" + "rawModeData": "{\n \"username\": \"dok_tester\"\n}", + "folder": "dcec6b34-9127-b6df-bbd9-da6c35c739f8" }, { - "id": "828d7e47-ee45-5ed2-fe37-2114815e84f1", - "headers": "Authorization: Bearer wrong\n", + "id": "6ab91574-6c11-9d54-a6a3-a87304bec08b", + "headers": "Authorization: Bearer {{adminToken}}\n", "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, @@ -1181,17 +1253,17 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474174234342, - "name": "get all admins with wrong Bearer header", + "time": 1474173887249, + "name": "get all admins with admin token", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "folder": "2964b89d-893b-aada-2e0e-c4136b920508" + "folder": "43eec092-7864-262f-fe9d-a2a416e1a2d8" }, { - "id": "84cd43c0-c407-365b-f1f4-07929e2876cc", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers", + "id": "6fc730e8-851c-c0c0-4dbf-79a9fc7c67e1", + "headers": "Authorization: Bearer wrong\nContent-Type: application/json\n", + "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, "method": "POST", @@ -1200,17 +1272,17 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474188081763, - "name": "create reviewer with non-integer categoryId", + "time": 1474178865110, + "name": "create copilot with wrong Bearer header", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 1.1\n}", - "folder": "7544e9b2-c615-4376-7145-511bb968c906" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isSoftwareCopilot\": true,\n \"isStudioCopilot\":true\n}", + "folder": "1438537c-a455-8206-0b64-bcb6e98cb447" }, { - "id": "85022108-999a-7200-89cd-e6b11f66bcb8", - "headers": "Authorization: Bearer {{userToken}}\nContent-Type: application/json\n", + "id": "73994f91-2d50-2d6b-f808-5c8b5063d046", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, @@ -1220,17 +1292,45 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474177106806, - "name": "remove copilot with user token", + "time": 1474177126290, + "name": "remove copilot with empty username", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "2afb4105-1932-6ef0-866c-43ecb13c0048" + "rawModeData": "{\n \"username\": \" \"\n}", + "folder": "dcec6b34-9127-b6df-bbd9-da6c35c739f8" + }, + { + "id": "76441abd-9a70-5fe9-93e1-59dd0318384f", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/challenges/checkpoint/2220003", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497550652259, + "name": "Old logic, access denied", + "description": "", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "responses": [] }, { - "id": "858050d9-d3f2-900f-79a8-4a56c7ca586b", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "id": "7667b82b-d891-3959-4469-2b6e3673ed03", + "headers": "Content-Type: application/json\n", "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, @@ -1240,17 +1340,17 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474179176872, - "name": "create copilot with not exist username", + "time": 1474178853689, + "name": "create copilot without Authorization header", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"notexist\",\n \"isSoftwareCopilot\": true,\n \"isStudioCopilot\":true\n}", - "folder": "8052cbf5-e206-af03-0392-e853f3f06bf4" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isSoftwareCopilot\": true,\n \"isStudioCopilot\":true\n}", + "folder": "1438537c-a455-8206-0b64-bcb6e98cb447" }, { - "id": "8679c69e-e94d-7188-60fd-bbe506b851d1", - "headers": "Authorization: Bearer wrong\nContent-Type: application/json\n", + "id": "789c4564-2cb5-a4da-04f4-0d3a432950dd", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, @@ -1260,18 +1360,18 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474187897602, - "name": "create reviewer with wrong Bearer header", + "time": 1474282655617, + "name": "create reviewer with empty username", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", - "folder": "7544e9b2-c615-4376-7145-511bb968c906" + "rawModeData": "{\n \"username\": \" \",\n \"categoryId\": 14\n}", + "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" }, { - "id": "88ae8323-4232-1675-8796-e06c6997f3f9", - "headers": "Authorization: Bearer wrong\nContent-Type: application/json\n", - "url": "{{url}}/admin/admins", + "id": "7b7bc600-f9a9-e566-ccd3-4bff678d50da", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, "method": "POST", @@ -1280,35 +1380,36 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474168987848, - "name": "create admin with wrong Bearer header", + "time": 1474283473763, + "name": "create reviewer with immune", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "142d5b1b-b304-bced-c1f3-b59e8187d2aa" + "rawModeData": "{\n \"username\": \"Yoshi\",\n \"categoryId\": 14,\n \"immune\":1\n}", + "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" }, { - "id": "897d4baa-72d5-1eca-ff61-51db0d14408c", - "headers": "Authorization: Bearer wrong\n", - "url": "{{url}}/admin/copilots", + "id": "7d7675c4-0334-9a22-beab-485f817fbbce", + "headers": "Authorization: wrong\nContent-Type: application/json\n", + "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, - "method": "GET", - "data": null, - "dataMode": "params", + "method": "DELETE", + "data": [], + "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474176766163, - "name": "get all copilots with wrong Bearer header", + "time": 1474189071606, + "name": "remove reviewer without Bearer header", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "folder": "1a80812c-dfa2-5dc4-aca7-299502bbc807" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", + "folder": "f51d9a83-9d4a-fa4d-a3a8-08c9a94a35b5" }, { - "id": "8a43eff3-3f9a-83a2-6734-a683e29252c8", + "id": "8b52ad5d-31a4-8a84-4d24-ceb91021a467", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", "url": "{{url}}/admin/reviewers", "preRequestScript": null, @@ -1319,38 +1420,69 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474189200056, - "name": "create reviewer without categoryId", + "time": 1474282760160, + "name": "create reviewer with studio type", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "7544e9b2-c615-4376-7145-511bb968c906" + "rawModeData": "{\n \"username\": \"cartajs\",\n \"categoryId\": 17\n}", + "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" }, { - "id": "8b843cb6-1fc6-8c0b-1d6d-f54d9470cf76", - "headers": "Authorization: wrong\nContent-Type: application/json\n", - "url": "{{url}}/admin/admins", + "id": "8bb4421e-098b-3ae7-59b7-869927cf659e", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, - "method": "POST", + "method": "DELETE", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474168982704, - "name": "create admin without Bearer header", + "time": 1474189177783, + "name": "remove reviewer without categoryId", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "142d5b1b-b304-bced-c1f3-b59e8187d2aa" + "folder": "f51d9a83-9d4a-fa4d-a3a8-08c9a94a35b5" + }, + { + "id": "8db48405-6ba0-f116-06c6-cc34cffd77c1", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/challenges/checkpoint/2220001", + "queryParams": [], + "pathVariables": {}, + "pathVariableData": [], + "preRequestScript": null, + "method": "GET", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "data": null, + "dataMode": "params", + "name": "No groups (challenge is not private)", + "description": "", + "descriptionFormat": "html", + "time": 1497550504090, + "version": 2, + "responses": [], + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "folder": "498ee2d2-174c-7049-3cc4-43b4e330083b" }, { - "id": "8bd1727c-34f8-ced7-eb92-d50cc6e56772", - "headers": "", - "url": "{{url}}/admin/reviewers?categoryId=7", + "id": "9308798f-cbfd-b44c-1d47-6ef6650424f0", + "headers": "Authorization: Bearer {{adminToken}}\n", + "url": "{{url}}/admin/reviewers?categoryId=-4", "preRequestScript": null, "pathVariables": {}, "method": "GET", @@ -1359,57 +1491,57 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474282217351, - "name": "get all reviewers without Authorization header", + "time": 1474184022183, + "name": "get all reviewers with negative categoryId", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "folder": "81516934-d74e-f97d-262f-21d87d5961d1" + "folder": "790ca3b9-d88f-04e9-b65d-fd59442f3394" }, { - "id": "9bccd2a2-8aac-1931-b78e-8b61a99415a4", - "headers": "Content-Type: application/json\n", + "id": "972a47ef-1768-7d9b-f12c-df8c57cb5bf5", + "headers": "Authorization: Bearer {{userToken}}\nContent-Type: application/json\n", "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, - "method": "POST", + "method": "DELETE", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474168977872, - "name": "create admin without Authorization header", + "time": 1474173280471, + "name": "remove admin with user token", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "142d5b1b-b304-bced-c1f3-b59e8187d2aa" + "folder": "4ff79efc-3da3-8c10-cbf9-8a883260cc55" }, { - "id": "9e458d5b-5aa5-05ec-6240-7d171c75cf5e", + "id": "983e7dd1-673c-a1a9-81e9-4e81ff0ec74b", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers", + "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, - "method": "POST", + "method": "DELETE", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474282760160, - "name": "create reviewer with studio type", + "time": 1474173326368, + "name": "remove admin without empty username", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"cartajs\",\n \"categoryId\": 17\n}", - "folder": "7544e9b2-c615-4376-7145-511bb968c906" + "rawModeData": "{\n \"username\": \" \"\n}", + "folder": "4ff79efc-3da3-8c10-cbf9-8a883260cc55" }, { - "id": "9fb05ea1-f85e-209e-7619-e40450acd7f3", - "headers": "Authorization: wrong\nContent-Type: application/json\n", - "url": "{{url}}/admin/copilots", + "id": "9ddc746e-591c-69e7-2326-a05aa52f7109", + "headers": "Content-Type: application/json\n", + "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, "method": "POST", @@ -1418,36 +1550,36 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474178858906, - "name": "create copilot without Bearer header", + "time": 1474168977872, + "name": "create admin without Authorization header", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isSoftwareCopilot\": true,\n \"isStudioCopilot\":true\n}", - "folder": "8052cbf5-e206-af03-0392-e853f3f06bf4" + "rawModeData": "{\n \"username\": \"dok_tester\"\n}", + "folder": "305f84dd-24a3-cbe7-97f1-7063b14a5f42" }, { - "id": "9ff114f0-56ca-f56c-08e4-3bb4dcaac10f", + "id": "a183318a-b246-f372-1b0e-2ff1ad2395c0", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/copilots", + "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, - "method": "POST", + "method": "DELETE", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474189226479, - "name": "create copilot without isSoftwareCopilot", + "time": 1474266891365, + "name": "remove reviewer with admin token", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isStudioCopilot\":true\n}", - "folder": "8052cbf5-e206-af03-0392-e853f3f06bf4" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", + "folder": "f51d9a83-9d4a-fa4d-a3a8-08c9a94a35b5" }, { - "id": "a466f2b7-2f9c-4a14-fc0e-eee7981cdb42", + "id": "a407a482-48ea-5561-9158-71259c3e8a3b", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", "url": "{{url}}/admin/reviewers", "preRequestScript": null, @@ -1458,57 +1590,17 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474282767080, - "name": "create reviewer with f2f category id", - "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", - "responses": [], - "rawModeData": "{\n \"username\": \"liquid_user\",\n \"categoryId\": 38\n}", - "folder": "7544e9b2-c615-4376-7145-511bb968c906" - }, - { - "id": "a47c9a54-d12a-6801-02a1-c57c420237cf", - "headers": "", - "url": "{{url}}/admin/copilots", - "preRequestScript": null, - "pathVariables": {}, - "method": "GET", - "data": null, - "dataMode": "params", - "tests": null, - "currentHelper": "normal", - "helperAttributes": {}, - "time": 1474176772030, - "name": "get all copilots without Authorization header", - "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", - "responses": [], - "folder": "1a80812c-dfa2-5dc4-aca7-299502bbc807" - }, - { - "id": "a495567b-a450-037f-ca8e-c9da52116890", - "headers": "Content-Type: application/json\n", - "url": "{{url}}/auth", - "preRequestScript": null, - "pathVariables": {}, - "method": "POST", - "data": [], - "dataMode": "raw", - "version": 2, - "tests": "var authResponse = JSON.parse(responseBody);\npostman.setEnvironmentVariable(\"authToken\", authResponse.token);\ntests[\"Status code is 200\"] = responseCode.code === 200;\nvar jsonData = JSON.parse(responseBody);\ntests[\"A valid token is returned\"] = !!jsonData.token;", - "currentHelper": "normal", - "helperAttributes": {}, - "time": 1474159245944, - "name": "Log in as ordinary user", + "time": 1474188081763, + "name": "create reviewer with non-integer categoryId", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"user\", \n \"password\": \"password\"\n}", - "folder": "fedff379-68f7-3322-d2e9-29471d82cc60" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 1.1\n}", + "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" }, { - "id": "a887c7eb-8b15-90aa-07ef-6d998297bcee", - "headers": "Authorization: wrong\nContent-Type: application/json\n", + "id": "a6001143-99ca-b1ab-a1c9-58c3dc8b6fe0", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, @@ -1518,17 +1610,17 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474189071606, - "name": "remove reviewer without Bearer header", + "time": 1474282491538, + "name": "remove reviewer with empty username", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", - "folder": "f11d599f-4472-bcef-b9e3-7c86ac139e35" + "rawModeData": "{\n \"username\": \" \",\n \"categoryId\": 14\n}", + "folder": "f51d9a83-9d4a-fa4d-a3a8-08c9a94a35b5" }, { - "id": "a8e7c6c2-1cfb-e3ad-af5c-9c27bd71924b", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "id": "b557e83b-d42a-a7b8-8a9c-8fa2270188b1", + "headers": "Authorization: wrong\nContent-Type: application/json\n", "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, @@ -1538,58 +1630,57 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474282655617, - "name": "create reviewer with empty username", + "time": 1474187893955, + "name": "create reviewer without Bearer header", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \" \",\n \"categoryId\": 14\n}", - "folder": "7544e9b2-c615-4376-7145-511bb968c906" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", + "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" }, { - "id": "ac18e672-1e47-37fa-1ae8-85eed1beab2d", - "headers": "Content-Type: application/json\n", - "url": "{{url}}/admin/reviewers", + "id": "b5f484a7-b5e9-e763-97fb-5d750d08cd6d", + "headers": "Authorization: wrong\n", + "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, - "method": "POST", - "data": [], - "dataMode": "raw", + "method": "GET", + "data": null, + "dataMode": "params", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474187888883, - "name": "create reviewer without Authorization header", + "time": 1474174209799, + "name": "get all admins without Bearer header", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", - "folder": "7544e9b2-c615-4376-7145-511bb968c906" + "folder": "43eec092-7864-262f-fe9d-a2a416e1a2d8" }, { - "id": "ad152575-1e23-f242-96d2-f4b49a616c56", + "id": "b762147c-aae5-9630-dfe7-d6468a8a3843", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/copilots", + "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", + "method": "POST", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474177119734, - "name": "remove copilot without username", + "time": 1474169000065, + "name": "create admin without username", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], "rawModeData": "{}", - "folder": "2afb4105-1932-6ef0-866c-43ecb13c0048" + "folder": "305f84dd-24a3-cbe7-97f1-7063b14a5f42" }, { - "id": "b0bfa529-5f58-d5a6-e1bc-2099abfa253f", - "headers": "Authorization: Bearer {{adminToken}}\n", - "url": "{{url}}/admin/admins", + "id": "c15dff6e-1a55-a875-3460-2d2097b2f960", + "headers": "Authorization: Bearer wrong\n", + "url": "{{url}}/admin/reviewers?categoryId=7", "preRequestScript": null, "pathVariables": {}, "method": "GET", @@ -1598,15 +1689,15 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474173887249, - "name": "get all admins with admin token", + "time": 1474282226901, + "name": "get all reviewers with wrong Bearer header", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "folder": "2964b89d-893b-aada-2e0e-c4136b920508" + "folder": "790ca3b9-d88f-04e9-b65d-fd59442f3394" }, { - "id": "b83cdcb1-5abe-0f73-1c9c-b558c0634baf", + "id": "c21ce35d-8558-ca77-c6af-8a6d930564b9", "headers": "Authorization: Bearer {{userToken}}\n", "url": "{{url}}/admin/admins", "preRequestScript": null, @@ -1620,91 +1711,93 @@ "time": 1474174015997, "name": "get all admins with user token", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "folder": "2964b89d-893b-aada-2e0e-c4136b920508" + "folder": "43eec092-7864-262f-fe9d-a2a416e1a2d8" }, { - "id": "b84bd2e1-cd0b-3489-3c11-917a1624249e", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers?categoryId=14", + "id": "c2e943b2-f53d-6788-26e6-ca35b5a5fec7", + "headers": "Content-Type: application/json\n", + "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, - "method": "POST", + "method": "DELETE", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474282455411, - "name": "create reviewer with categoryId in query", + "time": 1474177110084, + "name": "remove copilot without Authorization header", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "7544e9b2-c615-4376-7145-511bb968c906" + "folder": "dcec6b34-9127-b6df-bbd9-da6c35c739f8" }, { - "id": "b8d3fef6-214c-5032-3002-f6c16f3288e2", - "headers": "Authorization: Bearer wrong\nContent-Type: application/json\n", - "url": "{{url}}/admin/admins", + "id": "c3dcb7b2-c57c-398e-62d8-170db419f168", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", + "method": "POST", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474173287352, - "name": "remove admin with wrong Bearer header", + "time": 1474188046380, + "name": "create reviewer with nagative categoryId", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "78aeaf8b-80c8-40df-6ed6-2af5acdbf2ea" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": -1\n}", + "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" }, { - "id": "c0db4362-622a-b556-1991-80df568707b7", - "headers": "Authorization: Bearer {{adminToken}}\n", - "url": "{{url}}/admin/reviewers?categoryId=-4", + "id": "c42386fb-4880-273c-5f56-514a24108ffc", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, - "method": "GET", - "data": null, - "dataMode": "params", + "method": "POST", + "data": [], + "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474184022183, - "name": "get all reviewers with negative categoryId", + "time": 1474189200056, + "name": "create reviewer without categoryId", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "folder": "81516934-d74e-f97d-262f-21d87d5961d1" + "rawModeData": "{\n \"username\": \"dok_tester\"\n}", + "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" }, { - "id": "c1d0d1a9-a8b9-8ee7-c6e6-e539a52fbf35", - "headers": "Authorization: Bearer {{adminToken}}\n", + "id": "d01d666a-59bc-e7e9-2fc1-435a1b4cee89", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, - "method": "GET", - "data": null, - "dataMode": "params", + "method": "DELETE", + "data": [], + "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474189283486, - "name": "get all reviewers without categoryId", + "time": 1474189158880, + "name": "remove reviewer with non-integer categoryId", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "folder": "81516934-d74e-f97d-262f-21d87d5961d1" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 1.1\n}", + "folder": "f51d9a83-9d4a-fa4d-a3a8-08c9a94a35b5" }, { - "id": "c28b4a81-8ee7-24ba-fc8b-54b1b3642fab", - "headers": "Authorization: Bearer {{userToken}}\n", + "id": "d0457f1e-5957-b83c-f603-aaf45690e622", + "headers": "", "url": "{{url}}/admin/reviewers?categoryId=7", "preRequestScript": null, "pathVariables": {}, @@ -1714,17 +1807,17 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474282212758, - "name": "get all reviewers with user token", + "time": 1474282217351, + "name": "get all reviewers without Authorization header", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "folder": "81516934-d74e-f97d-262f-21d87d5961d1" + "folder": "790ca3b9-d88f-04e9-b65d-fd59442f3394" }, { - "id": "c3383672-4018-ec1b-2688-515b73987d36", + "id": "d0e8a5bc-f7c7-268b-5a66-37e90947dabc", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers?categoryId=14", + "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, "method": "DELETE", @@ -1733,58 +1826,77 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474273020582, - "name": "remove reviewer with categoryId in query", + "time": 1474177129491, + "name": "remove copilot with not exist username", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "f11d599f-4472-bcef-b9e3-7c86ac139e35" + "rawModeData": "{\n \"username\": \"notexist\"\n}", + "folder": "dcec6b34-9127-b6df-bbd9-da6c35c739f8" }, { - "id": "c8075e84-bb8d-7596-ba92-5990705f93bc", - "headers": "Authorization: wrong\nContent-Type: application/json\n", - "url": "{{url}}/admin/admins", + "id": "d7913d8d-6c66-b1cd-62d5-c40393c22661", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", + "method": "POST", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474173283865, - "name": "remove admin without Bearer header", + "time": 1474179169639, + "name": "create copilot with empty username", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "78aeaf8b-80c8-40df-6ed6-2af5acdbf2ea" + "rawModeData": "{\n \"username\": \" \",\n \"isSoftwareCopilot\": true,\n \"isStudioCopilot\":true\n}", + "folder": "1438537c-a455-8206-0b64-bcb6e98cb447" }, { - "id": "ccc25e86-5365-aaf6-8ce8-9838898142eb", + "id": "dcf543f4-41e0-0506-52a1-d9abc07132e2", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", + "method": "POST", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474177185914, - "name": "remove copilot with admin token", + "time": 1474179220315, + "name": "create copilot with invalid isSoftwareCopilot", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "2afb4105-1932-6ef0-866c-43ecb13c0048" + "rawModeData": "{\n \"username\": \"notexist\",\n \"isSoftwareCopilot\": \"invalid boolean\",\n \"isStudioCopilot\":true\n}", + "folder": "1438537c-a455-8206-0b64-bcb6e98cb447" }, { - "id": "d0a6e94f-3c59-2398-f0f5-a1d54a6f4e15", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers", + "id": "e1dd94fd-2dea-4082-61f8-a551fcf1d55f", + "headers": "Authorization: Bearer wrong\n", + "url": "{{url}}/admin/copilots", + "preRequestScript": null, + "pathVariables": {}, + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1474176766163, + "name": "get all copilots with wrong Bearer header", + "description": "", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "responses": [], + "folder": "2c775e97-29a3-c27d-abb5-e5dc6a5e05d9" + }, + { + "id": "e3c87489-0dac-48e0-869b-117743e7fb01", + "headers": "Authorization: Bearer {{userToken}}\nContent-Type: application/json\n", + "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, "method": "POST", @@ -1793,57 +1905,57 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474282659872, - "name": "create reviewer with not exist username", + "time": 1474177780363, + "name": "create copilot with user token", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"notexist\",\n \"categoryId\": 14\n}", - "folder": "7544e9b2-c615-4376-7145-511bb968c906" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isSoftwareCopilot\": true,\n \"isStudioCopilot\":true\n}", + "folder": "1438537c-a455-8206-0b64-bcb6e98cb447" }, { - "id": "d2bf20ce-e0ed-a347-69dc-577e34dbefd0", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "id": "e498adc6-5df6-ea02-491f-de46950eff67", + "headers": "Authorization: wrong\nContent-Type: application/json\n", "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", + "method": "POST", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474173258538, - "name": "remove admin with admin token", + "time": 1474168982704, + "name": "create admin without Bearer header", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "78aeaf8b-80c8-40df-6ed6-2af5acdbf2ea" + "folder": "305f84dd-24a3-cbe7-97f1-7063b14a5f42" }, { - "id": "da88d593-5117-3c1f-f56c-47ac74724c79", + "id": "e5179ef5-cef4-a08b-9fbf-cd63b4a4066d", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers", + "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", + "method": "POST", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474282491538, - "name": "remove reviewer with empty username", + "time": 1474169674465, + "name": "create admin with empty username", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \" \",\n \"categoryId\": 14\n}", - "folder": "f11d599f-4472-bcef-b9e3-7c86ac139e35" + "rawModeData": "{\n \"username\": \" \"\n}", + "folder": "305f84dd-24a3-cbe7-97f1-7063b14a5f42" }, { - "id": "ddf839fa-733a-056a-8a2c-a1e56d0e9072", - "headers": "Authorization: Bearer wrong\n", + "id": "e61162b5-ccbd-79fc-7daa-ad1e9e71f8db", + "headers": "Authorization: Bearer {{userToken}}\n", "url": "{{url}}/admin/reviewers?categoryId=7", "preRequestScript": null, "pathVariables": {}, @@ -1853,56 +1965,57 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474282226901, - "name": "get all reviewers with wrong Bearer header", + "time": 1474282212758, + "name": "get all reviewers with user token", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "folder": "81516934-d74e-f97d-262f-21d87d5961d1" + "folder": "790ca3b9-d88f-04e9-b65d-fd59442f3394" }, { - "id": "e058d344-3c5d-951a-c86e-ebfeba41bab8", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/copilots", + "id": "e766e9a8-dd56-26b0-5fa7-2e7e876001d7", + "headers": "Authorization: Bearer wrong\nContent-Type: application/json\n", + "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, - "method": "POST", + "method": "DELETE", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474179507223, - "name": "create copilot with isStudioCopilot false", + "time": 1474173287352, + "name": "remove admin with wrong Bearer header", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isSoftwareCopilot\": 1,\n \"isStudioCopilot\":0\n}", - "folder": "8052cbf5-e206-af03-0392-e853f3f06bf4" + "rawModeData": "{\n \"username\": \"dok_tester\"\n}", + "folder": "4ff79efc-3da3-8c10-cbf9-8a883260cc55" }, { - "id": "e10c59ae-1669-54bd-03bb-4de19d51fb5e", - "headers": "Authorization: wrong\n", + "id": "e8a850e5-31bf-6c13-0e44-bc4583bca2cb", + "headers": "Authorization: wrong\nContent-Type: application/json\n", "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, - "method": "GET", - "data": null, - "dataMode": "params", + "method": "DELETE", + "data": [], + "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474174209799, - "name": "get all admins without Bearer header", + "time": 1474173283865, + "name": "remove admin without Bearer header", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "folder": "2964b89d-893b-aada-2e0e-c4136b920508" + "rawModeData": "{\n \"username\": \"dok_tester\"\n}", + "folder": "4ff79efc-3da3-8c10-cbf9-8a883260cc55" }, { - "id": "e6b6464b-da41-67ee-c2ca-53b1d5ba417d", - "headers": "Authorization: Bearer wrong\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers", + "id": "eb8f368e-9c8e-47b7-c70d-1cf7ac89c02c", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, "method": "DELETE", @@ -1911,18 +2024,38 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474189083334, - "name": "remove reviewer with wrong Bearer header", + "time": 1474173533574, + "name": "remove admin with notexist username", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", - "folder": "f11d599f-4472-bcef-b9e3-7c86ac139e35" + "rawModeData": "{\n \"username\": \"notexist\"\n}", + "folder": "4ff79efc-3da3-8c10-cbf9-8a883260cc55" }, { - "id": "ebcf31ae-035b-49ac-41d4-fa4484eff6a1", + "id": "eeabcbce-4ca9-88ce-ec1a-93e0729bad11", + "headers": "Authorization: wrong\nContent-Type: application/json\n", + "url": "{{url}}/admin/copilots", + "preRequestScript": null, + "pathVariables": {}, + "method": "DELETE", + "data": [], + "dataMode": "raw", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1474177113168, + "name": "remove copilot without Bearer header", + "description": "", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "responses": [], + "rawModeData": "{\n \"username\": \"dok_tester\"\n}", + "folder": "dcec6b34-9127-b6df-bbd9-da6c35c739f8" + }, + { + "id": "f6e293f3-5650-d73b-36e8-97d587604a4b", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers", + "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, "method": "POST", @@ -1931,18 +2064,18 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474187872946, - "name": "create reviewer with admin token", + "time": 1474179290066, + "name": "create copilot with isStudioCopilot/isSoftwareCopilot false", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", - "folder": "7544e9b2-c615-4376-7145-511bb968c906" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isStudioCopilot\": false,\n \"isSoftwareCopilot\":false\n}", + "folder": "1438537c-a455-8206-0b64-bcb6e98cb447" }, { - "id": "ef7fd1f5-a302-b7b6-a772-a43eb3b82062", + "id": "f88f1d64-7461-652d-f3fb-6c48fa553e61", "headers": "Authorization: Bearer {{adminToken}}\n", - "url": "{{url}}/admin/reviewers?categoryId=wrong", + "url": "{{url}}/admin/reviewers?categoryId=7", "preRequestScript": null, "pathVariables": {}, "method": "GET", @@ -1951,75 +2084,76 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474184004438, - "name": "get all reviewers with invalid categoryId", + "time": 1474268286128, + "name": "get all reviewers with admin token", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "folder": "81516934-d74e-f97d-262f-21d87d5961d1" + "folder": "790ca3b9-d88f-04e9-b65d-fd59442f3394" }, { - "id": "f6c44b3f-570d-e48f-3b7e-8419a9ebe9b6", - "headers": "Content-Type: application/json\n", - "url": "{{url}}/auth", + "id": "f8efe766-a322-ee21-b4f5-78d78642af19", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, "method": "POST", "data": [], "dataMode": "raw", - "version": 2, - "tests": "var authResponse = JSON.parse(responseBody);\npostman.setEnvironmentVariable(\"authToken\", authResponse.token);\ntests[\"Status code is 200\"] = responseCode.code === 200;\nvar jsonData = JSON.parse(responseBody);\ntests[\"A valid token is returned\"] = !!jsonData.token;", + "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474159263289, - "name": "Login as admin user", + "time": 1474187901930, + "name": "create reviewer without username", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"heffan\", \n \"password\": \"password\"\n}", - "folder": "fedff379-68f7-3322-d2e9-29471d82cc60" + "rawModeData": "{}", + "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" }, { - "id": "f784d0d8-8645-7633-91c6-54ec81aa95ff", - "headers": "Authorization: Bearer {{adminToken}}\n", - "url": "{{url}}/admin/reviewers?categoryId=1.1", + "id": "f901106d-47f8-080c-d56b-7badc5774481", + "headers": "Content-Type: application/json\n", + "url": "{{url}}/auth", "preRequestScript": null, "pathVariables": {}, - "method": "GET", - "data": null, - "dataMode": "params", - "tests": null, + "method": "POST", + "data": [], + "dataMode": "raw", + "version": 2, + "tests": "var authResponse = JSON.parse(responseBody);\npostman.setEnvironmentVariable(\"authToken\", authResponse.token);\ntests[\"Status code is 200\"] = responseCode.code === 200;\nvar jsonData = JSON.parse(responseBody);\ntests[\"A valid token is returned\"] = !!jsonData.token;", "currentHelper": "normal", "helperAttributes": {}, - "time": 1474188155542, - "name": "get all reviewers with non-integer categoryId", + "time": 1474159245944, + "name": "Log in as ordinary user", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "folder": "81516934-d74e-f97d-262f-21d87d5961d1" + "rawModeData": "{\n \"username\": \"user\", \n \"password\": \"password\"\n}", + "folder": "14f4dd06-76e0-ca22-602f-0ad3974aa4fa" }, { - "id": "fc7d7ac4-d1e1-a441-6717-ecb50b9ad7f6", + "id": "f9a913ac-f3b4-3cba-ad0d-41265aa5904b", "headers": "Authorization: Bearer {{userToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/admins", + "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, - "method": "POST", + "method": "DELETE", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474172375481, - "name": "create admin with user token", + "time": 1474189053598, + "name": "remove reviewer with user token", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "142d5b1b-b304-bced-c1f3-b59e8187d2aa" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", + "folder": "f51d9a83-9d4a-fa4d-a3a8-08c9a94a35b5" }, { - "id": "fe0a03f9-4969-651a-5eed-01de9398498e", + "id": "fbdd77d2-d138-3a05-a543-d5302daeca50", "headers": "Authorization: wrong\n", "url": "{{url}}/admin/reviewers?categoryId=7", "preRequestScript": null, @@ -2033,9 +2167,29 @@ "time": 1474282221279, "name": "get all reviewers without Bearer header", "description": "", - "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "responses": [], + "folder": "790ca3b9-d88f-04e9-b65d-fd59442f3394" + }, + { + "id": "ff7618ed-fc54-1b81-6129-8df5ac4e67a9", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "url": "{{url}}/admin/copilots", + "preRequestScript": null, + "pathVariables": {}, + "method": "DELETE", + "data": [], + "dataMode": "raw", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1474177119734, + "name": "remove copilot without username", + "description": "", + "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", "responses": [], - "folder": "81516934-d74e-f97d-262f-21d87d5961d1" + "rawModeData": "{}", + "folder": "dcec6b34-9127-b6df-bbd9-da6c35c739f8" } ] } \ No newline at end of file diff --git a/test/scripts/mock_v3.js b/test/scripts/mock_v3.js new file mode 100644 index 000000000..8df5e8c02 --- /dev/null +++ b/test/scripts/mock_v3.js @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2017 TopCoder Inc., All Rights Reserved. + * + * This is the REST server that mocks some services from the V3 API + * + * @author GFalcon + * @version 1.0 + */ +"use strict"; + +var express = require('express'); +var bodyParser = require('body-parser'); + +var app = express(); + +app.use(bodyParser.json()); + +/* + * Log all incoming requests + */ +/*jslint unparam: true*/ +app.use(function (req, res, next) { + console.info('V3 Request: ' + JSON.stringify({ + path: req.path, + method: req.method, + headers: req.headers, + body: req.body + }, null, ' ')); + next(); +}); +/*jslint unparam: false*/ + +/* + * Return a fake 'authorization token' + */ +/*jslint unparam: true*/ +app.post('/v3/authorizations', function (req, res) { + res.json({ + result: { + content: { + token: 'FAKE-TOKEN' + } + } + }); +}); +/*jslint unparam: false*/ + +/* + * Get group members. Makes each group consist of one user + * (the user from the sample database whose handle is 'user') + * except one group (id 3330004) that doesn't have any users at all + */ +app.get('/v3/groups/:groupId/members', function (req, res) { + /*jslint eqeq: true*/ + if (req.params.groupId != 3330004) { + /*jslint eqeq: false*/ + res.json({ + result: { + content: [{ + memberId: 132458 + }] + } + }); + } else { + res.json({ + result: { + content: [] + } + }); + } +}); + +app.listen(8084); From b4a5dc9fbb1ba0812ea92ef41b52820990164133 Mon Sep 17 00:00:00 2001 From: Vyacheslav V Sokolov Date: Fri, 16 Jun 2017 06:23:53 +0700 Subject: [PATCH 2/6] Restoring an accidentially modified file --- test/postman/Reviewer_Management_API.json | 1892 ++++++++++----------- 1 file changed, 869 insertions(+), 1023 deletions(-) diff --git a/test/postman/Reviewer_Management_API.json b/test/postman/Reviewer_Management_API.json index b58200657..cd7d0837e 100755 --- a/test/postman/Reviewer_Management_API.json +++ b/test/postman/Reviewer_Management_API.json @@ -1,214 +1,203 @@ { - "id": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "id": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "name": "Admin App - TC API Reviewer Management API", "description": "", "order": [], "folders": [ { - "id": "498ee2d2-174c-7049-3cc4-43b4e330083b", - "name": "Get checkpoints", - "description": "", - "order": [ - "8db48405-6ba0-f116-06c6-cc34cffd77c1", - "03badc56-40a6-750a-a0fa-937d6af188b8", - "76441abd-9a70-5fe9-93e1-59dd0318384f", - "60330c29-7ed3-b453-8d01-652084ca19b1", - "46fea4dc-9708-763b-c0cc-713ac9c1a9eb" - ], - "owner": "316251" - }, - { - "id": "305f84dd-24a3-cbe7-97f1-7063b14a5f42", + "id": "142d5b1b-b304-bced-c1f3-b59e8187d2aa", "name": "create admin", "description": "", "order": [ - "2dc63d17-e288-5432-1e70-ea3b38dbd939", - "13cfe266-39c7-4139-4526-0f45743c1ec1", - "9ddc746e-591c-69e7-2326-a05aa52f7109", - "e498adc6-5df6-ea02-491f-de46950eff67", - "0dc9a5b6-60b7-0006-30f3-a93f6a23efee", - "b762147c-aae5-9630-dfe7-d6468a8a3843", - "e5179ef5-cef4-a08b-9fbf-cd63b4a4066d", - "4b62272c-8167-0310-930a-d5f0526c52a8" + "17cd6d9b-17b2-1f5c-a0d8-e0948c718d26", + "fc7d7ac4-d1e1-a441-6717-ecb50b9ad7f6", + "9bccd2a2-8aac-1931-b78e-8b61a99415a4", + "8b843cb6-1fc6-8c0b-1d6d-f54d9470cf76", + "88ae8323-4232-1675-8796-e06c6997f3f9", + "2297e0e7-4871-b68e-6258-b59a1da3acd4", + "59d2ab3f-1ef2-3925-42c4-754eced98658", + "43dbe6f5-32e5-f0f0-5735-42a3a9f08120" ], - "owner": "316251", + "owner": 0, "collectionId": "6369974d-65cc-d819-459b-0026549ddb47" }, { - "id": "1438537c-a455-8206-0b64-bcb6e98cb447", + "id": "8052cbf5-e206-af03-0392-e853f3f06bf4", "name": "create copilot", "description": "", "order": [ - "597e4417-c496-e48d-801c-5504e9201d18", - "16572157-2b12-830a-35df-e87fee271e02", - "121ce835-ccff-770b-cf19-d4c8715734ee", - "e3c87489-0dac-48e0-869b-117743e7fb01", - "7667b82b-d891-3959-4469-2b6e3673ed03", - "1a4b8b23-8b80-aaf8-5350-63d6e573ef85", - "6fc730e8-851c-c0c0-4dbf-79a9fc7c67e1", - "4c54c5ab-5d8b-a873-49b0-0f3d63d6b42f", - "497b04d4-c729-3008-107e-b69aead7e3db", - "676c46be-e1bf-ba14-d357-1ca01119054b", - "d7913d8d-6c66-b1cd-62d5-c40393c22661", - "0303a184-79f4-7216-4ecc-797f324d6f3e", - "dcf543f4-41e0-0506-52a1-d9abc07132e2", - "216bd35b-31af-ba0a-497d-9b93576104b7", - "f6e293f3-5650-d73b-36e8-97d587604a4b" + "3a87b2a7-3761-5089-38d9-6c7d3796e984", + "2cb65342-ba7f-b473-6afc-8a729da04563", + "e058d344-3c5d-951a-c86e-ebfeba41bab8", + "42fc7559-c2a2-8b85-67e3-3812ae0d5998", + "518db876-c166-6aa7-d484-b8b778297b4e", + "9fb05ea1-f85e-209e-7619-e40450acd7f3", + "79444594-2c40-1e6e-9f71-f22d57828026", + "26e53a5b-bef9-17f2-fb02-34595bf8a8c4", + "9ff114f0-56ca-f56c-08e4-3bb4dcaac10f", + "6727946e-aa76-0996-e734-800bb07cf5c6", + "49c5d6f4-5b86-3e9f-8c82-ef7430411264", + "858050d9-d3f2-900f-79a8-4a56c7ca586b", + "68d189c2-eb05-ded4-1e97-414ebde03ab8", + "34ac4817-1082-2274-ed98-f17b63e62786", + "477195d0-14ca-6a6e-274f-513e7d50a45c" ], - "owner": "316251", + "owner": 0, "collectionId": "6369974d-65cc-d819-459b-0026549ddb47" }, { - "id": "ff6b7b38-7532-5c03-26db-c68f88696eb9", + "id": "7544e9b2-c615-4376-7145-511bb968c906", "name": "create reviewer", "description": "", "order": [ - "0b12cd19-4eda-4c11-e926-7f8c8920d2ab", - "1b4714ed-d2cb-cd10-98c3-4965448e6b17", - "617c7aa5-6a13-7f08-3621-050d7bb9fb42", - "32fd36b2-7397-5e93-8b6c-755557c77586", - "b557e83b-d42a-a7b8-8a9c-8fa2270188b1", - "39116742-fb19-f8ba-f177-1e1910b0dd50", - "f8efe766-a322-ee21-b4f5-78d78642af19", - "789c4564-2cb5-a4da-04f4-0d3a432950dd", - "38247541-c9f7-206a-f77a-2cdbd47c3968", - "5eee889a-83e0-96da-a476-ffd50ad66960", - "c3dcb7b2-c57c-398e-62d8-170db419f168", - "a407a482-48ea-5561-9158-71259c3e8a3b", - "c42386fb-4880-273c-5f56-514a24108ffc", - "7b7bc600-f9a9-e566-ccd3-4bff678d50da", - "37345c71-a682-1d40-ff87-7739450f0904", - "8b52ad5d-31a4-8a84-4d24-ceb91021a467", - "61f8c960-54fd-f1b3-0cc3-8ac89de6361a", - "0baebd12-e9e9-b75f-5409-4bdd22db26e1", - "12863b80-7674-2de7-7371-1921c77e6ad1" + "ebcf31ae-035b-49ac-41d4-fa4484eff6a1", + "b84bd2e1-cd0b-3489-3c11-917a1624249e", + "4a6e3f4b-cb9e-978d-281f-81a57545b0ac", + "ac18e672-1e47-37fa-1ae8-85eed1beab2d", + "202e4545-829b-f158-372f-206e632d609f", + "8679c69e-e94d-7188-60fd-bbe506b851d1", + "2f652b9b-7dc4-8140-9ac5-e6995f1a3fba", + "a8e7c6c2-1cfb-e3ad-af5c-9c27bd71924b", + "d0a6e94f-3c59-2398-f0f5-a1d54a6f4e15", + "03ce940d-9b2d-b46b-0f84-48da5529615c", + "24bc8058-d1ef-1f33-eb64-ede9b9663f49", + "84cd43c0-c407-365b-f1f4-07929e2876cc", + "8a43eff3-3f9a-83a2-6734-a683e29252c8", + "790064a6-e429-1f9c-24b5-7112ce1fb8b2", + "0865091c-8f04-f18c-f9e5-e5c182bc8ab3", + "9e458d5b-5aa5-05ec-6240-7d171c75cf5e", + "0e55b155-b8b7-ae58-5505-f1ff9ba0eb36", + "a466f2b7-2f9c-4a14-fc0e-eee7981cdb42", + "16044f47-5b3d-2ba2-1787-8e6f7e78af97" ], - "owner": "316251", + "owner": 0, "collectionId": "6369974d-65cc-d819-459b-0026549ddb47" }, { - "id": "43eec092-7864-262f-fe9d-a2a416e1a2d8", + "id": "2964b89d-893b-aada-2e0e-c4136b920508", "name": "get all admins", "description": "", "order": [ - "6ab91574-6c11-9d54-a6a3-a87304bec08b", - "c21ce35d-8558-ca77-c6af-8a6d930564b9", - "1739bc1d-f48e-2f66-c423-d56a7dd6925f", - "b5f484a7-b5e9-e763-97fb-5d750d08cd6d", - "1c6e9cc9-1d15-c2cb-0b7d-7b552558f26c" + "b0bfa529-5f58-d5a6-e1bc-2099abfa253f", + "b83cdcb1-5abe-0f73-1c9c-b558c0634baf", + "144d7cd5-cedb-1e15-fec5-27c5e56863df", + "e10c59ae-1669-54bd-03bb-4de19d51fb5e", + "828d7e47-ee45-5ed2-fe37-2114815e84f1" ], - "owner": "316251", + "owner": 0, "collectionId": "6369974d-65cc-d819-459b-0026549ddb47" }, { - "id": "2c775e97-29a3-c27d-abb5-e5dc6a5e05d9", + "id": "1a80812c-dfa2-5dc4-aca7-299502bbc807", "name": "get all copilots", "description": "", "order": [ - "0554d512-8935-33a8-6447-85eba32b8873", - "2e452537-8224-19aa-e79d-3bdd2d3d6092", - "62a5e348-741b-fd42-ed58-839def26d4bf", - "05f2c4f0-2f80-95ed-54f6-2b731960bdac", - "e1dd94fd-2dea-4082-61f8-a551fcf1d55f" + "67db2b5a-4b85-4e18-2709-5c475849329f", + "2d18170b-9631-3c97-fc68-51d0ed76766c", + "a47c9a54-d12a-6801-02a1-c57c420237cf", + "21bdc1e1-c5b2-d063-fd54-386ab396b224", + "897d4baa-72d5-1eca-ff61-51db0d14408c" ], - "owner": "316251", + "owner": 0, "collectionId": "6369974d-65cc-d819-459b-0026549ddb47" }, { - "id": "790ca3b9-d88f-04e9-b65d-fd59442f3394", + "id": "81516934-d74e-f97d-262f-21d87d5961d1", "name": "get all reviewers", "description": "", "order": [ - "f88f1d64-7461-652d-f3fb-6c48fa553e61", - "e61162b5-ccbd-79fc-7daa-ad1e9e71f8db", - "d0457f1e-5957-b83c-f603-aaf45690e622", - "fbdd77d2-d138-3a05-a543-d5302daeca50", - "c15dff6e-1a55-a875-3460-2d2097b2f960", - "4f247a99-8f61-47ea-3323-68ec5a7e7000", - "9308798f-cbfd-b44c-1d47-6ef6650424f0", - "4547a259-b0cf-c5e6-8d04-035b9ae443ce", - "52edc048-18d6-ce4d-5312-69286ce2e2f9" + "08364378-8daf-8159-547e-fac22ca27847", + "c28b4a81-8ee7-24ba-fc8b-54b1b3642fab", + "8bd1727c-34f8-ced7-eb92-d50cc6e56772", + "fe0a03f9-4969-651a-5eed-01de9398498e", + "ddf839fa-733a-056a-8a2c-a1e56d0e9072", + "ef7fd1f5-a302-b7b6-a772-a43eb3b82062", + "c0db4362-622a-b556-1991-80df568707b7", + "f784d0d8-8645-7633-91c6-54ec81aa95ff", + "c1d0d1a9-a8b9-8ee7-c6e6-e539a52fbf35" ], - "owner": "316251", + "owner": 0, "collectionId": "6369974d-65cc-d819-459b-0026549ddb47" }, { - "id": "14f4dd06-76e0-ca22-602f-0ad3974aa4fa", + "id": "fedff379-68f7-3322-d2e9-29471d82cc60", "name": "login", "description": "", "order": [ - "1b96aaf0-f11e-a4c3-4217-c0833e6c75ee", - "f901106d-47f8-080c-d56b-7badc5774481" + "f6c44b3f-570d-e48f-3b7e-8419a9ebe9b6", + "a495567b-a450-037f-ca8e-c9da52116890" ], - "owner": "316251", + "owner": 0, "collectionId": "6369974d-65cc-d819-459b-0026549ddb47" }, { - "id": "4ff79efc-3da3-8c10-cbf9-8a883260cc55", + "id": "78aeaf8b-80c8-40df-6ed6-2af5acdbf2ea", "name": "remove admin", "description": "", "order": [ - "2c17ef61-6067-4da2-6125-3bf54a8d7526", - "972a47ef-1768-7d9b-f12c-df8c57cb5bf5", - "2f8eda4d-c65c-ba89-a38c-4f197342b382", - "e8a850e5-31bf-6c13-0e44-bc4583bca2cb", - "e766e9a8-dd56-26b0-5fa7-2e7e876001d7", - "35dea5ec-b89c-fe4f-9a74-4ed2637c3501", - "983e7dd1-673c-a1a9-81e9-4e81ff0ec74b", - "eb8f368e-9c8e-47b7-c70d-1cf7ac89c02c" + "d2bf20ce-e0ed-a347-69dc-577e34dbefd0", + "07358622-f7d4-9233-8dc1-204acb7b1ccf", + "3f0e98fb-e97a-e6ed-8dc7-e864b1447e03", + "c8075e84-bb8d-7596-ba92-5990705f93bc", + "b8d3fef6-214c-5032-3002-f6c16f3288e2", + "2f633003-2ac7-99ec-e52a-8b1f2e0534d4", + "600d723c-706d-42ca-9ecc-94a32e280063", + "1e4fffd8-a809-e9dc-0659-0df467954407" ], - "owner": "316251", + "owner": 0, "collectionId": "6369974d-65cc-d819-459b-0026549ddb47" }, { - "id": "dcec6b34-9127-b6df-bbd9-da6c35c739f8", + "id": "2afb4105-1932-6ef0-866c-43ecb13c0048", "name": "remove copilot", "description": "", "order": [ - "4063d0fe-dc7b-03fd-1958-219c5d10b788", - "3347ecb1-015e-bd23-20ea-1e5c1bacf1ec", - "c2e943b2-f53d-6788-26e6-ca35b5a5fec7", - "eeabcbce-4ca9-88ce-ec1a-93e0729bad11", - "6a8ef947-840a-bf33-c225-be351341f914", - "ff7618ed-fc54-1b81-6129-8df5ac4e67a9", - "73994f91-2d50-2d6b-f808-5c8b5063d046", - "d0e8a5bc-f7c7-268b-5a66-37e90947dabc" + "ccc25e86-5365-aaf6-8ce8-9838898142eb", + "85022108-999a-7200-89cd-e6b11f66bcb8", + "357caf52-98e8-90a9-8d13-1bf8d330915e", + "34b27e13-3b96-0a9e-25e6-8a339c517518", + "49952d3d-864a-25ff-3648-abbb79550dc2", + "ad152575-1e23-f242-96d2-f4b49a616c56", + "538a99a4-4701-1ee0-527c-6d2db316dae6", + "19a2adaa-d44b-5fd7-9ee7-a6d3452e4492" ], - "owner": "316251", + "owner": 0, "collectionId": "6369974d-65cc-d819-459b-0026549ddb47" }, { - "id": "f51d9a83-9d4a-fa4d-a3a8-08c9a94a35b5", + "id": "f11d599f-4472-bcef-b9e3-7c86ac139e35", "name": "remove reviewer", "description": "", "order": [ - "a183318a-b246-f372-1b0e-2ff1ad2395c0", - "f9a913ac-f3b4-3cba-ad0d-41265aa5904b", - "5ebd6774-7f4f-df1a-86e7-f81966773ba8", - "5fcaab29-db1b-2b79-e6a0-ee0f19f60f58", - "7d7675c4-0334-9a22-beab-485f817fbbce", - "6116bd27-1dd4-0d0e-938b-26e50c622b75", - "2208a6ea-3cce-8bae-eb41-a7bc31f99e79", - "a6001143-99ca-b1ab-a1c9-58c3dc8b6fe0", - "5cf9ac97-40c2-128f-a531-982ec0dc1247", - "2fde5963-bef1-afc8-52ff-1b494e2dff11", - "30c5af89-92ae-3cb7-92dc-9c29a41d468a", - "d01d666a-59bc-e7e9-2fc1-435a1b4cee89", - "8bb4421e-098b-3ae7-59b7-869927cf659e", - "261b410d-a3bb-054a-de84-03487ed7b549" + "49557532-d98e-55e3-5cc4-4c702b62e3ed", + "3453a16f-6a34-c92c-91ed-d2107b505e7a", + "c3383672-4018-ec1b-2688-515b73987d36", + "636f8c2c-7cc2-4d90-179e-7808ae8bbba1", + "a887c7eb-8b15-90aa-07ef-6d998297bcee", + "e6b6464b-da41-67ee-c2ca-53b1d5ba417d", + "4b8d4933-247c-d204-23c6-3acd8ec2e66a", + "da88d593-5117-3c1f-f56c-47ac74724c79", + "13c71689-cfe5-512d-f5b6-d971fa88129a", + "6fd784f5-bda9-b183-1d85-c30879a47427", + "37b02c2b-7018-6af5-4e3c-57b2abde2b0e", + "05ed43fe-61be-43b3-36c7-0c4a12f98efd", + "12d79b9a-e008-ea3d-6fa4-21c7e72e4e94", + "6fcaeb1e-8611-9adf-319f-92f61ac2d62d" ], - "owner": "316251", + "owner": 0, "collectionId": "6369974d-65cc-d819-459b-0026549ddb47" } ], "timestamp": 1474156790593, - "owner": "316251", + "owner": 0, "public": false, + "published": false, + "hasRequests": true, "requests": [ { - "id": "0303a184-79f4-7216-4ecc-797f324d6f3e", + "id": "03ce940d-9b2d-b46b-0f84-48da5529615c", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/copilots", + "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, "method": "POST", @@ -217,65 +206,58 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474179176872, - "name": "create copilot with not exist username", + "time": 1474188017748, + "name": "create reviewer with invalid categoryId", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"notexist\",\n \"isSoftwareCopilot\": true,\n \"isStudioCopilot\":true\n}", - "folder": "1438537c-a455-8206-0b64-bcb6e98cb447" - }, - { - "id": "03badc56-40a6-750a-a0fa-937d6af188b8", - "headers": "Authorization: Bearer {{authToken}}\n", - "headerData": [ - { - "key": "Authorization", - "value": "Bearer {{authToken}}", - "description": "", - "enabled": true - } - ], - "url": "{{url}}/develop/challenges/checkpoint/2220002", - "queryParams": [], + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": \"wrong number\"\n}", + "folder": "7544e9b2-c615-4376-7145-511bb968c906" + }, + { + "id": "05ed43fe-61be-43b3-36c7-0c4a12f98efd", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, - "pathVariableData": [], - "method": "GET", - "data": null, - "dataMode": "params", + "method": "DELETE", + "data": [], + "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1497550612717, - "name": "Old logic, access allowed", + "time": 1474189158880, + "name": "remove reviewer with non-integer categoryId", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", - "responses": [] + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "responses": [], + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 1.1\n}", + "folder": "f11d599f-4472-bcef-b9e3-7c86ac139e35" }, { - "id": "0554d512-8935-33a8-6447-85eba32b8873", - "headers": "Authorization: Bearer {{adminToken}}\n", - "url": "{{url}}/admin/copilots", + "id": "07358622-f7d4-9233-8dc1-204acb7b1ccf", + "headers": "Authorization: Bearer {{userToken}}\nContent-Type: application/json\n", + "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, - "method": "GET", - "data": null, - "dataMode": "params", + "method": "DELETE", + "data": [], + "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474176736874, - "name": "get all copilots with admin token", + "time": 1474173280471, + "name": "remove admin with user token", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "folder": "2c775e97-29a3-c27d-abb5-e5dc6a5e05d9" + "rawModeData": "{\n \"username\": \"dok_tester\"\n}", + "folder": "78aeaf8b-80c8-40df-6ed6-2af5acdbf2ea" }, { - "id": "05f2c4f0-2f80-95ed-54f6-2b731960bdac", - "headers": "Authorization: wrong\n", - "url": "{{url}}/admin/copilots", + "id": "08364378-8daf-8159-547e-fac22ca27847", + "headers": "Authorization: Bearer {{adminToken}}\n", + "url": "{{url}}/admin/reviewers?categoryId=7", "preRequestScript": null, "pathVariables": {}, "method": "GET", @@ -284,15 +266,15 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474176769090, - "name": "get all copilots without Bearer header", + "time": 1474268286128, + "name": "get all reviewers with admin token", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "folder": "2c775e97-29a3-c27d-abb5-e5dc6a5e05d9" + "folder": "81516934-d74e-f97d-262f-21d87d5961d1" }, { - "id": "0b12cd19-4eda-4c11-e926-7f8c8920d2ab", + "id": "0865091c-8f04-f18c-f9e5-e5c182bc8ab3", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", "url": "{{url}}/admin/reviewers", "preRequestScript": null, @@ -303,16 +285,16 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474187872946, - "name": "create reviewer with admin token", + "time": 1474268192451, + "name": "create reviewer with invalid immune", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", - "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" + "rawModeData": "{\n \"username\": \"Yoshi\",\n \"categoryId\": 14,\n \"immune\": \"invalid boolean\"\n}", + "folder": "7544e9b2-c615-4376-7145-511bb968c906" }, { - "id": "0baebd12-e9e9-b75f-5409-4bdd22db26e1", + "id": "0e55b155-b8b7-ae58-5505-f1ff9ba0eb36", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", "url": "{{url}}/admin/reviewers", "preRequestScript": null, @@ -323,78 +305,77 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474282767080, - "name": "create reviewer with f2f category id", + "time": 1474282763352, + "name": "create reviewer with code category id", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"liquid_user\",\n \"categoryId\": 38\n}", - "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" + "rawModeData": "{\n \"username\": \"Hung\",\n \"categoryId\": 39\n}", + "folder": "7544e9b2-c615-4376-7145-511bb968c906" }, { - "id": "0dc9a5b6-60b7-0006-30f3-a93f6a23efee", - "headers": "Authorization: Bearer wrong\nContent-Type: application/json\n", - "url": "{{url}}/admin/admins", + "id": "12d79b9a-e008-ea3d-6fa4-21c7e72e4e94", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, - "method": "POST", + "method": "DELETE", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474168987848, - "name": "create admin with wrong Bearer header", + "time": 1474189177783, + "name": "remove reviewer without categoryId", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "305f84dd-24a3-cbe7-97f1-7063b14a5f42" + "folder": "f11d599f-4472-bcef-b9e3-7c86ac139e35" }, { - "id": "121ce835-ccff-770b-cf19-d4c8715734ee", + "id": "13c71689-cfe5-512d-f5b6-d971fa88129a", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/copilots", + "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, - "method": "POST", + "method": "DELETE", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474179507223, - "name": "create copilot with isStudioCopilot false", + "time": 1474282495801, + "name": "remove reviewer with not exist username", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isSoftwareCopilot\": 1,\n \"isStudioCopilot\":0\n}", - "folder": "1438537c-a455-8206-0b64-bcb6e98cb447" + "rawModeData": "{\n \"username\": \"notexist\",\n \"categoryId\": 14\n}", + "folder": "f11d599f-4472-bcef-b9e3-7c86ac139e35" }, { - "id": "12863b80-7674-2de7-7371-1921c77e6ad1", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers?categoryId=14", + "id": "144d7cd5-cedb-1e15-fec5-27c5e56863df", + "headers": "", + "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, - "method": "POST", - "data": [], - "dataMode": "raw", + "method": "GET", + "data": null, + "dataMode": "params", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474284611393, - "name": "create reviewer with categoryId in query and body at same time", + "time": 1474174192935, + "name": "get all admins without Authorization header", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\":7\n}", - "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" + "folder": "2964b89d-893b-aada-2e0e-c4136b920508" }, { - "id": "13cfe266-39c7-4139-4526-0f45743c1ec1", - "headers": "Authorization: Bearer {{userToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/admins", + "id": "16044f47-5b3d-2ba2-1787-8e6f7e78af97", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "url": "{{url}}/admin/reviewers?categoryId=14", "preRequestScript": null, "pathVariables": {}, "method": "POST", @@ -403,18 +384,18 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474172375481, - "name": "create admin with user token", + "time": 1474284611393, + "name": "create reviewer with categoryId in query and body at same time", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "305f84dd-24a3-cbe7-97f1-7063b14a5f42" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\":7\n}", + "folder": "7544e9b2-c615-4376-7145-511bb968c906" }, { - "id": "16572157-2b12-830a-35df-e87fee271e02", + "id": "17cd6d9b-17b2-1f5c-a0d8-e0948c718d26", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/copilots", + "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, "method": "POST", @@ -423,98 +404,78 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474179347234, - "name": "create copilot with isSoftwareCopilot false", - "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", - "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isSoftwareCopilot\": 0,\n \"isStudioCopilot\":true\n}", - "folder": "1438537c-a455-8206-0b64-bcb6e98cb447" - }, - { - "id": "1739bc1d-f48e-2f66-c423-d56a7dd6925f", - "headers": "", - "url": "{{url}}/admin/admins", - "preRequestScript": null, - "pathVariables": {}, - "method": "GET", - "data": null, - "dataMode": "params", - "tests": null, - "currentHelper": "normal", - "helperAttributes": {}, - "time": 1474174192935, - "name": "get all admins without Authorization header", + "time": 1474168970336, + "name": "create admin with admin token", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "folder": "43eec092-7864-262f-fe9d-a2a416e1a2d8" + "rawModeData": "{\n \"username\": \"dok_tester\"\n}", + "folder": "142d5b1b-b304-bced-c1f3-b59e8187d2aa" }, { - "id": "1a4b8b23-8b80-aaf8-5350-63d6e573ef85", - "headers": "Authorization: wrong\nContent-Type: application/json\n", + "id": "19a2adaa-d44b-5fd7-9ee7-a6d3452e4492", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, - "method": "POST", + "method": "DELETE", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474178858906, - "name": "create copilot without Bearer header", + "time": 1474177129491, + "name": "remove copilot with not exist username", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isSoftwareCopilot\": true,\n \"isStudioCopilot\":true\n}", - "folder": "1438537c-a455-8206-0b64-bcb6e98cb447" + "rawModeData": "{\n \"username\": \"notexist\"\n}", + "folder": "2afb4105-1932-6ef0-866c-43ecb13c0048" }, { - "id": "1b4714ed-d2cb-cd10-98c3-4965448e6b17", + "id": "1e4fffd8-a809-e9dc-0659-0df467954407", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers?categoryId=14", + "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, - "method": "POST", + "method": "DELETE", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474282455411, - "name": "create reviewer with categoryId in query", + "time": 1474173533574, + "name": "remove admin with notexist username", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" + "rawModeData": "{\n \"username\": \"notexist\"\n}", + "folder": "78aeaf8b-80c8-40df-6ed6-2af5acdbf2ea" }, { - "id": "1b96aaf0-f11e-a4c3-4217-c0833e6c75ee", - "headers": "Content-Type: application/json\n", - "url": "{{url}}/auth", + "id": "202e4545-829b-f158-372f-206e632d609f", + "headers": "Authorization: wrong\nContent-Type: application/json\n", + "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, "method": "POST", "data": [], "dataMode": "raw", - "version": 2, - "tests": "var authResponse = JSON.parse(responseBody);\npostman.setEnvironmentVariable(\"authToken\", authResponse.token);\ntests[\"Status code is 200\"] = responseCode.code === 200;\nvar jsonData = JSON.parse(responseBody);\ntests[\"A valid token is returned\"] = !!jsonData.token;", + "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474159263289, - "name": "Login as admin user", + "time": 1474187893955, + "name": "create reviewer without Bearer header", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"heffan\", \n \"password\": \"password\"\n}", - "folder": "14f4dd06-76e0-ca22-602f-0ad3974aa4fa" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", + "folder": "7544e9b2-c615-4376-7145-511bb968c906" }, { - "id": "1c6e9cc9-1d15-c2cb-0b7d-7b552558f26c", - "headers": "Authorization: Bearer wrong\n", - "url": "{{url}}/admin/admins", + "id": "21bdc1e1-c5b2-d063-fd54-386ab396b224", + "headers": "Authorization: wrong\n", + "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, "method": "GET", @@ -523,17 +484,17 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474174234342, - "name": "get all admins with wrong Bearer header", + "time": 1474176769090, + "name": "get all copilots without Bearer header", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "folder": "43eec092-7864-262f-fe9d-a2a416e1a2d8" + "folder": "1a80812c-dfa2-5dc4-aca7-299502bbc807" }, { - "id": "216bd35b-31af-ba0a-497d-9b93576104b7", + "id": "2297e0e7-4871-b68e-6258-b59a1da3acd4", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/copilots", + "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, "method": "POST", @@ -542,78 +503,58 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474179249694, - "name": "create copilot with invalid isStudioCopilot", - "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", - "responses": [], - "rawModeData": "{\n \"username\": \"notexist\",\n \"isStudioCopilot\": \"invalid boolean\",\n \"isSoftwareCopilot\":true\n}", - "folder": "1438537c-a455-8206-0b64-bcb6e98cb447" - }, - { - "id": "2208a6ea-3cce-8bae-eb41-a7bc31f99e79", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers", - "preRequestScript": null, - "pathVariables": {}, - "method": "DELETE", - "data": [], - "dataMode": "raw", - "tests": null, - "currentHelper": "normal", - "helperAttributes": {}, - "time": 1474189091821, - "name": "remove reviewer without username", + "time": 1474169000065, + "name": "create admin without username", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], "rawModeData": "{}", - "folder": "f51d9a83-9d4a-fa4d-a3a8-08c9a94a35b5" + "folder": "142d5b1b-b304-bced-c1f3-b59e8187d2aa" }, { - "id": "261b410d-a3bb-054a-de84-03487ed7b549", + "id": "24bc8058-d1ef-1f33-eb64-ede9b9663f49", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers?categoryId=14", + "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", + "method": "POST", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474284520276, - "name": "remove reviewer with categoryId in query and body at same time", + "time": 1474188046380, + "name": "create reviewer with nagative categoryId", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\":7\n}", - "folder": "f51d9a83-9d4a-fa4d-a3a8-08c9a94a35b5" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": -1\n}", + "folder": "7544e9b2-c615-4376-7145-511bb968c906" }, { - "id": "2c17ef61-6067-4da2-6125-3bf54a8d7526", + "id": "26e53a5b-bef9-17f2-fb02-34595bf8a8c4", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/admins", + "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", + "method": "POST", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474173258538, - "name": "remove admin with admin token", + "time": 1474178883094, + "name": "create copilot without username", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "4ff79efc-3da3-8c10-cbf9-8a883260cc55" + "rawModeData": "{}", + "folder": "8052cbf5-e206-af03-0392-e853f3f06bf4" }, { - "id": "2dc63d17-e288-5432-1e70-ea3b38dbd939", + "id": "2cb65342-ba7f-b473-6afc-8a729da04563", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/admins", + "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, "method": "POST", @@ -622,16 +563,16 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474168970336, - "name": "create admin with admin token", + "time": 1474179347234, + "name": "create copilot with isSoftwareCopilot false", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "305f84dd-24a3-cbe7-97f1-7063b14a5f42" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isSoftwareCopilot\": 0,\n \"isStudioCopilot\":true\n}", + "folder": "8052cbf5-e206-af03-0392-e853f3f06bf4" }, { - "id": "2e452537-8224-19aa-e79d-3bdd2d3d6092", + "id": "2d18170b-9631-3c97-fc68-51d0ed76766c", "headers": "Authorization: Bearer {{userToken}}\n", "url": "{{url}}/admin/copilots", "preRequestScript": null, @@ -645,13 +586,13 @@ "time": 1474176739711, "name": "get all copilots with user token", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "folder": "2c775e97-29a3-c27d-abb5-e5dc6a5e05d9" + "folder": "1a80812c-dfa2-5dc4-aca7-299502bbc807" }, { - "id": "2f8eda4d-c65c-ba89-a38c-4f197342b382", - "headers": "Content-Type: application/json\n", + "id": "2f633003-2ac7-99ec-e52a-8b1f2e0534d4", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, @@ -661,37 +602,37 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474173276705, - "name": "remove admin without Authorization header", + "time": 1474173290943, + "name": "remove admin without username", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "4ff79efc-3da3-8c10-cbf9-8a883260cc55" + "rawModeData": "{}", + "folder": "78aeaf8b-80c8-40df-6ed6-2af5acdbf2ea" }, { - "id": "2fde5963-bef1-afc8-52ff-1b494e2dff11", + "id": "2f652b9b-7dc4-8140-9ac5-e6995f1a3fba", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", + "method": "POST", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474189135829, - "name": "remove reviewer with invalid categoryId", + "time": 1474187901930, + "name": "create reviewer without username", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": \"wrong number\"\n}", - "folder": "f51d9a83-9d4a-fa4d-a3a8-08c9a94a35b5" + "rawModeData": "{}", + "folder": "7544e9b2-c615-4376-7145-511bb968c906" }, { - "id": "30c5af89-92ae-3cb7-92dc-9c29a41d468a", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "id": "3453a16f-6a34-c92c-91ed-d2107b505e7a", + "headers": "Authorization: Bearer {{userToken}}\nContent-Type: application/json\n", "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, @@ -701,18 +642,18 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474189145913, - "name": "remove reviewer with negative categoryId", + "time": 1474189053598, + "name": "remove reviewer with user token", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": -1\n}", - "folder": "f51d9a83-9d4a-fa4d-a3a8-08c9a94a35b5" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", + "folder": "f11d599f-4472-bcef-b9e3-7c86ac139e35" }, { - "id": "32fd36b2-7397-5e93-8b6c-755557c77586", - "headers": "Content-Type: application/json\n", - "url": "{{url}}/admin/reviewers", + "id": "34ac4817-1082-2274-ed98-f17b63e62786", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, "method": "POST", @@ -721,17 +662,17 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474187888883, - "name": "create reviewer without Authorization header", + "time": 1474179249694, + "name": "create copilot with invalid isStudioCopilot", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", - "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" + "rawModeData": "{\n \"username\": \"notexist\",\n \"isStudioCopilot\": \"invalid boolean\",\n \"isSoftwareCopilot\":true\n}", + "folder": "8052cbf5-e206-af03-0392-e853f3f06bf4" }, { - "id": "3347ecb1-015e-bd23-20ea-1e5c1bacf1ec", - "headers": "Authorization: Bearer {{userToken}}\nContent-Type: application/json\n", + "id": "34b27e13-3b96-0a9e-25e6-8a339c517518", + "headers": "Authorization: wrong\nContent-Type: application/json\n", "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, @@ -741,18 +682,18 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474177106806, - "name": "remove copilot with user token", + "time": 1474177113168, + "name": "remove copilot without Bearer header", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "dcec6b34-9127-b6df-bbd9-da6c35c739f8" + "folder": "2afb4105-1932-6ef0-866c-43ecb13c0048" }, { - "id": "35dea5ec-b89c-fe4f-9a74-4ed2637c3501", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/admins", + "id": "357caf52-98e8-90a9-8d13-1bf8d330915e", + "headers": "Content-Type: application/json\n", + "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, "method": "DELETE", @@ -761,38 +702,38 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474173290943, - "name": "remove admin without username", + "time": 1474177110084, + "name": "remove copilot without Authorization header", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{}", - "folder": "4ff79efc-3da3-8c10-cbf9-8a883260cc55" + "rawModeData": "{\n \"username\": \"dok_tester\"\n}", + "folder": "2afb4105-1932-6ef0-866c-43ecb13c0048" }, { - "id": "37345c71-a682-1d40-ff87-7739450f0904", + "id": "37b02c2b-7018-6af5-4e3c-57b2abde2b0e", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, - "method": "POST", + "method": "DELETE", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474268192451, - "name": "create reviewer with invalid immune", + "time": 1474189145913, + "name": "remove reviewer with negative categoryId", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"Yoshi\",\n \"categoryId\": 14,\n \"immune\": \"invalid boolean\"\n}", - "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": -1\n}", + "folder": "f11d599f-4472-bcef-b9e3-7c86ac139e35" }, { - "id": "38247541-c9f7-206a-f77a-2cdbd47c3968", + "id": "3a87b2a7-3761-5089-38d9-6c7d3796e984", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers", + "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, "method": "POST", @@ -801,143 +742,136 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474282659872, - "name": "create reviewer with not exist username", + "time": 1474272371352, + "name": "create copilot with admin token", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"notexist\",\n \"categoryId\": 14\n}", - "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isSoftwareCopilot\": true,\n \"isStudioCopilot\":true\n}", + "folder": "8052cbf5-e206-af03-0392-e853f3f06bf4" }, { - "id": "39116742-fb19-f8ba-f177-1e1910b0dd50", - "headers": "Authorization: Bearer wrong\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers", + "id": "3f0e98fb-e97a-e6ed-8dc7-e864b1447e03", + "headers": "Content-Type: application/json\n", + "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, - "method": "POST", + "method": "DELETE", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474187897602, - "name": "create reviewer with wrong Bearer header", + "time": 1474173276705, + "name": "remove admin without Authorization header", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", - "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" + "rawModeData": "{\n \"username\": \"dok_tester\"\n}", + "folder": "78aeaf8b-80c8-40df-6ed6-2af5acdbf2ea" }, { - "id": "4063d0fe-dc7b-03fd-1958-219c5d10b788", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "id": "42fc7559-c2a2-8b85-67e3-3812ae0d5998", + "headers": "Authorization: Bearer {{userToken}}\nContent-Type: application/json\n", "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", + "method": "POST", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474177185914, - "name": "remove copilot with admin token", + "time": 1474177780363, + "name": "create copilot with user token", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "dcec6b34-9127-b6df-bbd9-da6c35c739f8" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isSoftwareCopilot\": true,\n \"isStudioCopilot\":true\n}", + "folder": "8052cbf5-e206-af03-0392-e853f3f06bf4" }, { - "id": "4547a259-b0cf-c5e6-8d04-035b9ae443ce", - "headers": "Authorization: Bearer {{adminToken}}\n", - "url": "{{url}}/admin/reviewers?categoryId=1.1", + "id": "43dbe6f5-32e5-f0f0-5735-42a3a9f08120", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, - "method": "GET", - "data": null, - "dataMode": "params", + "method": "POST", + "data": [], + "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474188155542, - "name": "get all reviewers with non-integer categoryId", + "time": 1474173399023, + "name": "create admin with not exist username", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "folder": "790ca3b9-d88f-04e9-b65d-fd59442f3394" + "rawModeData": "{\n \"username\": \"notexist\"\n}", + "folder": "142d5b1b-b304-bced-c1f3-b59e8187d2aa" }, { - "id": "46fea4dc-9708-763b-c0cc-713ac9c1a9eb", - "headers": "Authorization: Bearer {{authToken}}\n", - "headerData": [ - { - "key": "Authorization", - "value": "Bearer {{authToken}}", - "description": "", - "enabled": true - } - ], - "url": "{{url}}/develop/challenges/checkpoint/2220005", - "queryParams": [], + "id": "477195d0-14ca-6a6e-274f-513e7d50a45c", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, - "pathVariableData": [], - "method": "GET", - "data": null, - "dataMode": "params", + "method": "POST", + "data": [], + "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1497550755372, - "name": "New logic, access denied", + "time": 1474179290066, + "name": "create copilot with isStudioCopilot/isSoftwareCopilot false", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", - "responses": [] + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "responses": [], + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isStudioCopilot\": false,\n \"isSoftwareCopilot\":false\n}", + "folder": "8052cbf5-e206-af03-0392-e853f3f06bf4" }, { - "id": "497b04d4-c729-3008-107e-b69aead7e3db", + "id": "49557532-d98e-55e3-5cc4-4c702b62e3ed", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/copilots", + "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, - "method": "POST", + "method": "DELETE", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474189226479, - "name": "create copilot without isSoftwareCopilot", + "time": 1474266891365, + "name": "remove reviewer with admin token", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isStudioCopilot\":true\n}", - "folder": "1438537c-a455-8206-0b64-bcb6e98cb447" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", + "folder": "f11d599f-4472-bcef-b9e3-7c86ac139e35" }, { - "id": "4b62272c-8167-0310-930a-d5f0526c52a8", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/admins", + "id": "49952d3d-864a-25ff-3648-abbb79550dc2", + "headers": "Authorization: Bearer wrong\nContent-Type: application/json\n", + "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, - "method": "POST", + "method": "DELETE", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474173399023, - "name": "create admin with not exist username", + "time": 1474177116518, + "name": "remove copilot with wrong Bearer header", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"notexist\"\n}", - "folder": "305f84dd-24a3-cbe7-97f1-7063b14a5f42" + "rawModeData": "{\n \"username\": \"dok_tester\"\n}", + "folder": "2afb4105-1932-6ef0-866c-43ecb13c0048" }, { - "id": "4c54c5ab-5d8b-a873-49b0-0f3d63d6b42f", + "id": "49c5d6f4-5b86-3e9f-8c82-ef7430411264", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", "url": "{{url}}/admin/copilots", "preRequestScript": null, @@ -948,55 +882,57 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474178883094, - "name": "create copilot without username", + "time": 1474179169639, + "name": "create copilot with empty username", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{}", - "folder": "1438537c-a455-8206-0b64-bcb6e98cb447" + "rawModeData": "{\n \"username\": \" \",\n \"isSoftwareCopilot\": true,\n \"isStudioCopilot\":true\n}", + "folder": "8052cbf5-e206-af03-0392-e853f3f06bf4" }, { - "id": "4f247a99-8f61-47ea-3323-68ec5a7e7000", - "headers": "Authorization: Bearer {{adminToken}}\n", - "url": "{{url}}/admin/reviewers?categoryId=wrong", + "id": "4a6e3f4b-cb9e-978d-281f-81a57545b0ac", + "headers": "Authorization: Bearer {{userToken}}\nContent-Type: application/json\n", + "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, - "method": "GET", - "data": null, - "dataMode": "params", + "method": "POST", + "data": [], + "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474184004438, - "name": "get all reviewers with invalid categoryId", + "time": 1474187884890, + "name": "create reviewer with user token", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "folder": "790ca3b9-d88f-04e9-b65d-fd59442f3394" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", + "folder": "7544e9b2-c615-4376-7145-511bb968c906" }, { - "id": "52edc048-18d6-ce4d-5312-69286ce2e2f9", - "headers": "Authorization: Bearer {{adminToken}}\n", + "id": "4b8d4933-247c-d204-23c6-3acd8ec2e66a", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, - "method": "GET", - "data": null, - "dataMode": "params", + "method": "DELETE", + "data": [], + "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474189283486, - "name": "get all reviewers without categoryId", + "time": 1474189091821, + "name": "remove reviewer without username", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "folder": "790ca3b9-d88f-04e9-b65d-fd59442f3394" + "rawModeData": "{}", + "folder": "f11d599f-4472-bcef-b9e3-7c86ac139e35" }, { - "id": "597e4417-c496-e48d-801c-5504e9201d18", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "id": "518db876-c166-6aa7-d484-b8b778297b4e", + "headers": "Content-Type: application/json\n", "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, @@ -1006,18 +942,18 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474272371352, - "name": "create copilot with admin token", + "time": 1474178853689, + "name": "create copilot without Authorization header", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isSoftwareCopilot\": true,\n \"isStudioCopilot\":true\n}", - "folder": "1438537c-a455-8206-0b64-bcb6e98cb447" + "folder": "8052cbf5-e206-af03-0392-e853f3f06bf4" }, { - "id": "5cf9ac97-40c2-128f-a531-982ec0dc1247", + "id": "538a99a4-4701-1ee0-527c-6d2db316dae6", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers", + "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, "method": "DELETE", @@ -1026,56 +962,56 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474282495801, - "name": "remove reviewer with not exist username", + "time": 1474177126290, + "name": "remove copilot with empty username", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"notexist\",\n \"categoryId\": 14\n}", - "folder": "f51d9a83-9d4a-fa4d-a3a8-08c9a94a35b5" + "rawModeData": "{\n \"username\": \" \"\n}", + "folder": "2afb4105-1932-6ef0-866c-43ecb13c0048" }, { - "id": "5ebd6774-7f4f-df1a-86e7-f81966773ba8", + "id": "59d2ab3f-1ef2-3925-42c4-754eced98658", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers?categoryId=14", + "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", + "method": "POST", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474273020582, - "name": "remove reviewer with categoryId in query", + "time": 1474169674465, + "name": "create admin with empty username", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "f51d9a83-9d4a-fa4d-a3a8-08c9a94a35b5" + "rawModeData": "{\n \"username\": \" \"\n}", + "folder": "142d5b1b-b304-bced-c1f3-b59e8187d2aa" }, { - "id": "5eee889a-83e0-96da-a476-ffd50ad66960", + "id": "600d723c-706d-42ca-9ecc-94a32e280063", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers", + "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, - "method": "POST", + "method": "DELETE", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474188017748, - "name": "create reviewer with invalid categoryId", + "time": 1474173326368, + "name": "remove admin without empty username", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": \"wrong number\"\n}", - "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" + "rawModeData": "{\n \"username\": \" \"\n}", + "folder": "78aeaf8b-80c8-40df-6ed6-2af5acdbf2ea" }, { - "id": "5fcaab29-db1b-2b79-e6a0-ee0f19f60f58", + "id": "636f8c2c-7cc2-4d90-179e-7808ae8bbba1", "headers": "Content-Type: application/json\n", "url": "{{url}}/admin/reviewers", "preRequestScript": null, @@ -1089,63 +1025,54 @@ "time": 1474189062608, "name": "remove reviewer without Authorization header", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", - "folder": "f51d9a83-9d4a-fa4d-a3a8-08c9a94a35b5" - }, - { - "id": "60330c29-7ed3-b453-8d01-652084ca19b1", - "headers": "Authorization: Bearer {{authToken}}\n", - "headerData": [ - { - "key": "Authorization", - "value": "Bearer {{authToken}}", - "description": "", - "enabled": true - } - ], - "url": "{{url}}/develop/challenges/checkpoint/2220004", - "queryParams": [], + "folder": "f11d599f-4472-bcef-b9e3-7c86ac139e35" + }, + { + "id": "6727946e-aa76-0996-e734-800bb07cf5c6", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, - "pathVariableData": [], - "method": "GET", - "data": null, - "dataMode": "params", + "method": "POST", + "data": [], + "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1497550705028, - "name": "New logic, access allowed", + "time": 1474189246551, + "name": "create copilot without isStudioCopilot", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", - "responses": [] + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "responses": [], + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isSoftwareCopilot\": true\n}", + "folder": "8052cbf5-e206-af03-0392-e853f3f06bf4" }, { - "id": "6116bd27-1dd4-0d0e-938b-26e50c622b75", - "headers": "Authorization: Bearer wrong\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers", + "id": "67db2b5a-4b85-4e18-2709-5c475849329f", + "headers": "Authorization: Bearer {{adminToken}}\n", + "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", - "data": [], - "dataMode": "raw", + "method": "GET", + "data": null, + "dataMode": "params", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474189083334, - "name": "remove reviewer with wrong Bearer header", + "time": 1474176736874, + "name": "get all copilots with admin token", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", - "folder": "f51d9a83-9d4a-fa4d-a3a8-08c9a94a35b5" + "folder": "1a80812c-dfa2-5dc4-aca7-299502bbc807" }, { - "id": "617c7aa5-6a13-7f08-3621-050d7bb9fb42", - "headers": "Authorization: Bearer {{userToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers", + "id": "68d189c2-eb05-ded4-1e97-414ebde03ab8", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, "method": "POST", @@ -1154,57 +1081,58 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474187884890, - "name": "create reviewer with user token", + "time": 1474179220315, + "name": "create copilot with invalid isSoftwareCopilot", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", - "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" + "rawModeData": "{\n \"username\": \"notexist\",\n \"isSoftwareCopilot\": \"invalid boolean\",\n \"isStudioCopilot\":true\n}", + "folder": "8052cbf5-e206-af03-0392-e853f3f06bf4" }, { - "id": "61f8c960-54fd-f1b3-0cc3-8ac89de6361a", + "id": "6fcaeb1e-8611-9adf-319f-92f61ac2d62d", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers", + "url": "{{url}}/admin/reviewers?categoryId=14", "preRequestScript": null, "pathVariables": {}, - "method": "POST", + "method": "DELETE", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474282763352, - "name": "create reviewer with code category id", + "time": 1474284520276, + "name": "remove reviewer with categoryId in query and body at same time", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"Hung\",\n \"categoryId\": 39\n}", - "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\":7\n}", + "folder": "f11d599f-4472-bcef-b9e3-7c86ac139e35" }, { - "id": "62a5e348-741b-fd42-ed58-839def26d4bf", - "headers": "", - "url": "{{url}}/admin/copilots", + "id": "6fd784f5-bda9-b183-1d85-c30879a47427", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, - "method": "GET", - "data": null, - "dataMode": "params", + "method": "DELETE", + "data": [], + "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474176772030, - "name": "get all copilots without Authorization header", + "time": 1474189135829, + "name": "remove reviewer with invalid categoryId", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "folder": "2c775e97-29a3-c27d-abb5-e5dc6a5e05d9" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": \"wrong number\"\n}", + "folder": "f11d599f-4472-bcef-b9e3-7c86ac139e35" }, { - "id": "676c46be-e1bf-ba14-d357-1ca01119054b", + "id": "790064a6-e429-1f9c-24b5-7112ce1fb8b2", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/copilots", + "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, "method": "POST", @@ -1213,37 +1141,37 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474189246551, - "name": "create copilot without isStudioCopilot", + "time": 1474283473763, + "name": "create reviewer with immune", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isSoftwareCopilot\": true\n}", - "folder": "1438537c-a455-8206-0b64-bcb6e98cb447" + "rawModeData": "{\n \"username\": \"Yoshi\",\n \"categoryId\": 14,\n \"immune\":1\n}", + "folder": "7544e9b2-c615-4376-7145-511bb968c906" }, { - "id": "6a8ef947-840a-bf33-c225-be351341f914", + "id": "79444594-2c40-1e6e-9f71-f22d57828026", "headers": "Authorization: Bearer wrong\nContent-Type: application/json\n", "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", + "method": "POST", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474177116518, - "name": "remove copilot with wrong Bearer header", + "time": 1474178865110, + "name": "create copilot with wrong Bearer header", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "dcec6b34-9127-b6df-bbd9-da6c35c739f8" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isSoftwareCopilot\": true,\n \"isStudioCopilot\":true\n}", + "folder": "8052cbf5-e206-af03-0392-e853f3f06bf4" }, { - "id": "6ab91574-6c11-9d54-a6a3-a87304bec08b", - "headers": "Authorization: Bearer {{adminToken}}\n", + "id": "828d7e47-ee45-5ed2-fe37-2114815e84f1", + "headers": "Authorization: Bearer wrong\n", "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, @@ -1253,17 +1181,17 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474173887249, - "name": "get all admins with admin token", + "time": 1474174234342, + "name": "get all admins with wrong Bearer header", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "folder": "43eec092-7864-262f-fe9d-a2a416e1a2d8" + "folder": "2964b89d-893b-aada-2e0e-c4136b920508" }, { - "id": "6fc730e8-851c-c0c0-4dbf-79a9fc7c67e1", - "headers": "Authorization: Bearer wrong\nContent-Type: application/json\n", - "url": "{{url}}/admin/copilots", + "id": "84cd43c0-c407-365b-f1f4-07929e2876cc", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, "method": "POST", @@ -1272,17 +1200,17 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474178865110, - "name": "create copilot with wrong Bearer header", + "time": 1474188081763, + "name": "create reviewer with non-integer categoryId", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isSoftwareCopilot\": true,\n \"isStudioCopilot\":true\n}", - "folder": "1438537c-a455-8206-0b64-bcb6e98cb447" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 1.1\n}", + "folder": "7544e9b2-c615-4376-7145-511bb968c906" }, { - "id": "73994f91-2d50-2d6b-f808-5c8b5063d046", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "id": "85022108-999a-7200-89cd-e6b11f66bcb8", + "headers": "Authorization: Bearer {{userToken}}\nContent-Type: application/json\n", "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, @@ -1292,45 +1220,17 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474177126290, - "name": "remove copilot with empty username", + "time": 1474177106806, + "name": "remove copilot with user token", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \" \"\n}", - "folder": "dcec6b34-9127-b6df-bbd9-da6c35c739f8" - }, - { - "id": "76441abd-9a70-5fe9-93e1-59dd0318384f", - "headers": "Authorization: Bearer {{authToken}}\n", - "headerData": [ - { - "key": "Authorization", - "value": "Bearer {{authToken}}", - "description": "", - "enabled": true - } - ], - "url": "{{url}}/develop/challenges/checkpoint/2220003", - "queryParams": [], - "preRequestScript": null, - "pathVariables": {}, - "pathVariableData": [], - "method": "GET", - "data": null, - "dataMode": "params", - "tests": null, - "currentHelper": "normal", - "helperAttributes": {}, - "time": 1497550652259, - "name": "Old logic, access denied", - "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", - "responses": [] + "rawModeData": "{\n \"username\": \"dok_tester\"\n}", + "folder": "2afb4105-1932-6ef0-866c-43ecb13c0048" }, { - "id": "7667b82b-d891-3959-4469-2b6e3673ed03", - "headers": "Content-Type: application/json\n", + "id": "858050d9-d3f2-900f-79a8-4a56c7ca586b", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, @@ -1340,17 +1240,17 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474178853689, - "name": "create copilot without Authorization header", + "time": 1474179176872, + "name": "create copilot with not exist username", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isSoftwareCopilot\": true,\n \"isStudioCopilot\":true\n}", - "folder": "1438537c-a455-8206-0b64-bcb6e98cb447" + "rawModeData": "{\n \"username\": \"notexist\",\n \"isSoftwareCopilot\": true,\n \"isStudioCopilot\":true\n}", + "folder": "8052cbf5-e206-af03-0392-e853f3f06bf4" }, { - "id": "789c4564-2cb5-a4da-04f4-0d3a432950dd", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "id": "8679c69e-e94d-7188-60fd-bbe506b851d1", + "headers": "Authorization: Bearer wrong\nContent-Type: application/json\n", "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, @@ -1360,18 +1260,18 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474282655617, - "name": "create reviewer with empty username", + "time": 1474187897602, + "name": "create reviewer with wrong Bearer header", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \" \",\n \"categoryId\": 14\n}", - "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", + "folder": "7544e9b2-c615-4376-7145-511bb968c906" }, { - "id": "7b7bc600-f9a9-e566-ccd3-4bff678d50da", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers", + "id": "88ae8323-4232-1675-8796-e06c6997f3f9", + "headers": "Authorization: Bearer wrong\nContent-Type: application/json\n", + "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, "method": "POST", @@ -1380,36 +1280,35 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474283473763, - "name": "create reviewer with immune", + "time": 1474168987848, + "name": "create admin with wrong Bearer header", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"Yoshi\",\n \"categoryId\": 14,\n \"immune\":1\n}", - "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" + "rawModeData": "{\n \"username\": \"dok_tester\"\n}", + "folder": "142d5b1b-b304-bced-c1f3-b59e8187d2aa" }, { - "id": "7d7675c4-0334-9a22-beab-485f817fbbce", - "headers": "Authorization: wrong\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers", + "id": "897d4baa-72d5-1eca-ff61-51db0d14408c", + "headers": "Authorization: Bearer wrong\n", + "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", - "data": [], - "dataMode": "raw", + "method": "GET", + "data": null, + "dataMode": "params", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474189071606, - "name": "remove reviewer without Bearer header", + "time": 1474176766163, + "name": "get all copilots with wrong Bearer header", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", - "folder": "f51d9a83-9d4a-fa4d-a3a8-08c9a94a35b5" + "folder": "1a80812c-dfa2-5dc4-aca7-299502bbc807" }, { - "id": "8b52ad5d-31a4-8a84-4d24-ceb91021a467", + "id": "8a43eff3-3f9a-83a2-6734-a683e29252c8", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", "url": "{{url}}/admin/reviewers", "preRequestScript": null, @@ -1420,69 +1319,38 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474282760160, - "name": "create reviewer with studio type", + "time": 1474189200056, + "name": "create reviewer without categoryId", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"cartajs\",\n \"categoryId\": 17\n}", - "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" + "rawModeData": "{\n \"username\": \"dok_tester\"\n}", + "folder": "7544e9b2-c615-4376-7145-511bb968c906" }, { - "id": "8bb4421e-098b-3ae7-59b7-869927cf659e", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers", + "id": "8b843cb6-1fc6-8c0b-1d6d-f54d9470cf76", + "headers": "Authorization: wrong\nContent-Type: application/json\n", + "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", + "method": "POST", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474189177783, - "name": "remove reviewer without categoryId", + "time": 1474168982704, + "name": "create admin without Bearer header", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "f51d9a83-9d4a-fa4d-a3a8-08c9a94a35b5" - }, - { - "id": "8db48405-6ba0-f116-06c6-cc34cffd77c1", - "headers": "Authorization: Bearer {{authToken}}\n", - "headerData": [ - { - "key": "Authorization", - "value": "Bearer {{authToken}}", - "description": "", - "enabled": true - } - ], - "url": "{{url}}/develop/challenges/checkpoint/2220001", - "queryParams": [], - "pathVariables": {}, - "pathVariableData": [], - "preRequestScript": null, - "method": "GET", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", - "data": null, - "dataMode": "params", - "name": "No groups (challenge is not private)", - "description": "", - "descriptionFormat": "html", - "time": 1497550504090, - "version": 2, - "responses": [], - "tests": null, - "currentHelper": "normal", - "helperAttributes": {}, - "folder": "498ee2d2-174c-7049-3cc4-43b4e330083b" + "folder": "142d5b1b-b304-bced-c1f3-b59e8187d2aa" }, { - "id": "9308798f-cbfd-b44c-1d47-6ef6650424f0", - "headers": "Authorization: Bearer {{adminToken}}\n", - "url": "{{url}}/admin/reviewers?categoryId=-4", + "id": "8bd1727c-34f8-ced7-eb92-d50cc6e56772", + "headers": "", + "url": "{{url}}/admin/reviewers?categoryId=7", "preRequestScript": null, "pathVariables": {}, "method": "GET", @@ -1491,57 +1359,57 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474184022183, - "name": "get all reviewers with negative categoryId", + "time": 1474282217351, + "name": "get all reviewers without Authorization header", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "folder": "790ca3b9-d88f-04e9-b65d-fd59442f3394" + "folder": "81516934-d74e-f97d-262f-21d87d5961d1" }, { - "id": "972a47ef-1768-7d9b-f12c-df8c57cb5bf5", - "headers": "Authorization: Bearer {{userToken}}\nContent-Type: application/json\n", + "id": "9bccd2a2-8aac-1931-b78e-8b61a99415a4", + "headers": "Content-Type: application/json\n", "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", + "method": "POST", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474173280471, - "name": "remove admin with user token", + "time": 1474168977872, + "name": "create admin without Authorization header", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "4ff79efc-3da3-8c10-cbf9-8a883260cc55" + "folder": "142d5b1b-b304-bced-c1f3-b59e8187d2aa" }, { - "id": "983e7dd1-673c-a1a9-81e9-4e81ff0ec74b", + "id": "9e458d5b-5aa5-05ec-6240-7d171c75cf5e", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/admins", + "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", + "method": "POST", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474173326368, - "name": "remove admin without empty username", + "time": 1474282760160, + "name": "create reviewer with studio type", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \" \"\n}", - "folder": "4ff79efc-3da3-8c10-cbf9-8a883260cc55" + "rawModeData": "{\n \"username\": \"cartajs\",\n \"categoryId\": 17\n}", + "folder": "7544e9b2-c615-4376-7145-511bb968c906" }, { - "id": "9ddc746e-591c-69e7-2326-a05aa52f7109", - "headers": "Content-Type: application/json\n", - "url": "{{url}}/admin/admins", + "id": "9fb05ea1-f85e-209e-7619-e40450acd7f3", + "headers": "Authorization: wrong\nContent-Type: application/json\n", + "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, "method": "POST", @@ -1550,36 +1418,36 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474168977872, - "name": "create admin without Authorization header", + "time": 1474178858906, + "name": "create copilot without Bearer header", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "305f84dd-24a3-cbe7-97f1-7063b14a5f42" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isSoftwareCopilot\": true,\n \"isStudioCopilot\":true\n}", + "folder": "8052cbf5-e206-af03-0392-e853f3f06bf4" }, { - "id": "a183318a-b246-f372-1b0e-2ff1ad2395c0", + "id": "9ff114f0-56ca-f56c-08e4-3bb4dcaac10f", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers", + "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", + "method": "POST", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474266891365, - "name": "remove reviewer with admin token", + "time": 1474189226479, + "name": "create copilot without isSoftwareCopilot", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", - "folder": "f51d9a83-9d4a-fa4d-a3a8-08c9a94a35b5" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isStudioCopilot\":true\n}", + "folder": "8052cbf5-e206-af03-0392-e853f3f06bf4" }, { - "id": "a407a482-48ea-5561-9158-71259c3e8a3b", + "id": "a466f2b7-2f9c-4a14-fc0e-eee7981cdb42", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", "url": "{{url}}/admin/reviewers", "preRequestScript": null, @@ -1590,17 +1458,57 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474188081763, - "name": "create reviewer with non-integer categoryId", + "time": 1474282767080, + "name": "create reviewer with f2f category id", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 1.1\n}", - "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" + "rawModeData": "{\n \"username\": \"liquid_user\",\n \"categoryId\": 38\n}", + "folder": "7544e9b2-c615-4376-7145-511bb968c906" }, { - "id": "a6001143-99ca-b1ab-a1c9-58c3dc8b6fe0", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "id": "a47c9a54-d12a-6801-02a1-c57c420237cf", + "headers": "", + "url": "{{url}}/admin/copilots", + "preRequestScript": null, + "pathVariables": {}, + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1474176772030, + "name": "get all copilots without Authorization header", + "description": "", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "responses": [], + "folder": "1a80812c-dfa2-5dc4-aca7-299502bbc807" + }, + { + "id": "a495567b-a450-037f-ca8e-c9da52116890", + "headers": "Content-Type: application/json\n", + "url": "{{url}}/auth", + "preRequestScript": null, + "pathVariables": {}, + "method": "POST", + "data": [], + "dataMode": "raw", + "version": 2, + "tests": "var authResponse = JSON.parse(responseBody);\npostman.setEnvironmentVariable(\"authToken\", authResponse.token);\ntests[\"Status code is 200\"] = responseCode.code === 200;\nvar jsonData = JSON.parse(responseBody);\ntests[\"A valid token is returned\"] = !!jsonData.token;", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1474159245944, + "name": "Log in as ordinary user", + "description": "", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", + "responses": [], + "rawModeData": "{\n \"username\": \"user\", \n \"password\": \"password\"\n}", + "folder": "fedff379-68f7-3322-d2e9-29471d82cc60" + }, + { + "id": "a887c7eb-8b15-90aa-07ef-6d998297bcee", + "headers": "Authorization: wrong\nContent-Type: application/json\n", "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, @@ -1610,17 +1518,17 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474282491538, - "name": "remove reviewer with empty username", + "time": 1474189071606, + "name": "remove reviewer without Bearer header", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \" \",\n \"categoryId\": 14\n}", - "folder": "f51d9a83-9d4a-fa4d-a3a8-08c9a94a35b5" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", + "folder": "f11d599f-4472-bcef-b9e3-7c86ac139e35" }, { - "id": "b557e83b-d42a-a7b8-8a9c-8fa2270188b1", - "headers": "Authorization: wrong\nContent-Type: application/json\n", + "id": "a8e7c6c2-1cfb-e3ad-af5c-9c27bd71924b", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, @@ -1630,57 +1538,58 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474187893955, - "name": "create reviewer without Bearer header", + "time": 1474282655617, + "name": "create reviewer with empty username", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", - "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" + "rawModeData": "{\n \"username\": \" \",\n \"categoryId\": 14\n}", + "folder": "7544e9b2-c615-4376-7145-511bb968c906" }, { - "id": "b5f484a7-b5e9-e763-97fb-5d750d08cd6d", - "headers": "Authorization: wrong\n", - "url": "{{url}}/admin/admins", + "id": "ac18e672-1e47-37fa-1ae8-85eed1beab2d", + "headers": "Content-Type: application/json\n", + "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, - "method": "GET", - "data": null, - "dataMode": "params", + "method": "POST", + "data": [], + "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474174209799, - "name": "get all admins without Bearer header", + "time": 1474187888883, + "name": "create reviewer without Authorization header", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "folder": "43eec092-7864-262f-fe9d-a2a416e1a2d8" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", + "folder": "7544e9b2-c615-4376-7145-511bb968c906" }, { - "id": "b762147c-aae5-9630-dfe7-d6468a8a3843", + "id": "ad152575-1e23-f242-96d2-f4b49a616c56", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/admins", + "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, - "method": "POST", + "method": "DELETE", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474169000065, - "name": "create admin without username", + "time": 1474177119734, + "name": "remove copilot without username", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], "rawModeData": "{}", - "folder": "305f84dd-24a3-cbe7-97f1-7063b14a5f42" + "folder": "2afb4105-1932-6ef0-866c-43ecb13c0048" }, { - "id": "c15dff6e-1a55-a875-3460-2d2097b2f960", - "headers": "Authorization: Bearer wrong\n", - "url": "{{url}}/admin/reviewers?categoryId=7", + "id": "b0bfa529-5f58-d5a6-e1bc-2099abfa253f", + "headers": "Authorization: Bearer {{adminToken}}\n", + "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, "method": "GET", @@ -1689,15 +1598,15 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474282226901, - "name": "get all reviewers with wrong Bearer header", + "time": 1474173887249, + "name": "get all admins with admin token", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "folder": "790ca3b9-d88f-04e9-b65d-fd59442f3394" + "folder": "2964b89d-893b-aada-2e0e-c4136b920508" }, { - "id": "c21ce35d-8558-ca77-c6af-8a6d930564b9", + "id": "b83cdcb1-5abe-0f73-1c9c-b558c0634baf", "headers": "Authorization: Bearer {{userToken}}\n", "url": "{{url}}/admin/admins", "preRequestScript": null, @@ -1711,93 +1620,91 @@ "time": 1474174015997, "name": "get all admins with user token", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "folder": "43eec092-7864-262f-fe9d-a2a416e1a2d8" + "folder": "2964b89d-893b-aada-2e0e-c4136b920508" }, { - "id": "c2e943b2-f53d-6788-26e6-ca35b5a5fec7", - "headers": "Content-Type: application/json\n", - "url": "{{url}}/admin/copilots", + "id": "b84bd2e1-cd0b-3489-3c11-917a1624249e", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "url": "{{url}}/admin/reviewers?categoryId=14", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", + "method": "POST", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474177110084, - "name": "remove copilot without Authorization header", + "time": 1474282455411, + "name": "create reviewer with categoryId in query", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "dcec6b34-9127-b6df-bbd9-da6c35c739f8" + "folder": "7544e9b2-c615-4376-7145-511bb968c906" }, { - "id": "c3dcb7b2-c57c-398e-62d8-170db419f168", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers", + "id": "b8d3fef6-214c-5032-3002-f6c16f3288e2", + "headers": "Authorization: Bearer wrong\nContent-Type: application/json\n", + "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, - "method": "POST", + "method": "DELETE", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474188046380, - "name": "create reviewer with nagative categoryId", + "time": 1474173287352, + "name": "remove admin with wrong Bearer header", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": -1\n}", - "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" + "rawModeData": "{\n \"username\": \"dok_tester\"\n}", + "folder": "78aeaf8b-80c8-40df-6ed6-2af5acdbf2ea" }, { - "id": "c42386fb-4880-273c-5f56-514a24108ffc", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers", + "id": "c0db4362-622a-b556-1991-80df568707b7", + "headers": "Authorization: Bearer {{adminToken}}\n", + "url": "{{url}}/admin/reviewers?categoryId=-4", "preRequestScript": null, "pathVariables": {}, - "method": "POST", - "data": [], - "dataMode": "raw", + "method": "GET", + "data": null, + "dataMode": "params", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474189200056, - "name": "create reviewer without categoryId", + "time": 1474184022183, + "name": "get all reviewers with negative categoryId", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" + "folder": "81516934-d74e-f97d-262f-21d87d5961d1" }, { - "id": "d01d666a-59bc-e7e9-2fc1-435a1b4cee89", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "id": "c1d0d1a9-a8b9-8ee7-c6e6-e539a52fbf35", + "headers": "Authorization: Bearer {{adminToken}}\n", "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", - "data": [], - "dataMode": "raw", + "method": "GET", + "data": null, + "dataMode": "params", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474189158880, - "name": "remove reviewer with non-integer categoryId", + "time": 1474189283486, + "name": "get all reviewers without categoryId", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 1.1\n}", - "folder": "f51d9a83-9d4a-fa4d-a3a8-08c9a94a35b5" + "folder": "81516934-d74e-f97d-262f-21d87d5961d1" }, { - "id": "d0457f1e-5957-b83c-f603-aaf45690e622", - "headers": "", + "id": "c28b4a81-8ee7-24ba-fc8b-54b1b3642fab", + "headers": "Authorization: Bearer {{userToken}}\n", "url": "{{url}}/admin/reviewers?categoryId=7", "preRequestScript": null, "pathVariables": {}, @@ -1807,17 +1714,17 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474282217351, - "name": "get all reviewers without Authorization header", + "time": 1474282212758, + "name": "get all reviewers with user token", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "folder": "790ca3b9-d88f-04e9-b65d-fd59442f3394" + "folder": "81516934-d74e-f97d-262f-21d87d5961d1" }, { - "id": "d0e8a5bc-f7c7-268b-5a66-37e90947dabc", + "id": "c3383672-4018-ec1b-2688-515b73987d36", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/copilots", + "url": "{{url}}/admin/reviewers?categoryId=14", "preRequestScript": null, "pathVariables": {}, "method": "DELETE", @@ -1826,77 +1733,58 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474177129491, - "name": "remove copilot with not exist username", + "time": 1474273020582, + "name": "remove reviewer with categoryId in query", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"notexist\"\n}", - "folder": "dcec6b34-9127-b6df-bbd9-da6c35c739f8" + "rawModeData": "{\n \"username\": \"dok_tester\"\n}", + "folder": "f11d599f-4472-bcef-b9e3-7c86ac139e35" }, { - "id": "d7913d8d-6c66-b1cd-62d5-c40393c22661", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/copilots", + "id": "c8075e84-bb8d-7596-ba92-5990705f93bc", + "headers": "Authorization: wrong\nContent-Type: application/json\n", + "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, - "method": "POST", + "method": "DELETE", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474179169639, - "name": "create copilot with empty username", + "time": 1474173283865, + "name": "remove admin without Bearer header", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \" \",\n \"isSoftwareCopilot\": true,\n \"isStudioCopilot\":true\n}", - "folder": "1438537c-a455-8206-0b64-bcb6e98cb447" + "rawModeData": "{\n \"username\": \"dok_tester\"\n}", + "folder": "78aeaf8b-80c8-40df-6ed6-2af5acdbf2ea" }, { - "id": "dcf543f4-41e0-0506-52a1-d9abc07132e2", + "id": "ccc25e86-5365-aaf6-8ce8-9838898142eb", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, - "method": "POST", + "method": "DELETE", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474179220315, - "name": "create copilot with invalid isSoftwareCopilot", - "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", - "responses": [], - "rawModeData": "{\n \"username\": \"notexist\",\n \"isSoftwareCopilot\": \"invalid boolean\",\n \"isStudioCopilot\":true\n}", - "folder": "1438537c-a455-8206-0b64-bcb6e98cb447" - }, - { - "id": "e1dd94fd-2dea-4082-61f8-a551fcf1d55f", - "headers": "Authorization: Bearer wrong\n", - "url": "{{url}}/admin/copilots", - "preRequestScript": null, - "pathVariables": {}, - "method": "GET", - "data": null, - "dataMode": "params", - "tests": null, - "currentHelper": "normal", - "helperAttributes": {}, - "time": 1474176766163, - "name": "get all copilots with wrong Bearer header", + "time": 1474177185914, + "name": "remove copilot with admin token", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "folder": "2c775e97-29a3-c27d-abb5-e5dc6a5e05d9" + "rawModeData": "{\n \"username\": \"dok_tester\"\n}", + "folder": "2afb4105-1932-6ef0-866c-43ecb13c0048" }, { - "id": "e3c87489-0dac-48e0-869b-117743e7fb01", - "headers": "Authorization: Bearer {{userToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/copilots", + "id": "d0a6e94f-3c59-2398-f0f5-a1d54a6f4e15", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, "method": "POST", @@ -1905,57 +1793,57 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474177780363, - "name": "create copilot with user token", + "time": 1474282659872, + "name": "create reviewer with not exist username", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isSoftwareCopilot\": true,\n \"isStudioCopilot\":true\n}", - "folder": "1438537c-a455-8206-0b64-bcb6e98cb447" + "rawModeData": "{\n \"username\": \"notexist\",\n \"categoryId\": 14\n}", + "folder": "7544e9b2-c615-4376-7145-511bb968c906" }, { - "id": "e498adc6-5df6-ea02-491f-de46950eff67", - "headers": "Authorization: wrong\nContent-Type: application/json\n", + "id": "d2bf20ce-e0ed-a347-69dc-577e34dbefd0", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, - "method": "POST", + "method": "DELETE", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474168982704, - "name": "create admin without Bearer header", + "time": 1474173258538, + "name": "remove admin with admin token", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "305f84dd-24a3-cbe7-97f1-7063b14a5f42" + "folder": "78aeaf8b-80c8-40df-6ed6-2af5acdbf2ea" }, { - "id": "e5179ef5-cef4-a08b-9fbf-cd63b4a4066d", + "id": "da88d593-5117-3c1f-f56c-47ac74724c79", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/admins", + "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, - "method": "POST", + "method": "DELETE", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474169674465, - "name": "create admin with empty username", + "time": 1474282491538, + "name": "remove reviewer with empty username", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \" \"\n}", - "folder": "305f84dd-24a3-cbe7-97f1-7063b14a5f42" + "rawModeData": "{\n \"username\": \" \",\n \"categoryId\": 14\n}", + "folder": "f11d599f-4472-bcef-b9e3-7c86ac139e35" }, { - "id": "e61162b5-ccbd-79fc-7daa-ad1e9e71f8db", - "headers": "Authorization: Bearer {{userToken}}\n", + "id": "ddf839fa-733a-056a-8a2c-a1e56d0e9072", + "headers": "Authorization: Bearer wrong\n", "url": "{{url}}/admin/reviewers?categoryId=7", "preRequestScript": null, "pathVariables": {}, @@ -1965,77 +1853,56 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474282212758, - "name": "get all reviewers with user token", - "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", - "responses": [], - "folder": "790ca3b9-d88f-04e9-b65d-fd59442f3394" - }, - { - "id": "e766e9a8-dd56-26b0-5fa7-2e7e876001d7", - "headers": "Authorization: Bearer wrong\nContent-Type: application/json\n", - "url": "{{url}}/admin/admins", - "preRequestScript": null, - "pathVariables": {}, - "method": "DELETE", - "data": [], - "dataMode": "raw", - "tests": null, - "currentHelper": "normal", - "helperAttributes": {}, - "time": 1474173287352, - "name": "remove admin with wrong Bearer header", + "time": 1474282226901, + "name": "get all reviewers with wrong Bearer header", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "4ff79efc-3da3-8c10-cbf9-8a883260cc55" + "folder": "81516934-d74e-f97d-262f-21d87d5961d1" }, { - "id": "e8a850e5-31bf-6c13-0e44-bc4583bca2cb", - "headers": "Authorization: wrong\nContent-Type: application/json\n", - "url": "{{url}}/admin/admins", + "id": "e058d344-3c5d-951a-c86e-ebfeba41bab8", + "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "url": "{{url}}/admin/copilots", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", + "method": "POST", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474173283865, - "name": "remove admin without Bearer header", + "time": 1474179507223, + "name": "create copilot with isStudioCopilot false", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "4ff79efc-3da3-8c10-cbf9-8a883260cc55" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isSoftwareCopilot\": 1,\n \"isStudioCopilot\":0\n}", + "folder": "8052cbf5-e206-af03-0392-e853f3f06bf4" }, { - "id": "eb8f368e-9c8e-47b7-c70d-1cf7ac89c02c", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", + "id": "e10c59ae-1669-54bd-03bb-4de19d51fb5e", + "headers": "Authorization: wrong\n", "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", - "data": [], - "dataMode": "raw", + "method": "GET", + "data": null, + "dataMode": "params", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474173533574, - "name": "remove admin with notexist username", + "time": 1474174209799, + "name": "get all admins without Bearer header", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"notexist\"\n}", - "folder": "4ff79efc-3da3-8c10-cbf9-8a883260cc55" + "folder": "2964b89d-893b-aada-2e0e-c4136b920508" }, { - "id": "eeabcbce-4ca9-88ce-ec1a-93e0729bad11", - "headers": "Authorization: wrong\nContent-Type: application/json\n", - "url": "{{url}}/admin/copilots", + "id": "e6b6464b-da41-67ee-c2ca-53b1d5ba417d", + "headers": "Authorization: Bearer wrong\nContent-Type: application/json\n", + "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, "method": "DELETE", @@ -2044,18 +1911,18 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474177113168, - "name": "remove copilot without Bearer header", + "time": 1474189083334, + "name": "remove reviewer with wrong Bearer header", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\"\n}", - "folder": "dcec6b34-9127-b6df-bbd9-da6c35c739f8" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", + "folder": "f11d599f-4472-bcef-b9e3-7c86ac139e35" }, { - "id": "f6e293f3-5650-d73b-36e8-97d587604a4b", + "id": "ebcf31ae-035b-49ac-41d4-fa4484eff6a1", "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/copilots", + "url": "{{url}}/admin/reviewers", "preRequestScript": null, "pathVariables": {}, "method": "POST", @@ -2064,18 +1931,18 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474179290066, - "name": "create copilot with isStudioCopilot/isSoftwareCopilot false", + "time": 1474187872946, + "name": "create reviewer with admin token", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"isStudioCopilot\": false,\n \"isSoftwareCopilot\":false\n}", - "folder": "1438537c-a455-8206-0b64-bcb6e98cb447" + "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", + "folder": "7544e9b2-c615-4376-7145-511bb968c906" }, { - "id": "f88f1d64-7461-652d-f3fb-6c48fa553e61", + "id": "ef7fd1f5-a302-b7b6-a772-a43eb3b82062", "headers": "Authorization: Bearer {{adminToken}}\n", - "url": "{{url}}/admin/reviewers?categoryId=7", + "url": "{{url}}/admin/reviewers?categoryId=wrong", "preRequestScript": null, "pathVariables": {}, "method": "GET", @@ -2084,76 +1951,75 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474268286128, - "name": "get all reviewers with admin token", + "time": 1474184004438, + "name": "get all reviewers with invalid categoryId", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "folder": "790ca3b9-d88f-04e9-b65d-fd59442f3394" + "folder": "81516934-d74e-f97d-262f-21d87d5961d1" }, { - "id": "f8efe766-a322-ee21-b4f5-78d78642af19", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers", + "id": "f6c44b3f-570d-e48f-3b7e-8419a9ebe9b6", + "headers": "Content-Type: application/json\n", + "url": "{{url}}/auth", "preRequestScript": null, "pathVariables": {}, "method": "POST", "data": [], "dataMode": "raw", - "tests": null, + "version": 2, + "tests": "var authResponse = JSON.parse(responseBody);\npostman.setEnvironmentVariable(\"authToken\", authResponse.token);\ntests[\"Status code is 200\"] = responseCode.code === 200;\nvar jsonData = JSON.parse(responseBody);\ntests[\"A valid token is returned\"] = !!jsonData.token;", "currentHelper": "normal", "helperAttributes": {}, - "time": 1474187901930, - "name": "create reviewer without username", + "time": 1474159263289, + "name": "Login as admin user", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{}", - "folder": "ff6b7b38-7532-5c03-26db-c68f88696eb9" + "rawModeData": "{\n \"username\": \"heffan\", \n \"password\": \"password\"\n}", + "folder": "fedff379-68f7-3322-d2e9-29471d82cc60" }, { - "id": "f901106d-47f8-080c-d56b-7badc5774481", - "headers": "Content-Type: application/json\n", - "url": "{{url}}/auth", + "id": "f784d0d8-8645-7633-91c6-54ec81aa95ff", + "headers": "Authorization: Bearer {{adminToken}}\n", + "url": "{{url}}/admin/reviewers?categoryId=1.1", "preRequestScript": null, "pathVariables": {}, - "method": "POST", - "data": [], - "dataMode": "raw", - "version": 2, - "tests": "var authResponse = JSON.parse(responseBody);\npostman.setEnvironmentVariable(\"authToken\", authResponse.token);\ntests[\"Status code is 200\"] = responseCode.code === 200;\nvar jsonData = JSON.parse(responseBody);\ntests[\"A valid token is returned\"] = !!jsonData.token;", + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474159245944, - "name": "Log in as ordinary user", + "time": 1474188155542, + "name": "get all reviewers with non-integer categoryId", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"user\", \n \"password\": \"password\"\n}", - "folder": "14f4dd06-76e0-ca22-602f-0ad3974aa4fa" + "folder": "81516934-d74e-f97d-262f-21d87d5961d1" }, { - "id": "f9a913ac-f3b4-3cba-ad0d-41265aa5904b", + "id": "fc7d7ac4-d1e1-a441-6717-ecb50b9ad7f6", "headers": "Authorization: Bearer {{userToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/reviewers", + "url": "{{url}}/admin/admins", "preRequestScript": null, "pathVariables": {}, - "method": "DELETE", + "method": "POST", "data": [], "dataMode": "raw", "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474189053598, - "name": "remove reviewer with user token", + "time": 1474172375481, + "name": "create admin with user token", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{\n \"username\": \"dok_tester\",\n \"categoryId\": 14\n}", - "folder": "f51d9a83-9d4a-fa4d-a3a8-08c9a94a35b5" + "rawModeData": "{\n \"username\": \"dok_tester\"\n}", + "folder": "142d5b1b-b304-bced-c1f3-b59e8187d2aa" }, { - "id": "fbdd77d2-d138-3a05-a543-d5302daeca50", + "id": "fe0a03f9-4969-651a-5eed-01de9398498e", "headers": "Authorization: wrong\n", "url": "{{url}}/admin/reviewers?categoryId=7", "preRequestScript": null, @@ -2167,29 +2033,9 @@ "time": 1474282221279, "name": "get all reviewers without Bearer header", "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", - "responses": [], - "folder": "790ca3b9-d88f-04e9-b65d-fd59442f3394" - }, - { - "id": "ff7618ed-fc54-1b81-6129-8df5ac4e67a9", - "headers": "Authorization: Bearer {{adminToken}}\nContent-Type: application/json\n", - "url": "{{url}}/admin/copilots", - "preRequestScript": null, - "pathVariables": {}, - "method": "DELETE", - "data": [], - "dataMode": "raw", - "tests": null, - "currentHelper": "normal", - "helperAttributes": {}, - "time": 1474177119734, - "name": "remove copilot without username", - "description": "", - "collectionId": "ec27457a-c67c-97cc-a855-d1b82e4f952a", + "collectionId": "b4745ce1-c766-7823-c9cf-fa73e6b9cb2b", "responses": [], - "rawModeData": "{}", - "folder": "dcec6b34-9127-b6df-bbd9-da6c35c739f8" + "folder": "81516934-d74e-f97d-262f-21d87d5961d1" } ] } \ No newline at end of file From 445be50b7aac2abe76aba1d404e09914299e9bb7 Mon Sep 17 00:00:00 2001 From: Vyacheslav V Sokolov Date: Fri, 16 Jun 2017 08:15:33 +0700 Subject: [PATCH 3/6] Fixed the case with a challenge that doesn't have eligibility --- actions/challenges.js | 20 +++++++++++++++----- db_scripts/test_eligibility.insert.sql | 1 - 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/actions/challenges.js b/actions/challenges.js index f47bbe7a6..3b17370ca 100755 --- a/actions/challenges.js +++ b/actions/challenges.js @@ -867,22 +867,32 @@ function validateChallenge(api, connection, dbConnectionMap, challengeId, isStud challengeId: challengeId, user_id: userId }; - api.dataAccess.executeQuery('get_challenge_accessibility_and_groups', sqlParams, dbConnectionMap, cb); + async.parallel({ + accessibility: function (cbx) { + api.dataAccess.executeQuery('get_challenge_accessibility_and_groups', sqlParams, dbConnectionMap, cbx); + }, + exists: function (cbx) { + api.dataAccess.executeQuery('check_challenge_exists', sqlParams, dbConnectionMap, cbx); + } + }, cb); }, function (res, cb) { - // If the record with this callengeId doesn't exist in contest_eligibility table + // If the record with this callengeId doesn't exist in 'project' table // or there's a studio/software mismatch - if (res.length === 0 || Boolean(res[0].is_studio) !== isStudio) { + if (res.exists.length === 0 || Boolean(res.exists[0].is_studio) !== isStudio) { cb(new NotFoundError("Challenge not found.")); return; } // If there's no corresponding record in group_contest_eligibility // or the user is an admin - if (_.isNull(res[0].challenge_group_ind) || _.isUndefined(res[0].challenge_group_ind) || connection.caller.accessLevel === 'admin') { + if (res.accessibility.length === 0 + || _.isNull(res.accessibility[0].challenge_group_ind) + || _.isUndefined(res.accessibility[0].challenge_group_ind) + || connection.caller.accessLevel === 'admin') { cb(); return; } error = false; - async.some(res, function (record, cbx) { + async.some(res.accessibility, function (record, cbx) { if (record.challenge_group_ind === 0) { cbx(!(_.isNull(record.user_group_xref_found) || _.isUndefined(record.user_group_xref_found))); } else { diff --git a/db_scripts/test_eligibility.insert.sql b/db_scripts/test_eligibility.insert.sql index 05d827c15..020fd832e 100644 --- a/db_scripts/test_eligibility.insert.sql +++ b/db_scripts/test_eligibility.insert.sql @@ -114,7 +114,6 @@ INSERT INTO review_item_comment (review_item_comment_id, resource_id, review_ite DATABASE common_oltp; -INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110001, 2220001, 0); INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110002, 2220002, 0); INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110003, 2220003, 0); INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110004, 2220004, 0); From 16be372f51e13af663a17b69d12ac2c39cfb7ae0 Mon Sep 17 00:00:00 2001 From: Vyacheslav V Sokolov Date: Mon, 19 Jun 2017 02:42:34 +0700 Subject: [PATCH 4/6] Shared the eligibility verification with challengeRegistration. The eligibility check routine is now in challengeHelper and can be added anywhere by a couple of simple lines of code. --- actions/challengeRegistration.js | 39 +++-- actions/challenges.js | 47 +---- db_scripts/test_eligibility.delete.sql | 17 ++ db_scripts/test_eligibility.insert.sql | 89 +++++++++- ...e-Improve Challenge Visibility Control.doc | Bin 49664 -> 52736 bytes initializers/challengeHelper.js | 77 ++++++++- queries/challenge_registration_validations | 10 -- ...Visibility_Control.postman_collection.json | 160 ++++++++++++++++++ 8 files changed, 365 insertions(+), 74 deletions(-) diff --git a/actions/challengeRegistration.js b/actions/challengeRegistration.js index f50077b66..9424951ef 100644 --- a/actions/challengeRegistration.js +++ b/actions/challengeRegistration.js @@ -3,8 +3,8 @@ * * The APIs to register a challenge (studio category or software category) for the current logged-in user. * - * @version 1.7 - * @author ecnu_haozi, xjtufreeman, bugbuka, flytoj2ee, muzehyun + * @version 1.8 + * @author ecnu_haozi, xjtufreeman, bugbuka, flytoj2ee, muzehyun, GFalcon * * changes in 1.1: * Combine Challenge Registration API(BUGR-11058) @@ -27,6 +27,9 @@ * * changes in 1.7: * Avoid reliability info set if there is none for new user. + * + * changes in 1.8: + * Added the verification of the challenge's eligibility */ "use strict"; @@ -880,19 +883,31 @@ exports.registerChallenge = { } else { api.helper.checkUserActivated(connection.caller.handle, api, connection.dbConnectionMap, function (err, inactive) { var fail = err || inactive; - if (fail) cb(fail); - else api.dataAccess.executeQuery('check_challenge_exists', {challengeId: challengeId}, connection.dbConnectionMap, cb); + if (fail) { + cb(fail); + } else { + api.dataAccess.executeQuery('check_challenge_exists', {challengeId: challengeId}, connection.dbConnectionMap, cb); + } }, "You must activate your account in order to participate. Please check your e-mail in order to complete the activation process, or contact support@topcoder.com if you did not receive an e-mail."); } - }, function (result, cb) { - if (result.length > 0) { - if (result[0].is_studio) { - registerStudioChallengeAction(api, connection, next); - } else { - registerSoftwareChallengeAction(api, connection, next); - } - } else { + }, function(result, cb) { + // If the challenge is not found in the tcs_catalog:project table, + if (result.length === 0) { + // Do nothing, do not register cb(); + return; + } + var isStudio = result[0].isStudio !== 0; + api.challengeHelper.checkUserChallengeEligibility(connection, challengeId, function (err) { + cb(err, isStudio); + }); + }, function (isStudio, cb) { + if (_.isUndefined(isStudio)) { + cb(); + } else if (isStudio) { + registerStudioChallengeAction(api, connection, next); + } else { + registerSoftwareChallengeAction(api, connection, next); } } ], function (err) { diff --git a/actions/challenges.js b/actions/challenges.js index 3b17370ca..53266e7a8 100755 --- a/actions/challenges.js +++ b/actions/challenges.js @@ -867,55 +867,16 @@ function validateChallenge(api, connection, dbConnectionMap, challengeId, isStud challengeId: challengeId, user_id: userId }; - async.parallel({ - accessibility: function (cbx) { - api.dataAccess.executeQuery('get_challenge_accessibility_and_groups', sqlParams, dbConnectionMap, cbx); - }, - exists: function (cbx) { - api.dataAccess.executeQuery('check_challenge_exists', sqlParams, dbConnectionMap, cbx); - } - }, cb); + api.dataAccess.executeQuery('check_challenge_exists', sqlParams, dbConnectionMap, cb); }, function (res, cb) { // If the record with this callengeId doesn't exist in 'project' table // or there's a studio/software mismatch - if (res.exists.length === 0 || Boolean(res.exists[0].is_studio) !== isStudio) { + if (res.length === 0 || Boolean(res[0].is_studio) !== isStudio) { cb(new NotFoundError("Challenge not found.")); return; } - // If there's no corresponding record in group_contest_eligibility - // or the user is an admin - if (res.accessibility.length === 0 - || _.isNull(res.accessibility[0].challenge_group_ind) - || _.isUndefined(res.accessibility[0].challenge_group_ind) - || connection.caller.accessLevel === 'admin') { - cb(); - return; - } - error = false; - async.some(res.accessibility, function (record, cbx) { - if (record.challenge_group_ind === 0) { - cbx(!(_.isNull(record.user_group_xref_found) || _.isUndefined(record.user_group_xref_found))); - } else { - api.v3client.isUserInGroup(connection, userId, record.group_id, function (err, result) { - if (err) { - error = err; - cbx(true); - } else { - cbx(result); - } - }); - } - }, function (eligible) { - if (error) { - cb(error); - } else if (eligible) { - cb(); - } else if (connection.caller.accessLevel === "anon") { - cb(new UnauthorizedError()); - } else { - cb(new ForbiddenError()); - } - }); + // Check the eligibility + api.challengeHelper.checkUserChallengeEligibility(connection, challengeId, cb); } ], callback); } diff --git a/db_scripts/test_eligibility.delete.sql b/db_scripts/test_eligibility.delete.sql index c6a88def0..5f77f6c44 100644 --- a/db_scripts/test_eligibility.delete.sql +++ b/db_scripts/test_eligibility.delete.sql @@ -5,8 +5,25 @@ DELETE FROM security_groups WHERE group_id > 3330000 AND group_id < 3330100; DELETE FROM group_contest_eligibility WHERE contest_eligibility_id > 1110000 AND contest_eligibility_id < 1110100; DELETE FROM contest_eligibility WHERE contest_eligibility_id > 1110000 AND contest_eligibility_id < 1110100; +DATABASE informixoltp; + +-- UPDATE coder SET comp_country_code = NULL WHERE user_id = 132458; + DATABASE tcs_catalog; +DELETE FROM notification WHERE project_id > 1110000 AND project_id < 1110100; +DELETE FROM project_result WHERE project_id > 1110000 AND project_id < 1110100; +DELETE FROM project_user_audit WHERE project_id > 1110000 AND project_id < 1110100; +DELETE FROM component_inquiry WHERE project_id > 1110000 AND project_id < 1110100; +DELETE FROM resource_info WHERE resource_id IN (SELECT resource_id FROM resource WHERE project_id > 1110000 AND project_id < 1110100); +DELETE FROM resource WHERE project_id > 1110000 AND project_id < 1110100; + +DELETE FROM project_info WHERE project_id > 1110000 AND project_id < 1110100; +DELETE FROM comp_versions WHERE component_id = 3330333; +DELETE FROM comp_catalog WHERE component_id = 3330333; +DELETE FROM project_phase WHERE project_id > 1110000 AND project_id < 1110100; +DELETE FROM project WHERE project_id > 1110000 AND project_id < 1110100; + DELETE FROM review_item_comment WHERE review_item_comment_id > 7770000 AND review_item_id < 7770100; DELETE FROM review_item WHERE review_item_id > 5550000 AND review_item_id < 5550100; DELETE FROM review WHERE review_id > 4440000 AND review_id < 4440100; diff --git a/db_scripts/test_eligibility.insert.sql b/db_scripts/test_eligibility.insert.sql index 020fd832e..8bb746502 100644 --- a/db_scripts/test_eligibility.insert.sql +++ b/db_scripts/test_eligibility.insert.sql @@ -99,7 +99,6 @@ INSERT INTO review_item (review_item_id, review_id, scorecard_question_id, uploa VALUES (5550004, 4440004, 3330333, 9990004, "---", 1, "132456", CURRENT, "132456", CURRENT); INSERT INTO review_item (review_item_id, review_id, scorecard_question_id, upload_id, answer, sort, create_user, create_date, modify_user, modify_date) VALUES (5550005, 4440005, 3330333, 9990005, "---", 1, "132456", CURRENT, "132456", CURRENT); - INSERT INTO review_item_comment (review_item_comment_id, resource_id, review_item_id, comment_type_id, content, sort, create_user, create_date, modify_user, modify_date) VALUES (7770001, 8880001, 5550001, 1, "The current user has the right to view this challenge", 1, "132456", CURRENT, "132456", CURRENT); @@ -111,6 +110,84 @@ INSERT INTO review_item_comment (review_item_comment_id, resource_id, review_ite VALUES (7770004, 8880004, 5550004, 1, "The current user has the right to view this challenge", 1, "132456", CURRENT, "132456", CURRENT); INSERT INTO review_item_comment (review_item_comment_id, resource_id, review_item_id, comment_type_id, content, sort, create_user, create_date, modify_user, modify_date) VALUES (7770005, 8880005, 5550005, 1, "The current user has the right to view this challenge", 1, "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date) + VALUES (1110001, 1, 14, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date) + VALUES (1110002, 1, 14, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date) + VALUES (1110003, 1, 14, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date) + VALUES (1110004, 1, 14, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date) + VALUES (1110005, 1, 14, "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (2220001, 1110001, 1, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (2220002, 1110002, 1, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (2220003, 1110003, 1, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (2220004, 1110004, 1, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (2220005, 1110005, 1, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); + +INSERT INTO comp_catalog (component_id, current_version, component_name, status_id, modify_date, public_ind) + VALUES (3330333, 1, "---", 1, CURRENT, 0); + +INSERT INTO comp_versions (comp_vers_id, component_id, version, version_text, phase_id, phase_time, price, modify_date) + VALUES (4440444, 3330333, 1, "1", 113, CURRENT, 1000, CURRENT); + +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110001, 2, "3330333", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110002, 2, "3330333", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110003, 2, "3330333", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110004, 2, "3330333", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110005, 2, "3330333", "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110001, 6, 3330333, "Not private", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110002, 6, 3330333, "Old logic - access allowed", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110003, 6, 3330333, "Old logic - access denied", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110004, 6, 3330333, "New logic - access allowed", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110005, 6, 3330333, "New logic - access denied", CURRENT, "132456", CURRENT); + +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110001, 79, "---", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110002, 79, "---", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110003, 79, "---", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110004, 79, "---", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110005, 79, "---", "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (3330001, 1110001, 2, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (3330002, 1110002, 2, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (3330003, 1110003, 2, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (3330004, 1110004, 2, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (3330005, 1110005, 2, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); + +DATABASE informixoltp; + +UPDATE coder SET comp_country_code = ( + SELECT MIN(country_code) FROM country WHERE country_name = "United States" +) WHERE coder_id = 132458; DATABASE common_oltp; @@ -130,3 +207,13 @@ INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110003, 3330002); INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110004, 3330003); INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110005, 3330004); + +INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110012, 1110002, 0); +INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110013, 1110003, 0); +INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110014, 1110004, 0); +INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110015, 1110005, 0); + +INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110012, 3330001); +INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110013, 3330002); +INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110014, 3330003); +INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110015, 3330004); diff --git a/docs/Verification_Guide-Improve Challenge Visibility Control.doc b/docs/Verification_Guide-Improve Challenge Visibility Control.doc index 5385983df3f5a6c74c77c93f4fa89de8b359be7d..1c2913aaec56e9f7acc508b92ae08a944ff0a3e0 100644 GIT binary patch delta 3948 zcmaKv4Nz3q701upU2q3k5M_}C#03{wkl?~DXu$aWfz+x|N7GaV)%s4Gk3_EtLHJ=QpS`1&eJ9xHZDhD~zx!>X7Q%HAZg>#)FnlGe<^L>Yz_ojt$YT66jvM?-XEJmM0 zbEyEMT|_TY32js@DR@*4rP5Sf4q#XFcKUXI$8i3fke(2*-+(y_A~Ko|q$m0XU^CRXAT!?FCw*RhVRd+KjS} zs_P_u+`8EnIJZFCmKE!l@sGbgKop4Pag=}eY)}a3@ldMc1%Xj<*+5IaR0&Vm+2^1#Q3rF;lpC0n!TOmeVF|gbLb*ZBwS+ zo5Lxujfpdv&9Ic9%a40k&=%NULM=0?o*{0}eDx`tP@|m3RY#84pte@Xnbp-w5`V8Y zKIWU&mf<<;(T4P_5PoL#U=x+`om!)-zj{aTvj#HI3fvmL>rYpoFV)e^EDqUVG(OoO zX>A@qsD9Ni2|gA4gPK`mpKjw(7x;Qj@-r(u6IG7k=HrsSl%tzls2FX?M3p1X>Ts!$ zm+Y}ezT)x8!_W$$3>ol?g~vt&aok=LKm3t@N}f+!W_1G0>W(czz7RR--(zia${S-w z6r&Zi!?RwG=hgetU1#@HDl;%7#3vu!G^11Hs4f$bug1*X$S^Yuk3x4Xnd=<0I)Gw& z6?Pel3{$#Lj*_eu`IYXJs{`w{cZCM$ zW76cgCGguqrF?AHJTBT57VLgPsplDa{L|vGA+qY$1Cg*~1kT{f;a)5T14>{}2vmqkfJHSp*37l+fn9NxX7OrRrO}G|8bRC37 z5`_UL=mDdmh?2*lCTIf>xw~OJ>l!V2(KrNRK`J;6YClQ8R`cB`chmXvk9Mjz!)b4wstTtxJ>_MG(`r3ECy(d?*MJj( za}IQYt8wToxCX2cg+!19l0iCH2MRz1*b26TI?xI(fDgb$&`zCuuY=gIJIVrUN;H<;1?Hevr^0^?Sa( z-()?uK?KrmoIT9FzmQy4=n}r@QQ(~HP+FR;LzF^^^iuNX!X5Kk{3n zCkpb|#M@I27axf>%1flbmB0z=Koe*N9U$9Av!4_1Oo-~@G`2{eNaP>ds_1XO|#z(pYE(q(W3^nyNc1Kb2Q zoM)-P;lMJQi_AW70Gvoe!=M@52M+<^6xVbLyj>K1A@6`%67N^at}kLU;}s=$jfF4u;Bfs6dVDAz=HRRiNFdHK@undrJx=(fG%(u^n$*ORR}0D zH^CR+pI~$*gc5{-a3F8A|Ne5A@0Zlye*+iwQ|I}1YN4ZtaW&SZWL> z=%whS=%eVN=%C17jg_<8mhz=$gL0WaK4s#;=7`91-bEtm8Q(%HztL)nJnn1ym2aVu zr@3}U1!*Z@qGlxCdbJj9o<+O1=89%b4I)`%d%$%rBmcO?x_q=Kt|+Z2tf;FftEj4| zsi>%^r>Lf=rHG`6qX=VzM;N0$!YHCBf;e+BFFU=TKWU3#%NYkxZ;4P^@jhzgSI$K7 zAAc9hIj)lLhl*T^?1b#j8KM`W6QU2I4WbFMt7JFH zF2e3nH;rr-*(9<#il=%e;68?Goiy6JQG7Q=8P<3O*a~D*Tm%uBsF%Rc=nTB)w1KxB zi3sZP4eFoyU#CrM$hpS7@5Tk;uTPjoSy&`pUtr;%ypzcLUC~tm^8YUiL<2L31r{(7 zSb^-Mdf#Rb`4$fP77q9p>U<0Pd<(Tc1r6=RKY*Vh)+P>k_sU4pyZ?(~W?h>PMk&Kg c2K+x#l(uvCw8~-Ef8KK{N|9^F`>$*M2WNJX1ONa4 delta 2417 zcmaLZYfMvT7zgm@w6%6z1}f#E$o*zTshEt4V#t zf{A@&!q^&A@|9 zD|KeomRGB23eD`7AM85095R#$SD2n3G*6~p4-*q^lauShmHD3p7Rrd}Z9S%bCx)!T zQtUvV1Md+Ws9Utqv4kiDmwRU^Q5KGvB8l*%$T+SvSd5ofV0Cdg_;sQ|bSL72jQEpY zn^S`mgV0*7@5YCnQ@APF;hK$8voY*yEG`ERWDYTxM^L;z)f4dc;6u>HSN%M3MTuys?@3){TLRj78bGuSq&`N6Mlox>UA@$S zmyX^JJgHq?dV726yu3;SP1#5#d%L}z?8oU#RaJS-Q9FNh#8;D4%q?}{6+457j)7k= zCLXfD0h&-m6!ef2hSG&x$b&6#01m4s0TYBFBNna zjb?ZV127DuAocwOp21G6bupAcDcIm3d;#@v6FT8OjKLFdL6WXR2Xw=H6XqR!ApnBF zWU3&FMk5x?V1WdkwQad%D$K!0{S^RAreRAK@ z|5$=G@+E1I4jCXnSmUGPs#5ri;;xHM-AFW7Uf(h(q;oXD$T+J>R_4^X*GLO|EmJW-3#vQYum^Q7TX>PAW|*ObSa1YAl>nFJ!2PT9Xw1RE^j$ zUn)zgN-9dKNvcSyN2*4uMXE%qLyAHQqGP%k(x;0-5+`Yslu5dJqBym6KYOXJJmhdy ze&E2befVLkD?hzx=FfCSHeT`JwiajJbE)WU56PfpPckQ2lbj8}OuQso5-W+5#7N>J zv5~k)Oe7)_4~fPpI0JU*jALu_Am3{U=RN0Kd6~}O?1Ef`DC@T1_ma41(p9TM)1|ow@2(a7q64 p>Fk{n{NyE0&y$X$u5@zs} next The callback that will receive an error + * if the user is not eligible + * + * @since 1.5 + */ + checkUserChallengeEligibility: function (connection, challengeId, next) { + // Admins can access any challenge + if (connection.caller.accessLevel === 'admin') { + next(); + return; + } + // Query the accessibility information + var userId = (connection.caller.userId || 0); + api.dataAccess.executeQuery('get_challenge_accessibility_and_groups', { + challengeId: challengeId, + user_id: userId + }, connection.dbConnectionMap, function (err, res) { + if (err) { + next(err); + return; + } + // If there's no corresponding record in group_contest_eligibility + // then the challenge is available to all users + if (res.length === 0 + || _.isNull(res[0].challenge_group_ind) + || _.isUndefined(res[0].challenge_group_ind)) { + next(); + return; + } + var error = false; + // Look at the groups + async.some(res, function (record, cbx) { + // Old challenges: check by looking up in common_oltp:user_group_xref + if (record.challenge_group_ind === 0) { + cbx(!(_.isNull(record.user_group_xref_found) || _.isUndefined(record.user_group_xref_found))); + } else { + // New challenges: query the V3 API + api.v3client.isUserInGroup(connection, userId, record.group_id, function (err, result) { + if (err) { + error = err; + cbx(true); + } else { + cbx(result); + } + }); + } + }, function (eligible) { + if (error) { + next(error); + } else if (eligible) { + next(); + } else if (connection.caller.accessLevel === "anon") { + next(new UnauthorizedError()); + } else { + next(new ForbiddenError()); + } + }); + }); } - }; next(); diff --git a/queries/challenge_registration_validations b/queries/challenge_registration_validations index 1b20283f4..4bd4a63de 100644 --- a/queries/challenge_registration_validations +++ b/queries/challenge_registration_validations @@ -4,8 +4,6 @@ select (pp_reg_open.project_id IS NOT NULL) as reg_open, (r.project_id IS NOT NULL) as user_registered, (us.user_id IS NOT NULL) as user_suspended, - (ce.contest_eligibility_id IS NULL) as no_elgibility_req, - (ugx.login_id IS NOT NULL) as user_in_eligible_group, (uax.user_id IS NOT NULL OR coder.coder_id IS NOT NULL) as user_country_banned, (coder2.comp_country_code IS NULL OR coder2.comp_country_code = '') as comp_country_is_null, (cop.copilot_profile_id IS NOT NULL) as user_is_copilot, @@ -28,14 +26,6 @@ left join on us.user_id = @userId@ and us.user_status_type_id = 1 and us.user_status_id = 3 --- Check if user meets eligibility requirements -left outer join ( - contest_eligibility ce join ( - group_contest_eligibility gce left outer join user_group_xref ugx - on ugx.group_id = gce.group_id and ugx.login_id = @userId@ - ) - on ce.contest_eligibility_id = gce.contest_eligibility_id -) on p.project_id = ce.contest_id -- Check user's country left outer join ( informixoltp:user_address_xref uax join ( diff --git a/test/postman/New_Challenge_Visibility_Control.postman_collection.json b/test/postman/New_Challenge_Visibility_Control.postman_collection.json index 521f5e6a2..7dadfd3d1 100644 --- a/test/postman/New_Challenge_Visibility_Control.postman_collection.json +++ b/test/postman/New_Challenge_Visibility_Control.postman_collection.json @@ -17,6 +17,19 @@ ], "owner": "316251" }, + { + "id": "cfbf928f-56b8-9813-f8f3-4ac4e342d965", + "name": "Register for challenges", + "description": "", + "order": [ + "4b64d85a-4c08-8ec2-9c3f-50605bd2e09e", + "5224f722-9f4f-07bb-58e7-351512cc66ea", + "60ae89de-4eb1-c0aa-b866-b28b52436e89", + "843d6759-0cc0-a0c6-9fde-60f893f56eac", + "46cf305a-8251-66aa-391c-46def82773a1" + ], + "owner": "316251" + }, { "id": "0eeb693c-c6b6-e23b-156d-cff5f21dbb27", "name": "login", @@ -62,6 +75,124 @@ "responses": [], "folder": "712ffa63-a959-e4a3-6af9-84d4f236b2f3" }, + { + "id": "46cf305a-8251-66aa-391c-46def82773a1", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/1110005/register", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "POST", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497813578982, + "name": "New logic, access denied", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "4b64d85a-4c08-8ec2-9c3f-50605bd2e09e", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/1110001/register", + "queryParams": [], + "pathVariables": {}, + "pathVariableData": [], + "preRequestScript": null, + "method": "POST", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "data": null, + "dataMode": "params", + "name": "No groups (challenge is not private)", + "description": "", + "descriptionFormat": "html", + "time": 1497813014785, + "version": 2, + "responses": [], + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "folder": "cfbf928f-56b8-9813-f8f3-4ac4e342d965" + }, + { + "id": "5224f722-9f4f-07bb-58e7-351512cc66ea", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/1110002/register", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "POST", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497813399305, + "name": "Old logic, access allowed", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "60ae89de-4eb1-c0aa-b866-b28b52436e89", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/1110003/register", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "POST", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497813480606, + "name": "Old logic, access denied", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, { "id": "6bed8920-6800-0ae0-e63d-b39b05c7f50c", "headers": "Content-Type: application/json\n", @@ -114,6 +245,35 @@ "helperAttributes": {}, "folder": "712ffa63-a959-e4a3-6af9-84d4f236b2f3" }, + { + "id": "843d6759-0cc0-a0c6-9fde-60f893f56eac", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/1110004/register", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "POST", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497813524683, + "name": "New logic, access allowed", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, { "id": "a3ae5124-2077-4ff2-4e02-afae7670bbe5", "headers": "Authorization: Bearer {{authToken}}\n", From f3e792ccd6f84091c72241d6ba2e85745ad51f2d Mon Sep 17 00:00:00 2001 From: Vyacheslav V Sokolov Date: Tue, 20 Jun 2017 19:01:07 +0700 Subject: [PATCH 5/6] Improve challenge visibility control: getChallenge and getRegistrants --- actions/challenges.js | 96 ++- db_scripts/test_eligibility.insert.sql | 21 +- ...e-Improve Challenge Visibility Control.doc | Bin 52736 -> 56832 bytes initializers/challengeHelper.js | 2 +- queries/check_is_related_with_challenge | 26 +- ...Visibility_Control.postman_collection.json | 640 +++++++++++++++++- 6 files changed, 708 insertions(+), 77 deletions(-) diff --git a/actions/challenges.js b/actions/challenges.js index 53266e7a8..3fd653222 100755 --- a/actions/challenges.js +++ b/actions/challenges.js @@ -80,8 +80,9 @@ * Changes in 1.31: * - Remove screeningScorecardId and reviewScorecardId from search challenges api. * Changes in 1.32: - * - validateChallenge function now checks if an user belongs to a group via - * user_group_xref for old challenges and by calling V3 API for new ones. + * - validateChallenge, getRegistrants, getChallenge, getSubmissions and getPhases functions now check + * if an user belongs to a group via user_group_xref for old challenges and by calling V3 API for new ones. + * - */ "use strict"; /*jslint stupid: true, unparam: true, continue: true, nomen: true */ @@ -1081,19 +1082,20 @@ var getChallenge = function (api, connection, dbConnectionMap, isStudio, next) { }; // Do the private check. + api.challengeHelper.checkUserChallengeEligibility( + connection, + connection.params.challengeId, + cb + ); + }, function (cb) { api.dataAccess.executeQuery('check_is_related_with_challenge', sqlParams, dbConnectionMap, cb); }, function (result, cb) { - if (result[0].is_private && !result[0].has_access) { - cb(new UnauthorizedError('The user is not allowed to visit the challenge.')); - return; - } - if (result[0].is_manager) { isManager = true; } // If the user has the access to the challenge or is a resource for the challenge then he is related with this challenge. - if (result[0].has_access || result[0].is_related || isManager || helper.isAdmin(caller)) { + if (result[0].is_private || result[0].is_related || isManager || helper.isAdmin(caller)) { isRelated = true; } @@ -3342,33 +3344,32 @@ var getRegistrants = function (api, connection, dbConnectionMap, isStudio, next) }; // Do the private check. - api.dataAccess.executeQuery('check_is_related_with_challenge', sqlParams, dbConnectionMap, cb); - }, function (result, cb) { - if (result[0].is_private && !result[0].has_access) { - cb(new UnauthorizedError('The user is not allowed to visit the challenge.')); - return; - } - + api.challengeHelper.checkUserChallengeEligibility( + connection, + connection.params.challengeId, + cb + ); + }, function (cb) { api.dataAccess.executeQuery('challenge_registrants', sqlParams, dbConnectionMap, cb); }, function (results, cb) { var mapRegistrants = function (results) { - if (!_.isDefined(results)) { - return []; + if (!_.isDefined(results)) { + return []; + } + return _.map(results, function (item) { + var registrant = { + handle: item.handle, + reliability: !_.isDefined(item.reliability) ? "n/a" : item.reliability + "%", + registrationDate: formatDate(item.inquiry_date), + submissionDate: formatDate(item.submission_date) + }; + if (!isStudio) { + registrant.rating = item.rating; + registrant.colorStyle = helper.getColorStyle(item.rating); } - return _.map(results, function (item) { - var registrant = { - handle: item.handle, - reliability: !_.isDefined(item.reliability) ? "n/a" : item.reliability + "%", - registrationDate: formatDate(item.inquiry_date), - submissionDate: formatDate(item.submission_date) - }; - if (!isStudio) { - registrant.rating = item.rating; - registrant.colorStyle = helper.getColorStyle(item.rating); - } - return registrant; - }); - }; + return registrant; + }); + }; registrants = mapRegistrants(results); cb(); } @@ -3440,18 +3441,16 @@ var getSubmissions = function (api, connection, dbConnectionMap, isStudio, next) submission_type: [helper.SUBMISSION_TYPE.challenge.id, helper.SUBMISSION_TYPE.checkpoint.id] }; - async.parallel({ - privateCheck: execQuery("check_is_related_with_challenge"), - challengeStatus: execQuery("get_challenge_status") - }, cb); - }, function (result, cb) { - if (result.privateCheck[0].is_private && !result.privateCheck[0].has_access) { - cb(new UnauthorizedError('The user is not allowed to visit the challenge.')); - return; - } - + api.challengeHelper.checkUserChallengeEligibility( + connection, + connection.params.challengeId, + cb + ); + }, + execQuery("get_challenge_status"), + function (result, cb) { // If the caller is not admin and challenge status is still active. - if (!helper.isAdmin(caller) && result.challengeStatus[0].challenge_status_id === 1) { + if (!helper.isAdmin(caller) && result[0].challenge_status_id === 1) { cb(new BadRequestError("The challenge is not finished.")); return; } @@ -3567,13 +3566,12 @@ var getPhases = function (api, connection, dbConnectionMap, isStudio, next) { }; // Do the private check. - api.dataAccess.executeQuery('check_is_related_with_challenge', sqlParams, dbConnectionMap, cb); - }, function (result, cb) { - if (result[0].is_private && !result[0].has_access) { - cb(new UnauthorizedError('The user is not allowed to visit the challenge.')); - return; - } - + api.challengeHelper.checkUserChallengeEligibility( + connection, + connection.params.challengeId, + cb + ); + }, function (cb) { var execQuery = function (name) { return function (cbx) { api.dataAccess.executeQuery(name, sqlParams, dbConnectionMap, cbx); diff --git a/db_scripts/test_eligibility.insert.sql b/db_scripts/test_eligibility.insert.sql index 8bb746502..44a286bf0 100644 --- a/db_scripts/test_eligibility.insert.sql +++ b/db_scripts/test_eligibility.insert.sql @@ -151,16 +151,27 @@ INSERT INTO project_info (project_id, project_info_type_id, value, create_user, VALUES (1110005, 2, "3330333", "132456", CURRENT, "132456", CURRENT); INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) - VALUES (1110001, 6, 3330333, "Not private", CURRENT, "132456", CURRENT); + VALUES (1110001, 6, "Not private", "132456", CURRENT, "132456", CURRENT); INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) - VALUES (1110002, 6, 3330333, "Old logic - access allowed", CURRENT, "132456", CURRENT); + VALUES (1110002, 6, "Old logic - access allowed", "132456", CURRENT, "132456", CURRENT); INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) - VALUES (1110003, 6, 3330333, "Old logic - access denied", CURRENT, "132456", CURRENT); + VALUES (1110003, 6, "Old logic - access denied", "132456", CURRENT, "132456", CURRENT); INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) - VALUES (1110004, 6, 3330333, "New logic - access allowed", CURRENT, "132456", CURRENT); + VALUES (1110004, 6, "New logic - access allowed", "132456", CURRENT, "132456", CURRENT); INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) - VALUES (1110005, 6, 3330333, "New logic - access denied", CURRENT, "132456", CURRENT); + VALUES (1110005, 6, "New logic - access denied", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110001, 26, "---", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110002, 26, "---", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110003, 26, "---", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110004, 26, "---", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110005, 26, "---", "132456", CURRENT, "132456", CURRENT); + INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) VALUES (1110001, 79, "---", "132456", CURRENT, "132456", CURRENT); INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) diff --git a/docs/Verification_Guide-Improve Challenge Visibility Control.doc b/docs/Verification_Guide-Improve Challenge Visibility Control.doc index 1c2913aaec56e9f7acc508b92ae08a944ff0a3e0..fd53c55cca92514a1e3731a719129a08120a1bcc 100644 GIT binary patch delta 5309 zcmb8z4^UNA9>DS610*u}Bl6^*;PZjzzeo^B5e=2hB_kt8%g|83$dFiI&2@9Z)y!p@ z{Bw|X$gEZi%eGb?^Fl==av7!CbscM3D{9DbwQ+EF#%;(k*zfN>9zJPz+unPhch5cd z-gECg=iKub6V zoE-l~jL5`T5kHZ&Y!G(n^OH2M^wVoi+LULaPR6rif=FAkNa-w*+PNY*nIdswMkU6Y z&M7wgi7_G<#);IhTM)Z7O()H+d)Rd$yDrK!(-Q6Gq>s%kO`Pwir#5eKY)hiQqa(4) z;xjSUygfD6H<0|FCyzGWQ&Y{->AKnMJp1rCk^$)J3zkVNL(Im!4HIY}>8ABIv-G@DI8T{BZl}@7>|#0IjPZ+(>Y5

e*VFW=-`E7lV3Sfr<8BLtiIh*yt~k7$d>l3bHZKPLF!^M=MTguFeH6u*grlG-uuG<7}2_KTcKJ&~=o1-6cmy*vJ%3W2k zk`lC<+!a%CbEUcRwHkj(s+?_4QJuxEdeXC0uvR7|=E=3AhXl%_5@?=$E+)p#ep*`v zu9EGN#+$&ZKwjIrhdjz0Nq-$e^QxzU>l7p8LIl^fElb_^EZM z^{*xBHJ0-XXnPj0m3B0i>Ji5F>@btFE9t(c*;iYrP}U)zdeAG^p0<+ZDpwhWGJ|z@ z$yygSaUWG8k+uq%%(|;x%;U9jk$RN&(ntAT#&%cBYAM>4XX=?sSkp4xb*w%3f4A{X z<@-{;WA<-1T7GK(Hc2(1xAZ?e=GD#C;7FSmJn%S~9nV?g%DG^zyupuJsjJKAbE*$m zy4!tFFEWRA zg^w+EJ)NFPy}3VXPtqP$q)p;WA2T~TtdTbQUm<yB9NGGEl) z#kcjv%ceE+Q-@_wzF+0~NRemIgd>QL5?O~voFT@=j$*LJezf5P+Hsvo*{jiVG($J` zqZysJj3}E(HEQ5LhGWr=hwUP{SdG#+c~Hs-P!(v87tv`)k6gVfm%g|pXZSj!Z}~{S zF7ZAtN5%P(^CNK{lzr}`YxStS_@aLFWjbGuH21&SP?@f!b>Kssg^VSzBNSm6i3DUL z7t4`{b?Aie4@yzLT`qv}f{hzKI$^N_^Ip?+Ao!R5rt4BT_As_QTEvLLbX4}58K|yn~ zA|y3HRf$#tb9OEmWFj$kKbSmwqhrAl39!0NWYVsLk1Yn#Rq=yM-c3YM>2A; z93|L_YSbYsQDgyfu{V*XdWFORyoI;Xgd=E13xbm93kXFXp2u#~VJ{k)!8p-`0A?>k zbp`{S8IMFNrXd6KFdtc1fW{?!Injh8Xv23`T_3qBSLDhS7X2CC3HQdo^ODcy?B{Yy znq8k$a#kAUO)($tiw}>On-!+jof04mv;3&_Flt?L&9>JbsSMC#Lv)}tDYaH1VPGw3fEHiLE#A`ya6grOIH z=_1>)6E&#CUNoQ)CvX|v=tTt6-Y87O1zbcALijaQ0{sEyc`#hhljkv6O!kEfoxE8{ zr*z)2hTW(`BaYw%&Y=@N8T=4H0aj&HGP02<#b#_l zEn3iu)A$CLaUD&wDG(j#LdG1CImpBUEJO~LA`dH3fK^y9mkx=A$iX7iYC^v4maZ;_ zs&i*NFX`~S$Y!(Gr`xsW+P_0O#92=P-me(5w?4+y)KAKca94K()lC(-tKZ_Tev43cKY5q$8hWl+u^evtFd4{{D!hNS33K_?00 zqTG`NC(9;yCIy}e!Nk!blW}4U_hXhHh%}3xQR7c~SLI>vmAAcD_L-2w)^M$%dR>30zOJDf8l^QtYh>1ltdUrQq6R|^f;9;yt7Wyx<9u~Zf#%Bt$>y`h zK(ppppyf~IFD;Q~gEP>4&y~FN#}Q`a`w^z~ShU%2bm3yFhE5Heo{*{GQbVPNNDYk| z5;YWR1k}iCG3Ma0^!uzD@HEhA zfYacnaZO{Ih7t`S8agy&Xo%3zpdq0@91M*7I_ft~cVx9VEm=D9>xi!-y^ioYqU%Vm zBe)LSI%w-at%I}<&N?XTV620%4t+Z0=}=cQ%T?a}p5ZQ*;Yx?If(-X4wS{FXE<;Bl z9d&fH(NRW681K=gj>l8~<{I1wil~l2GwN`l3e^MlLZ9<* zFo)+h6Z0@1Sy+H<=>KQmn}f}fX6una?PL$E6|Yx?SDK$vUawNGG`|D9Ud3K%S8ZWQKYPkJg)5INGP7y~o$`FUNPM Osw|eZj`bgG@%cA;d-3%E delta 3478 zcmZwK3s6+o83*w1?k*G&1QC!$+%6AcK|*-03QE){1=}KaI_N~DyrqUBMT%(*?D`ld z?WBr+hM|NhY2%~}LZe)}r9gcU5(U9pN^MFgW~?QWI?806jwP-1|LwYQ(d^yd-h0kH z_uR+f{CBbTYOT%M`go=2Y{FLUyhpRMv&BSI!e_OckLMdZb%C)F0eYea&=HklAEC{x zj#6E=_my&L{A*=gDmIO;#~Zj+{-*ny#@wjv+a(!_y}DRSv~@9&JN*!49UZEd z_1s#ikyn(Kj2yovQ1va2Q`B`C7Zk4CncJBe=9c=;zy1$TjA&z#H8d)8-8YEzIIZIp zQcv`D#?tA9sC&Aly5rluz6%mo;Yp&E^;Ximcl|gr&+xTqf4}nGcScy*n4((qniUP6 zsv$qz+dgR0qy6r)^TQU(Ai2ZrtPe$C?ZXH1YojqHG!aSk8rII&%_O2KG<_+Gs1lWf zSerOhwfW*$aF2sxw770X_v(MAh_t+Cvqz zm!9Wewk(>zm*QwQN=EYL&9#e_8s1W-x0Fy7mOUVQs;P{mrUcuC_$;CV`Vsa>ISY!> zXEFNJ8>{WD_h4@kj&UAoL}?FNe06(iS%9N=VSgHq`2iL9(#!V7d(n~ow7jJ@AgcnM z7*X$fX>vK$v=5&p=)y?lxReTP%Vn>m6f$Eiofl)hiW0CylefC+$KmsM+7if>Ey45U z03&7NpnbfsEN!{o=(yf;bSC%ed}66+6=W>OMeMSlL~o4cJ>N{j7Wh-xB(x5{}Q4=u)-+#h7iRqC3+P);Sorr7{CaUA=`}jbA%mm7$jzb zAQdv91}0$|3d8Wo42Y;ONQ84Bk@b)sJfNw+PtgcIMr5I3`Iw>$G&N;k^^k4YW*a8k zX?n-LJ&f`&_4MGBb6&jRbdP0?^g0ALz=}!L4MQ-p47Ub1z=S{e7>I>9Fhd~}Lp9XE zD^L$-;5=M}J{W_1%!op$f@-LNIyh*uII{H(6uO`r`rrx-!Vp}8^_Y7bAOkWX2a2H- zYTy^}Hk<*O;6pGDjWI+`&<3~QHr$12_#9>|_@L#;PSAlnG-6UWLr5G34?+<91~5Vx z#6UX87lM3+JhZ>CqG_6Z{2qI<`M7QxWA{wug-!89-+~>`1kG>?TA>ZjfepH#8}bq`E>H+zi9`_) z2_}e#4T%_=3~b~=9ay0r+MpeJp&aQ}0d;T@`alx%8eE4l7>5b?1mcmjiI5B%;3%Ac z))e#$?eJfC1Z2S%jRrg+24W!@Qeicu!&+Dmtu%J=F1{imxPO&mKv z{glRObeslg!0{&k(NVfIXU3qwUcWYR>w9bYM8{%FmYm84gD?c+pj&}IBM5|eNQCw9 z2oQ+m3z@J9z5}_i4f3HB%3wFh?~DqFz&BqnqUa7 z!5ECg1bhN_;4|<`Lx@2j1cCgR`S-oAc;BPR$q6hpNrOE$>Y!6CSehGU!IxnYcl|bl zv(+sAo$Ad)XMK5G4ObF7ZU4}C?3%qfe``?mGM?>g!TNPDB3>oTZ6J~B zj8=(NiBySFiBO45iAsq``PDh|@!6%{D^f>ekk3&xaPr^<@ZicOcdM+J0 z#+vt|IN?&1a>nrx2159~fgHA6PTcM<4JDT(k0ggAelL+Gh)1GU_^pS6vHztbFelcmH`KzwjsXE>Gzo z1Pow=Fo=LiFoDd{M%UvTTni^%3nyF)^{$1Z{6)WB`6+&rzRCLs^!(Y#_4(xC_-_V} kPgROT6u)P08CQBmQ95rt)G96NfBt4wlv4H8kB?~n4~Qp6qW}N^ diff --git a/initializers/challengeHelper.js b/initializers/challengeHelper.js index 2460e3f17..66edae75f 100644 --- a/initializers/challengeHelper.js +++ b/initializers/challengeHelper.js @@ -374,7 +374,7 @@ exports.challengeHelper = function (api, next) { } else if (connection.caller.accessLevel === "anon") { next(new UnauthorizedError()); } else { - next(new ForbiddenError()); + next(new ForbiddenError('The user is not allowed to visit the challenge.')); } }); }); diff --git a/queries/check_is_related_with_challenge b/queries/check_is_related_with_challenge index 5c18c5bb6..1728d3e2d 100644 --- a/queries/check_is_related_with_challenge +++ b/queries/check_is_related_with_challenge @@ -2,21 +2,21 @@ SELECT (SELECT 1 FROM contest_eligibility ce - INNER JOIN group_contest_eligibility gce ON gce.contest_eligibility_id = ce.contest_eligibility_id - INNER JOIN user_group_xref ugx ON ugx.group_id = gce.group_id WHERE ce.contest_id = @challengeId@ - AND ugx.login_id = @user_id@) AS has_access -, (SELECT - 1 - FROM contest_eligibility ce - WHERE ce.contest_id = @challengeId@) AS is_private -, ( - SELECT +) AS is_private +, (SELECT decode(max(ri.value), null, null, 1) FROM resource r - INNER JOIN resource_info ri ON ri.resource_id = r.resource_id AND ri.resource_info_type_id = 1 + INNER JOIN resource_info ri ON ri.resource_id = r.resource_id AND ri.resource_info_type_id = 1 WHERE r.project_id = @challengeId@ - AND ri.value = @user_id@) AS is_related -, (SELECT max(project_metadata_id) FROM direct_project_metadata m, project p - WHERE metadata_value = @user_id@ AND p.tc_direct_project_id = m.tc_direct_project_id and p.project_id = @challengeId@ AND project_metadata_key_id IN (1, 2, 14)) AS is_manager + AND ri.value = @user_id@ +) AS is_related +, (SELECT + max(project_metadata_id) + FROM direct_project_metadata m, project p + WHERE metadata_value = @user_id@ + AND p.tc_direct_project_id = m.tc_direct_project_id + AND p.project_id = @challengeId@ + AND project_metadata_key_id IN (1, 2, 14) +) AS is_manager FROM dual diff --git a/test/postman/New_Challenge_Visibility_Control.postman_collection.json b/test/postman/New_Challenge_Visibility_Control.postman_collection.json index 7dadfd3d1..3c52fb3e4 100644 --- a/test/postman/New_Challenge_Visibility_Control.postman_collection.json +++ b/test/postman/New_Challenge_Visibility_Control.postman_collection.json @@ -4,6 +4,19 @@ "description": "", "order": [], "folders": [ + { + "id": "cada5a0c-766f-dde0-3c9f-d001a67eddd4", + "name": "Get challenge", + "description": "", + "order": [ + "c383cab7-3145-145e-9da9-846001755460", + "42b84596-9d5a-50e7-76be-c1ad23f98468", + "3246a996-e8f9-5e60-79b9-8aeffcd5392f", + "bf83e2d2-549b-361e-f5cf-66a40d816f0c", + "1af5c911-4627-ad92-085c-63e6fc7b6d9e" + ], + "owner": "316251" + }, { "id": "712ffa63-a959-e4a3-6af9-84d4f236b2f3", "name": "Get checkpoints", @@ -17,6 +30,47 @@ ], "owner": "316251" }, + { + "id": "6b9370a1-5974-a6a6-a961-67e73abaa861", + "name": "Get phases", + "description": "", + "order": [ + "c7d11de6-630a-71bd-4095-cd3c8fb8ab77", + "f5da62a7-9231-5f7a-f44a-f2f14c9ae003", + "d7a050dc-6eaa-f62e-24e4-37d111002d4a", + "c305f2ea-dbfd-f95f-c809-583133af5881", + "0461a7de-3ae1-f873-b667-50d04a43b317" + ], + "owner": "316251", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240" + }, + { + "id": "6a038555-23cd-e79f-1d34-0fb860e305a3", + "name": "Get registrants", + "description": "", + "order": [ + "bcc821a7-0e3a-3454-d900-12af0cc94656", + "70b3453b-1d1a-e411-f8e5-527edb0a2530", + "f73f4e00-c286-d440-ce79-89095d7354dd", + "e97dac4e-c786-27b1-5e4b-fff50b6de93a", + "b3cb44e7-3e5f-897e-5d6f-6179afc52653" + ], + "owner": "316251" + }, + { + "id": "2a873809-800c-ee71-51ad-94f10096709b", + "name": "Get submissions", + "description": "", + "order": [ + "f90179ed-98da-be6d-77ae-9e3aa4199b5c", + "f915c206-b3fe-a4be-1094-bc8a448cb467", + "d3e5ca45-334d-fb54-1fd7-46f8e7b82841", + "f8e9d38f-8d8d-6e63-4978-6e3546f20b7c", + "f8720a5a-5a8b-423c-065f-8d3a3469fbca" + ], + "owner": "316251", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240" + }, { "id": "cfbf928f-56b8-9813-f8f3-4ac4e342d965", "name": "Register for challenges", @@ -46,6 +100,62 @@ "owner": "316251", "public": false, "requests": [ + { + "id": "0461a7de-3ae1-f873-b667-50d04a43b317", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/phases/1110005", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497959637871, + "name": "New logic, access denied", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "1af5c911-4627-ad92-085c-63e6fc7b6d9e", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/phases/1110005", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497959273575, + "name": "New logic, access denied", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, { "id": "2af8f0d9-f3e8-c58a-ca3d-1130e4b07371", "headers": "Authorization: Bearer {{authToken}}\n", @@ -75,6 +185,62 @@ "responses": [], "folder": "712ffa63-a959-e4a3-6af9-84d4f236b2f3" }, + { + "id": "3246a996-e8f9-5e60-79b9-8aeffcd5392f", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/1110003", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497958076427, + "name": "Old logic, access denied", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "42b84596-9d5a-50e7-76be-c1ad23f98468", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/1110002", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497957969156, + "name": "Old logic, access allowed", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, { "id": "46cf305a-8251-66aa-391c-46def82773a1", "headers": "Authorization: Bearer {{authToken}}\n", @@ -214,6 +380,34 @@ "rawModeData": "{\n \"username\": \"heffan\", \n \"password\": \"password\"\n}", "folder": "0eeb693c-c6b6-e23b-156d-cff5f21dbb27" }, + { + "id": "70b3453b-1d1a-e411-f8e5-527edb0a2530", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/registrants/1110002", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497934833132, + "name": "Old logic, access allowed", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, { "id": "7c7643c6-89ab-641e-b67a-32b3ac91e09e", "headers": "Authorization: Bearer {{authToken}}\n", @@ -304,7 +498,7 @@ "folder": "712ffa63-a959-e4a3-6af9-84d4f236b2f3" }, { - "id": "d830ec36-eb8e-9586-c546-14af77cec152", + "id": "b3cb44e7-3e5f-897e-5d6f-6179afc52653", "headers": "Authorization: Bearer {{authToken}}\n", "headerData": [ { @@ -314,7 +508,7 @@ "enabled": true } ], - "url": "{{url}}/develop/challenges/checkpoint/2220002", + "url": "{{url}}/challenges/registrants/1110005", "queryParams": [], "preRequestScript": null, "pathVariables": {}, @@ -325,15 +519,45 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1497550612717, - "name": "Old logic, access allowed", + "time": 1497935002619, + "name": "New logic, access denied", "description": "", "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "bcc821a7-0e3a-3454-d900-12af0cc94656", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/registrants/1110001", + "queryParams": [], + "pathVariables": {}, + "pathVariableData": [], + "preRequestScript": null, + "method": "GET", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "data": null, + "dataMode": "params", + "name": "No groups (challenge is not private)", + "description": "", + "descriptionFormat": "html", + "time": 1497934405019, + "version": 2, "responses": [], - "folder": "712ffa63-a959-e4a3-6af9-84d4f236b2f3" + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "folder": "6a038555-23cd-e79f-1d34-0fb860e305a3" }, { - "id": "f545bbfc-36d7-6567-25a8-b4d6634575e7", + "id": "bf83e2d2-549b-361e-f5cf-66a40d816f0c", "headers": "Authorization: Bearer {{authToken}}\n", "headerData": [ { @@ -343,7 +567,7 @@ "enabled": true } ], - "url": "{{url}}/develop/challenges/checkpoint/2220004", + "url": "{{url}}/challenges/1110004", "queryParams": [], "preRequestScript": null, "pathVariables": {}, @@ -354,12 +578,410 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1497550705028, + "time": 1497958165136, + "name": "New logic, access allowed", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "c305f2ea-dbfd-f95f-c809-583133af5881", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/phases/1110004", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497959248881, "name": "New logic, access allowed", "description": "", "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "c383cab7-3145-145e-9da9-846001755460", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/1110001", + "queryParams": [], + "pathVariables": {}, + "pathVariableData": [], + "preRequestScript": null, + "method": "GET", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "data": null, + "dataMode": "params", + "name": "No groups (challenge is not private)", + "description": "", + "descriptionFormat": "html", + "time": 1497957874624, + "version": 2, "responses": [], - "folder": "712ffa63-a959-e4a3-6af9-84d4f236b2f3" + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "folder": "cada5a0c-766f-dde0-3c9f-d001a67eddd4" + }, + { + "id": "c7d11de6-630a-71bd-4095-cd3c8fb8ab77", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/phases/1110001", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497959147405, + "name": "No groups (challenge is not private)", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "d3e5ca45-334d-fb54-1fd7-46f8e7b82841", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/submissions/2220003", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497959455425, + "name": "Old logic, access denied", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "d7a050dc-6eaa-f62e-24e4-37d111002d4a", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/phases/1110003", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497959220837, + "name": "Old logic, access denied", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "d830ec36-eb8e-9586-c546-14af77cec152", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/challenges/checkpoint/2220002", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497550612717, + "name": "Old logic, access allowed", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [], + "folder": "712ffa63-a959-e4a3-6af9-84d4f236b2f3" + }, + { + "id": "e97dac4e-c786-27b1-5e4b-fff50b6de93a", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/registrants/1110004", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497934940451, + "name": "New logic, access allowed", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "f545bbfc-36d7-6567-25a8-b4d6634575e7", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/challenges/checkpoint/2220004", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497550705028, + "name": "New logic, access allowed", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [], + "folder": "712ffa63-a959-e4a3-6af9-84d4f236b2f3" + }, + { + "id": "f5da62a7-9231-5f7a-f44a-f2f14c9ae003", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/phases/1110002", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497959161340, + "name": "Old logic, access allowed", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "f73f4e00-c286-d440-ce79-89095d7354dd", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/registrants/1110003", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497934860473, + "name": "Old logic, access denied", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "f8720a5a-5a8b-423c-065f-8d3a3469fbca", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/submissions/2220005", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497959508749, + "name": "New logic, access denied", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "f8e9d38f-8d8d-6e63-4978-6e3546f20b7c", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/submissions/2220004", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497959483268, + "name": "New logic, access allowed", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "f90179ed-98da-be6d-77ae-9e3aa4199b5c", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/submissions/2220001", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497959423349, + "name": "No groups (challenge is not private)", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "f915c206-b3fe-a4be-1094-bc8a448cb467", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/submissions/2220002", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497959438513, + "name": "Old logic, access allowed", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] }, { "id": "fd4cd936-2d4d-a272-f402-d0f7b6cab82f", From 5752555da66be407f89d9e0430f2813c8fb3637b Mon Sep 17 00:00:00 2001 From: Vyacheslav V Sokolov Date: Sat, 24 Jun 2017 05:54:47 +0700 Subject: [PATCH 6/6] Improve challenge visibility control: review and search --- actions/challenges.js | 64 +- actions/reviewOpportunities.js | 49 +- db_scripts/test_eligibility.delete.sql | 25 + db_scripts/test_eligibility.insert.sql | 374 ++++- ...e-Improve Challenge Visibility Control.doc | Bin 56832 -> 63488 bytes initializers/v3client.js | 38 +- queries/get_challenge_results_validations | 2 - queries/get_open_challenges | 2 +- queries/get_open_challenges_count | 2 +- queries/get_past_challenges | 1 - queries/get_past_challenges_count | 5 - .../search_past_software_studio_challenges | 7 +- ...arch_past_software_studio_challenges_count | 5 +- .../search_software_review_opportunities_data | 26 +- queries/search_software_studio_challenges | 5 - .../search_software_studio_challenges_count | 6 - queries/search_studio_review_opportunities | 24 +- ...Visibility_Control.postman_collection.json | 1239 +++++++++++++++-- test/scripts/mock_v3.js | 18 + 19 files changed, 1703 insertions(+), 189 deletions(-) diff --git a/actions/challenges.js b/actions/challenges.js index bb4d6ceb9..c7e7ab32e 100755 --- a/actions/challenges.js +++ b/actions/challenges.js @@ -80,8 +80,9 @@ * Changes in 1.31: * - Remove screeningScorecardId and reviewScorecardId from search challenges api. * Changes in 1.32: - * - validateChallenge, getRegistrants, getChallenge, getSubmissions and getPhases functions now check - * if an user belongs to a group via user_group_xref for old challenges and by calling V3 API for new ones. + * - validateChallenge, getRegistrants, getChallenge, getSubmissions, getPhases, searchChallenges and getChallenges + * functions now check if an user belongs to a group via user_group_xref for old challenges and by calling V3 API + * for new ones. */ "use strict"; /*jslint stupid: true, unparam: true, continue: true, nomen: true */ @@ -155,15 +156,22 @@ var CHALLENGE_TYPE_FILTER = ' AND p.project_category_id IN (@filter@)'; * This filter will return all private challenges. * @since 1.24 */ -var ALL_PRIVATE_CHALLENGE_FILTER = ' EXISTS (SELECT contest_id FROM contest_eligibility WHERE contest_id = p.project_id)\n'; +var ALL_PRIVATE_CHALLENGE_FILTER = '(@amIAdmin@ = 0 AND EXISTS (SELECT contest_id FROM contest_eligibility WHERE contest_id = p.project_id))\n'; /** * This filter will return private challenges that given user_id can access. * @since 1.24 */ -var USER_PRIVATE_CHALLENGE_FILTER = ' EXISTS (SELECT contest_id FROM contest_eligibility ce, ' + - 'group_contest_eligibility gce, user_group_xref x WHERE x.login_id = @user_id@ AND x.group_id = gce.group_id ' + - 'AND gce.contest_eligibility_id = ce.contest_eligibility_id AND ce.contest_id = p.project_id)\n'; +var USER_PRIVATE_CHALLENGE_FILTER = ' EXISTS (SELECT contest_id ' + + 'FROM contest_eligibility ce ' + + 'INNER JOIN group_contest_eligibility gce ON gce.contest_eligibility_id = ce.contest_eligibility_id ' + + 'INNER JOIN security_groups sg ON gce.group_id = sg.group_id ' + + 'LEFT JOIN user_group_xref x ON x.group_id = gce.group_id ' + + 'WHERE ce.contest_id = p.project_id AND (' + + '(sg.challenge_group_ind = 0 AND x.login_id = @userId@)' + + 'OR (sg.challenge_group_ind <> 0 AND gce.group_id IN (@myGroups@))' + + ')' + +')\n'; /** * This filter return all private challenges that in specific group. @@ -908,7 +916,8 @@ var searchChallenges = function (api, connection, dbConnectionMap, community, ne total, challengeType, queryName, - challenges; + challenges, + myGroups; for (prop in query) { if (query.hasOwnProperty(prop)) { query[prop.toLowerCase()] = query[prop]; @@ -963,7 +972,17 @@ var searchChallenges = function (api, connection, dbConnectionMap, community, ne sqlParams.user_id = caller.userId || 0; // Check the private challenge access - api.dataAccess.executeQuery('check_eligibility', sqlParams, dbConnectionMap, cb); + api.v3client.getMyGroups(connection, cb); + }, function (groups, cb) { + myGroups = groups; + sqlParams.amIAdmin = connection.caller.accessLevel === 'admin' ? 1 : 0; + sqlParams.myGroups = myGroups; + // Next function uses the passed parameter only to check if it's not empty + if(sqlParams.amIAdmin || !_.isDefined(query.communityId) || _.indexOf(myGroups, query.communityId) !== -1) { + cb(null, [1]); + } else { + api.dataAccess.executeQuery('check_eligibility', sqlParams, dbConnectionMap, cb); + } }, function (results, cb) { if (results.length === 0) { // Return error if the user is not allowed to a specific group(communityId is set) @@ -2310,7 +2329,8 @@ var getChallengeResults = function (api, connection, dbConnectionMap, isStudio, cb(error); return; } - + api.challengeHelper.checkUserChallengeEligibility(connection, challengeId, cb); + }, function (cb) { sqlParams.challengeId = challengeId; api.dataAccess.executeQuery("get_challenge_results_validations", sqlParams, dbConnectionMap, cb); }, function (rows, cb) { @@ -2319,11 +2339,6 @@ var getChallengeResults = function (api, connection, dbConnectionMap, isStudio, return; } - if (rows[0].is_private_challenge) { - cb(new NotFoundError('This is a private challenge. You cannot view it.')); - return; - } - if (!rows[0].is_challenge_finished) { cb(new BadRequestError('You cannot view the results because the challenge is not yet finished or was cancelled.')); return; @@ -3677,7 +3692,8 @@ var getChallenges = function (api, connection, listType, isMyChallenges, next) { result = {}, total, challenges, - index; + index, + myGroups; for (prop in query) { if (query.hasOwnProperty(prop)) { query[prop.toLowerCase()] = query[prop]; @@ -3723,11 +3739,15 @@ var getChallenges = function (api, connection, listType, isMyChallenges, next) { }, function (cb) { validateInputParameterV2(helper, caller, type, query, filter, pageIndex, pageSize, sortColumn, sortOrder, listType, dbConnectionMap, cb); - + }, function (cb) { + api.v3client.getMyGroups(connection, cb); + }, function (groups, cb) { + myGroups = groups; + if (filter.technologies) { filter.tech = filter.technologies.split(',')[0]; } - }, function (cb) { + if (pageIndex === -1) { pageIndex = 1; pageSize = helper.MAX_PAGE_SIZE; @@ -3744,7 +3764,9 @@ var getChallenges = function (api, connection, listType, isMyChallenges, next) { registration_phase_status: helper.LIST_TYPE_REGISTRATION_STATUS_MAP[listType], project_status_id: helper.LIST_TYPE_PROJECT_STATUS_MAP[listType], user_id: caller.userId || 0, - userId: caller.userId || 0 + userId: caller.userId || 0, + amIAdmin: caller.accessLevel === 'admin' ? 1 : 0, + myGroups: myGroups }); if (isMyChallenges) { @@ -3757,7 +3779,11 @@ var getChallenges = function (api, connection, listType, isMyChallenges, next) { } // Check the private challenge access - api.dataAccess.executeQuery('check_eligibility', sqlParams, dbConnectionMap, cb); + if(sqlParams.amIAdmin || !_.isDefined(query.communityId) || _.indexOf(myGroups, query.communityId) !== -1) { + cb(null, [1]); + } else { + api.dataAccess.executeQuery('check_eligibility', sqlParams, dbConnectionMap, cb); + } }, function (results, cb) { if (results.length === 0) { // Return error if the user is not allowed to a specific group(communityId is set) diff --git a/actions/reviewOpportunities.js b/actions/reviewOpportunities.js index ed89b53ef..052296805 100644 --- a/actions/reviewOpportunities.js +++ b/actions/reviewOpportunities.js @@ -1,8 +1,8 @@ /* - * Copyright (C) 2013 - 2014 TopCoder Inc., All Rights Reserved. + * Copyright (C) 2013 - 2017 TopCoder Inc., All Rights Reserved. * - * @version 1.6 - * @author Sky_, Ghost_141, flytoj2ee + * @version 1.7 + * @author Sky_, Ghost_141, flytoj2ee, GFalcon * changes in 1.1 * - Implement the studio review opportunities. * changes in 1.2 @@ -17,6 +17,10 @@ * - Implement the applyStudioReviewOpportunity api. * Changes in 1.6: * - Fix bug in review opportunities api. + * Changes in 1.7: + * - all functions check the right of the current user to view + * or apply to a challenge via user_group_xref for old challenges + * and by calling V3 API for new ones. */ 'use strict'; /*jslint node: true, stupid: true, unparam: true, plusplus: true */ @@ -212,6 +216,7 @@ var getStudioReviewOpportunity = function (api, connection, dbConnectionMap, nex cb(error); return; } + sqlParams.challengeId = challengeId; api.dataAccess.executeQuery('get_studio_review_opportunity_phases', sqlParams, dbConnectionMap, cb); }, function (rows, cb) { @@ -229,6 +234,9 @@ var getStudioReviewOpportunity = function (api, connection, dbConnectionMap, nex duration: getDuration(row.start_time, row.end_time) + ' hours' }); }); + // Check if the user has the right to view the challenge + api.challengeHelper.checkUserChallengeEligibility(connection, challengeId, cb); + }, function (cb) { api.dataAccess.executeQuery('get_studio_review_opportunity_positions', sqlParams, dbConnectionMap, cb); }, function (rows, cb) { if (rows.length !== 0) { @@ -467,6 +475,7 @@ var calculatePayment = function (reviewOpportunityInfo, adjustPayments) { */ var getPaymentValues = function (reviewOpportunityInfo, adjustPayments, isAsc) { var payment = calculatePayment(reviewOpportunityInfo, adjustPayments); + return _.sortBy(payment, function (item) { return (isAsc ? -item : item); }); }; @@ -479,7 +488,7 @@ var getPaymentValues = function (reviewOpportunityInfo, adjustPayments, isAsc) { */ var getReviewOpportunities = function (api, connection, isStudio, next) { var helper = api.helper, result = {}, sqlParams, dbConnectionMap = connection.dbConnectionMap, pageIndex, - pageSize, sortOrder, sortColumn, filter = {}, reviewOpportunities, queryName; + pageSize, sortOrder, sortColumn, filter = {}, reviewOpportunities, queryName, myGroups; pageSize = Number(connection.params.pageSize || helper.MAX_PAGE_SIZE); pageIndex = Number(connection.params.pageIndex || 1); @@ -491,6 +500,11 @@ var getReviewOpportunities = function (api, connection, isStudio, next) { validateInputParameter(helper, connection, filter, isStudio, cb); }, function (cb) { + api.v3client.getMyGroups(connection, cb) + }, + function (groups, cb) { + + myGroups = groups; if (pageIndex === -1) { pageIndex = 1; @@ -512,7 +526,10 @@ var getReviewOpportunities = function (api, connection, isStudio, next) { reviewStartDateSecondDate: filter.reviewStartDate.secondDate, reviewEndDateFirstDate: filter.reviewEndDate.firstDate, reviewEndDateSecondDate: filter.reviewEndDate.secondDate, - challenge_id: 0 + challenge_id: 0, + amIAdmin: connection.caller.accessLevel === 'admin' ? 1 : 0, + myId: (connection.caller.userId || 0), + myGroups: myGroups }; queryName = isStudio ? 'search_studio_review_opportunities' : 'search_software_review_opportunities_data'; @@ -653,7 +670,9 @@ var getSoftwareReviewOpportunity = function (api, connection, next) { }; async.parallel({ - privateCheck: execQuery('check_user_challenge_accessibility'), + privateCheck: function (cbx) { + api.challengeHelper.checkUserChallengeEligibility(connection, challengeId, cbx); + }, reviewCheck: execQuery('check_challenge_review_opportunity') }, cb); }, @@ -664,11 +683,6 @@ var getSoftwareReviewOpportunity = function (api, connection, next) { return; } - if (result.privateCheck[0].is_private && !result.privateCheck[0].has_access) { - cb(new ForbiddenError('The user is not allowed to visit this challenge review opportunity detail.')); - return; - } - async.parallel({ basic: execQuery('get_review_opportunity_detail_basic'), phases: execQuery('get_review_opportunity_detail_phases'), @@ -864,8 +878,8 @@ var applyDevelopReviewOpportunity = function (api, connection, next) { api.dataAccess.executeQuery('check_reviewer', { challenge_id: challengeId, user_id: caller.userId }, dbConnectionMap, cbx); }, privateCheck: function (cbx) { - api.dataAccess.executeQuery('check_user_challenge_accessibility', { challengeId: challengeId, user_id: caller.userId }, dbConnectionMap, cbx); - } + api.challengeHelper.checkUserChallengeEligibility(connection, challengeId, cbx); + }, }, cb); }, function (res, cb) { @@ -875,7 +889,6 @@ var applyDevelopReviewOpportunity = function (api, connection, next) { .map(function (item) { return item.review_application_role_id; }) .uniq() .value(), - privateCheck = res.privateCheck[0], positionsLeft, assignedResourceRoles = res.resourceRoles, currentUserResourceRole = _.filter(assignedResourceRoles, function (item) { return item.user_id === caller.userId; }); @@ -908,13 +921,7 @@ var applyDevelopReviewOpportunity = function (api, connection, next) { return; } - // The caller can't access this private challenge. - if (privateCheck.is_private && !privateCheck.has_access) { - cb(new ForbiddenError('The user is not allowed to register this challenge review.')); - return; - } - - // We only check this when caller is trying to apply review opportunity not cancel them. + // We only check this when caller is trying to apply review opportunity not cancel them. // Get the review resource role that belong to the caller. If the length > 0 then the user is a reviewer already. if (reviewApplicationRoleId.length > 0 && currentUserResourceRole.length > 0) { cb(new BadRequestError('You are already assigned as reviewer for the contest.')); diff --git a/db_scripts/test_eligibility.delete.sql b/db_scripts/test_eligibility.delete.sql index 5f77f6c44..bb51bcc0a 100644 --- a/db_scripts/test_eligibility.delete.sql +++ b/db_scripts/test_eligibility.delete.sql @@ -9,8 +9,30 @@ DATABASE informixoltp; -- UPDATE coder SET comp_country_code = NULL WHERE user_id = 132458; +DATABASE tcs_dw; + +DELETE FROM project WHERE project_id > 4440000 AND project_id < 4440100; + DATABASE tcs_catalog; +DELETE FROM project_info WHERE project_id > 5550000 AND project_id < 5550100; +DELETE FROM project_phase WHERE project_id > 5550000 AND project_id < 5550100; +DELETE FROM project WHERE project_id > 5550000 AND project_id < 5550100; + +DELETE FROM project_info WHERE project_id > 4440000 AND project_id < 4440100; +DELETE FROM project_phase WHERE project_id > 4440000 AND project_id < 4440100; +DELETE FROM prize WHERE project_id > 4440000 AND project_id < 4440100; +DELETE FROM project WHERE project_id > 4440000 AND project_id < 4440100; + +DELETE FROM resource_info WHERE resource_id IN (SELECT resource_id FROM resource WHERE project_id > 3330000 AND project_id < 3330100); +DELETE FROM resource WHERE project_id > 3330000 AND project_id < 3330100; +DELETE FROM project_info WHERE project_id > 3330000 AND project_id < 3330100; +DELETE FROM project_phase WHERE project_id > 3330000 AND project_id < 3330100; +DELETE FROM project WHERE project_id > 3330000 AND project_id < 3330100; +DELETE FROM project_studio_specification WHERE project_studio_spec_id = 3330333; + +DELETE FROM prize WHERE project_id > 1110000 AND project_id < 1110100; +DELETE FROM project_payment_adjustment WHERE project_id > 1110000 AND project_id < 1110100; DELETE FROM notification WHERE project_id > 1110000 AND project_id < 1110100; DELETE FROM project_result WHERE project_id > 1110000 AND project_id < 1110100; DELETE FROM project_user_audit WHERE project_id > 1110000 AND project_id < 1110100; @@ -18,9 +40,12 @@ DELETE FROM component_inquiry WHERE project_id > 1110000 AND project_id < 111010 DELETE FROM resource_info WHERE resource_id IN (SELECT resource_id FROM resource WHERE project_id > 1110000 AND project_id < 1110100); DELETE FROM resource WHERE project_id > 1110000 AND project_id < 1110100; +DELETE FROM review_application WHERE review_auction_id IN (SELECT review_auction_id FROM review_auction WHERE project_id > 1110000 AND project_id < 1110100); +DELETE FROM review_auction WHERE project_id > 1110000 AND project_id < 1110100; DELETE FROM project_info WHERE project_id > 1110000 AND project_id < 1110100; DELETE FROM comp_versions WHERE component_id = 3330333; DELETE FROM comp_catalog WHERE component_id = 3330333; +DELETE FROM phase_criteria WHERE project_phase_id > 1110000 AND project_phase_id < 1110100; DELETE FROM project_phase WHERE project_id > 1110000 AND project_id < 1110100; DELETE FROM project WHERE project_id > 1110000 AND project_id < 1110100; diff --git a/db_scripts/test_eligibility.insert.sql b/db_scripts/test_eligibility.insert.sql index 44a286bf0..e96d96135 100644 --- a/db_scripts/test_eligibility.insert.sql +++ b/db_scripts/test_eligibility.insert.sql @@ -111,16 +111,16 @@ INSERT INTO review_item_comment (review_item_comment_id, resource_id, review_ite INSERT INTO review_item_comment (review_item_comment_id, resource_id, review_item_id, comment_type_id, content, sort, create_user, create_date, modify_user, modify_date) VALUES (7770005, 8880005, 5550005, 1, "The current user has the right to view this challenge", 1, "132456", CURRENT, "132456", CURRENT); -INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date) - VALUES (1110001, 1, 14, "132456", CURRENT, "132456", CURRENT); -INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date) - VALUES (1110002, 1, 14, "132456", CURRENT, "132456", CURRENT); -INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date) - VALUES (1110003, 1, 14, "132456", CURRENT, "132456", CURRENT); -INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date) - VALUES (1110004, 1, 14, "132456", CURRENT, "132456", CURRENT); -INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date) - VALUES (1110005, 1, 14, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (1110001, 1, 14, "132456", CURRENT, "132456", CURRENT, 0); +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (1110002, 1, 14, "132456", CURRENT, "132456", CURRENT, 0); +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (1110003, 1, 14, "132456", CURRENT, "132456", CURRENT, 0); +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (1110004, 1, 14, "132456", CURRENT, "132456", CURRENT, 0); +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (1110005, 1, 14, "132456", CURRENT, "132456", CURRENT, 0); INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) VALUES (2220001, 1110001, 1, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); @@ -139,6 +139,17 @@ INSERT INTO comp_catalog (component_id, current_version, component_name, status_ INSERT INTO comp_versions (comp_vers_id, component_id, version, version_text, phase_id, phase_time, price, modify_date) VALUES (4440444, 3330333, 1, "1", 113, CURRENT, 1000, CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110001, 1, "23", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110002, 1, "23", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110003, 1, "23", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110004, 1, "23", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110005, 1, "23", "132456", CURRENT, "132456", CURRENT); + INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) VALUES (1110001, 2, "3330333", "132456", CURRENT, "132456", CURRENT); INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) @@ -151,15 +162,15 @@ INSERT INTO project_info (project_id, project_info_type_id, value, create_user, VALUES (1110005, 2, "3330333", "132456", CURRENT, "132456", CURRENT); INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) - VALUES (1110001, 6, "Not private", "132456", CURRENT, "132456", CURRENT); + VALUES (1110001, 6, "ElTest Not private", "132456", CURRENT, "132456", CURRENT); INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) - VALUES (1110002, 6, "Old logic - access allowed", "132456", CURRENT, "132456", CURRENT); + VALUES (1110002, 6, "ElTest Old logic - access allowed", "132456", CURRENT, "132456", CURRENT); INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) - VALUES (1110003, 6, "Old logic - access denied", "132456", CURRENT, "132456", CURRENT); + VALUES (1110003, 6, "ElTest Old logic - access denied", "132456", CURRENT, "132456", CURRENT); INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) - VALUES (1110004, 6, "New logic - access allowed", "132456", CURRENT, "132456", CURRENT); + VALUES (1110004, 6, "ElTest New logic - access allowed", "132456", CURRENT, "132456", CURRENT); INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) - VALUES (1110005, 6, "New logic - access denied", "132456", CURRENT, "132456", CURRENT); + VALUES (1110005, 6, "ElTest New logic - access denied", "132456", CURRENT, "132456", CURRENT); INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) VALUES (1110001, 26, "---", "132456", CURRENT, "132456", CURRENT); @@ -194,12 +205,315 @@ INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_st INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) VALUES (3330005, 1110005, 2, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110001, 1110001, 4, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110002, 1110002, 4, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110003, 1110003, 4, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110004, 1110004, 4, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110005, 1110005, 4, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); + +INSERT INTO phase_criteria (project_phase_id, phase_criteria_type_id, parameter, create_user, create_date, modify_user, modify_date) + VALUES (1110001, 6, "3", "132456", CURRENT, "132456", CURRENT); +INSERT INTO phase_criteria (project_phase_id, phase_criteria_type_id, parameter, create_user, create_date, modify_user, modify_date) + VALUES (1110002, 6, "3", "132456", CURRENT, "132456", CURRENT); +INSERT INTO phase_criteria (project_phase_id, phase_criteria_type_id, parameter, create_user, create_date, modify_user, modify_date) + VALUES (1110003, 6, "3", "132456", CURRENT, "132456", CURRENT); +INSERT INTO phase_criteria (project_phase_id, phase_criteria_type_id, parameter, create_user, create_date, modify_user, modify_date) + VALUES (1110004, 6, "3", "132456", CURRENT, "132456", CURRENT); +INSERT INTO phase_criteria (project_phase_id, phase_criteria_type_id, parameter, create_user, create_date, modify_user, modify_date) + VALUES (1110005, 6, "3", "132456", CURRENT, "132456", CURRENT); + +INSERT INTO review_auction (review_auction_id, project_id, review_auction_type_id) + VALUES (1110001, 1110001, 1); +INSERT INTO review_auction (review_auction_id, project_id, review_auction_type_id) + VALUES (1110002, 1110002, 1); +INSERT INTO review_auction (review_auction_id, project_id, review_auction_type_id) + VALUES (1110003, 1110003, 1); +INSERT INTO review_auction (review_auction_id, project_id, review_auction_type_id) + VALUES (1110004, 1110004, 1); +INSERT INTO review_auction (review_auction_id, project_id, review_auction_type_id) + VALUES (1110005, 1110005, 1); + +INSERT INTO project_payment_adjustment (project_id, resource_role_id, fixed_amount, multiplier) + VALUES (1110001, 4, 100, 1); +INSERT INTO project_payment_adjustment (project_id, resource_role_id, fixed_amount, multiplier) + VALUES (1110002, 4, 100, 1); +INSERT INTO project_payment_adjustment (project_id, resource_role_id, fixed_amount, multiplier) + VALUES (1110003, 4, 100, 1); +INSERT INTO project_payment_adjustment (project_id, resource_role_id, fixed_amount, multiplier) + VALUES (1110004, 4, 100, 1); +INSERT INTO project_payment_adjustment (project_id, resource_role_id, fixed_amount, multiplier) + VALUES (1110005, 4, 100, 1); + +INSERT INTO prize (prize_id, project_id, place, prize_amount, prize_type_id, number_of_submissions, create_user, create_date, modify_user, modify_date) + VALUES (2220001, 1110001, 1, 1000, 15, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO prize (prize_id, project_id, place, prize_amount, prize_type_id, number_of_submissions, create_user, create_date, modify_user, modify_date) + VALUES (2220002, 1110002, 1, 1000, 15, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO prize (prize_id, project_id, place, prize_amount, prize_type_id, number_of_submissions, create_user, create_date, modify_user, modify_date) + VALUES (2220003, 1110003, 1, 1000, 15, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO prize (prize_id, project_id, place, prize_amount, prize_type_id, number_of_submissions, create_user, create_date, modify_user, modify_date) + VALUES (2220004, 1110004, 1, 1000, 15, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO prize (prize_id, project_id, place, prize_amount, prize_type_id, number_of_submissions, create_user, create_date, modify_user, modify_date) + VALUES (2220005, 1110005, 1, 1000, 15, 1, "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project_studio_specification (project_studio_spec_id, create_user, create_date, modify_user, modify_date) + VALUES (3330333, "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project (project_id, project_status_id, project_category_id, project_studio_spec_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (3330001, 1, 17, 3330333, "132456", CURRENT, "132456", CURRENT, 0); +INSERT INTO project (project_id, project_status_id, project_category_id, project_studio_spec_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (3330002, 1, 17, 3330333, "132456", CURRENT, "132456", CURRENT, 0); +INSERT INTO project (project_id, project_status_id, project_category_id, project_studio_spec_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (3330003, 1, 17, 3330333, "132456", CURRENT, "132456", CURRENT, 0); +INSERT INTO project (project_id, project_status_id, project_category_id, project_studio_spec_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (3330004, 1, 17, 3330333, "132456", CURRENT, "132456", CURRENT, 0); +INSERT INTO project (project_id, project_status_id, project_category_id, project_studio_spec_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (3330005, 1, 17, 3330333, "132456", CURRENT, "132456", CURRENT, 0); + +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (4440001, 3330001, 1, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (4440002, 3330002, 1, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (4440003, 3330003, 1, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (4440004, 3330004, 1, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (4440005, 3330005, 1, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (5550001, 3330001, 2, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (5550002, 3330002, 2, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (5550003, 3330003, 2, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (5550004, 3330004, 2, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (5550005, 3330005, 2, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (8880001, 3330001, 3, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (8880002, 3330002, 3, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (8880003, 3330003, 3, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (8880004, 3330004, 3, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (8880005, 3330005, 3, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (9990001, 3330001, 16, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (9990002, 3330002, 16, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (9990003, 3330003, 16, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (9990004, 3330004, 16, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (9990005, 3330005, 16, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (3330001, 1, "23", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (3330002, 1, "23", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (3330003, 1, "23", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (3330004, 1, "23", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (3330005, 1, "23", "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (3330001, 6, "ElTest Studio Not private", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (3330002, 6, "ElTest Studio Old logic - access allowed", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (3330003, 6, "ElTest Studio Old logic - access denied", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (3330004, 6, "ElTest Studio New logic - access allowed", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (3330005, 6, "ElTest Studio New logic - access denied", "132456", CURRENT, "132456", CURRENT); + +INSERT INTO resource (resource_id, resource_role_id, project_id, project_phase_id, user_id, create_user, create_date, modify_user, modify_date) + VALUES (1110001, 2, 3330001, 5550001, 132456, "132456", CURRENT, "132456", CURRENT); +INSERT INTO resource (resource_id, resource_role_id, project_id, project_phase_id, user_id, create_user, create_date, modify_user, modify_date) + VALUES (1110002, 2, 3330002, 5550002, 132456, "132456", CURRENT, "132456", CURRENT); +INSERT INTO resource (resource_id, resource_role_id, project_id, project_phase_id, user_id, create_user, create_date, modify_user, modify_date) + VALUES (1110003, 2, 3330003, 5550003, 132456, "132456", CURRENT, "132456", CURRENT); +INSERT INTO resource (resource_id, resource_role_id, project_id, project_phase_id, user_id, create_user, create_date, modify_user, modify_date) + VALUES (1110004, 2, 3330004, 5550004, 132456, "132456", CURRENT, "132456", CURRENT); +INSERT INTO resource (resource_id, resource_role_id, project_id, project_phase_id, user_id, create_user, create_date, modify_user, modify_date) + VALUES (1110005, 2, 3330005, 5550005, 132456, "132456", CURRENT, "132456", CURRENT); + +INSERT INTO resource_info (resource_id, resource_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110001, 1, "132456", "132456", CURRENT, "132456", CURRENT); +INSERT INTO resource_info (resource_id, resource_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110002, 1, "132456", "132456", CURRENT, "132456", CURRENT); +INSERT INTO resource_info (resource_id, resource_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110003, 1, "132456", "132456", CURRENT, "132456", CURRENT); +INSERT INTO resource_info (resource_id, resource_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110004, 1, "132456", "132456", CURRENT, "132456", CURRENT); +INSERT INTO resource_info (resource_id, resource_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110005, 1, "132456", "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (4440001, 4, 14, "132456", CURRENT, "132456", CURRENT, 0); +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (4440002, 4, 14, "132456", CURRENT, "132456", CURRENT, 0); +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (4440003, 4, 14, "132456", CURRENT, "132456", CURRENT, 0); +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (4440004, 4, 14, "132456", CURRENT, "132456", CURRENT, 0); +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (4440005, 4, 14, "132456", CURRENT, "132456", CURRENT, 0); + +INSERT INTO prize (prize_id, project_id, place, prize_amount, prize_type_id, number_of_submissions, create_user, create_date, modify_user, modify_date) + VALUES (3330001, 4440001, 1, 1000, 15, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO prize (prize_id, project_id, place, prize_amount, prize_type_id, number_of_submissions, create_user, create_date, modify_user, modify_date) + VALUES (3330002, 4440002, 1, 1000, 15, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO prize (prize_id, project_id, place, prize_amount, prize_type_id, number_of_submissions, create_user, create_date, modify_user, modify_date) + VALUES (3330003, 4440003, 1, 1000, 15, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO prize (prize_id, project_id, place, prize_amount, prize_type_id, number_of_submissions, create_user, create_date, modify_user, modify_date) + VALUES (3330004, 4440004, 1, 1000, 15, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO prize (prize_id, project_id, place, prize_amount, prize_type_id, number_of_submissions, create_user, create_date, modify_user, modify_date) + VALUES (3330005, 4440005, 1, 1000, 15, 1, "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110011, 4440001, 1, 3, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110012, 4440002, 1, 3, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110013, 4440003, 1, 3, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110014, 4440004, 1, 3, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110015, 4440005, 1, 3, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, actual_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110021, 4440001, 2, 3, CURRENT, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, actual_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110022, 4440002, 2, 3, CURRENT, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, actual_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110023, 4440003, 2, 3, CURRENT, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, actual_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110024, 4440004, 2, 3, CURRENT, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, actual_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110025, 4440005, 2, 3, CURRENT, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (4440001, 1, "1", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (4440002, 1, "1", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (4440003, 1, "1", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (4440004, 1, "1", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (4440005, 1, "1", "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (4440001, 6, "ElTest Past Not private", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (4440002, 6, "ElTest Past Old logic - access allowed", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (4440003, 6, "ElTest Past Old logic - access denied", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (4440004, 6, "ElTest Past New logic - access allowed", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (4440005, 6, "ElTest Past New logic - access denied", "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (5550001, 2, 14, "132456", CURRENT, "132456", CURRENT, 0); +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (5550002, 2, 14, "132456", CURRENT, "132456", CURRENT, 0); +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (5550003, 2, 14, "132456", CURRENT, "132456", CURRENT, 0); +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (5550004, 2, 14, "132456", CURRENT, "132456", CURRENT, 0); +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (5550005, 2, 14, "132456", CURRENT, "132456", CURRENT, 0); + +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (5550001, 1, "1", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (5550002, 1, "1", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (5550003, 1, "1", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (5550004, 1, "1", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (5550005, 1, "1", "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (5550001, 6, "ElTest Upcoming Not private", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (5550002, 6, "ElTest Upcoming Old logic - access allowed", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (5550003, 6, "ElTest Upcoming Old logic - access denied", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (5550004, 6, "ElTest Upcoming New logic - access allowed", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (5550005, 6, "ElTest Upcoming New logic - access denied", "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (5550001, 32, "1", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (5550002, 32, "1", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (5550003, 32, "1", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (5550004, 32, "1", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (5550005, 32, "1", "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110031, 5550001, 1, 1, CURRENT + 7 UNITS DAY, CURRENT + 7 UNITS DAY, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110032, 5550002, 1, 1, CURRENT + 7 UNITS DAY, CURRENT + 7 UNITS DAY, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110033, 5550003, 1, 1, CURRENT + 7 UNITS DAY, CURRENT + 7 UNITS DAY, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110034, 5550004, 1, 1, CURRENT + 7 UNITS DAY, CURRENT + 7 UNITS DAY, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110035, 5550005, 1, 1, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110041, 5550001, 2, 1, CURRENT + 7 UNITS DAY, CURRENT + 7 UNITS DAY, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110042, 5550002, 2, 1, CURRENT + 7 UNITS DAY, CURRENT + 7 UNITS DAY, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110043, 5550003, 2, 1, CURRENT + 7 UNITS DAY, CURRENT + 7 UNITS DAY, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110044, 5550004, 2, 1, CURRENT + 7 UNITS DAY, CURRENT + 7 UNITS DAY, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110045, 5550005, 2, 1, CURRENT + 7 UNITS DAY, CURRENT + 7 UNITS DAY, 1, "132456", CURRENT, "132456", CURRENT); + DATABASE informixoltp; UPDATE coder SET comp_country_code = ( SELECT MIN(country_code) FROM country WHERE country_name = "United States" ) WHERE coder_id = 132458; +DATABASE tcs_dw; + +INSERT INTO project (project_id, component_name) + VALUES (4440001, "ElTest Past Not private"); +INSERT INTO project (project_id, component_name) + VALUES (4440002, "ElTest Past Old logic - access allowed"); +INSERT INTO project (project_id, component_name) + VALUES (4440003, "ElTest Past Old logic - access denied"); +INSERT INTO project (project_id, component_name) + VALUES (4440004, "ElTest Past New logic - access allowed"); +INSERT INTO project (project_id, component_name) + VALUES (4440005, "ElTest Past New logic - access denied"); + + DATABASE common_oltp; INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110002, 2220002, 0); @@ -228,3 +542,33 @@ INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110013, 3330002); INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110014, 3330003); INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110015, 3330004); + +INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110022, 3330002, 1); +INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110023, 3330003, 1); +INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110024, 3330004, 1); +INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110025, 3330005, 1); + +INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110022, 3330001); +INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110023, 3330002); +INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110024, 3330003); +INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110025, 3330004); + +INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110032, 4440002, 1); +INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110033, 4440003, 1); +INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110034, 4440004, 1); +INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110035, 4440005, 1); + +INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110032, 3330001); +INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110033, 3330002); +INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110034, 3330003); +INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110035, 3330004); + +INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110042, 5550002, 1); +INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110043, 5550003, 1); +INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110044, 5550004, 1); +INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110045, 5550005, 1); + +INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110042, 3330001); +INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110043, 3330002); +INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110044, 3330003); +INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110045, 3330004); diff --git a/docs/Verification_Guide-Improve Challenge Visibility Control.doc b/docs/Verification_Guide-Improve Challenge Visibility Control.doc index fd53c55cca92514a1e3731a719129a08120a1bcc..9e797573a1614ba9d5744fc42fc1ba99fe91c67c 100644 GIT binary patch delta 5862 zcmb_gYjjlA72bC;i4$QaLte}f0ylvqpfM{UnUDq&lV}1&2!vNj#t2QCf{4)QjO%B6WW zn>2JmP2PC^(DHi8N{na*RspMl7N8Ya19$-+;0M+MZNNG}6s*Vh2HqEy(qm1|9^acu zRGCF&CE9`x!hk_56^Grg+rq`U9m(xEMDZS?j#4Z;izs^`(E|&)ATN{8<`y~p)6hMe zs2$?X3;BelioJQ$ExnoA!91JAQklhl`EBeiDB{wBLQeJ+@ELq>obKY+3&!wSkBhTC zD!=SW=6cVqyk|x-#}xKqI-e-KD_V@Sa>?Wc(J&KtcTOIuJu=x9!}m-XGp66N9@qpu69u^u(;Ym3jO+=4B=ix3h@<` z^iPcx2bDNVuBb$v5;;0($>J%_xNzOiWLP<`B!OQoQ57ryz9cnT-xvOONyhcqqcYhk z*)@4toW{2Ubi~|g-Kr?VxYL@>u@yxN zE3o~F?I9OYzlCVIA{zED$ogUP8w(HB{G+K#7f@p~(J}DSM!!VAmG0dt-;q+0$SW&~ zRL(6))|`zwidJ6rnu5FGO3(E4=;HVP_*J2dsch&-%StN;aoljhSVQDQJF8O9jeu2wbKS+__}q#F@DJ3=|6+PmEP;*AQ(&lv~k%9^Vr<&6+am{6wM`5vJWx z){LIS8;FYV-CD?`pFn&M6eS_jQ=Q6);z`&%|U& z*7LAtKG)rGZ&DS;Uk8c#@}fN)JwEM1!?|K5n?L>eSWevJg=WTV=fYPu6C1W)v8%mm~4zea{MB9%ZL)wN>O(-2IB(1nwu%I8y zt%h7Q$l`Wf^DuiA`kQ&pqX}HYFT;D_>NI^F8QFrFe%Nb{ka1Vx1KT%^%=cmDTKF$*bM@$O;b(8&~PyXwTPGH^Ds#hR}0H zgzGMKp03s#RD4w=!B!{n+>Oam>!?LGu(lWri>64*N#IOZq&Gw}SE;*=-G&RYq83}Q%VWYfQGI>{^{pd@)cKAZUCfLrm%iZf)zRgnAjXqdW9 znk?04NnsEg7~2=xl8|MX$454#rpcC>{tJzV&Jgk^Wz<8T(8ln?C^yS=vaJO<#3IpG z-gN^n*vWPD`h}EYu~`qLP)V{$I!IZNNK1{B;wEbwHp-_^ypGmG z5=k#J4*598p6pJjH<>gSv)4eEX!c{4j1wM|!)}y6U6Z7~q=E@$Poc6&yF zRWsh%oyetKF;U1qt!`(ur8YEH!Xc+%uVfichC`D>NI0 zalY8hzv~<}cIa;c*&Hbf#@XZJpLLH+FwXjj@+l>RH*;cKWcv7cO-m{lJ>hiuND8H0 zFO}iNQ0T7Y%XH+oK}K0p_TD&{3}@uvlpQqlQFvgCbE%aGjP8JLW@N2378IvLKL?~X zN7e!fv7aC6iv12PkyT79&EO9`35JFvSTmF0{^bXX9;rf!lv6gqrOrW2B#n)lVVGX~ z-2^eD+Ri`iPL-Wa7_zglu|N*MMaBVG4o1oLNWpWfQvO})Y?M9WuGtQ04LYiiT7Xfa zTQWor0^@)zN5QS#n3U?l7?YEtTej{JevkK(2b*)Mt)_?%>`UX*+Bl_#ojs!iHvF9`18RV|Kz14a zW&wS`Vc;lm3>W}D1U>>T0O{p;mI4$2HNYHT2{5{XXbg}8JPqsy_5%BX7lBuSUZ4*+ zTtNXkikrPR5%mE3fnFf~W};+Zpo++g|FQBAqz%|!P4qah14z6DV*nR03P=ZfXF@U1 z51a%BfOh}~o~t;4cpwoN4deooX5B_qft$MkdHC|_`}7{Yck0wBI)3~(Zhw1V=vyCg zoQ~^5FiPH-f;X1&9aIfoh;8fR8yqA8;5r3OH-AT|hn12*l4tWPoJA z53~X8K+HV+T?eiO?q7f>Q^0267;pmk4EP+lZlUqyDxBGW9iU^>OTFm_4<4jm+~_dw z&>;PHTV{gg@aq^t-i2Brd~Kou|@ zXa&50A7}#}0KPo`<@x`7ESIJ+6RHWtgjzx=p_0((0(TsBYfFzku2f3XWYkQMrY1-rA&rnlNFwAAQuG5SfdN2B zp(5b&%u-j!54|~xJNoRNQ&4#6b(M{N9`=Tt&%JJ+@aCndxY-}x_*Hmg7oG)8<(J>C zgGJwL#ss14ZAYdLVl%^#h_1H;&!cRr7@{Hu&F{CR_t U!E66A7?X!7`?qKt-o4-QKU0=h^#A|> delta 1959 zcmai#e@s(X6vxkdEw#$8f`CP&Lkj*t#WLICDryA;MaHm0v$1Q~G~W4hs@*~A}l zGuejYEQAoZxk%^P4X*#4?P}F3=zcw{#uUG34_1{LxM22$~XOm z;T=4@3m$&8eqD_^Y+=l?NTN6ck(#IkcET8snrvSB_7b+4N)zJZiJHws#Vd#^QivR> zL`J+YG4CAcbHO|?AH?xp)3Sg=7@3WcIbZ>ChiMLX$a>zButq)>sa#6X%5t26yO)&k z9`jPpGFy39W*8?~3_J||BzS1iOA&m<9La4K8<$(cINogFO%^?eS=-=*UDho=ViziY zF>!-(I#I8YRD3;YIxl!(DhJwUu+<&_%UXNv0*@UF8{e*IWu5qii2Y|1X@#x_>0t*Y z-mQ*N&e+p5>yi;0N&5vlI%J|kNsOx9F!$3RsyC)*-Q1iuZXh2u(ZvX&DO84jHSIkp z+9$1L%B}PORZV8JkF6~zaJq1mYFstNv7|7VC>*Q#&y}zf9ZriJ34-nEk;?1qPwD)S z2s;Lq*4OESI5zJ&?Psd8=K8-n#k$Q(Y2G18&PioMzR`a?lfoepf|ZpY9VD_Q_UiEj zA}2&T-ktyPd?bj5k;HvyC&YqjwrT(pTMT0_+Ic)%9Wk>PDXv2}Di;!oZ%Vz0XeruY zGw;?~Lyy{s^3XkXInf}@QE(KBr7iPm!i&++QZ&=>rPN6*71sDC;q8qWc6UcM%ExR) zt3N^k0LdWwKJMQ$3NyxkM3n{M55;X*?$a!uZylPWsI2$#15=x#TcoeSs2b5UYR zK`)C*wt^kt6HtDB)~+AXHiPq^6ZC^Y5U`SHCYS}HKqaUGwV(mCf*#-kvK`q4`Jez4 zf?}`_><1O#G-v`HU;qq)zwNY(POgGO&<=WmJ((yOq=HP44IE$-$OU;I9~6L0RFf=G zQGf&F08xwR{xJ3SQV;cXP6)M62+ZhybVmzqc>Hnvg?4JEx})$gDQvp9j=#CEnw{s2 zIV*+xO3(zF!6>*7WSkc@&;TvafnZ<*Nni!A15qZ&=nnPYz;(?jE=4NbEOGZQ0a~po z<5hYiL(TFmAoBZ17MDXSmMtBDFvN} callback - the callback. Receives either an error - * or the list of group's users an array of numeric IDs + * or the list of group's users as an array of numeric IDs */ function getGroupMembers(connection, groupId, callback) { getToken(connection, function (err, token) { @@ -118,6 +118,38 @@ function getGroupMembers(connection, groupId, callback) { }); } +/** + * Get IDs of groups the specified user belongs to + * + * @param {Object} connection - the connection object provided by ActionHero + * @param {Number} userId - the user ID + * @param {Function} callback - the callback. Receives either an error + * or the list of user's groups as an array of numeric IDs + */ +function getUserGroups(connection, userId, callback) { + getToken(connection, function (err, token) { + if (err) { + callback(err); + return; + } + callService({ + url: v3url + 'groups?memberId=' + userId + '&membershipType=user', + method: 'GET', + headers: { + 'Authorization': 'Bearer ' + token + } + }, function (err, body) { + if (err) { + callback(err); + } else { + callback(null, body.result.content.map(function (item) { + return item.id; + })); + } + }); + }); +} + exports.v3client = function (api, next) { api.v3client = { /** @@ -137,6 +169,10 @@ exports.v3client = function (api, next) { callback(null, members.indexOf(userId) >= 0); } }); + }, + + getMyGroups: function (connection, callback) { + getUserGroups(connection, (connection.caller.userId || 0), callback); } }; next(); diff --git a/queries/get_challenge_results_validations b/queries/get_challenge_results_validations index 1e2acb93d..f9c7cf315 100644 --- a/queries/get_challenge_results_validations +++ b/queries/get_challenge_results_validations @@ -1,10 +1,8 @@ select p.project_id, - ce.contest_eligibility_id IS NOT NULL as is_private_challenge, p.project_status_id IN (4,5,7) as is_challenge_finished, p.project_category_id, pcl.project_type_id from project p -left join contest_eligibility ce on p.project_id = ce.contest_id inner join project_category_lu pcl on p.project_category_id = pcl.project_category_id where p.project_id = @challengeId@ diff --git a/queries/get_open_challenges b/queries/get_open_challenges index 7a581d5f9..56e00225c 100644 --- a/queries/get_open_challenges +++ b/queries/get_open_challenges @@ -98,7 +98,7 @@ AND NVL(pp2.actual_end_time, pp2.scheduled_end_time) BETWEEN TO_DATE('@submissio AND pi1.project_info_type_id = 1 -- external reference id AND pi1.project_id = p.project_id -AND pn.value LIKE ('@challenge_name@') +AND LOWER(pn.value) LIKE ('@challenge_name@') AND NVL((SELECT pr.prize_amount FROM prize pr WHERE pr.project_id = p.project_id AND pr.prize_type_id = 15 AND pr.place = 1), 0) >= @prize_lower_bound@ AND NVL((SELECT pr.prize_amount FROM prize pr WHERE pr.project_id = p.project_id AND pr.prize_type_id = 15 AND pr.place = 1), 0) <= @prize_upper_bound@ AND p.tc_direct_project_id = DECODE(@project_id@, 0, p.tc_direct_project_id, @project_id@) diff --git a/queries/get_open_challenges_count b/queries/get_open_challenges_count index 0b65313d6..c55f71031 100644 --- a/queries/get_open_challenges_count +++ b/queries/get_open_challenges_count @@ -28,7 +28,7 @@ AND pi1.project_info_type_id = 1 -- external reference id AND pi1.project_id = p.project_id AND LOWER(pcl.description) = DECODE('@challenge_type@', '', LOWER(pcl.description), '@challenge_type@') -AND pn.value LIKE ('@challenge_name@') +AND LOWER(pn.value) LIKE ('@challenge_name@') AND NVL((SELECT pr.prize_amount FROM prize pr WHERE pr.project_id = p.project_id AND pr.prize_type_id = 15 AND pr.place = 1), 0) >= @prize_lower_bound@ AND NVL((SELECT pr.prize_amount FROM prize pr WHERE pr.project_id = p.project_id AND pr.prize_type_id = 15 AND pr.place = 1), 0) <= @prize_upper_bound@ AND p.tc_direct_project_id = DECODE(@project_id@, 0, p.tc_direct_project_id, @project_id@) diff --git a/queries/get_past_challenges b/queries/get_past_challenges index 49ff02fcf..283ba4ab6 100644 --- a/queries/get_past_challenges +++ b/queries/get_past_challenges @@ -64,7 +64,6 @@ p.project_status_id IN (4, 5, 6, 7, 8, 9, 10, 11) AND pcl.project_category_id NOT IN (27, 37) AND pcl.project_type_id IN (@track@) and NVL(pp2.actual_end_time, pp2.scheduled_end_time) > '2012-01-01 00:00:00' AND NVL(pp2.actual_end_time, pp2.scheduled_end_time) BETWEEN TO_DATE('@submission_end_from@ 00:00:00', '%Y-%m-%d %H:%M:%S') AND TO_DATE('@submission_end_to@ 23:59:59', '%Y-%m-%d %H:%M:%S') --- Filter out the challenge that user is not belong to. AND pp1.phase_status_id in (2,3) AND LOWER(pn.value) LIKE('@challenge_name@') -- start of parameters diff --git a/queries/get_past_challenges_count b/queries/get_past_challenges_count index 23b07d5eb..f9085edbd 100644 --- a/queries/get_past_challenges_count +++ b/queries/get_past_challenges_count @@ -25,9 +25,4 @@ AND LOWER(pn.value) LIKE ('@challenge_name@') AND NVL((SELECT pr.prize_amount FROM prize pr WHERE pr.project_id = p.project_id AND pr.prize_type_id = 15 AND pr.place = 1), 0) >= @prize_lower_bound@ AND NVL((SELECT pr.prize_amount FROM prize pr WHERE pr.project_id = p.project_id AND pr.prize_type_id = 15 AND pr.place = 1), 0) <= @prize_upper_bound@ AND p.tc_direct_project_id = DECODE(@project_id@, 0, p.tc_direct_project_id, @project_id@) --- Filter out the challenge that user is not belong to. -AND (not exists (select contest_id from contest_eligibility where contest_id = p.project_id) - or exists(select contest_id from contest_eligibility ce, group_contest_eligibility gce, user_group_xref x - where ((gce.group_id < 2000000 AND x.group_id = gce.group_id AND x.login_id = @user_id@) OR gce.group_id >= 2000000) AND gce.contest_eligibility_id = ce.contest_eligibility_id - AND ce.contest_id = p.project_id)) AND not exists (select 1 from resource r, project_info pi82 where r.project_id = p.project_id and r.resource_role_id = 1 and p.project_id = pi82.project_id and project_info_type_id = 82 and pi82.value = 1) diff --git a/queries/search_past_software_studio_challenges b/queries/search_past_software_studio_challenges index 53ba42220..f3b5a12ad 100644 --- a/queries/search_past_software_studio_challenges +++ b/queries/search_past_software_studio_challenges @@ -97,16 +97,11 @@ AND p.project_status_id IN (4, 5, 6, 7, 8, 9, 10, 11) AND pcl.project_type_id IN (@project_type_id@) AND NVL(pp.actual_end_time, pp.scheduled_end_time) BETWEEN TO_DATE('@submissionEndFrom@ 00:00:00', '%Y-%m-%d %H:%M:%S') AND TO_DATE('@submissionEndTo@ 23:59:59', '%Y-%m-%d %H:%M:%S') AND LOWER(pcl.description) = DECODE('@categoryName@', '', LOWER(pcl.description), '@categoryName@') -AND (challenge_name.value) LIKE ('@challengeName@') +AND LOWER(challenge_name.value) LIKE ('@challengeName@') AND NVL(pr.prize_amount, 0) >= @prilower@ AND NVL(pr.prize_amount, 0) <= @priupper@ AND p.tc_direct_project_id = DECODE(@tcdirectid@, 0, p.tc_direct_project_id, @tcdirectid@) AND NVL((cmc_task_id.value), '') = DECODE('@cmc@', '', NVL((cmc_task_id.value), ''), '@cmc@') --- Filter out the challenge that user is not belong to. -AND (not exists (SELECT contest_id FROM contest_eligibility WHERE contest_id = p.project_id) - OR exists(SELECT contest_id FROM contest_eligibility ce, group_contest_eligibility gce, user_group_xref x - WHERE ((gce.group_id < 2000000 AND x.group_id = gce.group_id AND x.login_id = @user_id@) OR gce.group_id >= 2000000) AND gce.contest_eligibility_id = ce.contest_eligibility_id - AND ce.contest_id = p.project_id)) and pp.actual_end_time > '2012-01-01 00:00:00' ORDER BY @sortColumn@ @sortOrder@ diff --git a/queries/search_past_software_studio_challenges_count b/queries/search_past_software_studio_challenges_count index 81bd29d3b..90ebf9b16 100644 --- a/queries/search_past_software_studio_challenges_count +++ b/queries/search_past_software_studio_challenges_count @@ -9,10 +9,7 @@ INNER JOIN project_status_lu pstatus ON p.project_status_id = pstatus.project_st INNER JOIN project_category_lu pcl on pcl.project_category_id = p.project_category_id LEFT JOIN project_info pi1 ON pi1.project_id = p.project_id AND pi1.project_info_type_id = 1 -WHERE (not exists (SELECT contest_id FROM contest_eligibility WHERE contest_id = p.project_id) - OR exists(SELECT contest_id FROM contest_eligibility ce, group_contest_eligibility gce, user_group_xref x - WHERE ((gce.group_id < 2000000 AND x.group_id = gce.group_id AND x.login_id = 22655028) OR gce.group_id >= 2000000) AND gce.contest_eligibility_id = ce.contest_eligibility_id - AND ce.contest_id = p.project_id)) +WHERE 1=1 AND pcl.project_category_id NOT IN (27, 37) --exclude when spec review was a 'contest.' Also exclude MM, which is in there as a 'software' contest. AND p.project_status_id IN (4, 5, 6, 7, 8, 9, 10, 11) AND pcl.project_type_id in (@project_type_id@) diff --git a/queries/search_software_review_opportunities_data b/queries/search_software_review_opportunities_data index 3db5243db..f6810dd61 100644 --- a/queries/search_software_review_opportunities_data +++ b/queries/search_software_review_opportunities_data @@ -1,5 +1,5 @@ SELECT -* +d.* FROM ( -- software contest review SELECT @@ -167,14 +167,24 @@ AND pp2.phase_status_id IN (2,3) AND pp18.phase_status_id IN (1,2) AND not exists (SELECT 1 FROM project_phase pp12 WHERE pp12.project_id=p.project_id AND pp12.phase_type_id=12) AND dpp.resource_role_id = 21 -) +) d + LEFT JOIN contest_eligibility ce ON ce.contest_id = d.challenge_id + LEFT JOIN group_contest_eligibility gce ON gce.contest_eligibility_id = ce.contest_eligibility_id + LEFT JOIN security_groups sg ON gce.group_id = sg.group_id + LEFT JOIN user_group_xref ugx ON ugx.group_id = gce.group_id WHERE 1=1 -AND LOWER(review_type) = LOWER(DECODE('@reviewType@', '', review_type, '@reviewType@')) -AND LOWER(challenge_name) LIKE LOWER('%@challengeName@%') -AND LOWER(challenge_type) = LOWER(DECODE('@challengeType@', '', challenge_type, '@challengeType@')) -AND review_start BETWEEN TO_DATE('@reviewStartDateFirstDate@ 00:00:00', '%Y-%m-%d %H:%M:%S') AND TO_DATE('@reviewStartDateSecondDate@ 00:00:00', '%Y-%m-%d %H:%M:%S') -AND review_end BETWEEN TO_DATE('@reviewEndDateFirstDate@ 00:00:00', '%Y-%m-%d %H:%M:%S') AND TO_DATE('@reviewEndDateSecondDate@ 00:00:00', '%Y-%m-%d %H:%M:%S') -AND number_of_review_positions_available > 0 +AND LOWER(d.review_type) = LOWER(DECODE('@reviewType@', '', d.review_type, '@reviewType@')) +AND LOWER(d.challenge_name) LIKE LOWER('%@challengeName@%') +AND LOWER(d.challenge_type) = LOWER(DECODE('@challengeType@', '', d.challenge_type, '@challengeType@')) +AND d.review_start BETWEEN TO_DATE('@reviewStartDateFirstDate@ 00:00:00', '%Y-%m-%d %H:%M:%S') AND TO_DATE('@reviewStartDateSecondDate@ 00:00:00', '%Y-%m-%d %H:%M:%S') +AND d.review_end BETWEEN TO_DATE('@reviewEndDateFirstDate@ 00:00:00', '%Y-%m-%d %H:%M:%S') AND TO_DATE('@reviewEndDateSecondDate@ 00:00:00', '%Y-%m-%d %H:%M:%S') +AND d.number_of_review_positions_available > 0 +-- eligibility check +AND (@amIAdmin@ = 1 + OR ce.contest_id IS NULL + OR (sg.challenge_group_ind = 0 AND ugx.login_id = @myId@) + OR (sg.challenge_group_ind <> 0 AND gce.group_id IN (@myGroups@)) +) ORDER BY @sortColumn@ @sortOrder@ diff --git a/queries/search_software_studio_challenges b/queries/search_software_studio_challenges index 18c7c1370..149baaa21 100644 --- a/queries/search_software_studio_challenges +++ b/queries/search_software_studio_challenges @@ -101,11 +101,6 @@ FIRST @pageSize@ AND p.project_Id = nd_phase.project_id AND nd_phase.phase_type_id = (SELECT MIN(phase_type_id) FROM project_phase WHERE project_id = p.project_id AND phase_status_id = 2 AND phase_type_id not in (13,14)) AND p.project_category_id = pcl.project_category_id - -- Filter out the challenge that user is not belong to. - AND (not exists (select contest_id from contest_eligibility where contest_id = p.project_id) - or exists(select contest_id from contest_eligibility ce, group_contest_eligibility gce, user_group_xref x - where ((gce.group_id < 2000000 AND x.group_id = gce.group_id AND x.login_id = 22655028) OR gce.group_id >= 2000000) AND gce.contest_eligibility_id = ce.contest_eligibility_id - AND ce.contest_id = p.project_id)) AND pcl.project_category_id NOT IN (27, 37) --exclude when spec review was a 'contest.' Also exclude MM, which is in there as a 'software' contest. -- start of parameters AND pstatus.project_status_id IN (@project_status_id@) diff --git a/queries/search_software_studio_challenges_count b/queries/search_software_studio_challenges_count index ca300b02b..bf338a9be 100644 --- a/queries/search_software_studio_challenges_count +++ b/queries/search_software_studio_challenges_count @@ -48,18 +48,12 @@ SELECT count(*) AS total AND p.project_Id = nd_phase.project_id AND nd_phase.project_phase_id = (SELECT MAX(project_phase_id) FROM project_phase WHERE project_id = p.project_id AND phase_status_id = 2 AND phase_type_id IN (1,2,3,4,5,6,7,8,9,10,11,12)) AND p.project_category_id = pcl.project_category_id - -- Filter out the challenge that user is not belong to. - AND (not exists (select contest_id from contest_eligibility where contest_id = p.project_id) - or exists(select contest_id from contest_eligibility ce, group_contest_eligibility gce, user_group_xref x - where ((gce.group_id < 2000000 AND x.group_id = gce.group_id AND x.login_id = 22655028) OR gce.group_id >= 2000000) AND gce.contest_eligibility_id = ce.contest_eligibility_id - AND ce.contest_id = p.project_id)) AND pcl.project_category_id NOT IN (27, 37) --exclude when spec review was a 'contest.' Also exclude MM, which is in there as a 'software' contest. AND pstatus.project_status_id IN (@project_status_id@) AND pcl.project_type_id IN (@project_type_id@) AND pp1.phase_status_id IN (@registration_phase_status@) AND pp1.scheduled_start_time >= decode (pstatus.project_status_id, 2, current, pp1.scheduled_start_time) AND NVL(pp2.actual_end_time, pp2.scheduled_end_time) BETWEEN TO_DATE('@submissionEndFrom@ 00:00:00', '%Y-%m-%d %H:%M:%S') AND TO_DATE('@submissionEndTo@ 23:59:59', '%Y-%m-%d %H:%M:%S') - AND LOWER(pcl.description) = DECODE('@categoryName@', '', LOWER(pcl.description), '@categoryName@') AND LOWER(pn.value) LIKE ('@challengeName@') AND NVL((SELECT pr.prize_amount FROM prize pr WHERE pr.project_id = p.project_id AND pr.prize_type_id = 15 AND pr.place = 1), 0) >= @prilower@ diff --git a/queries/search_studio_review_opportunities b/queries/search_studio_review_opportunities index 83266023c..75281ade0 100644 --- a/queries/search_studio_review_opportunities +++ b/queries/search_studio_review_opportunities @@ -1,5 +1,5 @@ SELECT -* +d.* FROM ( -- studio screen review SELECT @@ -43,13 +43,23 @@ WHERE p.project_status_id = 1 AND pcl.project_type_id = 3 AND pps.phase_status_id = 2 AND ppsub.phase_status_id = 1 -) +) d + LEFT JOIN contest_eligibility ce ON ce.contest_id = d.challenge_id + LEFT JOIN group_contest_eligibility gce ON gce.contest_eligibility_id = ce.contest_eligibility_id + LEFT JOIN security_groups sg ON gce.group_id = sg.group_id + LEFT JOIN user_group_xref ugx ON ugx.group_id = gce.group_id WHERE 1=1 -AND LOWER(review_type) = LOWER(DECODE('@reviewType@', '', review_type, '@reviewType@')) -AND LOWER(challenge_name) LIKE LOWER('%@challengeName@%') -AND LOWER(challenge_type) = LOWER(DECODE('@challengeType@', '', challenge_type, '@challengeType@')) -AND round_1_scheduled_start_date BETWEEN TO_DATE('@round1ScheduledStartDateFirstDate@ 00:00:00', '%Y-%m-%d %H:%M:%S') AND TO_DATE('@round1ScheduledStartDateSecondDate@ 00:00:00', '%Y-%m-%d %H:%M:%S') -AND round_2_scheduled_start_date BETWEEN TO_DATE('@round2ScheduledStartDateFirstDate@ 00:00:00', '%Y-%m-%d %H:%M:%S') AND TO_DATE('@round2ScheduledStartDateSecondDate@ 00:00:00', '%Y-%m-%d %H:%M:%S') +AND LOWER(d.review_type) = LOWER(DECODE('@reviewType@', '', d.review_type, '@reviewType@')) +AND LOWER(d.challenge_name) LIKE LOWER('%@challengeName@%') +AND LOWER(d.challenge_type) = LOWER(DECODE('@challengeType@', '', d.challenge_type, '@challengeType@')) +AND d.round_1_scheduled_start_date BETWEEN TO_DATE('@round1ScheduledStartDateFirstDate@ 00:00:00', '%Y-%m-%d %H:%M:%S') AND TO_DATE('@round1ScheduledStartDateSecondDate@ 00:00:00', '%Y-%m-%d %H:%M:%S') +AND d.round_2_scheduled_start_date BETWEEN TO_DATE('@round2ScheduledStartDateFirstDate@ 00:00:00', '%Y-%m-%d %H:%M:%S') AND TO_DATE('@round2ScheduledStartDateSecondDate@ 00:00:00', '%Y-%m-%d %H:%M:%S') +-- eligibility check +AND (@amIAdmin@ = 1 + OR ce.contest_id IS NULL + OR (sg.challenge_group_ind = 0 AND ugx.login_id = @myId@) + OR (sg.challenge_group_ind <> 0 AND gce.group_id IN (@myGroups@)) +) ORDER BY @sortColumn@ @sortOrder@ diff --git a/test/postman/New_Challenge_Visibility_Control.postman_collection.json b/test/postman/New_Challenge_Visibility_Control.postman_collection.json index 3c52fb3e4..20631b0ed 100644 --- a/test/postman/New_Challenge_Visibility_Control.postman_collection.json +++ b/test/postman/New_Challenge_Visibility_Control.postman_collection.json @@ -4,6 +4,19 @@ "description": "", "order": [], "folders": [ + { + "id": "a12cc40f-4ca4-bad5-caea-1ae2cfd77178", + "name": "Apply develop review opportunity", + "description": "", + "order": [ + "30e239bc-9e0e-2a97-0399-9853d7c975e6", + "92d5a6ac-d7fc-79de-c5d4-fd10a79b018e", + "cc1cbe83-a990-ff80-e1fa-0358899198f2", + "bc9566fa-bd94-980a-2b61-813d1340cfa4", + "23b8c76c-9c35-b358-4528-8e1709bcb3e8" + ], + "owner": "316251" + }, { "id": "cada5a0c-766f-dde0-3c9f-d001a67eddd4", "name": "Get challenge", @@ -17,6 +30,32 @@ ], "owner": "316251" }, + { + "id": "7a366938-cb0d-d72c-9417-b89ddfe0c118", + "name": "Get challenge results", + "description": "", + "order": [ + "0786bf2a-c9bf-96ee-a118-67ead2b1455f", + "70050c8d-3db5-9437-7c90-1f1c15ac8a46", + "21d43db1-c228-6827-7a46-e6461bb713fb", + "6dc5c17f-a1d8-ebc8-7549-5208871f72db", + "b7a298cc-2b90-6522-f82b-49d20d22d2bb" + ], + "owner": "316251", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240" + }, + { + "id": "4f202fce-de29-8aad-46e1-ba806709ac52", + "name": "Get challenges", + "description": "", + "order": [ + "247ab2ed-2b95-b175-e608-f50edceb9362", + "9205a134-bc37-29e2-3db8-971b7ac77967", + "83e8261b-f1c3-3e4a-ba71-161e0920a501", + "e34964fd-e868-71a4-e852-31625310c757" + ], + "owner": "316251" + }, { "id": "712ffa63-a959-e4a3-6af9-84d4f236b2f3", "name": "Get checkpoints", @@ -57,6 +96,34 @@ ], "owner": "316251" }, + { + "id": "8cc9f069-2635-6081-ef6f-baf617842ce3", + "name": "Get software review opportunities", + "description": "", + "order": [ + "8d5321d9-a039-cdd3-48a7-9579e45ba662", + "4261978e-2788-4268-1861-d07789751882", + "39daceeb-f95f-d17f-69bf-69f72d7c26a1", + "0d3ba7cd-d432-fa9c-983e-1e81a07a6f42", + "74cdf1ee-8c8d-2dba-a6eb-1b9fa5a7ac6e" + ], + "owner": "316251", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240" + }, + { + "id": "0b5aaf5f-42c8-c27e-64d1-40850629e731", + "name": "Get studio review opportunities", + "description": "", + "order": [ + "5ebf9f3b-84d9-fdcb-cfb4-d26bbdfe45bf", + "bb5cd293-ec53-ec1f-b50c-182111a88aab", + "f074d3f8-29e3-3ba2-1443-94880e0dc8c1", + "215af832-848a-8cbe-2b5f-573ca44b0118", + "1e8d26dc-0ca8-3749-5c2e-915e1befd3ef" + ], + "owner": "316251", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240" + }, { "id": "2a873809-800c-ee71-51ad-94f10096709b", "name": "Get submissions", @@ -84,6 +151,29 @@ ], "owner": "316251" }, + { + "id": "ec385321-d8aa-d1ed-8b5d-991a495f5ea5", + "name": "Search challenges", + "description": "", + "order": [ + "0f2cd89b-df48-b349-b768-c0d75359f2e8", + "6cddf85e-0300-8961-475b-6875e7a7cc94", + "4ee820aa-c05e-94ed-ff5f-491a16ee50f8", + "6593fbc7-0b92-62a1-9456-1b79f1116b7c" + ], + "owner": "316251", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240" + }, + { + "id": "a75c1882-2a5a-8f93-2af5-8e7f552e4c64", + "name": "Search review opportunities", + "description": "", + "order": [ + "851754f0-043d-2145-4b39-47d555a9bffe", + "bd0a5b89-bfc7-4f0c-ed41-a46351fc2c02" + ], + "owner": "316251" + }, { "id": "0eeb693c-c6b6-e23b-156d-cff5f21dbb27", "name": "login", @@ -128,6 +218,101 @@ "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", "responses": [] }, + { + "id": "0786bf2a-c9bf-96ee-a118-67ead2b1455f", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/challenges/result/4440001", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498254891698, + "name": "No groups (challenge is not private)", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "0d3ba7cd-d432-fa9c-983e-1e81a07a6f42", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/reviewOpportunities/1110004", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498218134168, + "name": "New logic, access allowed", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "0f2cd89b-df48-b349-b768-c0d75359f2e8", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/design/challenges?challengeName=ElTest", + "queryParams": [ + { + "key": "challengeName", + "value": "ElTest", + "equals": true, + "description": "", + "enabled": true + } + ], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498249335711, + "name": "Studio", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, { "id": "1af5c911-4627-ad92-085c-63e6fc7b6d9e", "headers": "Authorization: Bearer {{authToken}}\n", @@ -157,7 +342,7 @@ "responses": [] }, { - "id": "2af8f0d9-f3e8-c58a-ca3d-1130e4b07371", + "id": "1e8d26dc-0ca8-3749-5c2e-915e1befd3ef", "headers": "Authorization: Bearer {{authToken}}\n", "headerData": [ { @@ -167,7 +352,7 @@ "enabled": true } ], - "url": "{{url}}/develop/challenges/checkpoint/2220003", + "url": "{{url}}/design/reviewOpportunities/3330005", "queryParams": [], "preRequestScript": null, "pathVariables": {}, @@ -175,18 +360,111 @@ "method": "GET", "data": null, "dataMode": "params", + "version": 2, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1497550652259, + "time": 1498147418116, + "name": "New logic, access denied", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "215af832-848a-8cbe-2b5f-573ca44b0118", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/design/reviewOpportunities/3330004", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498147402100, + "name": "New logic, access allowed", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "21d43db1-c228-6827-7a46-e6461bb713fb", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/challenges/result/4440003", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498254961664, "name": "Old logic, access denied", "description": "", "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "23b8c76c-9c35-b358-4528-8e1709bcb3e8", + "headers": "Authorization: Bearer {{authToken}}\nContent-Type: application/json\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + }, + { + "key": "Content-Type", + "value": "application/json", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/reviewOpportunities/1110005/apply", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "POST", + "data": [], + "dataMode": "raw", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498218619120, + "name": "New logic, access denied", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", "responses": [], - "folder": "712ffa63-a959-e4a3-6af9-84d4f236b2f3" + "rawModeData": "{\n\t\"reviewApplicationRoleId\": \"1\"\n}" }, { - "id": "3246a996-e8f9-5e60-79b9-8aeffcd5392f", + "id": "247ab2ed-2b95-b175-e608-f50edceb9362", "headers": "Authorization: Bearer {{authToken}}\n", "headerData": [ { @@ -196,7 +474,7 @@ "enabled": true } ], - "url": "{{url}}/challenges/1110003", + "url": "{{url}}/challenges/active", "queryParams": [], "preRequestScript": null, "pathVariables": {}, @@ -204,17 +482,18 @@ "method": "GET", "data": null, "dataMode": "params", + "version": 2, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1497958076427, - "name": "Old logic, access denied", + "time": 1498248914110, + "name": "Active", "description": "", "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", "responses": [] }, { - "id": "42b84596-9d5a-50e7-76be-c1ad23f98468", + "id": "2af8f0d9-f3e8-c58a-ca3d-1130e4b07371", "headers": "Authorization: Bearer {{authToken}}\n", "headerData": [ { @@ -224,7 +503,7 @@ "enabled": true } ], - "url": "{{url}}/challenges/1110002", + "url": "{{url}}/develop/challenges/checkpoint/2220003", "queryParams": [], "preRequestScript": null, "pathVariables": {}, @@ -235,14 +514,624 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1497957969156, - "name": "Old logic, access allowed", + "time": 1497550652259, + "name": "Old logic, access denied", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [], + "folder": "712ffa63-a959-e4a3-6af9-84d4f236b2f3" + }, + { + "id": "30e239bc-9e0e-2a97-0399-9853d7c975e6", + "headers": "Authorization: Bearer {{authToken}}\nContent-Type: application/json\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + }, + { + "key": "Content-Type", + "value": "application/json", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/reviewOpportunities/1110001/apply", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "POST", + "data": [], + "dataMode": "raw", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498218392399, + "name": "No groups (challenge is not private)", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [], + "rawModeData": "{\n\t\"reviewApplicationRoleId\": \"1\"\n}" + }, + { + "id": "3246a996-e8f9-5e60-79b9-8aeffcd5392f", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/1110003", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497958076427, + "name": "Old logic, access denied", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "39daceeb-f95f-d17f-69bf-69f72d7c26a1", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/reviewOpportunities/1110003", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498218096242, + "name": "Old logic, access denied", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "4261978e-2788-4268-1861-d07789751882", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/reviewOpportunities/1110002", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498218104222, + "name": "Old logic, access allowed", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "42b84596-9d5a-50e7-76be-c1ad23f98468", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/1110002", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497957969156, + "name": "Old logic, access allowed", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "46cf305a-8251-66aa-391c-46def82773a1", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/1110005/register", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "POST", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497813578982, + "name": "New logic, access denied", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "4b64d85a-4c08-8ec2-9c3f-50605bd2e09e", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/1110001/register", + "queryParams": [], + "pathVariables": {}, + "pathVariableData": [], + "preRequestScript": null, + "method": "POST", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "data": null, + "dataMode": "params", + "name": "No groups (challenge is not private)", + "description": "", + "descriptionFormat": "html", + "time": 1497813014785, + "version": 2, + "responses": [], + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "folder": "cfbf928f-56b8-9813-f8f3-4ac4e342d965" + }, + { + "id": "4ee820aa-c05e-94ed-ff5f-491a16ee50f8", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges?challengeName=ElTest", + "queryParams": [ + { + "key": "challengeName", + "value": "ElTest", + "equals": true, + "description": "", + "enabled": true + } + ], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498249357470, + "name": "Studio and Software", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "5224f722-9f4f-07bb-58e7-351512cc66ea", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/1110002/register", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "POST", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497813399305, + "name": "Old logic, access allowed", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "5ebf9f3b-84d9-fdcb-cfb4-d26bbdfe45bf", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/design/reviewOpportunities/3330001", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498147241389, + "name": "No groups (challenge is not private)", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "60ae89de-4eb1-c0aa-b866-b28b52436e89", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/1110003/register", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "POST", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497813480606, + "name": "Old logic, access denied", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "6593fbc7-0b92-62a1-9456-1b79f1116b7c", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges?challengeName=ElTest&listtype=PAST", + "queryParams": [ + { + "key": "challengeName", + "value": "ElTest", + "equals": true, + "description": "", + "enabled": true + }, + { + "key": "listtype", + "value": "PAST", + "equals": true, + "description": "", + "enabled": true + } + ], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498249368414, + "name": "Past", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "6bed8920-6800-0ae0-e63d-b39b05c7f50c", + "headers": "Content-Type: application/json\n", + "url": "{{url}}/auth", + "preRequestScript": null, + "pathVariables": {}, + "method": "POST", + "data": [], + "dataMode": "raw", + "version": 2, + "tests": "var authResponse = JSON.parse(responseBody);\npostman.setEnvironmentVariable(\"authToken\", authResponse.token);\ntests[\"Status code is 200\"] = responseCode.code === 200;\nvar jsonData = JSON.parse(responseBody);\ntests[\"A valid token is returned\"] = !!jsonData.token;", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1474159263289, + "name": "Login as admin user", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [], + "rawModeData": "{\n \"username\": \"heffan\", \n \"password\": \"password\"\n}", + "folder": "0eeb693c-c6b6-e23b-156d-cff5f21dbb27" + }, + { + "id": "6cddf85e-0300-8961-475b-6875e7a7cc94", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/challenges?challengeName=ElTest", + "queryParams": [ + { + "key": "challengeName", + "value": "ElTest", + "equals": true, + "description": "", + "enabled": true + } + ], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498249348509, + "name": "Software", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "6dc5c17f-a1d8-ebc8-7549-5208871f72db", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/challenges/result/4440004", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498254985316, + "name": "New logic, access allowed", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "70050c8d-3db5-9437-7c90-1f1c15ac8a46", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/challenges/result/4440002", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498254935504, + "name": "Old logic, access allowed", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "70b3453b-1d1a-e411-f8e5-527edb0a2530", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/registrants/1110002", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497934833132, + "name": "Old logic, access allowed", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "74cdf1ee-8c8d-2dba-a6eb-1b9fa5a7ac6e", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/reviewOpportunities/1110005", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498218178618, + "name": "New logic, access denied", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "7c7643c6-89ab-641e-b67a-32b3ac91e09e", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/challenges/checkpoint/2220001", + "queryParams": [], + "pathVariables": {}, + "pathVariableData": [], + "preRequestScript": null, + "method": "GET", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "data": null, + "dataMode": "params", + "name": "No groups (challenge is not private)", + "description": "", + "descriptionFormat": "html", + "time": 1497550504090, + "version": 2, + "responses": [], + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "folder": "712ffa63-a959-e4a3-6af9-84d4f236b2f3" + }, + { + "id": "83e8261b-f1c3-3e4a-ba71-161e0920a501", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/upcoming", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498249612829, + "name": "Upcoming", "description": "", "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", "responses": [] }, { - "id": "46cf305a-8251-66aa-391c-46def82773a1", + "id": "843d6759-0cc0-a0c6-9fde-60f893f56eac", "headers": "Authorization: Bearer {{authToken}}\n", "headerData": [ { @@ -252,7 +1141,7 @@ "enabled": true } ], - "url": "{{url}}/challenges/1110005/register", + "url": "{{url}}/challenges/1110004/register", "queryParams": [], "preRequestScript": null, "pathVariables": {}, @@ -264,14 +1153,14 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1497813578982, - "name": "New logic, access denied", + "time": 1497813524683, + "name": "New logic, access allowed", "description": "", "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", "responses": [] }, { - "id": "4b64d85a-4c08-8ec2-9c3f-50605bd2e09e", + "id": "851754f0-043d-2145-4b39-47d555a9bffe", "headers": "Authorization: Bearer {{authToken}}\n", "headerData": [ { @@ -281,28 +1170,34 @@ "enabled": true } ], - "url": "{{url}}/challenges/1110001/register", - "queryParams": [], + "url": "{{url}}/design/reviewOpportunities?challengeName=ElTest", + "queryParams": [ + { + "key": "challengeName", + "value": "ElTest", + "equals": true, + "description": "", + "enabled": true + } + ], + "preRequestScript": null, "pathVariables": {}, "pathVariableData": [], - "preRequestScript": null, - "method": "POST", - "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "method": "GET", "data": null, "dataMode": "params", - "name": "No groups (challenge is not private)", - "description": "", - "descriptionFormat": "html", - "time": 1497813014785, "version": 2, - "responses": [], "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "folder": "cfbf928f-56b8-9813-f8f3-4ac4e342d965" + "time": 1498204539465, + "name": "Studio", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] }, { - "id": "5224f722-9f4f-07bb-58e7-351512cc66ea", + "id": "8d5321d9-a039-cdd3-48a7-9579e45ba662", "headers": "Authorization: Bearer {{authToken}}\n", "headerData": [ { @@ -312,26 +1207,26 @@ "enabled": true } ], - "url": "{{url}}/challenges/1110002/register", + "url": "{{url}}/develop/reviewOpportunities/1110001", "queryParams": [], "preRequestScript": null, "pathVariables": {}, "pathVariableData": [], - "method": "POST", + "method": "GET", "data": null, "dataMode": "params", "version": 2, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1497813399305, - "name": "Old logic, access allowed", + "time": 1498218039588, + "name": "No groups (challenge is not private)", "description": "", "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", "responses": [] }, { - "id": "60ae89de-4eb1-c0aa-b866-b28b52436e89", + "id": "9205a134-bc37-29e2-3db8-971b7ac77967", "headers": "Authorization: Bearer {{authToken}}\n", "headerData": [ { @@ -341,47 +1236,70 @@ "enabled": true } ], - "url": "{{url}}/challenges/1110003/register", - "queryParams": [], + "url": "{{url}}/challenges/open?challengeName=ElTest", + "queryParams": [ + { + "key": "challengeName", + "value": "ElTest", + "equals": true, + "description": "", + "enabled": true + } + ], "preRequestScript": null, "pathVariables": {}, "pathVariableData": [], - "method": "POST", + "method": "GET", "data": null, "dataMode": "params", "version": 2, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1497813480606, - "name": "Old logic, access denied", + "time": 1498249401889, + "name": "Open", "description": "", "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", "responses": [] }, { - "id": "6bed8920-6800-0ae0-e63d-b39b05c7f50c", - "headers": "Content-Type: application/json\n", - "url": "{{url}}/auth", + "id": "92d5a6ac-d7fc-79de-c5d4-fd10a79b018e", + "headers": "Authorization: Bearer {{authToken}}\nContent-Type: application/json\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + }, + { + "key": "Content-Type", + "value": "application/json", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/reviewOpportunities/1110002/apply", + "queryParams": [], "preRequestScript": null, "pathVariables": {}, + "pathVariableData": [], "method": "POST", "data": [], "dataMode": "raw", "version": 2, - "tests": "var authResponse = JSON.parse(responseBody);\npostman.setEnvironmentVariable(\"authToken\", authResponse.token);\ntests[\"Status code is 200\"] = responseCode.code === 200;\nvar jsonData = JSON.parse(responseBody);\ntests[\"A valid token is returned\"] = !!jsonData.token;", + "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474159263289, - "name": "Login as admin user", + "time": 1498218503646, + "name": "Old logic, access allowed", "description": "", "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", "responses": [], - "rawModeData": "{\n \"username\": \"heffan\", \n \"password\": \"password\"\n}", - "folder": "0eeb693c-c6b6-e23b-156d-cff5f21dbb27" + "rawModeData": "{\n\t\"reviewApplicationRoleId\": \"1\"\n}" }, { - "id": "70b3453b-1d1a-e411-f8e5-527edb0a2530", + "id": "a3ae5124-2077-4ff2-4e02-afae7670bbe5", "headers": "Authorization: Bearer {{authToken}}\n", "headerData": [ { @@ -391,7 +1309,7 @@ "enabled": true } ], - "url": "{{url}}/challenges/registrants/1110002", + "url": "{{url}}/develop/challenges/checkpoint/2220005", "queryParams": [], "preRequestScript": null, "pathVariables": {}, @@ -402,14 +1320,15 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1497934833132, - "name": "Old logic, access allowed", + "time": 1497550755372, + "name": "New logic, access denied", "description": "", "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", - "responses": [] + "responses": [], + "folder": "712ffa63-a959-e4a3-6af9-84d4f236b2f3" }, { - "id": "7c7643c6-89ab-641e-b67a-32b3ac91e09e", + "id": "b3cb44e7-3e5f-897e-5d6f-6179afc52653", "headers": "Authorization: Bearer {{authToken}}\n", "headerData": [ { @@ -419,28 +1338,25 @@ "enabled": true } ], - "url": "{{url}}/develop/challenges/checkpoint/2220001", + "url": "{{url}}/challenges/registrants/1110005", "queryParams": [], + "preRequestScript": null, "pathVariables": {}, "pathVariableData": [], - "preRequestScript": null, "method": "GET", - "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", "data": null, "dataMode": "params", - "name": "No groups (challenge is not private)", - "description": "", - "descriptionFormat": "html", - "time": 1497550504090, - "version": 2, - "responses": [], "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "folder": "712ffa63-a959-e4a3-6af9-84d4f236b2f3" + "time": 1497935002619, + "name": "New logic, access denied", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] }, { - "id": "843d6759-0cc0-a0c6-9fde-60f893f56eac", + "id": "b7a298cc-2b90-6522-f82b-49d20d22d2bb", "headers": "Authorization: Bearer {{authToken}}\n", "headerData": [ { @@ -450,26 +1366,25 @@ "enabled": true } ], - "url": "{{url}}/challenges/1110004/register", + "url": "{{url}}/develop/challenges/result/4440005", "queryParams": [], "preRequestScript": null, "pathVariables": {}, "pathVariableData": [], - "method": "POST", + "method": "GET", "data": null, "dataMode": "params", - "version": 2, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1497813524683, - "name": "New logic, access allowed", + "time": 1498255007073, + "name": "New logic, access denied", "description": "", "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", "responses": [] }, { - "id": "a3ae5124-2077-4ff2-4e02-afae7670bbe5", + "id": "bb5cd293-ec53-ec1f-b50c-182111a88aab", "headers": "Authorization: Bearer {{authToken}}\n", "headerData": [ { @@ -479,7 +1394,7 @@ "enabled": true } ], - "url": "{{url}}/develop/challenges/checkpoint/2220005", + "url": "{{url}}/design/reviewOpportunities/3330002", "queryParams": [], "preRequestScript": null, "pathVariables": {}, @@ -487,43 +1402,51 @@ "method": "GET", "data": null, "dataMode": "params", + "version": 2, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1497550755372, - "name": "New logic, access denied", + "time": 1498147297080, + "name": "Old logic, access allowed", "description": "", "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", - "responses": [], - "folder": "712ffa63-a959-e4a3-6af9-84d4f236b2f3" + "responses": [] }, { - "id": "b3cb44e7-3e5f-897e-5d6f-6179afc52653", - "headers": "Authorization: Bearer {{authToken}}\n", + "id": "bc9566fa-bd94-980a-2b61-813d1340cfa4", + "headers": "Authorization: Bearer {{authToken}}\nContent-Type: application/json\n", "headerData": [ { "key": "Authorization", "value": "Bearer {{authToken}}", "description": "", "enabled": true + }, + { + "key": "Content-Type", + "value": "application/json", + "description": "", + "enabled": true } ], - "url": "{{url}}/challenges/registrants/1110005", + "url": "{{url}}/develop/reviewOpportunities/1110004/apply", "queryParams": [], "preRequestScript": null, "pathVariables": {}, "pathVariableData": [], - "method": "GET", - "data": null, - "dataMode": "params", + "method": "POST", + "data": [], + "dataMode": "raw", + "version": 2, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1497935002619, - "name": "New logic, access denied", + "time": 1498218589287, + "name": "New logic, access allowed", "description": "", "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", - "responses": [] + "responses": [], + "rawModeData": "{\n\t\"reviewApplicationRoleId\": \"1\"\n}" }, { "id": "bcc821a7-0e3a-3454-d900-12af0cc94656", @@ -556,6 +1479,43 @@ "helperAttributes": {}, "folder": "6a038555-23cd-e79f-1d34-0fb860e305a3" }, + { + "id": "bd0a5b89-bfc7-4f0c-ed41-a46351fc2c02", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/reviewOpportunities?challengeName=ElTest", + "queryParams": [ + { + "key": "challengeName", + "value": "ElTest", + "equals": true, + "description": "", + "enabled": true + } + ], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498211029200, + "name": "Software", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, { "id": "bf83e2d2-549b-361e-f5cf-66a40d816f0c", "headers": "Authorization: Bearer {{authToken}}\n", @@ -672,6 +1632,42 @@ "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", "responses": [] }, + { + "id": "cc1cbe83-a990-ff80-e1fa-0358899198f2", + "headers": "Authorization: Bearer {{authToken}}\nContent-Type: application/json\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + }, + { + "key": "Content-Type", + "value": "application/json", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/reviewOpportunities/1110003/apply", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "POST", + "data": [], + "dataMode": "raw", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498218550163, + "name": "Old logic, access denied", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [], + "rawModeData": "{\n\t\"reviewApplicationRoleId\": \"1\"\n}" + }, { "id": "d3e5ca45-334d-fb54-1fd7-46f8e7b82841", "headers": "Authorization: Bearer {{authToken}}\n", @@ -757,6 +1753,43 @@ "responses": [], "folder": "712ffa63-a959-e4a3-6af9-84d4f236b2f3" }, + { + "id": "e34964fd-e868-71a4-e852-31625310c757", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/past?challengeName=ElTest", + "queryParams": [ + { + "key": "challengeName", + "value": "ElTest", + "equals": true, + "description": "", + "enabled": true + } + ], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498252881840, + "name": "Past", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, { "id": "e97dac4e-c786-27b1-5e4b-fff50b6de93a", "headers": "Authorization: Bearer {{authToken}}\n", @@ -785,6 +1818,35 @@ "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", "responses": [] }, + { + "id": "f074d3f8-29e3-3ba2-1443-94880e0dc8c1", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/design/reviewOpportunities/3330003", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498147315438, + "name": "Old logic, access denied", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, { "id": "f545bbfc-36d7-6567-25a8-b4d6634575e7", "headers": "Authorization: Bearer {{authToken}}\n", @@ -896,7 +1958,8 @@ "name": "New logic, access denied", "description": "", "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", - "responses": [] + "responses": [], + "folder": "2a873809-800c-ee71-51ad-94f10096709b" }, { "id": "f8e9d38f-8d8d-6e63-4978-6e3546f20b7c", @@ -924,7 +1987,8 @@ "name": "New logic, access allowed", "description": "", "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", - "responses": [] + "responses": [], + "folder": "2a873809-800c-ee71-51ad-94f10096709b" }, { "id": "f90179ed-98da-be6d-77ae-9e3aa4199b5c", @@ -953,7 +2017,8 @@ "name": "No groups (challenge is not private)", "description": "", "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", - "responses": [] + "responses": [], + "folder": "2a873809-800c-ee71-51ad-94f10096709b" }, { "id": "f915c206-b3fe-a4be-1094-bc8a448cb467", diff --git a/test/scripts/mock_v3.js b/test/scripts/mock_v3.js index 8df5e8c02..3557ba8cb 100644 --- a/test/scripts/mock_v3.js +++ b/test/scripts/mock_v3.js @@ -10,6 +10,7 @@ var express = require('express'); var bodyParser = require('body-parser'); +var _ = require('underscore'); var app = express(); @@ -70,4 +71,21 @@ app.get('/v3/groups/:groupId/members', function (req, res) { } }); +/* + * Get all groups the given user belongs to + * This mock always returns a list consisting of one group + * (3330003) + */ +/*jslint unparam: true*/ +app.get('/v3/groups', function (req, res) { + res.json({ + result: { + content: [{ + id: 3330003 + }] + } + }); +}); +/*jslint unparam: false*/ + app.listen(8084); pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy