feat(bsr): add credentials to session meta

This commit is contained in:
irenarindos authored and Timothy Messier committed 2023-05-31 12:18:19 +00:00
1 parent 35a2296092
commit 200e7dca5a
9 files changed
+866 -354

No files matched your search

+36
View File
@@ -12,6 +12,40 @@ func TestSessionMeta(s string, p Protocol) *SessionMeta {
PublicId: "staticcat123",
ProjectId: "proj123",
}
creds := make([]StaticCredential, 0)
c := StaticJsonCredential{
PublicId: "scjson123",
ProjectId: "proj123",
ObjectHmac: []byte("hmac"),
}
creds = append(creds, c)
staticCredentialStore := make([]StaticCredentialStore, 0)
scs := StaticCredentialStore{
PublicId: "scs123",
ProjectId: "proj123",
Credentials: creds,
}
staticCredentialStore = append(staticCredentialStore, scs)
vcreds := make([]DynamicCredentialLibraries, 0)
v := VaultLibrary{
PublicId: "vl123",
ProjectId: "proj123",
VaultPath: "/a/path",
HttpMethod: "GET",
CredentialType: "magic",
}
vcreds = append(vcreds, v)
vaultCredentialStore := make([]VaultCredentialStore, 0)
vcs := VaultCredentialStore{
PublicId: "vcs123",
ProjectId: "proj123",
VaultAddress: "an/address",
Namespace: "name",
TlsServerName: "imaserver",
TlsSkipVerify: false,
CredentialLibraries: vcreds,
}
vaultCredentialStore = append(vaultCredentialStore, vcs)
sessionMeta := &SessionMeta{
Id: s,
Protocol: p,
@@ -32,6 +66,8 @@ func TestSessionMeta(s string, p Protocol) *SessionMeta {
SessionMaxSeconds: 0,
SessionConnectionLimit: 0,
},
StaticCredentialStore: staticCredentialStore,
VaultCredentialStore: vaultCredentialStore,
}
return sessionMeta
}