feat: static json credentials (#2423)

This commit is contained in:
Damian Debkowski authored and GitHub committed 2022-09-16 15:00:04 -07:00
1 parent 8c53d931aa
commit 546c5dc5be
42 files changed
+3207 -165

No files matched your search

@@ -209,3 +209,66 @@ message SshPrivateKeyCredential {
that: "attributes.private_key_passphrase_hmac"
}];
}
message JsonCredential {
// public_id is a surrogate key suitable for use in a public API.
// @inject_tag: `gorm:"primary_key"`
string public_id = 1;
// create_time is set by the database.
// @inject_tag: `gorm:"default:current_timestamp"`
timestamp.v1.Timestamp create_time = 2;
// update_time is set by the database.
// @inject_tag: `gorm:"default:current_timestamp"`
timestamp.v1.Timestamp update_time = 3;
// name is optional. If set, it must be unique within scope_id.
// @inject_tag: `gorm:"default:null"`
string name = 4 [(custom_options.v1.mask_mapping) = {
this: "Name"
that: "name"
}];
// description is optional.
// @inject_tag: `gorm:"default:null"`
string description = 5 [(custom_options.v1.mask_mapping) = {
this: "Description"
that: "description"
}];
// store_id of the owning static credential store.
// It must be set.
// @inject_tag: `gorm:"not_null"`
string store_id = 6;
// version allows optimistic locking of the resource.
// @inject_tag: `gorm:"default:null"`
uint32 version = 7;
// object is the plain-text of the json associated with the
// credential. We are not storing this plain-text object in the database.
// @inject_tag: `gorm:"-" wrapping:"pt,object"`
bytes object = 8 [(custom_options.v1.mask_mapping) = {
this: "Object"
that: "attributes.object"
}];
// object_encrypted is the ciphertext of the object. It is stored in
// the database.
// @inject_tag: `gorm:"column:object_encrypted;not_null" wrapping:"ct,object"`
bytes object_encrypted = 9;
// object_hmac is a sha256-hmac of the unencrypted object. It is recalculated
// everytime the object is updated.
// @inject_tag: `gorm:"not_null"`
bytes object_hmac = 10 [(custom_options.v1.mask_mapping) = {
this: "ObjectHmac"
that: "attributes.object_hmac"
}];
// The key_id of the kms database key used for encrypting this entry.
// It must be set.
// @inject_tag: `gorm:"not_null"`
string key_id = 11;
}