chore(bsr): remove references to ssh protocol

This commit is contained in:
irenarindos authored and Timothy Messier committed 2023-05-31 12:18:20 +00:00
1 parent e567bb97e6
commit 304d15021f
7 files changed
+21 -22

No files matched your search

+15 -16
View File
@@ -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
@@ -3,5 +3,5 @@
.* wrappedPrivKey
.* pubKeyBsrSignature.sign
.* pubKeySelfSignature.sign
c4b31c89766efe60d7c4041f37237e55e7fc4c5ba99a8f703e9f78d73d420eb8 session.meta
579ecb88b936d12dd5f8ba9091151372e9dcd8cf7c696dc650c26fe968eaf852 session.meta
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 session.summary
@@ -1,5 +1,5 @@
id: session_123456789
protocol: SSH
protocol: TEST
user_publicId: user123
user_scope_publicId: global
user_scope_type: global
@@ -1,5 +1,5 @@
id: session_123456789
protocol: SSH
protocol: TEST
user_publicId: user123
user_scope_publicId: global
user_scope_type: global
@@ -3,5 +3,5 @@
.* wrappedPrivKey
.* pubKeyBsrSignature.sign
.* pubKeySelfSignature.sign
c4b31c89766efe60d7c4041f37237e55e7fc4c5ba99a8f703e9f78d73d420eb8 session.meta
579ecb88b936d12dd5f8ba9091151372e9dcd8cf7c696dc650c26fe968eaf852 session.meta
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 session.summary
@@ -1,5 +1,5 @@
id: session_123456789
protocol: SSH
protocol: TEST
user_publicId: user123
user_scope_publicId: global
user_scope_type: global
@@ -1,5 +1,5 @@
id: session_123456789
protocol: SSH
protocol: TEST
user_publicId: user123
user_scope_publicId: global
user_scope_type: global