MCPcopy Create free account
hub / github.com/google/go-github / main

Function main

scrape/example/scrape/main.go:30–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28)
29
30func main() {
31 flag.Parse()
32
33 // prompt for password and otpseed in case the user didn't want to specify as flags
34 reader := bufio.NewReader(os.Stdin)
35 if *password == "" {
36 fmt.Print("password: ")
37 *password, _ = reader.ReadString('\n')
38 *password = strings.TrimSpace(*password)
39 }
40 if *otpseed == "" {
41 fmt.Print("OTP seed: ")
42 *otpseed, _ = reader.ReadString('\n')
43 *otpseed = strings.TrimSpace(*otpseed)
44 }
45
46 client := scrape.NewClient(nil)
47
48 if err := client.Authenticate(*username, *password, *otpseed); err != nil {
49 log.Fatal(err)
50 }
51
52 enabled, err := client.AppRestrictionsEnabled(*org)
53 if err != nil {
54 log.Fatal(err)
55 }
56 fmt.Printf("App restrictions enabled for %q: %t\n", *org, enabled)
57
58 apps, err := client.ListOAuthApps(*org)
59 if err != nil {
60 log.Fatal(err)
61 }
62 fmt.Printf("OAuth apps for %q: \n", *org)
63 for _, app := range apps {
64 fmt.Printf("\t%+v\n", app)
65 }
66}

Callers

nothing calls this directly

Calls 3

AuthenticateMethod · 0.95
ListOAuthAppsMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…