Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add APIMeta fields related to SSH keys #2293

Merged
merged 1 commit into from Feb 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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
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