Project

General

Profile

Actions

Defect #25793

closed

Cannot update a jounral from REST api

Added by Mao H almost 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

Description

I can get the journal from the REST api. But I cannot update it.

Here I'll demonstrate it (specifically I'm updating notes).

curl -v http://server/pm/journals/327.json -H "Content-Type: application/json" -H "X-Redmine-API-Key: <my key>" -X PUT --data-binary "@put.note.json" 

I don't get any response from the server and the server log shows it's not authorized:

Started PUT "/pm/journals/327.json" for 192.168.1.6 at 2017-05-08 21:46:21 -0700
Processing by JournalsController#update as JSON
  Parameters: {"notes"=>"update note", "id"=>"327"}
  Current user: anonymous
Filter chain halted as :check_if_login_required rendered or redirected
Completed 401 Unauthorized in 6ms (ActiveRecord: 1.8ms)

Given that I can update that from the website, and also given that I can use the same api key to get the issues and other information in the REST api, it seems like that JournalsController#update doesn't check the authorization correctly for TEST api.

Actions

Also available in: Atom PDF