about summary refs log tree commit diff
path: root/app/controllers/api/activitypub/notes_controller.rb
diff options
context:
space:
mode:
authorEvan Minto <evan.minto@gmail.com>2017-04-22 20:21:10 -0700
committerEugen <eugen@zeonfederated.com>2017-04-23 05:21:10 +0200
commit66fd8e782182390df81f1ed46f3a04f3a01d681e (patch)
treef8f6ffb3bfc220e3e8e7efaf273e285b932f1962 /app/controllers/api/activitypub/notes_controller.rb
parent83e35381814baf4ae5f420531d83c0450716f875 (diff)
ActivityPub: Add basic, read-only support for Outboxes, Notes, and Create/Announce Activities (#2197)
* Clean up collapsible components

* Expose user Outboxes and AS2 representations of statuses

* Save work thus far.

* Fix bad merge.

* Save my work

* Clean up pagination.

* First test working.

* Add tests.

* Add Forbidden error template.

* Revert yarn.lock changes.

* Fix code style deviations and use localized instead of hardcoded English text.
Diffstat (limited to 'app/controllers/api/activitypub/notes_controller.rb')
-rw-r--r--app/controllers/api/activitypub/notes_controller.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/controllers/api/activitypub/notes_controller.rb b/app/controllers/api/activitypub/notes_controller.rb
new file mode 100644
index 000000000..722961ec6
--- /dev/null
+++ b/app/controllers/api/activitypub/notes_controller.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class Api::Activitypub::NotesController < ApiController
+  before_action :set_status
+
+  respond_to :activitystreams2
+
+  def show
+    headers['Access-Control-Allow-Origin'] = '*'
+
+    forbidden unless @status.permitted?
+  end
+
+  private
+
+  def set_status
+    @status = Status.find(params[:id])
+  end
+end