linstrom/web/public/api/activitypub/util.go
mstar d272fa90b4
Some checks are pending
/ test (push) Waiting to run
AP stuff almost works
2025-04-09 17:35:31 +02:00

25 lines
412 B
Go

package activitypub
import (
"encoding/pem"
"fmt"
"git.mstar.dev/mstar/linstrom/config"
)
func userIdToApUrl(id string) string {
return fmt.Sprintf(
"%s/api/ap/users/%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))
}