Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix handle resolution in some cli commands #631

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

whyrusleeping
Copy link
Collaborator

probably more of this to come, the ProdHandleResolver type is basically broken now

Copy link
Collaborator

@bnewbold bnewbold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

happy to get this stuff over to the identity package! happy to help with any tweaks to that package if needed, and doing other similar code changes

@@ -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")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense. at some point we should probably have a better name than "admin" but i'm not sure what that should be right now

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, i always lean towards more verbose when i'm unsure here

Host: "https://api.bsky.app",
Host: "https://mod.bsky.app",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be good to have this be a config (env var) as well, but not a blocking issue

Comment on lines -626 to +631
phr := &api.ProdHandleResolver{}
resp, err := phr.ResolveHandleToDid(ctx, did)
dir := identity.DefaultDirectory()
resp, err := dir.LookupHandle(ctx, syntax.Handle(did))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feeling happy that these re-writes are basically one-to-one

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, the only weird bit is i'm not using the parse handle code and am just casting direct to the handle type. Feels like unnecessary overhead to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants