stable

Clone or download

Read-only

Add BasicAuth method if no token/cookie provided

This task is part of story #7701 Add REST basic auth You can test it through the Web UI or with a curl. Web UI ------ First, without be logged in, go to projects/ -> GET /v1/projects -> it must asks for credentials. Then, as a user logged in, go to projects/ -> GET /v1/projects -> it must lists projects curl ---- First, test with $> curl -XGET ".../api/v1/projects" -H 'Content-Type: application/json' -H 'Accept: application/json' -u username:password This must lists projects for user. Then, generate a token. Once done, list project with $> curl -XGET ".../api/v1/projects" -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'X-Auth-Token: token' -H 'X-Auth-UserId: user-id' Change-Id: I70076994fd012a63bd7188f62ee156b681a0ab22

Modified Files

Name
M plugins/agiledashboard/include/AgileDashboard/REST/v1/MilestoneResource.class.php +9 −2 Go to diff View file
M src/common/REST/BasicAuthentication.class.php +10 −2 Go to diff View file
M src/common/REST/TokenAuthentication.class.php +4 −3 Go to diff View file
M src/common/REST/TokenIsAllowed.class.php +3 −3 Go to diff View file
M src/common/project/REST/v1/ProjectResource.class.php +0 −4 Go to diff View file
M src/common/project/REST/v1/UserGroupResource.class.php +0 −2 Go to diff View file
M src/www/api/index.php +1 −0 Go to diff View file
M tests/lib/rest/RequestWrapper.php +5 −0 Go to diff View file
M tests/lib/rest/RestBase.php +6 −3 Go to diff View file
M tests/rest/ProjectTest.php +42 −0 Go to diff View file