Skip to content

Show masked aws secret key if set for Advaced Search

Terri Chu requested to merge tchu-fix-aws-access-key-value-when-set into master

What does this MR do and why?

Currently it's impossible to tell if the AWS Secret Access Key value is set from the Advanced Search Admin Settings UI as the field stays blank in both states (set and not set). This MR adds a masked value (hardcoded constant ****) if the AWS Secret Access Key is set.

Note: this works the exact same way as the Password field on the form above

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
image image

How to set up and validate locally

  1. you do not need to have elasticsearch setup to verify this
  2. navigate to Admin Settings - Advanced Search
  3. Make sure that Use AWS OpenSearch Service with IAM credentials is NOT enabled or it will try to connect and fail to save
  4. Set the AWS OpenSearch IAM credentials to anything
  5. Verify that the field shows **** if the secret key is set
  6. Check in the rails console that the field is setup correctly: ApplicationSetting.current_without_cache.elasticsearch_aws_secret_access_key
  7. Click save again on the Advanced Search settings page (do not edit anything) to test that the **** does not accidentally overwrite the value in the database
  8. Check in the rails console that the field is still set and not ****: ApplicationSetting.current_without_cache.elasticsearch_aws_secret_access_key

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Terri Chu

Merge request reports

Loading