Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Vault adds Amazon Secrets Manager #4455

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions src/views/settings/Feature/Vault/Aws.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<template>
<BaseKV :config="$data" :title="$tc('AmazonSecretsManager')" />
</template>

<script>
import BaseKV from './Base.vue'

export default {
name: 'AmazonSecretsManager',
components: {
BaseKV
},
data() {
const vm = this
return {
url: `/api/v1/settings/setting/?category=aws_sm`,
hasDetailInMsg: false,
visible: false,
moreButtons: [
{
title: this.$t('Test'),
loading: false,
callback: function(value, form, btn) {
btn.loading = true
vm.$axios.post(
'/api/v1/settings/vault/aws/testing/',
value
).then(res => {
vm.$message.success(res['msg'])
}).catch(() => {
vm.$log.error('err occur')
}).finally(() => { btn.loading = false })
}
}
],
encryptedFields: ['VAULT_AWS_ACCESS_SECRET_KEY'],
fields: [
[this.$t('AccountStorage'),
[
'VAULT_AWS_REGION_NAME',
'VAULT_AWS_ACCESS_KEY_ID',
'VAULT_AWS_ACCESS_SECRET_KEY'
]
]
],
fieldsMeta: {
},
submitMethod() {
return 'patch'
}
}
},
computed: {},
methods: {}
}
</script>

<style scoped>

</style>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, there aren't any major issues with this template code provided so far. It seems to be well-written but could potentially have some adjustments made depending on specific requirements and context.

As per my knowledge cut-off until now (September 2021), no significant changes were observed in the current JavaScript code snippet above.

10 changes: 9 additions & 1 deletion src/views/settings/Feature/Vault/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { openTaskPage } from '@/utils/jms'
import store from '@/store'
import HashiCorpKV from './HCP.vue'
import AzureKV from './Azure.vue'
import AwsSM from './Aws.vue'

export default {
components: {
Expand Down Expand Up @@ -48,7 +49,7 @@ export default {
],
fields: [
[this.$t('Basic'), ['VAULT_ENABLED', 'VAULT_BACKEND', 'HISTORY_ACCOUNT_CLEAN_LIMIT']],
[this.$t('Provider'), ['HCP', 'AZURE']]
[this.$t('Provider'), ['HCP', 'AZURE', 'AWS']]
],
fieldsMeta: {
HISTORY_ACCOUNT_CLEAN_LIMIT: {
Expand Down Expand Up @@ -79,6 +80,13 @@ export default {
hidden: (formValue) => {
return !formValue.VAULT_ENABLED || formValue['VAULT_BACKEND'] !== 'azure'
}
},
AWS: {
label: this.$t('AmazonSecretsManager'),
component: AwsSM,
hidden: (formValue) => {
return !formValue.VAULT_ENABLED || formValue['VAULT_BACKEND'] !== 'aws'
}
}
},
submitMethod() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The provided code does not appear to contain any significant differences or issues for checking. It appears to be consistent with past practices of using Vue Components such as HashiCorp KV, Azure KV, and AWS Secret Management Service (HCP), each requiring its own form fields based on Vault Backend selection.

It is crucial to note that while I have reviewed the code, it's important you review all necessary changes after making corrections or additions yourself. If there are specific areas where inconsistencies need further analysis or adjustments:

  1. Validation/Constraints: Review how constraints or validations are currently implemented across these components. Ensure they reflect current best practices.

  2. Form Fields Layout: Assess whether the order and layout between Vault Configurations match user flows efficiently or if adjustments are needed regarding display or functionality within individual forms.

  3. Accessibility and Usability Issues in Form Control Selections: Evaluate how accessible different choices are in relation to users' needs—make sure no accessibility barriers exist due to the complex nature of field dependencies or configurations.

By doing so, potential irregularities will become more discernible when comparing actual implementations versus suggested improvements.

Remember that reviewing modern coding standards and keeping updated with evolving software development best practices ensures robust solutions that scale well beyond just historical implementation requirements.

If you can share specific concerns or discrepancies from the code you referenced specifically, I could offer more detailed assistance. If nothing seems out-of-the-ordinary at face-value inspection, then your environment or context might require additional attention to fully analyze your application.

Expand Down