プロジェクト

全般

プロフィール

Vote #74635

完了

REST API POST and PUT broken

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
Closed
優先度:
急いで
担当者:
-
カテゴリ:
REST API_32
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
32
version_id:
76
issue_org_id:
15427
author_id:
31099
assigned_to_id:
1
comments:
10
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
70
ステータス-->[Closed]

説明

I could re-verify the behavior documented in #15424 for PUT requests. An update shows the same error message, as a POST request.
This effectively makes the REST API @read-only@.

The POST requests have been re-tested in 2.3.3, and there they do work!


journals

Adding the line

@skip_before_filter :verify_authenticity_token@

to the respective controller (e.g. for Users the file app/controllers/users_controller.rb) removes the problem. Wouldn't the correct solution be to verify the authenticity_token only in case of webbrowser based access?
--------------------------------------------------------------------------------
I could track down the changeset that seems to make the problem https://bitbucket.org/redmine/redmine-trunk/commits/b823653c220c8a7f32e321b39d0bdc5f85b4689f
--------------------------------------------------------------------------------
Removing lines 39-42 of above mentioned patch, makes POST and PUT usable again.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Fixed in r12311, a test with token verification turned _on_ (_off_ by default in tests) is now present. The fix will be included in 2.4.1 that will be released tomorrow. Thanks for pointing this out.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Merged.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------


related_issues

relates,Closed,11797,Using the API logs out my browser session
duplicates,Closed,15453,Redmine-Java-API - POST/Put stopped working from android application
duplicates,Closed,15424,Filter chain halted as :verify_authenticity_token rendered or redirected

Admin Redmine さんが約4年前に更新

  • カテゴリREST API_32 にセット
  • 対象バージョン2.4.1_76 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0