# Unauthorized requests This scenario make unauthorized requests and checks the right error is returned. SCENARIO unauthorized requests Set up the controller. GIVEN an access token for user with scopes ... uapi_projects_get ... uapi_projects_id_delete ... uapi_projects_post ... uapi_projects_id_status_put ... uapi_projects_id_status_get ... uapi_projects_id_builds_get ... uapi_workers_id_get ... uapi_builds_get ... uapi_builds_id_get ... uapi_logs_id_get AND a running ick controller WHEN user makes request POST /projects with a valid token and body ... { ... "project": "rome", ... "pipelines": [ ... { ... "pipeline": "construct", ... "actions": [ ... { "shell": "day 1" }, ... { "shell": "day 2" } ... ] ... } ... ] ... } THEN result has status code 201 GIVEN an access token for outsider with scopes ... uapi_version_get WHEN outsider makes request POST /projects ... with an invalid token and body {} THEN result has status code 401 WHEN outsider makes request GET /builds with an invalid token THEN result has status code 401 WHEN outsider makes request ... POST /workers with an invalid token and body [} THEN result has status code 401 WHEN outsider makes request ... GET /work with an invalid token THEN result has status code 401 WHEN outsider makes request ... GET /workers with an invalid token THEN result has status code 401 WHEN outsider makes request ... GET /builds with an invalid token THEN result has status code 401 WHEN outsider makes request GET /logs/1 with an invalid token THEN result has status code 401 WHEN outsider makes request POST /work with an invalid token and body {} THEN result has status code 401 WHEN user makes request DELETE /projects/rome WHEN user makes request GET /projects THEN body matches {"projects":[]} FINALLY stop ick controller