mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-10 21:07:29 -06:00
[chore] No sigs for retrieving instance actor
As a possible path towards resolving #1186, this removes the signature check on the instance actor. Also adds a test to check authentication for a user other than the instance actor to ensure we don't poke a big hole into that check.
This commit is contained in:
parent
be6d80c020
commit
e65bda768c
6 changed files with 120 additions and 4 deletions
|
|
@ -20,6 +20,7 @@ package uris
|
|||
import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
"path"
|
||||
"strings"
|
||||
|
||||
"code.superseriousbusiness.org/gotosocial/internal/config"
|
||||
|
|
@ -325,6 +326,11 @@ func IsPublicKeyPath(id *url.URL) bool {
|
|||
return regexes.PublicKeyPath.MatchString(id.Path)
|
||||
}
|
||||
|
||||
// IsInstanceActorPath returns true if the given URL corresponds to /users/instance_actor
|
||||
func IsInstanceActorPath(u *url.URL) bool {
|
||||
return u.Path == path.Join("/", "users", config.InstanceActor())
|
||||
}
|
||||
|
||||
// IsBlockPath returns true if the given URL path corresponds to eg /users/example_username/blocks/SOME_ULID_OF_A_BLOCK
|
||||
func IsBlockPath(id *url.URL) bool {
|
||||
return regexes.BlockPath.MatchString(id.Path)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue