Skip to content

Commit

Permalink
goat: resolve just DID
Browse files Browse the repository at this point in the history
  • Loading branch information
bnewbold committed Dec 23, 2024
1 parent e952e69 commit a0d0ac2
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions cmd/goat/identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ var cmdResolve = &cli.Command{
Name: "resolve",
Usage: "lookup identity metadata",
ArgsUsage: `<at-identifier>`,
Flags: []cli.Flag{},
Action: runResolve,
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "did",
Usage: "just resolve to DID",
},
},
Action: runResolve,
}

func runResolve(cctx *cli.Context) error {
Expand All @@ -33,11 +38,20 @@ func runResolve(cctx *cli.Context) error {
dir := identity.BaseDirectory{}
var doc *identity.DIDDocument

if cctx.Bool("did") {
if atid.IsDID() {
}
}

if atid.IsDID() {
did, err := atid.AsDID()
if err != nil {
return err
}
if cctx.Bool("did") {
fmt.Println(did)
return nil
}
doc, err = dir.ResolveDID(ctx, did)
if err != nil {
return err
Expand All @@ -51,6 +65,10 @@ func runResolve(cctx *cli.Context) error {
if err != nil {
return err
}
if cctx.Bool("did") {
fmt.Println(did)
return nil
}
doc, err = dir.ResolveDID(ctx, did)
if err != nil {
return err
Expand Down

0 comments on commit a0d0ac2

Please sign in to comment.