This commit is contained in:
17
cmd/ev/app.twtxt.go
Normal file
17
cmd/ev/app.twtxt.go
Normal 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
|
||||
})
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user