Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
pleroma
Commits
888ec9e5
Commit
888ec9e5
authored
Dec 12, 2017
by
lain
Browse files
ActivityPub: Check inbox requests for valid signature.
parent
a9c23e1c
Pipeline
#433
failed with stage
in 2 minutes and 58 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/web/activity_pub/activity_pub_controller.ex
View file @
888ec9e5
...
...
@@ -18,7 +18,8 @@ def object(conn, %{"uuid" => uuid}) do
end
end
def
inbox
(
conn
,
params
)
do
# TODO: Move signature failure halt into plug
def
inbox
(%{
assigns:
%{
valid_signature:
true
}}
=
conn
,
params
)
do
{
:ok
,
activity
}
=
ActivityPub
.
insert
(
params
,
false
)
json
(
conn
,
"ok"
)
end
...
...
lib/pleroma/web/router.ex
View file @
888ec9e5
...
...
@@ -219,9 +219,11 @@ def user_fetcher(username) do
pipeline
:activitypub
do
plug
:accepts
,
[
"activity+json"
]
plug
Pleroma
.
Web
.
Plugs
.
HTTPSignaturePlug
end
scope
"/"
,
Pleroma
.
Web
.
ActivityPub
do
pipe_through
:activitypub
post
"/users/:nickname/inbox"
,
ActivityPubController
,
:inbox
end
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment