this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

handle resolution does not depend on any xrpc routes (#433)

handle resolution is currently failing on things using this method
because the PDS check here is just wrong.

authored by

Whyrusleeping and committed by
GitHub
ab2c4b39 7a3aad7e

+4 -15
+1 -6
api/extra.go
··· 13 13 "time" 14 14 15 15 "github.com/bluesky-social/indigo/did" 16 - "github.com/bluesky-social/indigo/xrpc" 17 16 arc "github.com/hashicorp/golang-lru/arc/v2" 18 17 logging "github.com/ipfs/go-log" 19 18 "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" ··· 22 21 23 22 var log = logging.Logger("api") 24 23 25 - func ResolveDidToHandle(ctx context.Context, xrpcc *xrpc.Client, res did.Resolver, hr HandleResolver, udid string) (string, string, error) { 24 + func ResolveDidToHandle(ctx context.Context, res did.Resolver, hr HandleResolver, udid string) (string, string, error) { 26 25 ctx, span := otel.Tracer("gosky").Start(ctx, "resolveDidToHandle") 27 26 defer span.End() 28 27 ··· 54 53 55 54 if svc == nil { 56 55 return "", "", fmt.Errorf("users did document has no pds service set") 57 - } 58 - 59 - if xrpcc.Host != "*" && svc.ServiceEndpoint != xrpcc.Host { 60 - return "", "", fmt.Errorf("our XRPC client is authed for a different pds (%s != %s)", svc.ServiceEndpoint, xrpcc.Host) 61 56 } 62 57 63 58 verdid, err := hr.ResolveHandleToDid(ctx, handle)
+1 -1
cmd/gosky/admin.go
··· 100 100 if fa == "admin" { 101 101 invby = fa 102 102 } else { 103 - handle, _, err := api.ResolveDidToHandle(ctx, xrpcc, plcc, phr, fa) 103 + handle, _, err := api.ResolveDidToHandle(ctx, plcc, phr, fa) 104 104 if err != nil { 105 105 fmt.Println("ERROR: failed to resolve inviter: ", err) 106 106 handle = fa
+1 -6
cmd/gosky/did.go
··· 37 37 did := cctx.Args().First() 38 38 39 39 if cctx.Bool("handle") { 40 - xrpcc, err := cliutil.GetXrpcClient(cctx, false) 41 - if err != nil { 42 - return err 43 - } 44 - 45 40 phr := &api.ProdHandleResolver{} 46 - h, _, err := api.ResolveDidToHandle(context.TODO(), xrpcc, s, phr, did) 41 + h, _, err := api.ResolveDidToHandle(context.TODO(), s, phr, did) 47 42 if err != nil { 48 43 return err 49 44 }
+1 -2
cmd/gosky/main.go
··· 25 25 "github.com/bluesky-social/indigo/repo" 26 26 "github.com/bluesky-social/indigo/util" 27 27 "github.com/bluesky-social/indigo/util/cliutil" 28 - "github.com/bluesky-social/indigo/xrpc" 29 28 "golang.org/x/time/rate" 30 29 31 30 "github.com/gorilla/websocket" ··· 197 196 } 198 197 } 199 198 200 - h, _, err := api.ResolveDidToHandle(ctx, &xrpc.Client{Host: "*"}, didr, hr, did) 199 + h, _, err := api.ResolveDidToHandle(ctx, didr, hr, did) 201 200 if err != nil { 202 201 return "", err 203 202 }