about summary refs log tree commit diff
path: root/app/controllers/activitypub/claims_controller.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2020-06-02 19:24:53 +0200
committerGitHub <noreply@github.com>2020-06-02 19:24:53 +0200
commit5d8398c8b8b51ee7363e7d45acc560f489783e34 (patch)
tree1e0b663049feafdc003ad3c01b25bf5d5d793402 /app/controllers/activitypub/claims_controller.rb
parent9b7e3b4774d47c184aa759364d41f40e0cdfa210 (diff)
Add E2EE API (#13820)
Diffstat (limited to 'app/controllers/activitypub/claims_controller.rb')
-rw-r--r--app/controllers/activitypub/claims_controller.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/app/controllers/activitypub/claims_controller.rb b/app/controllers/activitypub/claims_controller.rb
new file mode 100644
index 000000000..08ad952df
--- /dev/null
+++ b/app/controllers/activitypub/claims_controller.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+class ActivityPub::ClaimsController < ActivityPub::BaseController
+  include SignatureVerification
+  include AccountOwnedConcern
+
+  skip_before_action :authenticate_user!
+
+  before_action :require_signature!
+  before_action :set_claim_result
+
+  def create
+    render json: @claim_result, serializer: ActivityPub::OneTimeKeySerializer
+  end
+
+  private
+
+  def set_claim_result
+    @claim_result = ::Keys::ClaimService.new.call(@account.id, params[:id])
+  end
+end