From 9cdfc5f9863a00d7d5e1344824990ba19623ace8 Mon Sep 17 00:00:00 2001 From: Michael Gaffney Date: Sat, 4 Dec 2021 12:23:54 -0500 Subject: [PATCH] docs(vault): Add comment about the default value of HttpMethod --- internal/credential/vault/repository_credential_library.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/credential/vault/repository_credential_library.go b/internal/credential/vault/repository_credential_library.go index 2c1d8e0a7..faff3f278 100644 --- a/internal/credential/vault/repository_credential_library.go +++ b/internal/credential/vault/repository_credential_library.go @@ -166,6 +166,12 @@ func (r *Repository) UpdateCredentialLibrary(ctx context.Context, scopeId string ) if strutil.StrListContains(nullFields, httpMethodField) { + // GET is the default value for the HttpMethod field in + // CredentialLibrary. The http_method column in the database does + // not allow NULL values but it also does not define a default + // value. Therefore, if the httpMethodField is in nullFields: + // remove it from nullFields then add it to dbMask and set the + // value to GET. dbMask = append(dbMask, httpMethodField) nullFields = strutil.StrListDelete(nullFields, httpMethodField) l.HttpMethod = string(MethodGet)