linstrom/web/public/api/activitypub/util.go
mStar e3a97170a9
All checks were successful
/ docker (push) Successful in 4m5s
Move stuff, keep working on authenticated fetch
2025-04-12 21:39:25 +02:00

25 lines
420 B
Go

package activitypub
import (
"encoding/pem"
"fmt"
"git.mstar.dev/mstar/linstrom/config"
)
func userIdToApUrl(id string) string {
return fmt.Sprintf(
"%s/api/activitypub/user/%s",
config.GlobalConfig.General.GetFullPublicUrl(),
id,
)
}
func keyBytesToPem(bytes []byte) string {
block := pem.Block{
Type: "PUBLIC KEY",
Headers: nil,
Bytes: bytes,
}
return string(pem.EncodeToMemory(&block))
}