Skip to content

Commit

Permalink
Add APIMeta fields related to SSH keys (#2293)
Browse files Browse the repository at this point in the history
  • Loading branch information
twpayne authored Feb 17, 2022
1 parent 2981e4f commit 62eaf97
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
8 changes: 8 additions & 0 deletions github/github-accessors.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions github/github-accessors_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions github/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ type APIMeta struct {
// An array of IP addresses in CIDR format specifying the IP addresses
// Dependabot will originate from.
Dependabot []string `json:"dependabot,omitempty"`

// A map of algorithms to SSH key fingerprints.
SSHKeyFingerprints map[string]string `json:"ssh_key_fingerprints,omitempty"`

// An array of SSH keys.
SSHKeys []string `json:"ssh_keys,omitempty"`
}

// APIMeta returns information about GitHub.com, the service. Or, if you access
Expand Down
6 changes: 5 additions & 1 deletion github/misc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ func TestAPIMeta_Marshal(t *testing.T) {
Importer: []string{"i"},
Actions: []string{"a"},
Dependabot: []string{"d"},
SSHKeyFingerprints: map[string]string{"a": "f"},
SSHKeys: []string{"k"},
}
want := `{
"hooks":["h"],
Expand All @@ -196,7 +198,9 @@ func TestAPIMeta_Marshal(t *testing.T) {
"pages":["p"],
"importer":["i"],
"actions":["a"],
"dependabot":["d"]
"dependabot":["d"],
"ssh_key_fingerprints":{"a":"f"},
"ssh_keys":["k"]
}`

testJSONMarshal(t, a, want)
Expand Down

0 comments on commit 62eaf97

Please sign in to comment.