MantisBT - TestLink
View Issue Details
0005866TestLinkAPI - RESTpublic2013-08-16 20:152013-09-08 17:53
lczub 
fman 
normalminoralways
closedfixed 
1.9.7 (2013 Q2 - bug fixing) 
1.9.8 (2013 Q3 - bug fixing) 
Postgres
READY FOR TESTING
0005866: REST 'GET /testprojects/:id' raise 500 Internal Server Error - due to authentication
The 1.9.7 TestLink REST method 'GET /testprojects/:id' returns a "500 Internal Server Error", cause tlRestApi.class.php does not set the authenticate attributes (check users rights) like it does for 'GET /testprojects'.

It seams that also all other REST calls like 'POST /testplans' or 'POST /executions' currently not checks the users right.

curl -i -X GET -u DevApiKey:NoPWNeeded http://localhost/testlink/lib/api/rest/v1/testprojects/1 [^]

HTTP/1.0 500 Internal Server Error
Date: Fri, 16 Aug 2013 19:54:10 GMT
Server: Apache/2.2.22 (Debian)
X-Powered-By: PHP/5.4.4-14+deb7u3
Set-Cookie: PHPSESSID=gr6mchvv9kithmh5muvn5jfhr6; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Vary: Accept-Encoding
Content-Length: 0
Connection: close
Content-Type: text/html

tail /var/log/apache2/error.log

[Fri Aug 16 21:54:11 2013] [error] [client ::1] PHP Fatal error: Call to a member function hasRight() on a non-object in .../www/testlink-1.9.7/lib/functions/testproject.class.php on line 585

WorkAround:

change in /testlink-1.9.7/lib/api/rest/v1/tlRestApi.class.php
old:
   $this->app->get('/testprojects/:id', array($this,'getProjects'));
new:
   $this->app->get('/testprojects/:id', array($this,'authenticate'), array($this,'getProjects'));
No tags attached.
child of 0005731closed fman Availables hot-fixes for 1.9.7 & How To get full fixed package from gitorious 
Issue History
2013-08-16 20:15lczubNew Issue
2013-08-17 08:04fmanNote Added: 0019442
2013-08-17 08:06fmanSummaryREST 'GET /testprojects/:id' raise 500 Internal Server Error => REST 'GET /testprojects/:id' raise 500 Internal Server Error - due to authentication
2013-08-17 08:07fmanQA Team - Task Workflow StatusTBD => READY FOR TESTING
2013-08-17 08:07fmanFixed in Version => 1.9.8 (2013 Q3 - bug fixing)
2013-08-17 08:07fmanRelationship addedchild of 0005731
2013-08-18 08:09fmanStatusnew => resolved
2013-08-18 08:09fmanResolutionopen => fixed
2013-08-18 08:09fmanAssigned To => fman
2013-09-08 17:53fmanNote Added: 0019521
2013-09-08 17:53fmanStatusresolved => closed

Notes
(0019442)
fman   
2013-08-17 08:04   
thanks, fix was ready but no commited.
(0019521)
fman   
2013-09-08 17:53   
1.9.8 released