this repo has no description
0
fork

Configure Feed

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

admin tooling for account invites (#189)

authored by

Whyrusleeping and committed by
GitHub
e7c7833e 8912d95e

+38
+38
cmd/gosky/admin.go
··· 23 23 checkUserCmd, 24 24 reportsCmd, 25 25 disableInvitesCmd, 26 + enableInvitesCmd, 26 27 }, 27 28 } 28 29 ··· 444 445 }) 445 446 }, 446 447 } 448 + 449 + var enableInvitesCmd = &cli.Command{ 450 + Name: "enableInvites", 451 + Flags: []cli.Flag{ 452 + &cli.StringFlag{ 453 + Name: "admin-password", 454 + EnvVars: []string{"ATP_AUTH_ADMIN_PASSWORD"}, 455 + Required: true, 456 + }, 457 + }, 458 + Action: func(cctx *cli.Context) error { 459 + 460 + xrpcc, err := cliutil.GetXrpcClient(cctx, false) 461 + if err != nil { 462 + return err 463 + } 464 + 465 + ctx := context.Background() 466 + 467 + adminKey := cctx.String("admin-password") 468 + xrpcc.AdminToken = &adminKey 469 + 470 + handle := cctx.Args().First() 471 + if !strings.HasPrefix(handle, "did:") { 472 + resp, err := atproto.IdentityResolveHandle(ctx, xrpcc, handle) 473 + if err != nil { 474 + return err 475 + } 476 + 477 + handle = resp.Did 478 + } 479 + 480 + return atproto.AdminEnableAccountInvites(ctx, xrpcc, &atproto.AdminEnableAccountInvites_Input{ 481 + Account: handle, 482 + }) 483 + }, 484 + }