diff options
author | FChannel <> | 2021-06-04 16:02:52 -0700 |
---|---|---|
committer | FChannel <> | 2021-06-04 16:02:52 -0700 |
commit | 8d9218e8cd7f18808bbd6b60e8a489cee967efb4 (patch) | |
tree | 7dcc875e19273e1a519dc11a743c99aa764438f6 /outboxPost.go | |
parent | d496ab89d560ea59f19669ea47ba9f991f7d8a94 (diff) |
added verfication based on signature header with pem keys
Diffstat (limited to 'outboxPost.go')
-rw-r--r-- | outboxPost.go | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/outboxPost.go b/outboxPost.go index 8bddf42..5729b2d 100644 --- a/outboxPost.go +++ b/outboxPost.go @@ -530,25 +530,13 @@ func CheckCaptcha(db *sql.DB, captcha string) bool { func ParseInboxRequest(w http.ResponseWriter, r *http.Request, db *sql.DB) { activity := GetActivityFromJson(r, db) - - header := r.Header.Get("Authorization") - auth := strings.Split(header, " ") - - if len(auth) < 2 { + if !VerifyHeaderSignature(r, *activity.Actor) { response := RejectActivity(activity) MakeActivityRequest(db, response) return } - if !RemoteActorHasAuth(activity.Actor.Id, auth[1]) { - if !RemoteActorHasAuth(Domain, auth[1]) { - response := RejectActivity(activity) - MakeActivityRequest(db, response) - return - } - } - switch(activity.Type) { case "Create": for _, e := range activity.To { |