bsr: rename fields and remove project id from meta

pull/3251/head
Johan Brandhorst-Satzkorn 3 years ago committed by Timothy Messier
parent 64764e29e5
commit 3e07b2ffaf
No known key found for this signature in database
GPG Key ID: EFD2F184F7600572

@ -59,8 +59,8 @@ func NewSession(ctx context.Context, meta *SessionRecordingMeta, sessionMeta *Se
case len(sessionMeta.StaticJSONCredentials) == 0 &&
len(sessionMeta.StaticUsernamePasswordCredentials) == 0 &&
len(sessionMeta.StaticSshPrivateKeyCredentials) == 0 &&
len(sessionMeta.VaultLibraries) == 0 &&
len(sessionMeta.VaultSshCertLibraries) == 0:
len(sessionMeta.VaultGenericLibraries) == 0 &&
len(sessionMeta.VaultSshCertificateLibraries) == 0:
return nil, fmt.Errorf("%s: missing credential information: %w", op, ErrInvalidParameter)
case is.Nil(sessionMeta.User):
return nil, fmt.Errorf("%s: missing session user: %w", op, ErrInvalidParameter)

@ -89,7 +89,6 @@ type StaticCredentialStore struct {
// StaticJsonCredential represents a static json credential used for this session
type StaticJsonCredential struct {
PublicId string
ProjectId string
Name string // optional field
Description string // optional field
ObjectHmac []byte
@ -100,9 +99,9 @@ type StaticJsonCredential struct {
// StaticUsernamePasswordCredential represents a Static username password credential used for this session
type StaticUsernamePasswordCredential struct {
PublicId string
ProjectId string
Name string // optional field
Description string // optional field
Username string
PasswordHmac []byte
Purposes []string
CredentialStore StaticCredentialStore
@ -111,9 +110,9 @@ type StaticUsernamePasswordCredential struct {
// StaticSshPrivateKeyCredential represents a Static Ssh private key credential used for this session
type StaticSshPrivateKeyCredential struct {
PublicId string
ProjectId string
Name string // optional field
Description string // optional field
Username string
PrivateKeyHmac []byte
PrivateKeyPassphraseHmac []byte // optional field
Purposes []string
@ -133,10 +132,9 @@ type VaultCredentialStore struct {
WorkerFilter string // optional field
}
// VaultLibrary contains information about the Vault library used for this session
type VaultLibrary struct {
// VaultGenericLibrary contains information about the Vault library used for this session
type VaultGenericLibrary struct {
PublicId string
ProjectId string
Name string // optional field
Description string // optional field
VaultPath string
@ -147,10 +145,9 @@ type VaultLibrary struct {
CredentialStore VaultCredentialStore
}
// VaultSshCertLibrary contains information about a Vault Ssh Cert library for this session
type VaultSshCertLibrary struct {
// VaultSshCertificateLibrary contains information about a Vault Ssh Cert library for this session
type VaultSshCertificateLibrary struct {
PublicId string
ProjectId string
Name string // optional field
Description string // optional field
VaultPath string
@ -179,6 +176,6 @@ type SessionMeta struct {
StaticJSONCredentials []StaticJsonCredential
StaticUsernamePasswordCredentials []StaticUsernamePasswordCredential
StaticSshPrivateKeyCredentials []StaticSshPrivateKeyCredential
VaultLibraries []VaultLibrary
VaultSshCertLibraries []VaultSshCertLibrary
VaultGenericLibraries []VaultGenericLibrary
VaultSshCertificateLibraries []VaultSshCertificateLibrary
}

@ -48,7 +48,6 @@ func TestSessionMeta(s string) *SessionMeta {
StaticJSONCredentials: []StaticJsonCredential{
{
PublicId: "scjson123",
ProjectId: "proj123",
ObjectHmac: []byte("hmac"),
CredentialStore: StaticCredentialStore{
PublicId: "scs123",
@ -56,10 +55,9 @@ func TestSessionMeta(s string) *SessionMeta {
},
},
},
VaultLibraries: []VaultLibrary{
VaultGenericLibraries: []VaultGenericLibrary{
{
PublicId: "vl123",
ProjectId: "proj123",
VaultPath: "/a/path",
HttpMethod: "GET",
CredentialType: "magic",

Loading…
Cancel
Save