Move stuff, keep working on authenticated fetch
All checks were successful
/ docker (push) Successful in 4m5s

This commit is contained in:
Melody Becker 2025-04-12 21:39:25 +02:00
parent f8b3a6ff06
commit e3a97170a9
Signed by: mstar
SSH key fingerprint: SHA256:vkXfS9FG2pVNVfvDrzd1VW9n8VJzqqdKQGljxxX8uK8
11 changed files with 81 additions and 39 deletions

19
activitypub/util.go Normal file
View file

@ -0,0 +1,19 @@
package activitypub
import "strings"
type InvalidFullHandleError struct {
Raw string
}
func (i InvalidFullHandleError) Error() string {
return "Invalid full handle"
}
func SplitFullHandle(full string) (string, string, error) {
splits := strings.Split(strings.TrimPrefix(full, "@"), "@")
if len(splits) != 2 {
return "", "", InvalidFullHandleError{full}
}
return splits[0], splits[1], nil
}