From 304d15021fc22b79a118fbde628929c612adc8ba Mon Sep 17 00:00:00 2001 From: irenarindos Date: Thu, 11 May 2023 12:27:53 -0400 Subject: [PATCH] chore(bsr): remove references to ssh protocol --- internal/bsr/bsr_test.go | 31 +++++++++---------- .../session_multiplexed/closed/SHA256SUM | 2 +- .../session_multiplexed/closed/session.meta | 2 +- .../session_multiplexed/opened/session.meta | 2 +- .../session_not_multiplexed/closed/SHA256SUM | 2 +- .../closed/session.meta | 2 +- .../opened/session.meta | 2 +- 7 files changed, 21 insertions(+), 22 deletions(-) diff --git a/internal/bsr/bsr_test.go b/internal/bsr/bsr_test.go index 7a8683331..06c81dcc9 100644 --- a/internal/bsr/bsr_test.go +++ b/internal/bsr/bsr_test.go @@ -19,7 +19,6 @@ import ( "github.com/hashicorp/boundary/internal/bsr" "github.com/hashicorp/boundary/internal/bsr/internal/fstest" "github.com/hashicorp/boundary/internal/bsr/kms" - "github.com/hashicorp/boundary/internal/bsr/ssh" "github.com/hashicorp/boundary/internal/storage" wrapping "github.com/hashicorp/go-kms-wrapping/v2" "github.com/stretchr/testify/assert" @@ -234,7 +233,7 @@ func TestBsr(t *testing.T) { for _, tc := range cases { t.Run(tc.name, func(t *testing.T) { - sessionMeta := bsr.TestSessionMeta(tc.id, ssh.Protocol) + sessionMeta := bsr.TestSessionMeta(tc.id, "TEST") s, err := bsr.NewSession(ctx, sessionMeta, tc.c, tc.keys, tc.opts...) require.NoError(t, err) require.NotNil(t, s) @@ -386,28 +385,28 @@ func TestNewSessionErrors(t *testing.T) { }, { "empty-session-id", - bsr.TestSessionMeta("", ssh.Protocol), + bsr.TestSessionMeta("", "TEST"), &fstest.MemFS{}, keys, errors.New("bsr.NewSession: missing session id: invalid parameter"), }, { "nil-fs", - bsr.TestSessionMeta("session", ssh.Protocol), + bsr.TestSessionMeta("session", "TEST"), nil, keys, errors.New("bsr.NewSession: missing storage fs: invalid parameter"), }, { "nil-keys", - bsr.TestSessionMeta("session", ssh.Protocol), + bsr.TestSessionMeta("session", "TEST"), &fstest.MemFS{}, nil, errors.New("bsr.NewSession: missing kms keys: invalid parameter"), }, { "missing-bsr-signature", - bsr.TestSessionMeta("session", ssh.Protocol), + bsr.TestSessionMeta("session", "TEST"), &fstest.MemFS{}, &kms.Keys{ PubKey: keys.PubKey, @@ -419,7 +418,7 @@ func TestNewSessionErrors(t *testing.T) { }, { "missing-pub-signature", - bsr.TestSessionMeta("session", ssh.Protocol), + bsr.TestSessionMeta("session", "TEST"), &fstest.MemFS{}, &kms.Keys{ PubKey: keys.PubKey, @@ -431,7 +430,7 @@ func TestNewSessionErrors(t *testing.T) { }, { "missing-pub-key", - bsr.TestSessionMeta("session", ssh.Protocol), + bsr.TestSessionMeta("session", "TEST"), &fstest.MemFS{}, &kms.Keys{ WrappedBsrKey: keys.WrappedBsrKey, @@ -443,7 +442,7 @@ func TestNewSessionErrors(t *testing.T) { }, { "missing-wrapped-bsr-key", - bsr.TestSessionMeta("session", ssh.Protocol), + bsr.TestSessionMeta("session", "TEST"), &fstest.MemFS{}, &kms.Keys{ PubKey: keys.PubKey, @@ -455,7 +454,7 @@ func TestNewSessionErrors(t *testing.T) { }, { "missing-wrapped-priv-key", - bsr.TestSessionMeta("session", ssh.Protocol), + bsr.TestSessionMeta("session", "TEST"), &fstest.MemFS{}, &kms.Keys{ PubKey: keys.PubKey, @@ -467,7 +466,7 @@ func TestNewSessionErrors(t *testing.T) { }, { "fs-new-error", - bsr.TestSessionMeta("session", ssh.Protocol), + bsr.TestSessionMeta("session", "TEST"), fstest.NewMemFS(fstest.WithNewFunc(func(_ context.Context, _ string) (storage.Container, error) { return nil, errors.New("fs new error") })), @@ -500,7 +499,7 @@ func TestNewConnectionErrors(t *testing.T) { { "nil-meta", func() *bsr.Session { - s, err := bsr.NewSession(ctx, bsr.TestSessionMeta("session", ssh.Protocol), &fstest.MemFS{}, keys) + s, err := bsr.NewSession(ctx, bsr.TestSessionMeta("session", "TEST"), &fstest.MemFS{}, keys) require.NoError(t, err) return s }(), @@ -510,7 +509,7 @@ func TestNewConnectionErrors(t *testing.T) { { "empty-connection-id", func() *bsr.Session { - s, err := bsr.NewSession(ctx, bsr.TestSessionMeta("session", ssh.Protocol), &fstest.MemFS{}, keys) + s, err := bsr.NewSession(ctx, bsr.TestSessionMeta("session", "TEST"), &fstest.MemFS{}, keys) require.NoError(t, err) return s }(), @@ -534,7 +533,7 @@ func TestNewChannelErrors(t *testing.T) { keys, err := kms.CreateKeys(ctx, kms.TestWrapper(t), "session") require.NoError(t, err) - sessionMeta := bsr.TestSessionMeta("session", ssh.Protocol) + sessionMeta := bsr.TestSessionMeta("session", "TEST") cases := []struct { name string connection *bsr.Connection @@ -610,7 +609,7 @@ func TestChannelNewMessagesWriterErrors(t *testing.T) { keys, err := kms.CreateKeys(ctx, kms.TestWrapper(t), "session") require.NoError(t, err) - sessionMeta := bsr.TestSessionMeta("session", ssh.Protocol) + sessionMeta := bsr.TestSessionMeta("session", "TEST") cases := []struct { name string channel *bsr.Channel @@ -650,7 +649,7 @@ func TestChannelNewRequestsWriterErrors(t *testing.T) { keys, err := kms.CreateKeys(ctx, kms.TestWrapper(t), "session") require.NoError(t, err) - sessionMeta := bsr.TestSessionMeta("session", ssh.Protocol) + sessionMeta := bsr.TestSessionMeta("session", "TEST") cases := []struct { name string channel *bsr.Channel diff --git a/internal/bsr/testdata/TestBsr/session_multiplexed/closed/SHA256SUM b/internal/bsr/testdata/TestBsr/session_multiplexed/closed/SHA256SUM index 366194be3..c23501475 100644 --- a/internal/bsr/testdata/TestBsr/session_multiplexed/closed/SHA256SUM +++ b/internal/bsr/testdata/TestBsr/session_multiplexed/closed/SHA256SUM @@ -3,5 +3,5 @@ .* wrappedPrivKey .* pubKeyBsrSignature.sign .* pubKeySelfSignature.sign -c4b31c89766efe60d7c4041f37237e55e7fc4c5ba99a8f703e9f78d73d420eb8 session.meta +579ecb88b936d12dd5f8ba9091151372e9dcd8cf7c696dc650c26fe968eaf852 session.meta e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 session.summary diff --git a/internal/bsr/testdata/TestBsr/session_multiplexed/closed/session.meta b/internal/bsr/testdata/TestBsr/session_multiplexed/closed/session.meta index 755c6ce2f..2c94027a2 100644 --- a/internal/bsr/testdata/TestBsr/session_multiplexed/closed/session.meta +++ b/internal/bsr/testdata/TestBsr/session_multiplexed/closed/session.meta @@ -1,5 +1,5 @@ id: session_123456789 -protocol: SSH +protocol: TEST user_publicId: user123 user_scope_publicId: global user_scope_type: global diff --git a/internal/bsr/testdata/TestBsr/session_multiplexed/opened/session.meta b/internal/bsr/testdata/TestBsr/session_multiplexed/opened/session.meta index 629b6e5c3..95be69988 100644 --- a/internal/bsr/testdata/TestBsr/session_multiplexed/opened/session.meta +++ b/internal/bsr/testdata/TestBsr/session_multiplexed/opened/session.meta @@ -1,5 +1,5 @@ id: session_123456789 -protocol: SSH +protocol: TEST user_publicId: user123 user_scope_publicId: global user_scope_type: global diff --git a/internal/bsr/testdata/TestBsr/session_not_multiplexed/closed/SHA256SUM b/internal/bsr/testdata/TestBsr/session_not_multiplexed/closed/SHA256SUM index 366194be3..c23501475 100644 --- a/internal/bsr/testdata/TestBsr/session_not_multiplexed/closed/SHA256SUM +++ b/internal/bsr/testdata/TestBsr/session_not_multiplexed/closed/SHA256SUM @@ -3,5 +3,5 @@ .* wrappedPrivKey .* pubKeyBsrSignature.sign .* pubKeySelfSignature.sign -c4b31c89766efe60d7c4041f37237e55e7fc4c5ba99a8f703e9f78d73d420eb8 session.meta +579ecb88b936d12dd5f8ba9091151372e9dcd8cf7c696dc650c26fe968eaf852 session.meta e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 session.summary diff --git a/internal/bsr/testdata/TestBsr/session_not_multiplexed/closed/session.meta b/internal/bsr/testdata/TestBsr/session_not_multiplexed/closed/session.meta index 755c6ce2f..2c94027a2 100644 --- a/internal/bsr/testdata/TestBsr/session_not_multiplexed/closed/session.meta +++ b/internal/bsr/testdata/TestBsr/session_not_multiplexed/closed/session.meta @@ -1,5 +1,5 @@ id: session_123456789 -protocol: SSH +protocol: TEST user_publicId: user123 user_scope_publicId: global user_scope_type: global diff --git a/internal/bsr/testdata/TestBsr/session_not_multiplexed/opened/session.meta b/internal/bsr/testdata/TestBsr/session_not_multiplexed/opened/session.meta index 629b6e5c3..95be69988 100644 --- a/internal/bsr/testdata/TestBsr/session_not_multiplexed/opened/session.meta +++ b/internal/bsr/testdata/TestBsr/session_not_multiplexed/opened/session.meta @@ -1,5 +1,5 @@ id: session_123456789 -protocol: SSH +protocol: TEST user_publicId: user123 user_scope_publicId: global user_scope_type: global