|
128 | 128 | required
|
129 | 129 | type="text"
|
130 | 130 | />
|
| 131 | + <KInput |
| 132 | + v-if="config.awsStsEndpointUrlAvailable" |
| 133 | + v-model.trim="configFields[VaultProviders.AWS].sts_endpoint_url" |
| 134 | + autocomplete="off" |
| 135 | + data-testid="vault-form-config-aws-sts_endpoint_url" |
| 136 | + :is-readonly="form.isReadonly" |
| 137 | + :label="t('form.config.aws.fields.sts_endpoint_url.label')" |
| 138 | + :label-attributes="{ |
| 139 | + info: t('form.config.aws.fields.sts_endpoint_url.tooltip'), |
| 140 | + tooltipAttributes: { maxWidth: '400px' }, |
| 141 | + }" |
| 142 | + type="text" |
| 143 | + /> |
131 | 144 | </div>
|
132 | 145 |
|
133 | 146 | <!-- GCP fields -->
|
@@ -627,6 +640,7 @@ const configFields = reactive<ConfigFields>({
|
627 | 640 | endpoint_url: '',
|
628 | 641 | assume_role_arn: '',
|
629 | 642 | role_session_name: 'KongVault',
|
| 643 | + sts_endpoint_url: '', |
630 | 644 | } as AWSVaultConfig,
|
631 | 645 | [VaultProviders.GCP]: {
|
632 | 646 | project_id: '',
|
@@ -669,6 +683,7 @@ const originalConfigFields = reactive<ConfigFields>({
|
669 | 683 | endpoint_url: '',
|
670 | 684 | assume_role_arn: '',
|
671 | 685 | role_session_name: 'KongVault',
|
| 686 | + sts_endpoint_url: '', |
672 | 687 | } as AWSVaultConfig,
|
673 | 688 | [VaultProviders.GCP]: {
|
674 | 689 | project_id: '',
|
@@ -871,8 +886,8 @@ const isVaultConfigValid = computed((): boolean => {
|
871 | 886 | // AWS Vault fields logic
|
872 | 887 | if (vaultProvider.value === VaultProviders.AWS) {
|
873 | 888 | return !Object.keys(configFields[VaultProviders.AWS]).filter(key => {
|
874 |
| - // endpoint_url, assume_role_arn and ttl fields are optional |
875 |
| - if (['endpoint_url', 'assume_role_arn', 'ttl', 'neg_ttl', 'resurrect_ttl'].includes(key)) { |
| 889 | + // sts_endpoint_url, endpoint_url, assume_role_arn and ttl fields are optional |
| 890 | + if (['endpoint_url', 'assume_role_arn', 'ttl', 'neg_ttl', 'resurrect_ttl', 'sts_endpoint_url'].includes(key)) { |
876 | 891 | return false
|
877 | 892 | }
|
878 | 893 | return !(configFields[vaultProvider.value] as AWSVaultConfig)[key as keyof AWSVaultConfig]
|
@@ -949,6 +964,7 @@ const getPayload = computed((): Record<string, any> => {
|
949 | 964 | ...configFields[vaultProvider.value],
|
950 | 965 | endpoint_url: (configFields[vaultProvider.value] as AWSVaultConfig).endpoint_url || null,
|
951 | 966 | assume_role_arn: (configFields[vaultProvider.value] as AWSVaultConfig).assume_role_arn || null,
|
| 967 | + sts_endpoint_url: (configFields[vaultProvider.value] as AWSVaultConfig).sts_endpoint_url || null, |
952 | 968 | }
|
953 | 969 |
|
954 | 970 | let config: VaultPayload['config'] = configFields[vaultProvider.value]
|
|
0 commit comments