From d7f49ba55b7641c07fde0be3ca2e530e9eef8848 Mon Sep 17 00:00:00 2001 From: Billy Keyes Date: Thu, 1 Dec 2022 16:34:59 -0500 Subject: [PATCH] Revert "Add basic support for SSH signatures" (#507) This reverts commit 07b7361b2c84642105836a8880f599ee3751e6a0. --- policy/predicate/signature_test.go | 27 +-------------------------- pull/context.go | 12 +++++------- pull/github.go | 20 -------------------- 3 files changed, 6 insertions(+), 53 deletions(-) diff --git a/policy/predicate/signature_test.go b/policy/predicate/signature_test.go index 9a33f06e..0733f746 100644 --- a/policy/predicate/signature_test.go +++ b/policy/predicate/signature_test.go @@ -30,7 +30,7 @@ func TestHasValidSignatures(t *testing.T) { testCases := []SignatureTestCase{ { - "ValidGpgSignature", + "ValidSignature", &pulltest.Context{ AuthorValue: "mhaypenny", CommitsValue: []*pull.Commit{ @@ -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{ diff --git a/pull/context.go b/pull/context.go index d093206b..44da64b3 100644 --- a/pull/context.go +++ b/pull/context.go @@ -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 { diff --git a/pull/github.go b/pull/github.go index 600fce7d..7d2a9628 100644 --- a/pull/github.go +++ b/pull/github.go @@ -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 { @@ -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 } @@ -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 -}