diff --git a/internal/bsr/meta.go b/internal/bsr/meta.go index 3aba4fff0e..e979fa32c7 100644 --- a/internal/bsr/meta.go +++ b/internal/bsr/meta.go @@ -92,7 +92,6 @@ func (u User) writeMeta(ctx context.Context, c *container) error { // Target contains information about the target for this session type Target struct { PublicId string - ProjectId string Scope Scope Name string // optional field Description string // optional field @@ -113,10 +112,6 @@ func (t Target) writeMeta(ctx context.Context, c *container) error { if err != nil { return err } - _, err = c.WriteMeta(ctx, "target_projectId", t.ProjectId) - if err != nil { - return err - } if t.Name != "" { _, err = c.WriteMeta(ctx, "target_name", t.Name) if err != nil { diff --git a/internal/bsr/testdata/TestBsr/session_multiplexed/closed/SHA256SUM b/internal/bsr/testdata/TestBsr/session_multiplexed/closed/SHA256SUM index 56820fd861..366194be36 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 -04fb6e9ce96c411f2ab185167d8b69a6d66d894d8620bf347e4003afe270f662 session.meta +c4b31c89766efe60d7c4041f37237e55e7fc4c5ba99a8f703e9f78d73d420eb8 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 2f5a530109..755c6ce2f2 100644 --- a/internal/bsr/testdata/TestBsr/session_multiplexed/closed/session.meta +++ b/internal/bsr/testdata/TestBsr/session_multiplexed/closed/session.meta @@ -4,9 +4,9 @@ user_publicId: user123 user_scope_publicId: global user_scope_type: global target_publicId: target123 -target_scope_publicId: global -target_scope_type: global -target_projectId: proj123 +target_scope_publicId: proj123 +target_scope_type: project +target_scope_parentId: org123 target_defaultPort: 0 target_sessionMaxSeconds: 0 target_sessionConnectionLimit: 0 diff --git a/internal/bsr/testdata/TestBsr/session_multiplexed/opened/session.meta b/internal/bsr/testdata/TestBsr/session_multiplexed/opened/session.meta index 26cccf86c3..629b6e5c30 100644 --- a/internal/bsr/testdata/TestBsr/session_multiplexed/opened/session.meta +++ b/internal/bsr/testdata/TestBsr/session_multiplexed/opened/session.meta @@ -4,9 +4,9 @@ user_publicId: user123 user_scope_publicId: global user_scope_type: global target_publicId: target123 -target_scope_publicId: global -target_scope_type: global -target_projectId: proj123 +target_scope_publicId: proj123 +target_scope_type: project +target_scope_parentId: org123 target_defaultPort: 0 target_sessionMaxSeconds: 0 target_sessionConnectionLimit: 0 @@ -32,4 +32,4 @@ vcs123_vaultCredentialStore_vl123_vaultLibrary_publicId: vl123 vcs123_vaultCredentialStore_vl123_vaultLibrary_projectId: proj123 vcs123_vaultCredentialStore_vl123_vaultLibrary_vaultPath: /a/path vcs123_vaultCredentialStore_vl123_vaultLibrary_httpMethod: GET -vcs123_vaultCredentialStore_vl123_vaultLibrary_credentialType: magic \ No newline at end of file +vcs123_vaultCredentialStore_vl123_vaultLibrary_credentialType: magic diff --git a/internal/bsr/testdata/TestBsr/session_not_multiplexed/closed/SHA256SUM b/internal/bsr/testdata/TestBsr/session_not_multiplexed/closed/SHA256SUM index 56820fd861..366194be36 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 -04fb6e9ce96c411f2ab185167d8b69a6d66d894d8620bf347e4003afe270f662 session.meta +c4b31c89766efe60d7c4041f37237e55e7fc4c5ba99a8f703e9f78d73d420eb8 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 3c8233707b..755c6ce2f2 100644 --- a/internal/bsr/testdata/TestBsr/session_not_multiplexed/closed/session.meta +++ b/internal/bsr/testdata/TestBsr/session_not_multiplexed/closed/session.meta @@ -4,9 +4,9 @@ user_publicId: user123 user_scope_publicId: global user_scope_type: global target_publicId: target123 -target_scope_publicId: global -target_scope_type: global -target_projectId: proj123 +target_scope_publicId: proj123 +target_scope_type: project +target_scope_parentId: org123 target_defaultPort: 0 target_sessionMaxSeconds: 0 target_sessionConnectionLimit: 0 @@ -33,4 +33,4 @@ vcs123_vaultCredentialStore_vl123_vaultLibrary_projectId: proj123 vcs123_vaultCredentialStore_vl123_vaultLibrary_vaultPath: /a/path vcs123_vaultCredentialStore_vl123_vaultLibrary_httpMethod: GET vcs123_vaultCredentialStore_vl123_vaultLibrary_credentialType: magic -connection: conn_1.connection \ No newline at end of file +connection: conn_1.connection 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 26cccf86c3..629b6e5c30 100644 --- a/internal/bsr/testdata/TestBsr/session_not_multiplexed/opened/session.meta +++ b/internal/bsr/testdata/TestBsr/session_not_multiplexed/opened/session.meta @@ -4,9 +4,9 @@ user_publicId: user123 user_scope_publicId: global user_scope_type: global target_publicId: target123 -target_scope_publicId: global -target_scope_type: global -target_projectId: proj123 +target_scope_publicId: proj123 +target_scope_type: project +target_scope_parentId: org123 target_defaultPort: 0 target_sessionMaxSeconds: 0 target_sessionConnectionLimit: 0 @@ -32,4 +32,4 @@ vcs123_vaultCredentialStore_vl123_vaultLibrary_publicId: vl123 vcs123_vaultCredentialStore_vl123_vaultLibrary_projectId: proj123 vcs123_vaultCredentialStore_vl123_vaultLibrary_vaultPath: /a/path vcs123_vaultCredentialStore_vl123_vaultLibrary_httpMethod: GET -vcs123_vaultCredentialStore_vl123_vaultLibrary_credentialType: magic \ No newline at end of file +vcs123_vaultCredentialStore_vl123_vaultLibrary_credentialType: magic diff --git a/internal/bsr/testing.go b/internal/bsr/testing.go index 05159143ea..fa80f052e4 100644 --- a/internal/bsr/testing.go +++ b/internal/bsr/testing.go @@ -59,9 +59,12 @@ func TestSessionMeta(s string, p Protocol) *SessionMeta { Address: "127.0.0.1", }, Target: &Target{ - PublicId: "target123", - ProjectId: "proj123", - Scope: scope, + PublicId: "target123", + Scope: Scope{ + PublicId: "proj123", + Type: "project", + ParentId: "org123", + }, DefaultPort: 0, SessionMaxSeconds: 0, SessionConnectionLimit: 0,