Skip to content

Commit

Permalink
Revert "Add basic support for SSH signatures" (#507)
Browse files Browse the repository at this point in the history
This reverts commit 07b7361.
  • Loading branch information
bluekeyes authored Dec 1, 2022
1 parent 5e9bc53 commit d7f49ba
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 53 deletions.
27 changes: 1 addition & 26 deletions policy/predicate/signature_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestHasValidSignatures(t *testing.T) {

testCases := []SignatureTestCase{
{
"ValidGpgSignature",
"ValidSignature",
&pulltest.Context{
AuthorValue: "mhaypenny",
CommitsValue: []*pull.Commit{
Expand All @@ -54,31 +54,6 @@ func TestHasValidSignatures(t *testing.T) {
ConditionValues: []string{"valid signatures"},
},
},
{
"ValidSshSignature",
&pulltest.Context{
AuthorValue: "mhaypenny",
CommitsValue: []*pull.Commit{
{
SHA: "abcdef123456789",
Author: "mhaypenny",
Committer: "mhaypenny",
Signature: &pull.Signature{
Type: pull.SignatureSSH,
IsValid: true,
Signer: "ttest",
State: "VALID",
KeyFingerprint: "Hello",
},
},
},
},
&common.PredicateResult{
Satisfied: true,
Values: []string{"abcdef123456789"},
ConditionValues: []string{"valid signatures"},
},
},
{
"InvalidSignature",
&pulltest.Context{
Expand Down
12 changes: 5 additions & 7 deletions pull/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,14 @@ type SignatureType string
const (
SignatureGpg SignatureType = "GpgSignature"
SignatureSmime SignatureType = "SmimeSignature"
SignatureSSH SignatureType = "SshSignature"
)

type Signature struct {
Type SignatureType
IsValid bool
KeyID string
KeyFingerprint string
Signer string
State string
Type SignatureType
IsValid bool
KeyID string
Signer string
State string
}

type Comment struct {
Expand Down
20 changes: 0 additions & 20 deletions pull/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -1210,7 +1210,6 @@ type v4GitSignature struct {
Type string `graphql:"__typename"`
GPG v4GpgSignature `graphql:"... on GpgSignature"`
SMIME v4SmimeSignature `graphql:"... on SmimeSignature"`
SSH v4SshSignature `graphql:"... on SshSignature"`
}

func (s *v4GitSignature) ToSignature() *Signature {
Expand All @@ -1230,14 +1229,6 @@ func (s *v4GitSignature) ToSignature() *Signature {
State: s.SMIME.State,
Type: SignatureSmime,
}
case SignatureSSH:
return &Signature{
IsValid: s.SSH.IsValid,
KeyFingerprint: s.SSH.KeyFingerprint,
Signer: s.SSH.Signer.GetV3Login(),
State: s.SSH.State,
Type: SignatureSSH,
}
default:
return nil
}
Expand All @@ -1263,14 +1254,3 @@ type v4GpgSignature struct {
State string
WasSignedByGitHub bool
}

type v4SshSignature struct {
Email string
IsValid bool
KeyFingerprint string
Payload string
Signature string
Signer *v4Actor
State string
WasSignedByGitHub bool
}

0 comments on commit d7f49ba

Please sign in to comment.