# Unauthorized requests This scenario make unauthorized requests and checks the right error is returned. SCENARIO unauthorized requests Set up the controller. GIVEN an RSA key pair for token signing AND controller config uses statedir at the state directory AND controller config uses https://blobs.example.com as artifact store AND controller config uses https://auth.example.com as authentication AND controller config uses https://notify.example.com as notify AND an access token for user with scopes ... 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 FINALLY stop ick controller