Move stuff, keep working on authenticated fetch
All checks were successful
/ docker (push) Successful in 4m5s
All checks were successful
/ docker (push) Successful in 4m5s
This commit is contained in:
parent
f8b3a6ff06
commit
e3a97170a9
11 changed files with 81 additions and 39 deletions
|
@ -12,7 +12,7 @@ import (
|
|||
"git.mstar.dev/mstar/goutils/sliceutils"
|
||||
"github.com/rs/zerolog/hlog"
|
||||
|
||||
"git.mstar.dev/mstar/linstrom/activitypub/shared/types"
|
||||
"git.mstar.dev/mstar/linstrom/activitypub"
|
||||
"git.mstar.dev/mstar/linstrom/config"
|
||||
"git.mstar.dev/mstar/linstrom/storage-new"
|
||||
"git.mstar.dev/mstar/linstrom/storage-new/dbgen"
|
||||
|
@ -53,6 +53,7 @@ func users(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
log := hlog.FromRequest(r)
|
||||
userId := r.PathValue("id")
|
||||
log.Debug().Any("headers", r.Header).Msg("request headers")
|
||||
user, err := dbgen.User.Where(dbgen.User.ID.Eq(userId)).
|
||||
Preload(dbgen.User.Icon).Preload(dbgen.User.Banner).
|
||||
Preload(dbgen.User.BeingTypes).
|
||||
|
@ -75,7 +76,7 @@ func users(w http.ResponseWriter, r *http.Request) {
|
|||
keyBytes = keyBytesToPem(user.PublicKeyRsa)
|
||||
}
|
||||
data := Outbound{
|
||||
Context: types.BaseLdContext,
|
||||
Context: activitypub.BaseLdContext,
|
||||
Id: apUrl,
|
||||
Type: "Person",
|
||||
PreferredUsername: user.Username,
|
||||
|
@ -136,7 +137,12 @@ func userInbox(w http.ResponseWriter, r *http.Request) {
|
|||
log := hlog.FromRequest(r)
|
||||
userId := r.PathValue("id")
|
||||
data, err := io.ReadAll(r.Body)
|
||||
log.Info().Err(err).Str("userId", userId).Bytes("body", data).Msg("Inbox message")
|
||||
log.Info().
|
||||
Err(err).
|
||||
Str("userId", userId).
|
||||
Bytes("body", data).
|
||||
Any("headers", r.Header).
|
||||
Msg("Inbox message")
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -9,7 +9,7 @@ import (
|
|||
|
||||
func userIdToApUrl(id string) string {
|
||||
return fmt.Sprintf(
|
||||
"%s/api/ap/users/%s",
|
||||
"%s/api/activitypub/user/%s",
|
||||
config.GlobalConfig.General.GetFullPublicUrl(),
|
||||
id,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue