updates to ev and webfinger
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Jon Lundy
2023-05-29 09:48:20 -06:00
parent 7c4c1521fd
commit 5b9b436125
19 changed files with 559 additions and 57 deletions

17
cmd/ev/app.twtxt.go Normal file
View File

@@ -0,0 +1,17 @@
package main
import (
"context"
"go.sour.is/ev/internal/lg"
"go.sour.is/ev/pkg/service"
)
var _ = apps.Register(50, func(ctx context.Context, svc *service.Harness) error {
_, span := lg.Span(ctx)
defer span.End()
span.AddEvent("Enable Twtxt")
return nil
})

View File

@@ -38,7 +38,7 @@ var _ = apps.Register(50, func(ctx context.Context, svc *service.Harness) error
cache.SetDefault(s, true)
return false
})
var withHostnames webfinger.WithHostnames = strings.Fields(env.Default(" ", "sour.is"))
var withHostnames webfinger.WithHostnames = strings.Fields(env.Default("WEBFINGER_DOMAINS", "sour.is"))
wf, err := webfinger.New(ctx, eventstore, withCache, withHostnames)
if err != nil {

View File

@@ -178,6 +178,8 @@ func run(opts opts) error {
break
}
fmt.Fprintln(os.Stderr, jrd)
token, err := webfinger.NewSignedRequest(jrd, key)
if err != nil {
return err

View File

@@ -62,14 +62,14 @@ func TestMain(m *testing.M) {
}
}
func TestGetHTTP(t *testing.T) {
func TestE2EGetHTTP(t *testing.T) {
is := is.New(t)
res, err := http.DefaultClient.Get("http://[::1]:61234/.well-known/webfinger")
is.NoErr(err)
is.Equal(res.StatusCode, http.StatusBadRequest)
}
func TestCreateResource(t *testing.T) {
func TestE2ECreateResource(t *testing.T) {
is := is.New(t)
_, priv, err := ed25519.GenerateKey(nil)