Skip to content

Commit

Permalink
[PLAT-14966] [PLAT-14968] Edit KMS config reverts to default name in …
Browse files Browse the repository at this point in the history
…hashicorp vault

Summary:
This diff fixes 2 issues:
1. [PLAT-14966] Edit KMS config reverts to default name in hashicorp vault
2. [PLAT-14968] [UI] Display the Hashicorp KMS key name under KMS config's Show Details section

Test Plan:
Manually tested:
Created a Hashicorp vault KMS, edited the secret token, edited the approle auth creds, ensured the vault key name stays the same instead of defaulting to `key_yugabyte`.

Also:
Run itests.
Run UTs.

Reviewers: svarshney, kkannan, sanketh

Reviewed By: kkannan, sanketh

Subscribers: sanketh, yugaware

Differential Revision: https://phorge.dev.yugabyte.com/D38500
  • Loading branch information
Sahith02 committed Sep 30, 2024
1 parent c18fd1c commit 8fade9b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ private void checkEditableFields(ObjectNode formData, KeyProvider keyProvider, U
Arrays.asList(
HashicorpVaultConfigParams.HC_VAULT_ENGINE,
HashicorpVaultConfigParams.HC_VAULT_MOUNT_PATH,
HashicorpVaultConfigParams.HC_VAULT_KEY_NAME,
HashicorpVaultConfigParams.HC_VAULT_ADDRESS);
for (String field : hashicorpKmsNonEditableFields) {
if (formData.get(field) != null && !authconfig.get(field).equals(formData.get(field))) {
Expand Down Expand Up @@ -305,6 +306,9 @@ private ObjectNode addNonEditableFieldsData(
formData.set(
HashicorpVaultConfigParams.HC_VAULT_MOUNT_PATH,
authConfig.get(HashicorpVaultConfigParams.HC_VAULT_MOUNT_PATH));
formData.set(
HashicorpVaultConfigParams.HC_VAULT_KEY_NAME,
authConfig.get(HashicorpVaultConfigParams.HC_VAULT_KEY_NAME));

if (formData.get(HashicorpVaultConfigParams.HC_VAULT_AUTH_NAMESPACE) == null
&& authConfig.get(HashicorpVaultConfigParams.HC_VAULT_AUTH_NAMESPACE) != null) {
Expand Down
5 changes: 5 additions & 0 deletions managed/ui/src/components/config/Security/ConfigDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export const ConfigDetails = ({ data, visible, onHide }) => {

const getForHashicorp = () => {
const {
HC_VAULT_KEY_NAME,
HC_VAULT_ADDRESS,
HC_VAULT_TOKEN,
HC_VAULT_AUTH_NAMESPACE,
Expand All @@ -71,6 +72,10 @@ export const ConfigDetails = ({ data, visible, onHide }) => {
HC_VAULT_TTL_EXPIRY
} = credentials;
const data = [
{
label: 'Key Name',
value: HC_VAULT_KEY_NAME
},
{
label: 'Vault Address',
value: HC_VAULT_ADDRESS
Expand Down

0 comments on commit 8fade9b

Please sign in to comment.