ユーザーAPIキーの仕様

特定の新しいスコープを作成し、3 番目のパラメータで「get パラメータが許可されている」ことを示すのはどうでしょうか。そうすれば、他の用途(例えば CORS の回避や、別のサイトからの Discourse API へのリクエストなど)に誤用されるのを防げます。

(ここから)

SCOPES = {
    read: [:get],
    write: [:get, :post, :patch, :put, :delete],
    message_bus: [[:post, 'message_bus']],
    push: nil,
    one_time_password: nil,
    notifications: [[:post, 'message_bus'], [:get, 'notifications#index'], [:put, 'notifications#mark_read']],
    session_info: [
      [:get, 'session#current'],
      [:get, 'users#topic_tracking_state'],
      [:get, 'list#unread'],
      [:get, 'list#new'],
      [:get, 'list#latest']
    ],
+   calendar: [ [:get, 'users#bookmarks_cal', true ] ],
  }

(余談ですが、なぜここでネストされた配列を使っているのでしょう…)

「いいね!」 10