diff --git a/github/misc.go b/github/misc.go index 412d1e2b95..8961524157 100644 --- a/github/misc.go +++ b/github/misc.go @@ -176,6 +176,14 @@ type APIMeta struct { // An array of SSH keys. SSHKeys []string `json:"ssh_keys,omitempty"` + + // An array of IP addresses in CIDR format specifying the addresses + // which serve GitHub websites. + Web []string `json:"web,omitempty"` + + // An array of IP addresses in CIDR format specifying the addresses + // which serve GitHub APIs. + API []string `json:"api,omitempty"` } // APIMeta returns information about GitHub.com, the service. Or, if you access diff --git a/github/misc_test.go b/github/misc_test.go index fc91d71294..4e88ec5452 100644 --- a/github/misc_test.go +++ b/github/misc_test.go @@ -190,6 +190,8 @@ func TestAPIMeta_Marshal(t *testing.T) { Dependabot: []string{"d"}, SSHKeyFingerprints: map[string]string{"a": "f"}, SSHKeys: []string{"k"}, + API: []string{"a"}, + Web: []string{"w"}, } want := `{ "hooks":["h"], @@ -200,7 +202,9 @@ func TestAPIMeta_Marshal(t *testing.T) { "actions":["a"], "dependabot":["d"], "ssh_key_fingerprints":{"a":"f"}, - "ssh_keys":["k"] + "ssh_keys":["k"], + "api":["a"], + "web":["w"] }` testJSONMarshal(t, a, want) @@ -212,7 +216,7 @@ func TestAPIMeta(t *testing.T) { mux.HandleFunc("/meta", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") - fmt.Fprint(w, `{"hooks":["h"], "git":["g"], "pages":["p"], "importer":["i"], "actions":["a"], "dependabot":["d"], "verifiable_password_authentication": true}`) + fmt.Fprint(w, `{"web":["w"],"api":["a"],"hooks":["h"], "git":["g"], "pages":["p"], "importer":["i"], "actions":["a"], "dependabot":["d"], "verifiable_password_authentication": true}`) }) ctx := context.Background() @@ -228,6 +232,8 @@ func TestAPIMeta(t *testing.T) { Importer: []string{"i"}, Actions: []string{"a"}, Dependabot: []string{"d"}, + API: []string{"a"}, + Web: []string{"w"}, VerifiablePasswordAuthentication: Bool(true), }