diff --git a/api/extra.go b/api/extra.go index db1013554..e32ed2320 100644 --- a/api/extra.go +++ b/api/extra.go @@ -13,7 +13,6 @@ import ( "time" "github.com/bluesky-social/indigo/did" - "github.com/bluesky-social/indigo/xrpc" arc "github.com/hashicorp/golang-lru/arc/v2" logging "github.com/ipfs/go-log" "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" @@ -22,7 +21,7 @@ import ( var log = logging.Logger("api") -func ResolveDidToHandle(ctx context.Context, xrpcc *xrpc.Client, res did.Resolver, hr HandleResolver, udid string) (string, string, error) { +func ResolveDidToHandle(ctx context.Context, res did.Resolver, hr HandleResolver, udid string) (string, string, error) { ctx, span := otel.Tracer("gosky").Start(ctx, "resolveDidToHandle") defer span.End() @@ -56,10 +55,6 @@ func ResolveDidToHandle(ctx context.Context, xrpcc *xrpc.Client, res did.Resolve return "", "", fmt.Errorf("users did document has no pds service set") } - if xrpcc.Host != "*" && svc.ServiceEndpoint != xrpcc.Host { - return "", "", fmt.Errorf("our XRPC client is authed for a different pds (%s != %s)", svc.ServiceEndpoint, xrpcc.Host) - } - verdid, err := hr.ResolveHandleToDid(ctx, handle) if err != nil { return "", "", err diff --git a/cmd/gosky/admin.go b/cmd/gosky/admin.go index c44575c28..a1a5458cc 100644 --- a/cmd/gosky/admin.go +++ b/cmd/gosky/admin.go @@ -100,7 +100,7 @@ var checkUserCmd = &cli.Command{ if fa == "admin" { invby = fa } else { - handle, _, err := api.ResolveDidToHandle(ctx, xrpcc, plcc, phr, fa) + handle, _, err := api.ResolveDidToHandle(ctx, plcc, phr, fa) if err != nil { fmt.Println("ERROR: failed to resolve inviter: ", err) handle = fa diff --git a/cmd/gosky/did.go b/cmd/gosky/did.go index 7794ebad8..bf8fe9212 100644 --- a/cmd/gosky/did.go +++ b/cmd/gosky/did.go @@ -37,13 +37,8 @@ var didGetCmd = &cli.Command{ did := cctx.Args().First() if cctx.Bool("handle") { - xrpcc, err := cliutil.GetXrpcClient(cctx, false) - if err != nil { - return err - } - phr := &api.ProdHandleResolver{} - h, _, err := api.ResolveDidToHandle(context.TODO(), xrpcc, s, phr, did) + h, _, err := api.ResolveDidToHandle(context.TODO(), s, phr, did) if err != nil { return err } diff --git a/cmd/gosky/main.go b/cmd/gosky/main.go index fd572282b..4dbfefead 100644 --- a/cmd/gosky/main.go +++ b/cmd/gosky/main.go @@ -24,7 +24,6 @@ import ( "github.com/bluesky-social/indigo/repo" "github.com/bluesky-social/indigo/util" "github.com/bluesky-social/indigo/util/cliutil" - "github.com/bluesky-social/indigo/xrpc" "golang.org/x/time/rate" "github.com/gorilla/websocket" @@ -196,7 +195,7 @@ var readRepoStreamCmd = &cli.Command{ } } - h, _, err := api.ResolveDidToHandle(ctx, &xrpc.Client{Host: "*"}, didr, hr, did) + h, _, err := api.ResolveDidToHandle(ctx, didr, hr, did) if err != nil { return "", err }