From 00bac230b30291822c2240bcb2a4023924150ac9 Mon Sep 17 00:00:00 2001 From: ajefts Date: Tue, 20 Jun 2017 10:42:56 -0400 Subject: [PATCH] More eligibility and group updates (#506) * Improve challenge visibility control (#501) * IMPROVE CHALLENGE VISIBILITY CONTROL (https://www.topcoder.com/challenge-details/30057891/?type=develop) Verification guide: docs/Verification_Guide-Improve Challenge Visibility Control.doc * Restoring an accidentially modified file * Fixed the case with a challenge that doesn't have eligibility * 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. * improve the query * update query for groups (#502) * Update queries (#503) improve logging for v3 api call * should use externalToken field name * update queries for group checking * Improve challenge visibility control: getChallenge and getRegistrants (#504) * IMPROVE CHALLENGE VISIBILITY CONTROL (https://www.topcoder.com/challenge-details/30057891/?type=develop) Verification guide: docs/Verification_Guide-Improve Challenge Visibility Control.doc * Restoring an accidentially modified file * Fixed the case with a challenge that doesn't have eligibility * 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. * Improve challenge visibility control: getChallenge and getRegistrants * revert commit --- actions/challenges.js | 95 ++- 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 +- queries/check_user_challenge_accessibility | 2 +- ...Visibility_Control.postman_collection.json | 640 +++++++++++++++++- 7 files changed, 708 insertions(+), 78 deletions(-) diff --git a/actions/challenges.js b/actions/challenges.js index 53266e7a8..bb4d6ceb9 100755 --- a/actions/challenges.js +++ b/actions/challenges.js @@ -80,8 +80,8 @@ * 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 +1081,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 +3343,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 +3440,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 +3565,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}3VXPtq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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 ab18cd096..010cb89f3 100644 --- a/queries/check_is_related_with_challenge +++ b/queries/check_is_related_with_challenge @@ -1,22 +1,22 @@ SELECT (SELECT - 1 + max(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@ AND gce.group_id < 2000000) OR gce.group_id >= 2000000)) AS has_access +) AS is_private , (SELECT - 1 - FROM contest_eligibility ce - WHERE ce.contest_id = @challengeId@) 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/queries/check_user_challenge_accessibility b/queries/check_user_challenge_accessibility index e7d7e9b14..309258da0 100644 --- a/queries/check_user_challenge_accessibility +++ b/queries/check_user_challenge_accessibility @@ -1,6 +1,6 @@ SELECT (SELECT - 1 + max(1) FROM contest_eligibility ce INNER JOIN group_contest_eligibility gce ON gce.contest_eligibility_id = ce.contest_eligibility_id LEFT JOIN user_group_xref ugx ON ugx.group_id = gce.group_id 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",