summaryrefslogtreecommitdiff
path: root/internal/api/s2s/user/user.go
diff options
context:
space:
mode:
authorLibravatar Tobi Smethurst <31960611+tsmethurst@users.noreply.github.com>2021-06-26 16:21:40 +0200
committerLibravatar GitHub <noreply@github.com>2021-06-26 16:21:40 +0200
commitb6c62309f236410a2dabdcf254473be99d7e60a7 (patch)
tree88982f7b25dffdc5b3f4bfaac0de241752c1815d /internal/api/s2s/user/user.go
parentqad getting started guide (#63) (diff)
downloadgotosocial-b6c62309f236410a2dabdcf254473be99d7e60a7.tar.xz
separate public key handler (#64)
Diffstat (limited to 'internal/api/s2s/user/user.go')
-rw-r--r--internal/api/s2s/user/user.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/api/s2s/user/user.go b/internal/api/s2s/user/user.go
index ffb308038..0cb8e1e90 100644
--- a/internal/api/s2s/user/user.go
+++ b/internal/api/s2s/user/user.go
@@ -40,6 +40,8 @@ const (
// Use this anywhere you need to know the username of the user being queried.
// Eg https://example.org/users/:username
UsersBasePathWithUsername = UsersBasePath + "/:" + UsernameKey
+ // UsersPublicKeyPath is a path to a user's public key, for serving bare minimum AP representations.
+ UsersPublicKeyPath = UsersBasePathWithUsername + "/" + util.PublicKeyPath
// UsersInboxPath is for serving POST requests to a user's inbox with the given username key.
UsersInboxPath = UsersBasePathWithUsername + "/" + util.InboxPath
// UsersFollowersPath is for serving GET request's to a user's followers list, with the given username key.
@@ -80,5 +82,6 @@ func (m *Module) Route(s router.Router) error {
s.AttachHandler(http.MethodGet, UsersFollowersPath, m.FollowersGETHandler)
s.AttachHandler(http.MethodGet, UsersFollowingPath, m.FollowingGETHandler)
s.AttachHandler(http.MethodGet, UsersStatusPath, m.StatusGETHandler)
+ s.AttachHandler(http.MethodGet, UsersPublicKeyPath, m.PublicKeyGETHandler)
return nil
}