Skip to content

Commit

Permalink
more handle resolving fixes, also switch to mod.bsky.app where necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
whyrusleeping committed Apr 3, 2024
1 parent 6621e98 commit 2f49d1e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
6 changes: 5 additions & 1 deletion cmd/gosky/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ var adminCmd = &cli.Command{
EnvVars: []string{"ATP_AUTH_ADMIN_PASSWORD"},
Required: true,
},
&cli.StringFlag{
Name: "admin-endpoint",
Value: "https://mod.bsky.app",
},
},
Subcommands: []*cli.Command{
buildInviteTreeCmd,
Expand Down Expand Up @@ -78,7 +82,7 @@ var checkUserCmd = &cli.Command{

adminKey := cctx.String("admin-password")
xrpcc.AdminToken = &adminKey
xrpcc.Host = id.PDSEndpoint()
xrpcc.Host = cctx.String("admin-endpoint")

rep, err := toolsozone.ModerationGetRepo(ctx, xrpcc, did)
if err != nil {
Expand Down
13 changes: 9 additions & 4 deletions cmd/gosky/handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,20 @@ var resolveHandleCmd = &cli.Command{
if err != nil {
return err
}
handle := args[0]

h, err := syntax.ParseHandle(args[0])
if err != nil {
return fmt.Errorf("resolving %q: %w", args[0], err)
}

dir := identity.DefaultDirectory()
resp, err := dir.LookupHandle(ctx, syntax.Handle(handle))

res, err := dir.LookupHandle(ctx, h)
if err != nil {
return fmt.Errorf("resolving %q: %w", handle, err)
return err
}

fmt.Println(resp.DID)
fmt.Println(res.DID)

return nil
},
Expand Down
2 changes: 1 addition & 1 deletion cmd/gosky/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ var listLabelsCmd = &cli.Command{
since := time.Now().Add(-1 * delta).UnixMilli()

xrpcc := &xrpc.Client{
Host: "https://api.bsky.app",
Host: "https://mod.bsky.app",
}

for {
Expand Down

0 comments on commit 2f49d1e

Please sign in to comment.