@kong-ui-public/entities-vaults 3.12.4 → 3.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -354,7 +354,7 @@ const he = {
354
354
  list: {
355
355
  konnect: {
356
356
  getAll: `${ke}/vaults`,
357
- deleteConfigStore: `${Ue}/{id}`
357
+ deleteConfigStore: `${Ue}/{id}?force=true`
358
358
  },
359
359
  kongManager: {
360
360
  getAll: `${Ce}/vaults`
@@ -1 +1 @@
1
- (function(A,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vue-router"),require("@kong/icons"),require("@kong-ui-public/entities-shared"),require("@kong-ui-public/i18n")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong/icons","@kong-ui-public/entities-shared","@kong-ui-public/i18n"],e):(A=typeof globalThis<"u"?globalThis:A||self,e(A["kong-ui-public-entities-vaults"]={},A.Vue,A.VueRouter,A.KongIcons,A["kong-ui-public-entities-shared"],A["kong-ui-public-i18n"]))})(this,function(A,e,ie,Z,p,de){"use strict";const ge={actions:{create:"New Vault",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",view:"View Details"},delete:{title:"Delete a Vault",title_for_secret:"Delete a Secret",description:"This action cannot be reversed."},errors:{general:"Vaults could not be retrieved",delete:"The vault could not be deleted at this time.",copy:"Failed to copy to clipboard"},search:{placeholder_for_vaults:{konnect:"Filter by exact prefix or ID"},placeholder_for_secrets:{konnect:"Filter by exact key"}},vaults:{title:"Vaults",list:{toolbar_actions:{new_vault:"New Vault"},table_headers:{prefix:"Prefix",name:"Vault Type",description:"Description",tags:"Tags",id:"ID"},empty_state:{title:"Configure a New Vault",description:"Improve the security of your Kong Gateway deployment with centralized secrets."}}},secrets:{title:"Secrets",list:{toolbar_actions:{new_secret:"Store New Secret"},table_headers:{key:"Secret Key",updated_at:"Updated At"},empty_state:{title:"No Secrets Stored",description:"Improve the security of your Kong Gateway deployment with centralized secrets."}},form:{info:{title:"Secret",description:"Enter the secret key and secret value to be stored in Konnect vault"},fields:{key:{label:"Key",placeholder:"Enter key"},value:{label:"Value",placeholder:"Enter value here, can be simple values or multi-line"}},hint:"Once saved, the secret value will not be visible"}},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},labels:{vault_type:"Vault Type"},form:{sections:{general:{title:"General Information",description:"General information helps identify and manage this Vault instance."},config:{title:"Vault Configuration",description:"Select a type of Vault and configure properties specific to each type of Vault."}},fields:{prefix:{label:"Prefix",placeholder:"Enter a unique prefix for this vault",help:"e.g. my-vault",tooltip:"The prefix is used to load the right Vault configuration and implementation when referencing secrets with the other entities."},description:{label:"Description",placeholder:"Enter some description for this vault"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3"}},config:{konnect:{label:"Konnect",description:"Access secrets stored directly in Konnect's unified platform to easily reference in Kong Gateway configuration."},env:{label:"Environment Variables",description:"Access secrets stored via variables to be made available in Kong Gateway at runtime.",fields:{prefix:{label:"Environment Variable Prefix",placeholder:"Enter your environment variable vault prefix",tooltip:"Data plane will access all the environment variables starting with this prefix."}}},aws:{label:"AWS Secrets Manager",description:"Access secrets stored in AWS Secrets Manager for Kong Gateway configuration.",fields:{region:{label:"Region",placeholder:"Select an AWS region",tooltip:"The AWS region your vault is located in",locations:{"us-east-1":{location:"N. Virginia"},"us-east-2":{location:"Ohio"},"us-west-1":{location:"N. California"},"us-west-2":{location:"Oregon"},"af-south-1":{location:"Cape Town"},"ap-east-1":{location:"Hong Kong"},"ap-southeast-3":{location:"Jakarta"},"ap-south-1":{location:"Mumbai"},"ap-northeast-1":{location:"Tokyo"},"ap-northeast-2":{location:"Seoul"},"ap-northeast-3":{location:"Osaka"},"ap-southeast-1":{location:"Singapore"},"ap-southeast-2":{location:"Sydney"},"ca-central-1":{location:"Canada"},"eu-central-1":{location:"Frankfurt"},"eu-west-1":{location:"Ireland"},"eu-west-2":{location:"London"},"eu-west-3":{location:"Paris"},"eu-south-1":{location:"Milan"},"eu-north-1":{location:"Stockholm"},"me-south-1":{location:"Bahrain"},"sa-east-1":{location:"São Paulo"},"us-gov-east-1":{location:"US East"},"us-gov-west-1":{location:"US West"}}},endpoint_url:{label:"Endpoint URL",tooltip:'The AWS SecretsManager service endpoint url. If not specified, the value used by vault will be the official AWS SecretsManager service url which is `https://secretsmanager.<region>.amazonaws.com`. You can specify a complete URL(including the "http/https" scheme) to override the endpoint that vault will connect to.'},assume_role_arn:{label:"Assume Role ARN",tooltip:"The target AWS IAM role ARN that will be assumed. Typically this is used for operating between multiple roles or cross-accounts. If you are not using assume role you should not specify this value."},role_session_name:{label:"Role Session Name",tooltip:"The role session name used for role assuming."},sts_endpoint_url:{label:"STS Endpoint URL",tooltip:"The custom STS endpoint URL used for role assuming in AWS Vault. Note that this value will override the default STS endpoint URL(which should be `https: //sts.amazonaws.com`, or `https: //sts.<region>.amazonaws.com` if you have `AWS_STS_REGIONAL_ENDPOINTS` set to `regional`). If you are not using private VPC endpoint for STS service, you should not specify this value."}}},gcp:{label:"Google Secret Manager",description:"Access secrets stored in Google Secret Manager for Kong Gateway configuration.",fields:{project_id:{label:"Project ID",placeholder:"Enter your Google Cloud Project ID",tooltip:{text:"Visit your Google API Console and select {italic-text} in the projects list to see your project ID",italicText:"Manage all projects"}}}},hcv:{label:"HashiCorp Vault",description:"Access secrets stored in HashiCorp Vault for Kong Gateway configuration.",fields:{protocol:{label:"Protocol"},host:{label:"Host"},port:{label:"Port"},mount:{label:"Mount"},kv:{label:"Kv"},namespace:{label:"Namespace"},auth_method:{label:"Authentication Method"},token:{label:"Token"},kube_role:{label:"Kubernetes Role"},kube_auth_path:{label:"Kubernetes Auth Path"},kube_api_token_file:{label:"Kubernetes API Token File"},approle_auth_path:{label:"App Role Auth Path"},approle_role_id:{label:"App Role Role ID"},approle_secret_id:{label:"App Role Secret ID"},approle_secret_id_file:{label:"App Role Secret ID File"},approle_response_wrapping:{label:"App Role Response Wrapping"}}},azure:{label:"Azure Vault",description:"Access secrets stored in Azure Key Vault for Kong Gateway configuration.",fields:{location:{label:"Location"},vault_uri:{label:"Vault URI"},credential_prefix:{label:"Credential Prefix"},type:{label:"Type",placeholder:"Select a type"},client_id:{label:"Client ID"},tenant_id:{label:"Tenant ID"}}},advancedFields:{title:"View Advanced Fields",ttl:"Time-to-Live",ttlTooltip:"Time-to-live (in seconds) of a secret from a vault when cached by this reference",negTtl:"Negative Time-to-Live",negTtlTooltip:"Time-to-live (in seconds) of a vault miss (no secret)",resurrectTtl:"Time-to-Live Resurrection",resurrectTtlTooltip:"Time (in seconds) for which stale secrets from the vault are resurrected for when they cannot be refreshed"}},unavailable:"This vault provider is available on Enterprise."}};function ye(){const o=de.createI18n("en-us",ge);return{i18n:o,i18nT:de.i18nTComponent(o)}}const ae={useI18n:ye},se="/v2/control-planes/{controlPlaneId}/core-entities",fe="/v2/control-planes/{controlPlaneId}/config-stores",ce="/{workspace}",Q={list:{konnect:{getAll:`${se}/vaults`,deleteConfigStore:`${fe}/{id}`},kongManager:{getAll:`${ce}/vaults`}},form:{konnect:{create:`${se}/vaults`,createConfigStore:fe,edit:`${se}/vaults/{id}`},kongManager:{create:`${ce}/vaults`,edit:`${ce}/vaults/{id}`}}},be={class:"kong-ui-entities-vaults-list"},he={class:"table-content-overflow-wrapper"},_e={class:"table-content-overflow-wrapper"},Ve={key:1},Ce=e.defineComponent({__name:"VaultList",props:{config:{type:Object,required:!0,validator:o=>!(!o||!["konnect","kongManager"].includes(o==null?void 0:o.app)||!o.createRoute||!o.getViewRoute||!o.getEditRoute||o.app==="kongManager"&&!o.isExactMatch&&!o.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(o,{emit:R}){var G;const f=R,c=o,{i18n:{t:u}}=ae.useI18n(),a=ie.useRouter(),{axiosInstance:w}=p.useAxios((G=c.config)==null?void 0:G.axiosRequestConfig),E=e.computed(()=>c.config.app!=="kongManager"||!!c.config.disableSorting),h={prefix:{label:u("vaults.list.table_headers.prefix"),searchable:!0,sortable:!0,hidable:!1},name:{label:u("vaults.list.table_headers.name"),searchable:!0,sortable:!0},description:{label:u("vaults.list.table_headers.description"),sortable:!1},tags:{label:u("vaults.list.table_headers.tags"),sortable:!1}},d=h,k=e.computed(()=>{var _,C;let g=`${c.config.apiBaseUrl}${Q.list[c.config.app].getAll}`;return c.config.app==="konnect"?g=g.replace(/{controlPlaneId}/gi,((_=c.config)==null?void 0:_.controlPlaneId)||""):c.config.app==="kongManager"&&(g=g.replace(/\/{workspace}/gi,(C=c.config)!=null&&C.workspace?`/${c.config.workspace}`:"")),g}),s=e.ref(""),U=e.computed(()=>{if(c.config.app==="konnect"||c.config.isExactMatch)return{isExactMatch:!0,placeholder:u("search.placeholder_for_vaults.konnect")};const{prefix:_,name:C}=h;return{isExactMatch:!1,fields:{name:C,prefix:_},schema:c.config.filterSchema}}),B=e.ref(1),{fetcher:J,fetcherState:W}=p.useFetcher(c.config,k.value),l=()=>{s.value=""},F=()=>{B.value++},j=e.ref(null),$=(g,_)=>{const C=g.id;if(!_(C)){f("copy:error",{entity:g,field:"id",message:u("errors.copy")});return}f("copy:success",{entity:g,field:"id",message:u("copy.success",{val:C})})},L=(g,_)=>{const C=JSON.stringify(g);if(!_(C)){f("copy:error",{entity:g,message:u("errors.copy")});return}f("copy:success",{entity:g,message:u("copy.success_brief")})},D=async g=>{var C;await((C=c.canRetrieve)==null?void 0:C.call(c,g))&&a.push(c.config.getViewRoute(g.id))},m=g=>({label:u("actions.view"),to:c.config.getViewRoute(g)}),T=g=>({label:u("actions.edit"),to:c.config.getEditRoute(g)}),I=e.ref(void 0),M=e.ref(!1),z=e.ref(!1),O=e.ref(""),Y=p.useDeleteUrlBuilder(c.config,k.value),X=g=>{I.value=g,M.value=!0},V=()=>{M.value=!1},P=async g=>{const{apiBaseUrl:_,app:C,controlPlaneId:K}=c.config,H=`${_}${Q.list[C].deleteConfigStore}`.replace(/{controlPlaneId}/gi,K||"").replace(/{id}/gi,g);try{await w.delete(H)}catch{}},q=async()=>{var g,_,C,K;if((g=I.value)!=null&&g.id){z.value=!0;try{await w.delete(Y(I.value.id)),c.config.app==="konnect"&&((_=I.value.config)!=null&&_.config_store_id)&&P(I.value.config.config_store_id),z.value=!1,M.value=!1,B.value++,f("delete:success",I.value)}catch(H){O.value=((K=(C=H.response)==null?void 0:C.data)==null?void 0:K.message)||H.message||u("errors.delete"),f("error",H)}finally{z.value=!1}}},v=e.ref(!1);e.watch(W,g=>{var _,C,K,H;if(Array.isArray((_=g==null?void 0:g.response)==null?void 0:_.data)&&(v.value=g.response.data.length>0),g.status===p.FetcherStatus.Error){j.value={title:u("errors.general")},(H=(K=(C=g.error)==null?void 0:C.response)==null?void 0:K.data)!=null&&H.message&&(j.value.message=g.error.response.data.message),f("error",g.error);return}j.value=null});const S=e.ref({ctaPath:c.config.createRoute,ctaText:void 0,message:`${u("vaults.list.empty_state.description")}${c.config.additionMessageForEmptyState?` ${c.config.additionMessageForEmptyState}`:""}`,title:u("vaults.title")});return e.onBeforeMount(async()=>{await c.canCreate()&&(S.value.title=u("vaults.list.empty_state.title"),S.value.ctaText=u("actions.create"))}),(g,_)=>{const C=e.resolveComponent("KButton"),K=e.resolveComponent("KBadge"),H=e.resolveComponent("KTruncate"),i=e.resolveComponent("KDropdownItem"),r=e.resolveComponent("KClipboardProvider");return e.openBlock(),e.createElementBlock("div",be,[e.createVNode(e.unref(p.EntityBaseTable),{"cache-identifier":o.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":E.value,"empty-state-options":S.value,"enable-entity-actions":"","error-message":j.value,fetcher:e.unref(J),"fetcher-cache-key":B.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-vaults-list",query:s.value,"table-headers":e.unref(d),onClearSearchInput:l,"onClick:row":_[2]||(_[2]=y=>D(y)),onSort:F},{"toolbar-filter":e.withCtx(()=>[e.createVNode(e.unref(p.EntityFilter),{modelValue:s.value,"onUpdate:modelValue":_[0]||(_[0]=y=>s.value=y),config:U.value},null,8,["modelValue","config"])]),"toolbar-button":e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!o.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[e.createVNode(e.unref(p.PermissionsWrapper),{"auth-function":()=>o.canCreate()},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(C,{appearance:"primary","data-testid":"toolbar-add-vault",size:o.useActionOutside?"medium":"large",to:o.config.createRoute},{default:e.withCtx(()=>[e.createVNode(e.unref(Z.AddIcon)),e.createTextVNode(" "+e.toDisplayString(e.unref(u)("vaults.list.toolbar_actions.new_vault")),1)]),_:1},8,["size","to"]),[[e.vShow,v.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),prefix:e.withCtx(({rowValue:y})=>[e.createElementVNode("div",he,[e.createElementVNode("b",null,e.toDisplayString(y??"-"),1)])]),name:e.withCtx(({rowValue:y})=>[e.createElementVNode("b",null,e.toDisplayString(y??"-"),1)]),description:e.withCtx(({rowValue:y})=>[e.createElementVNode("div",_e,e.toDisplayString(y??"-"),1)]),tags:e.withCtx(({rowValue:y})=>[(y==null?void 0:y.length)>0?(e.openBlock(),e.createBlock(H,{key:0},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y,x=>(e.openBlock(),e.createBlock(K,{key:x,onClick:_[1]||(_[1]=e.withModifiers(()=>{},["stop"]))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x),1)]),_:2},1024))),128))]),_:2},1024)):(e.openBlock(),e.createElementBlock("span",Ve,"-"))]),actions:e.withCtx(({row:y})=>[e.createVNode(r,null,{default:e.withCtx(({copyToClipboard:x})=>[e.createVNode(i,{"data-testid":"action-entity-copy-id",onClick:b=>$(y,x)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(r,null,{default:e.withCtx(({copyToClipboard:x})=>[e.createVNode(i,{"data-testid":"action-entity-copy-json",onClick:b=>L(y,x)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(e.unref(p.PermissionsWrapper),{"auth-function":()=>o.canRetrieve(y)},{default:e.withCtx(()=>[e.createVNode(i,{"data-testid":"action-entity-view","has-divider":"",item:m(y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(p.PermissionsWrapper),{"auth-function":()=>o.canEdit(y)},{default:e.withCtx(()=>[e.createVNode(i,{"data-testid":"action-entity-edit",item:T(y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(p.PermissionsWrapper),{"auth-function":()=>o.canDelete(y)},{default:e.withCtx(()=>[e.createVNode(i,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:x=>X(y)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers"]),e.createVNode(e.unref(p.EntityDeleteModal),{"action-pending":z.value,description:e.unref(u)("delete.description"),"entity-name":I.value&&(I.value.prefix||I.value.id),"entity-type":e.unref(p.EntityTypes).Vault,error:O.value,title:e.unref(u)("delete.title"),visible:M.value,onCancel:V,onProceed:q},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"])])}}}),oe=(o,R)=>{const f=o.__vccOpts||o;for(const[c,u]of R)f[c]=u;return f},ke=oe(Ce,[["__scopeId","data-v-fdf96cd9"]]);var t=(o=>(o.AWS="aws",o.GCP="gcp",o.HCV="hcv",o.ENV="env",o.AZURE="azure",o.KONNECT="konnect",o))(t||{}),N=(o=>(o.TOKEN="token",o.K8S="kubernetes",o.APP_ROLE="approle",o))(N||{});const we={class:"kong-ui-entities-vault-form"},Ee={class:"vault-form-provider-cards-container"},xe=["data-testid"],Ne={class:"provider-item-title-container"},Se={class:"provider-item-title"},Ae={class:"provider-item-description"},Ie={key:"kong-vault-config-fields",class:"vault-form-config-fields-container"},Te={key:0,class:"vault-form-config-auth-method-container"},Re={key:1,class:"vault-form-config-auth-method-container"},Ue={key:2,class:"vault-form-config-auth-method-container"},Be={key:5},$e={class:"wrapper"},ve={class:"item-50"},Me={class:"item-50"},Pe={class:"wrapper"},He={class:"item-100"},Ke=oe(e.defineComponent({__name:"VaultForm",props:{config:{type:Object,required:!0,validator:o=>!(!o||!["konnect","kongManager"].includes(o==null?void 0:o.app)||(o==null?void 0:o.app)==="konnect"&&!(o!=null&&o.controlPlaneId)||(o==null?void 0:o.app)==="kongManager"&&typeof(o==null?void 0:o.workspace)!="string"||!(o!=null&&o.cancelRoute))},vaultId:{type:String,required:!1,default:""},enableTerraform:{type:Boolean,default:!1}},emits:["update","error","loading"],setup(o,{emit:R}){var H;const f=o,c=R,{i18nT:u,i18n:{t:a}}=ae.useI18n(),w=ie.useRouter(),{axiosInstance:E}=p.useAxios((H=f.config)==null?void 0:H.axiosRequestConfig),{getMessageFromError:h}=p.useErrors(),d=e.reactive({fields:{prefix:"",description:"",tags:""},isReadonly:!1,errorMessage:""}),k=e.reactive({prefix:"",description:"",tags:""}),s=e.ref(f.config.konnectConfigStoreAvailable?t.KONNECT:t.ENV),U=e.ref(null),B=e.ref(),J=e.computed(()=>[t.AWS,t.GCP,t.HCV,t.AZURE].includes(s.value)),W=e.computed(()=>[...f.config.konnectConfigStoreAvailable?[{label:a("form.config.konnect.label"),value:t.KONNECT}]:[],{label:a("form.config.env.label"),value:t.ENV},{label:a("form.config.aws.label"),value:t.AWS,disabled:!M.value},{label:a("form.config.gcp.label"),value:t.GCP,disabled:!M.value},{label:a("form.config.hcv.label"),value:t.HCV,disabled:!M.value},...f.config.azureVaultProviderAvailable?[{label:a("form.config.azure.label"),value:t.AZURE,disabled:!M.value}]:[]]),l=e.reactive({[t.KONNECT]:{},[t.ENV]:{prefix:""},[t.AWS]:{region:"",endpoint_url:"",assume_role_arn:"",role_session_name:"KongVault"},[t.GCP]:{project_id:""},[t.HCV]:{protocol:"http",host:"127.0.0.1",port:8200,mount:"secret",kv:"v1",namespace:"",auth_method:N.TOKEN,token:"",kube_role:"",kube_auth_path:"",kube_api_token_file:"",approle_auth_path:"",approle_role_id:"",approle_secret_id:"",approle_secret_id_file:"",approle_response_wrapping:!1},[t.AZURE]:{location:"",vault_uri:"",type:"secrets",credentials_prefix:"AZURE",client_id:"",tenant_id:""}}),F=e.reactive({[t.KONNECT]:{},[t.ENV]:{prefix:""},[t.AWS]:{region:"",endpoint_url:"",assume_role_arn:"",role_session_name:"KongVault"},[t.GCP]:{project_id:""},[t.HCV]:{protocol:"http",host:"127.0.0.1",port:8200,mount:"secret",kv:"v1",namespace:"",auth_method:N.TOKEN,token:"",kube_role:"",kube_auth_path:"",kube_api_token_file:"",approle_auth_path:"",approle_role_id:"",approle_secret_id:"",approle_secret_id_file:"",approle_response_wrapping:!1},[t.AZURE]:{location:"",vault_uri:"",type:"secrets",credentials_prefix:"AZURE",client_id:"",tenant_id:""}}),j=[{label:`${a("form.config.aws.fields.region.locations.us-east-1.location")} (us-east-1)`,value:"us-east-1"},{label:`${a("form.config.aws.fields.region.locations.us-east-2.location")} (us-east-2)`,value:"us-east-2"},{label:`${a("form.config.aws.fields.region.locations.us-west-1.location")} (us-west-1)`,value:"us-west-1"},{label:`${a("form.config.aws.fields.region.locations.us-west-2.location")} (us-west-2)`,value:"us-west-2"},{label:`${a("form.config.aws.fields.region.locations.af-south-1.location")} (af-south-1)`,value:"af-south-1"},{label:`${a("form.config.aws.fields.region.locations.ap-east-1.location")} (ap-east-1)`,value:"ap-east-1"},{label:`${a("form.config.aws.fields.region.locations.ap-southeast-3.location")} (ap-southeast-3)`,value:"ap-southeast-3"},{label:`${a("form.config.aws.fields.region.locations.ap-south-1.location")} (ap-south-1)`,value:"ap-south-1"},{label:`${a("form.config.aws.fields.region.locations.ap-northeast-1.location")} (ap-northeast-1)`,value:"ap-northeast-1"},{label:`${a("form.config.aws.fields.region.locations.ap-northeast-2.location")} (ap-northeast-2)`,value:"ap-northeast-2"},{label:`${a("form.config.aws.fields.region.locations.ap-northeast-3.location")} (ap-northeast-3)`,value:"ap-northeast-3"},{label:`${a("form.config.aws.fields.region.locations.ap-southeast-1.location")} (ap-southeast-1)`,value:"ap-southeast-1"},{label:`${a("form.config.aws.fields.region.locations.ap-southeast-2.location")} (ap-southeast-2)`,value:"ap-southeast-2"},{label:`${a("form.config.aws.fields.region.locations.ca-central-1.location")} (ca-central-1)`,value:"ca-central-1"},{label:`${a("form.config.aws.fields.region.locations.eu-central-1.location")} (eu-central-1)`,value:"eu-central-1"},{label:`${a("form.config.aws.fields.region.locations.eu-west-1.location")} (eu-west-1)`,value:"eu-west-1"},{label:`${a("form.config.aws.fields.region.locations.eu-west-2.location")} (eu-west-2)`,value:"eu-west-2"},{label:`${a("form.config.aws.fields.region.locations.eu-west-3.location")} (eu-west-3)`,value:"eu-west-3"},{label:`${a("form.config.aws.fields.region.locations.eu-south-1.location")} (eu-south-1)`,value:"eu-south-1"},{label:`${a("form.config.aws.fields.region.locations.eu-north-1.location")} (eu-north-1)`,value:"eu-north-1"},{label:`${a("form.config.aws.fields.region.locations.me-south-1.location")} (me-south-1)`,value:"me-south-1"},{label:`${a("form.config.aws.fields.region.locations.sa-east-1.location")} (sa-east-1)`,value:"sa-east-1"},{label:`${a("form.config.aws.fields.region.locations.us-gov-east-1.location")} (us-gov-east-1)`,value:"us-gov-east-1"},{label:`${a("form.config.aws.fields.region.locations.us-gov-west-1.location")} (us-gov-west-1)`,value:"us-gov-west-1"}],$=[{label:"secrets",value:"secrets"}],L=[{label:"http",value:"http"},{label:"https",value:"https"}],D=[{label:"v1",value:"v1"},{label:"v2",value:"v2"}],m=e.computed(()=>f.vaultId?p.EntityBaseFormType.Edit:p.EntityBaseFormType.Create),T=e.computed(()=>{var i,r;return(r=Q.form[(i=f.config)==null?void 0:i.app])==null?void 0:r.edit}),I=e.computed(()=>m.value===p.EntityBaseFormType.Edit&&f.config.app==="kongManager"),M=e.computed(()=>f.config.app==="konnect"||p.useGatewayFeatureSupported({gatewayInfo:f.config.gatewayInfo,supportedRange:{enterprise:[]}})),z=()=>{var i;w.push(((i=f.config)==null?void 0:i.cancelRoute)||{name:"vault-list"})},O=i=>{c("loading",i)},Y=i=>{c("error",i)},X=i=>{switch(i){case t.KONNECT:return Z.KongIcon;case t.ENV:return Z.CodeIcon;case t.AWS:return Z.AwsIcon;case t.GCP:return Z.GoogleCloudIcon;case t.HCV:return Z.HashicorpIcon;case t.AZURE:return Z.AzureIcon}},V=i=>{switch(i){case t.KONNECT:return a("form.config.konnect.description");case t.ENV:return a("form.config.env.description");case t.AWS:return a("form.config.aws.description");case t.GCP:return a("form.config.gcp.description");case t.HCV:return a("form.config.hcv.description");case t.AZURE:return a("form.config.azure.description")}},P=i=>{var x,b,re,ee,te,n;d.fields.prefix=((x=i==null?void 0:i.item)==null?void 0:x.prefix)||(i==null?void 0:i.prefix)||"",d.fields.description=((b=i==null?void 0:i.item)==null?void 0:b.description)||(i==null?void 0:i.description)||"";const r=((re=i==null?void 0:i.item)==null?void 0:re.tags)||(i==null?void 0:i.tags)||[];d.fields.tags=(r==null?void 0:r.join(", "))||"",Object.assign(k,d.fields);const y=((ee=i==null?void 0:i.item)==null?void 0:ee.config)||(i==null?void 0:i.config)||null;y&&(Object.keys(y).length||(i==null?void 0:i.name)===t.KONNECT)?(s.value=((te=i==null?void 0:i.item)==null?void 0:te.name)||(i==null?void 0:i.name)||"",U.value=s.value,B.value=((n=i==null?void 0:i.config)==null?void 0:n.config_store_id)||void 0,Object.assign(l[s.value],y),Object.assign(F[s.value],y)):d.errorMessage="Error loading vault config"},q=e.computed(()=>s.value===t.HCV?!Object.keys(l[t.HCV]).filter(i=>["namespace","ttl","neg_ttl","resurrect_ttl","kube_auth_path","approle_auth_path","approle_secret_id","approle_secret_id_file"].includes(i)||l[t.HCV].auth_method!==N.K8S&&(i==="kube_role"||i==="kube_api_token_file")||l[t.HCV].auth_method!==N.TOKEN&&i==="token"||l[t.HCV].auth_method!==N.APP_ROLE&&(i==="approle_role_id"||i==="approle_response_wrapping")||l[t.HCV].auth_method===N.APP_ROLE&&i==="approle_response_wrapping"&&typeof l[s.value][i]=="boolean"?!1:!l[s.value][i]).length:s.value===t.AZURE?!Object.keys(l[t.AZURE]).filter(i=>["client_id","tenant_id","ttl","neg_ttl","resurrect_ttl"].includes(i)?!1:!l[s.value][i]).length:s.value===t.AWS?!Object.keys(l[t.AWS]).filter(i=>["endpoint_url","assume_role_arn","ttl","neg_ttl","resurrect_ttl","sts_endpoint_url"].includes(i)?!1:!l[s.value][i]).length:!Object.keys(l[s.value]).filter(i=>["ttl","neg_ttl","resurrect_ttl"].includes(i)?!1:!l[s.value][i]).length),v=e.computed(()=>!!d.fields.prefix&&q.value),S=e.computed(()=>JSON.stringify(d.fields)!==JSON.stringify(k)||s.value!==U.value||JSON.stringify(l[s.value])!==JSON.stringify(F[s.value])),G=e.computed(()=>{var r,y;let i=`${f.config.apiBaseUrl}${Q.form[f.config.app][m.value]}`;return f.config.app==="konnect"?i=i.replace(/{controlPlaneId}/gi,((r=f.config)==null?void 0:r.controlPlaneId)||""):f.config.app==="kongManager"&&(i=i.replace(/\/{workspace}/gi,(y=f.config)!=null&&y.workspace?`/${f.config.workspace}`:"")),i=i.replace(/{id}/gi,f.vaultId),i}),g=e.computed(()=>{var ee,te;const i={protocol:l[t.HCV].protocol,host:l[t.HCV].host,port:parseInt(l[t.HCV].port.toString()),mount:l[t.HCV].mount,kv:l[t.HCV].kv,namespace:l[t.HCV].namespace||null,auth_method:l[t.HCV].auth_method,...l[t.HCV].auth_method===N.TOKEN&&{token:l[t.HCV].token},...l[t.HCV].auth_method===N.K8S&&{kube_role:l[t.HCV].kube_role,kube_auth_path:l[t.HCV].kube_auth_path||void 0,kube_api_token_file:l[t.HCV].kube_api_token_file,token:null},...l[t.HCV].auth_method===N.APP_ROLE&&{approle_auth_path:l[t.HCV].approle_auth_path||void 0,approle_role_id:l[t.HCV].approle_role_id,approle_secret_id:l[t.HCV].approle_secret_id||void 0,approle_secret_id_file:l[t.HCV].approle_secret_id_file||void 0,approle_response_wrapping:l[t.HCV].approle_response_wrapping??!1}},r={...l[s.value],client_id:l[s.value].client_id||null,tenant_id:l[s.value].tenant_id||null},y={...l[s.value],endpoint_url:l[s.value].endpoint_url||null,assume_role_arn:l[s.value].assume_role_arn||null,...f.config.awsStsEndpointUrlAvailable?{sts_endpoint_url:l[s.value].sts_endpoint_url||null}:{}};let x=l[s.value];s.value===t.HCV?x=i:s.value===t.AZURE?x=r:s.value===t.AWS&&(x=y);let b={};if(![t.KONNECT,t.ENV].includes(s.value)){const n=l[s.value],ue=n.ttl,pe=n.neg_ttl,me=n.resurrect_ttl;b={ttl:ue?parseInt(ue.toString(),10):null,neg_ttl:pe?parseInt(pe.toString(),10):null,resurrect_ttl:me?parseInt(me.toString(),10):null}}return{prefix:d.fields.prefix,description:d.fields.description||null,tags:(te=(ee=d.fields.tags.split(","))==null?void 0:ee.map(n=>String(n||"").trim()))==null?void 0:te.filter(n=>n!==""),name:s.value,config:{...x,...b}}}),_=e.computed(()=>({...g.value,config:{...g.value.config,config_store_id:B.value}})),C=async()=>{var i;try{d.isReadonly=!0;const r=`${f.config.apiBaseUrl}${Q.form.konnect.createConfigStore}`.replace(/{controlPlaneId}/gi,((i=f.config)==null?void 0:i.controlPlaneId)||""),y=await E.post(r);return y==null?void 0:y.data.id}catch(r){d.errorMessage=h(r),c("error",r)}finally{d.isReadonly=!1}},K=async()=>{var i;try{d.isReadonly=!0;let r;m.value==="create"?s.value===t.KONNECT?(B.value=await C(),r=await E.post(G.value,_.value)):r=await E.post(G.value,g.value):m.value==="edit"&&(s.value===t.KONNECT&&!B.value?(B.value=await C(),r=await E.put(G.value,_.value)):r=((i=f.config)==null?void 0:i.app)==="konnect"?await E.put(G.value,_.value):await E.patch(G.value,g.value)),P(r==null?void 0:r.data),c("update",r==null?void 0:r.data)}catch(r){d.errorMessage=h(r),c("error",r)}finally{d.isReadonly=!1}};return(i,r)=>{const y=e.resolveComponent("KTooltip"),x=e.resolveComponent("KSelect"),b=e.resolveComponent("KInput"),re=e.resolveComponent("KCheckbox"),ee=e.resolveComponent("KCollapse"),te=e.resolveComponent("KTextArea");return e.openBlock(),e.createElementBlock("div",we,[e.createVNode(e.unref(p.EntityBaseForm),{"can-submit":v.value&&S.value,config:o.config,"edit-id":o.vaultId,"enable-terraform":o.enableTerraform,"entity-type":e.unref(p.SupportedEntityType).Vault,"error-message":d.errorMessage,"fetch-url":T.value,"form-fields":g.value,"is-readonly":d.isReadonly,onCancel:z,"onFetch:error":Y,"onFetch:success":P,onLoading:O,onSubmit:K},{default:e.withCtx(()=>[e.createVNode(e.unref(p.EntityFormSection),{description:e.unref(a)("form.sections.config.description"),title:e.unref(a)("form.sections.config.title")},{default:e.withCtx(()=>[e.createElementVNode("div",Ee,[e.createVNode(x,{modelValue:s.value,"onUpdate:modelValue":r[0]||(r[0]=n=>s.value=n),"data-testid":"provider-select",disabled:I.value,"dropdown-max-height":"500",items:W.value},{"selected-item-template":e.withCtx(({item:n})=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(X(n.value)))),e.createTextVNode(" "+e.toDisplayString(n==null?void 0:n.label),1)]),"item-template":e.withCtx(({item:n})=>[e.createVNode(y,{placement:"top",text:n.disabled?e.unref(a)("form.unavailable"):""},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"provider-item","data-testid":`vault-form-provider-${n.value}`},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(X(n.value)))),e.createElementVNode("div",Ne,[e.createElementVNode("span",Se,e.toDisplayString(n==null?void 0:n.label),1),e.createElementVNode("span",Ae,e.toDisplayString(V(n.value)),1)])],8,xe)]),_:2},1032,["text"])]),_:1},8,["modelValue","disabled","items"])]),e.createVNode(e.TransitionGroup,{name:"appear"},{default:e.withCtx(()=>[s.value===e.unref(t).ENV?(e.openBlock(),e.createElementBlock("div",Ie,[e.createVNode(b,{modelValue:l[e.unref(t).ENV].prefix,"onUpdate:modelValue":r[1]||(r[1]=n=>l[e.unref(t).ENV].prefix=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-kong-prefix","is-readonly":d.isReadonly,label:e.unref(a)("form.config.env.fields.prefix.label"),"label-attributes":{info:e.unref(a)("form.config.env.fields.prefix.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(a)("form.config.env.fields.prefix.placeholder"),required:"",type:"text"},null,8,["modelValue","is-readonly","label","label-attributes","placeholder"])])):e.createCommentVNode("",!0),s.value===e.unref(t).AWS?(e.openBlock(),e.createElementBlock("div",{key:`${e.unref(t).AWS}-vault-config-fields`,class:"vault-form-config-fields-container"},[e.createVNode(x,{modelValue:l[e.unref(t).AWS].region,"onUpdate:modelValue":r[2]||(r[2]=n=>l[e.unref(t).AWS].region=n),"data-testid":"vault-form-config-aws-region",items:j,label:e.unref(a)("form.config.aws.fields.region.label"),"label-attributes":{info:e.unref(a)("form.config.aws.fields.region.tooltip")},placeholder:e.unref(a)("form.config.aws.fields.region.placeholder"),readonly:d.isReadonly,required:"",width:"100%"},null,8,["modelValue","label","label-attributes","placeholder","readonly"]),e.createVNode(b,{modelValue:l[e.unref(t).AWS].endpoint_url,"onUpdate:modelValue":r[3]||(r[3]=n=>l[e.unref(t).AWS].endpoint_url=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-aws-endpoint_url","is-readonly":d.isReadonly,label:e.unref(a)("form.config.aws.fields.endpoint_url.label"),"label-attributes":{info:e.unref(a)("form.config.aws.fields.endpoint_url.tooltip"),tooltipAttributes:{maxWidth:"400"}},type:"text"},null,8,["modelValue","is-readonly","label","label-attributes"]),e.createVNode(b,{modelValue:l[e.unref(t).AWS].assume_role_arn,"onUpdate:modelValue":r[4]||(r[4]=n=>l[e.unref(t).AWS].assume_role_arn=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-aws-assume_role_arn","is-readonly":d.isReadonly,label:e.unref(a)("form.config.aws.fields.assume_role_arn.label"),"label-attributes":{info:e.unref(a)("form.config.aws.fields.assume_role_arn.tooltip"),tooltipAttributes:{maxWidth:"400"}},type:"text"},null,8,["modelValue","is-readonly","label","label-attributes"]),e.createVNode(b,{modelValue:l[e.unref(t).AWS].role_session_name,"onUpdate:modelValue":r[5]||(r[5]=n=>l[e.unref(t).AWS].role_session_name=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-aws-role_session_name","is-readonly":d.isReadonly,label:e.unref(a)("form.config.aws.fields.role_session_name.label"),"label-attributes":{info:e.unref(a)("form.config.aws.fields.role_session_name.tooltip"),tooltipAttributes:{maxWidth:"400"}},required:"",type:"text"},null,8,["modelValue","is-readonly","label","label-attributes"]),o.config.awsStsEndpointUrlAvailable?(e.openBlock(),e.createBlock(b,{key:0,modelValue:l[e.unref(t).AWS].sts_endpoint_url,"onUpdate:modelValue":r[6]||(r[6]=n=>l[e.unref(t).AWS].sts_endpoint_url=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-aws-sts_endpoint_url","is-readonly":d.isReadonly,label:e.unref(a)("form.config.aws.fields.sts_endpoint_url.label"),"label-attributes":{info:e.unref(a)("form.config.aws.fields.sts_endpoint_url.tooltip"),tooltipAttributes:{maxWidth:"400"}},type:"text"},null,8,["modelValue","is-readonly","label","label-attributes"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),s.value===e.unref(t).GCP?(e.openBlock(),e.createElementBlock("div",{key:`${e.unref(t).GCP}-vault-config-fields`,class:"vault-form-config-fields-container"},[e.createVNode(b,{modelValue:l[e.unref(t).GCP].project_id,"onUpdate:modelValue":r[7]||(r[7]=n=>l[e.unref(t).GCP].project_id=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-gcp-project-id","is-readonly":d.isReadonly,label:e.unref(a)("form.config.gcp.fields.project_id.label"),placeholder:e.unref(a)("form.config.gcp.fields.project_id.placeholder"),required:"",type:"text"},{"label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(u),{keypath:"form.config.gcp.fields.project_id.tooltip.text",scope:"global"},{"italic-text":e.withCtx(()=>[e.createElementVNode("em",null,e.toDisplayString(e.unref(a)("form.config.gcp.fields.project_id.tooltip.italicText")),1)]),_:1})]),_:1},8,["modelValue","is-readonly","label","placeholder"])])):e.createCommentVNode("",!0),s.value===e.unref(t).HCV?(e.openBlock(),e.createElementBlock("div",{key:`${e.unref(t).HCV}-vault-config-fields`,class:"vault-form-config-fields-container"},[e.createVNode(x,{modelValue:l[e.unref(t).HCV].protocol,"onUpdate:modelValue":r[8]||(r[8]=n=>l[e.unref(t).HCV].protocol=n),"data-testid":"vault-form-config-hcv-protocol",items:L,label:e.unref(a)("form.config.hcv.fields.protocol.label"),readonly:d.isReadonly,required:"",width:"100%"},null,8,["modelValue","label","readonly"]),e.createVNode(b,{modelValue:l[e.unref(t).HCV].host,"onUpdate:modelValue":r[9]||(r[9]=n=>l[e.unref(t).HCV].host=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-hcv-host","is-readonly":d.isReadonly,label:e.unref(a)("form.config.hcv.fields.host.label"),required:"",type:"text"},null,8,["modelValue","is-readonly","label"]),e.createVNode(b,{modelValue:l[e.unref(t).HCV].port,"onUpdate:modelValue":r[10]||(r[10]=n=>l[e.unref(t).HCV].port=n),autocomplete:"off","data-testid":"vault-form-config-hcv-port","is-readonly":d.isReadonly,label:e.unref(a)("form.config.hcv.fields.port.label"),min:"0",required:"",type:"number"},null,8,["modelValue","is-readonly","label"]),e.createVNode(b,{modelValue:l[e.unref(t).HCV].mount,"onUpdate:modelValue":r[11]||(r[11]=n=>l[e.unref(t).HCV].mount=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-hcv-mount","is-readonly":d.isReadonly,label:e.unref(a)("form.config.hcv.fields.mount.label"),required:"",type:"text"},null,8,["modelValue","is-readonly","label"]),e.createVNode(x,{modelValue:l[e.unref(t).HCV].kv,"onUpdate:modelValue":r[12]||(r[12]=n=>l[e.unref(t).HCV].kv=n),"data-testid":"vault-form-config-hcv-kv",items:D,label:e.unref(a)("form.config.hcv.fields.kv.label"),readonly:d.isReadonly,required:"",width:"100%"},null,8,["modelValue","label","readonly"]),e.createVNode(b,{modelValue:l[e.unref(t).HCV].namespace,"onUpdate:modelValue":r[13]||(r[13]=n=>l[e.unref(t).HCV].namespace=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-hcv-namespace","is-readonly":d.isReadonly,label:e.unref(a)("form.config.hcv.fields.namespace.label"),type:"text"},null,8,["modelValue","is-readonly","label"]),e.createVNode(x,{modelValue:l[e.unref(t).HCV].auth_method,"onUpdate:modelValue":r[14]||(r[14]=n=>l[e.unref(t).HCV].auth_method=n),"data-testid":"vault-form-config-hcv-auth_method",items:[{label:e.unref(N).TOKEN,value:e.unref(N).TOKEN},{label:e.unref(N).K8S,value:e.unref(N).K8S},...o.config.hcvAppRoleMethodAvailable?[{label:e.unref(N).APP_ROLE,value:e.unref(N).APP_ROLE}]:[]],label:e.unref(a)("form.config.hcv.fields.auth_method.label"),readonly:d.isReadonly,required:"",width:"100%"},null,8,["modelValue","items","label","readonly"]),l[e.unref(t).HCV].auth_method===e.unref(N).TOKEN?(e.openBlock(),e.createElementBlock("div",Te,[e.createVNode(b,{modelValue:l[e.unref(t).HCV].token,"onUpdate:modelValue":r[15]||(r[15]=n=>l[e.unref(t).HCV].token=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-hcv-token","is-readonly":d.isReadonly,label:e.unref(a)("form.config.hcv.fields.token.label"),required:"",type:"text"},null,8,["modelValue","is-readonly","label"])])):l[e.unref(t).HCV].auth_method===e.unref(N).K8S?(e.openBlock(),e.createElementBlock("div",Re,[e.createVNode(b,{modelValue:l[e.unref(t).HCV].kube_role,"onUpdate:modelValue":r[16]||(r[16]=n=>l[e.unref(t).HCV].kube_role=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-hcv-kube_role","is-readonly":d.isReadonly,label:e.unref(a)("form.config.hcv.fields.kube_role.label"),required:"",type:"text"},null,8,["modelValue","is-readonly","label"]),e.createVNode(b,{modelValue:l[e.unref(t).HCV].kube_auth_path,"onUpdate:modelValue":r[17]||(r[17]=n=>l[e.unref(t).HCV].kube_auth_path=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-hcv-kube_auth_path","is-readonly":d.isReadonly,label:e.unref(a)("form.config.hcv.fields.kube_auth_path.label"),type:"text"},null,8,["modelValue","is-readonly","label"]),e.createVNode(b,{modelValue:l[e.unref(t).HCV].kube_api_token_file,"onUpdate:modelValue":r[18]||(r[18]=n=>l[e.unref(t).HCV].kube_api_token_file=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-hcv-kube_api_token_file","is-readonly":d.isReadonly,label:e.unref(a)("form.config.hcv.fields.kube_api_token_file.label"),required:"",type:"text"},null,8,["modelValue","is-readonly","label"])])):l[e.unref(t).HCV].auth_method===e.unref(N).APP_ROLE?(e.openBlock(),e.createElementBlock("div",Ue,[e.createVNode(b,{modelValue:l[e.unref(t).HCV].approle_auth_path,"onUpdate:modelValue":r[19]||(r[19]=n=>l[e.unref(t).HCV].approle_auth_path=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-hcv-approle_auth_path","is-readonly":d.isReadonly,label:e.unref(a)("form.config.hcv.fields.approle_auth_path.label"),type:"text"},null,8,["modelValue","is-readonly","label"]),e.createVNode(b,{modelValue:l[e.unref(t).HCV].approle_role_id,"onUpdate:modelValue":r[20]||(r[20]=n=>l[e.unref(t).HCV].approle_role_id=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-hcv-approle_role_id","is-readonly":d.isReadonly,label:e.unref(a)("form.config.hcv.fields.approle_role_id.label"),required:"",type:"text"},null,8,["modelValue","is-readonly","label"]),e.createVNode(b,{modelValue:l[e.unref(t).HCV].approle_secret_id,"onUpdate:modelValue":r[21]||(r[21]=n=>l[e.unref(t).HCV].approle_secret_id=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-hcv-approle_secret_id","is-readonly":d.isReadonly,label:e.unref(a)("form.config.hcv.fields.approle_secret_id.label"),type:"text"},null,8,["modelValue","is-readonly","label"]),e.createVNode(b,{modelValue:l[e.unref(t).HCV].approle_secret_id_file,"onUpdate:modelValue":r[22]||(r[22]=n=>l[e.unref(t).HCV].approle_secret_id_file=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-hcv-approle_secret_id_file","is-readonly":d.isReadonly,label:e.unref(a)("form.config.hcv.fields.approle_secret_id_file.label"),type:"text"},null,8,["modelValue","is-readonly","label"]),e.createVNode(re,{modelValue:l[e.unref(t).HCV].approle_response_wrapping,"onUpdate:modelValue":r[23]||(r[23]=n=>l[e.unref(t).HCV].approle_response_wrapping=n),"data-testid":"vault-form-config-hcv-approle_response_wrapping",label:e.unref(a)("form.config.hcv.fields.approle_response_wrapping.label")},null,8,["modelValue","label"])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),s.value===e.unref(t).AZURE?(e.openBlock(),e.createElementBlock("div",{key:`${e.unref(t).HCV}-vault-config-fields`,class:"vault-form-config-fields-container"},[e.createVNode(b,{modelValue:l[e.unref(t).AZURE].location,"onUpdate:modelValue":r[24]||(r[24]=n=>l[e.unref(t).AZURE].location=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-azure-location","is-readonly":d.isReadonly,label:e.unref(a)("form.config.azure.fields.location.label"),required:"",type:"text"},null,8,["modelValue","is-readonly","label"]),e.createVNode(b,{modelValue:l[e.unref(t).AZURE].vault_uri,"onUpdate:modelValue":r[25]||(r[25]=n=>l[e.unref(t).AZURE].vault_uri=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-azure-uri","is-readonly":d.isReadonly,label:e.unref(a)("form.config.azure.fields.vault_uri.label"),required:"",type:"text"},null,8,["modelValue","is-readonly","label"]),e.createVNode(b,{modelValue:l[e.unref(t).AZURE].credentials_prefix,"onUpdate:modelValue":r[26]||(r[26]=n=>l[e.unref(t).AZURE].credentials_prefix=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-azure-prefix","is-readonly":d.isReadonly,label:e.unref(a)("form.config.azure.fields.credential_prefix.label"),required:"",type:"text"},null,8,["modelValue","is-readonly","label"]),e.createVNode(x,{modelValue:l[e.unref(t).AZURE].type,"onUpdate:modelValue":r[27]||(r[27]=n=>l[e.unref(t).AZURE].type=n),"data-testid":"vault-form-config-azure-type",items:$,label:e.unref(a)("form.config.azure.fields.type.label"),placeholder:e.unref(a)("form.config.azure.fields.type.placeholder"),readonly:d.isReadonly,required:"",width:"100%"},null,8,["modelValue","label","placeholder","readonly"]),e.createVNode(b,{modelValue:l[e.unref(t).AZURE].client_id,"onUpdate:modelValue":r[28]||(r[28]=n=>l[e.unref(t).AZURE].client_id=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-azure-client-id","is-readonly":d.isReadonly,label:e.unref(a)("form.config.azure.fields.client_id.label"),type:"text"},null,8,["modelValue","is-readonly","label"]),e.createVNode(b,{modelValue:l[e.unref(t).AZURE].tenant_id,"onUpdate:modelValue":r[29]||(r[29]=n=>l[e.unref(t).AZURE].tenant_id=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-azure-tenant-id","is-readonly":d.isReadonly,label:e.unref(a)("form.config.azure.fields.tenant_id.label"),type:"text"},null,8,["modelValue","is-readonly","label"])])):e.createCommentVNode("",!0),o.config.ttl?(e.openBlock(),e.createElementBlock("div",Be,[J.value?(e.openBlock(),e.createBlock(ee,{key:0,class:"advanced-fields-collapse","data-testid":"advanced-fields-collapse","trigger-alignment":"leading","trigger-label":e.unref(a)("form.config.advancedFields.title")},{default:e.withCtx(()=>[e.createElementVNode("div",$e,[e.createElementVNode("div",ve,[e.createVNode(b,{modelValue:l[s.value].ttl,"onUpdate:modelValue":r[30]||(r[30]=n=>l[s.value].ttl=n),"data-testid":"vault-ttl-input",label:e.unref(a)("form.config.advancedFields.ttl"),"label-attributes":{info:e.unref(a)("form.config.advancedFields.ttlTooltip"),tooltipAttributes:{maxWidth:"400"}},type:"number"},null,8,["modelValue","label","label-attributes"])]),e.createElementVNode("div",Me,[e.createVNode(b,{modelValue:l[s.value].neg_ttl,"onUpdate:modelValue":r[31]||(r[31]=n=>l[s.value].neg_ttl=n),"data-testid":"vault-neg-ttl-input",label:e.unref(a)("form.config.advancedFields.negTtl"),"label-attributes":{info:e.unref(a)("form.config.advancedFields.negTtlTooltip"),tooltipAttributes:{maxWidth:"400"}},type:"number"},null,8,["modelValue","label","label-attributes"])])]),e.createElementVNode("div",Pe,[e.createElementVNode("div",He,[e.createVNode(b,{modelValue:l[s.value].resurrect_ttl,"onUpdate:modelValue":r[32]||(r[32]=n=>l[s.value].resurrect_ttl=n),"data-testid":"vault-resurrect-ttl-input",label:e.unref(a)("form.config.advancedFields.resurrectTtl"),"label-attributes":{info:e.unref(a)("form.config.advancedFields.resurrectTtlTooltip"),tooltipAttributes:{maxWidth:"400"}},type:"number"},null,8,["modelValue","label","label-attributes"])])])]),_:1},8,["trigger-label"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["description","title"]),e.createVNode(e.unref(p.EntityFormSection),{description:e.unref(a)("form.sections.general.description"),title:e.unref(a)("form.sections.general.title")},{default:e.withCtx(()=>[e.createVNode(b,{modelValue:d.fields.prefix,"onUpdate:modelValue":r[33]||(r[33]=n=>d.fields.prefix=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-prefix",help:e.unref(a)("form.fields.prefix.help"),"is-readonly":d.isReadonly,label:e.unref(a)("form.fields.prefix.label"),"label-attributes":{info:e.unref(a)("form.fields.prefix.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(a)("form.fields.prefix.placeholder"),required:"",type:"text"},null,8,["modelValue","help","is-readonly","label","label-attributes","placeholder"]),e.createVNode(te,{modelValue:d.fields.description,"onUpdate:modelValue":r[34]||(r[34]=n=>d.fields.description=n),modelModifiers:{trim:!0},"character-limit":1e3,class:"vault-form-textarea","data-testid":"vault-form-description",label:e.unref(a)("form.fields.description.label"),placeholder:e.unref(a)("form.fields.description.placeholder"),readonly:d.isReadonly},null,8,["modelValue","label","placeholder","readonly"]),e.createVNode(b,{modelValue:d.fields.tags,"onUpdate:modelValue":r[35]||(r[35]=n=>d.fields.tags=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-tags",help:e.unref(a)("form.fields.tags.help"),"is-readonly":d.isReadonly,label:e.unref(a)("form.fields.tags.label"),placeholder:e.unref(a)("form.fields.tags.placeholder"),type:"text"},null,8,["modelValue","help","is-readonly","label","placeholder"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","enable-terraform","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-f9f68024"]]),Fe={class:"kong-ui-vault-entity-config-card"},De=e.defineComponent({__name:"VaultConfigCard",props:{config:{type:Object,required:!0,validator:o=>!(!o||!["konnect","kongManager"].includes(o==null?void 0:o.app)||o.app==="konnect"&&!o.controlPlaneId||o.app==="kongManager"&&typeof o.workspace!="string"||!o.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1},enableTerraform:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(o){const R=o,f=e.computed(()=>{var a,w;return(w=Q.form[(a=R.config)==null?void 0:a.app])==null?void 0:w.edit}),{i18n:{t:c}}=ae.useI18n(),u=e.ref({id:{},name:{label:c("labels.vault_type")},updated_at:{},created_at:{},prefix:{order:5,section:p.ConfigurationSchemaSection.Basic},description:{order:6,section:p.ConfigurationSchemaSection.Basic},tags:{order:7},config:{order:8,type:p.ConfigurationSchemaType.Json}});return(a,w)=>(e.openBlock(),e.createElementBlock("div",Fe,[e.createVNode(e.unref(p.EntityBaseConfigCard),{config:o.config,"config-card-doc":o.configCardDoc,"config-schema":u.value,"enable-terraform":o.enableTerraform,"entity-type":e.unref(p.SupportedEntityType).Vault,"fetch-url":f.value,"hide-title":o.hideTitle,"onFetch:error":w[0]||(w[0]=E=>a.$emit("fetch:error",E)),"onFetch:success":w[1]||(w[1]=E=>a.$emit("fetch:success",E)),onLoading:w[2]||(w[2]=E=>a.$emit("loading",E))},null,8,["config","config-card-doc","config-schema","enable-terraform","entity-type","fetch-url","hide-title"])]))}}),ne="/v2/control-planes/{controlPlaneId}",le={getVault:{konnect:`${ne}/core-entities/vaults/{id}`},list:{konnect:`${ne}/config-stores/{id}/secrets`},form:{konnect:{create:`${ne}/config-stores/{id}/secrets`,edit:`${ne}/config-stores/{id}/secrets/{secretId}`}}},Oe={class:"table-content-overflow-wrapper"},qe=oe(e.defineComponent({inheritAttrs:!1,__name:"SecretListInner",props:{config:{type:Object,required:!0,validator:o=>!(!o||(o==null?void 0:o.app)!=="konnect"||!o.createRoute||!o.getEditRoute)},configStoreId:{type:String,required:!0},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0}},emits:["error","delete:success"],setup(o,{emit:R}){var X;const f=R,c=o,{i18n:{t:u,formatUnixTimeStamp:a}}=ae.useI18n(),{axiosInstance:w}=p.useAxios((X=c.config)==null?void 0:X.axiosRequestConfig),h={key:{label:u("secrets.list.table_headers.key"),sortable:!1,hidable:!1},updated_at:{label:u("secrets.list.table_headers.updated_at"),sortable:!1}},d=V=>({"data-testid":V.key}),k=e.computed(()=>{var V;return`${c.config.apiBaseUrl}${le.list[c.config.app]}`.replace(/{controlPlaneId}/gi,((V=c.config)==null?void 0:V.controlPlaneId)||"").replace(/{id}/gi,c.configStoreId||"")}),s=e.ref(""),U={isExactMatch:!0,placeholder:u("search.placeholder_for_secrets.konnect")},B=e.ref(1),{fetcher:J,fetcherState:W}=p.useFetcher(c.config,k.value),l=()=>{s.value=""},F=e.ref(null),j=V=>({label:u("actions.edit"),to:c.config.getEditRoute(V)}),$=e.ref(void 0),L=e.ref(!1),D=e.ref(!1),m=e.ref(""),T=p.useDeleteUrlBuilder(c.config,k.value),I=V=>{$.value=V,L.value=!0},M=()=>{L.value=!1},z=async()=>{var V,P,q;if((V=$.value)!=null&&V.key){D.value=!0;try{await w.delete(T($.value.key)),D.value=!1,L.value=!1,B.value++,f("delete:success",$.value)}catch(v){m.value=((q=(P=v.response)==null?void 0:P.data)==null?void 0:q.message)||v.message||u("errors.delete"),f("error",v)}finally{D.value=!1}}},O=e.ref(!1);e.watch(W,V=>{var P,q,v,S;if(Array.isArray((P=V==null?void 0:V.response)==null?void 0:P.data)&&(O.value=V.response.data.length>0),V.status===p.FetcherStatus.Error){F.value={title:u("errors.general")},(S=(v=(q=V.error)==null?void 0:q.response)==null?void 0:v.data)!=null&&S.message&&(F.value.message=V.error.response.data.message),f("error",V.error);return}F.value=null});const Y=e.ref({ctaPath:c.config.createRoute,ctaText:void 0,message:`${u("secrets.list.empty_state.description")}${c.config.additionMessageForEmptyState?` ${c.config.additionMessageForEmptyState}`:""}`,title:u("secrets.title")});return e.onBeforeMount(async()=>{await c.canCreate()&&(Y.value.title=u("secrets.list.empty_state.title"),Y.value.ctaText=u("secrets.list.toolbar_actions.new_secret"))}),(V,P)=>{const q=e.resolveComponent("KButton"),v=e.resolveComponent("KDropdownItem");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(p.EntityBaseTable),{"cache-identifier":o.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":"","empty-state-options":Y.value,"enable-entity-actions":"","error-message":F.value,fetcher:e.unref(J),"fetcher-cache-key":B.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-secrets-list",query:s.value,"row-attributes":d,"table-headers":e.unref(h),onClearSearchInput:l},{"toolbar-filter":e.withCtx(()=>[e.createVNode(e.unref(p.EntityFilter),{modelValue:s.value,"onUpdate:modelValue":P[0]||(P[0]=S=>s.value=S),config:U},null,8,["modelValue"])]),"toolbar-button":e.withCtx(()=>[e.createVNode(e.unref(p.PermissionsWrapper),{"auth-function":()=>o.canCreate()},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(q,{appearance:"primary","data-testid":"toolbar-add-secret",size:"large",to:o.config.createRoute},{default:e.withCtx(()=>[e.createVNode(e.unref(Z.AddIcon)),e.createTextVNode(" "+e.toDisplayString(e.unref(u)("secrets.list.toolbar_actions.new_secret")),1)]),_:1},8,["to"]),[[e.vShow,O.value]])]),_:1},8,["auth-function"])]),key:e.withCtx(({rowValue:S})=>[e.createElementVNode("div",Oe,[e.createElementVNode("b",null,e.toDisplayString(S??"-"),1)])]),updated_at:e.withCtx(({rowValue:S})=>[e.createElementVNode("span",null,e.toDisplayString(S?e.unref(a)(new Date(S).getTime()/1e3):"-"),1)]),actions:e.withCtx(({row:S})=>[e.createVNode(e.unref(p.PermissionsWrapper),{"auth-function":()=>o.canEdit(S)},{default:e.withCtx(()=>[e.createVNode(v,{"data-testid":"action-entity-edit",item:j(S.key)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(p.PermissionsWrapper),{"auth-function":()=>o.canDelete(S)},{default:e.withCtx(()=>[e.createVNode(v,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:G=>I(S)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers"]),e.createVNode(e.unref(p.EntityDeleteModal),{"action-pending":D.value,description:e.unref(u)("delete.description"),"entity-name":$.value&&$.value.key,"entity-type":e.unref(p.EntityTypes).Secret,error:m.value,title:e.unref(u)("delete.title_for_secret"),visible:L.value,onCancel:M,onProceed:z},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"])],64)}}}),[["__scopeId","data-v-c5d1b687"]]),We={class:"kong-ui-entities-secrets-list"},je=oe(e.defineComponent({__name:"SecretList",props:{config:{type:Object,required:!0,validator:o=>!(!o||(o==null?void 0:o.app)!=="konnect"||!o.createRoute||!o.getEditRoute)},vaultId:{type:String,required:!0},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0}},emits:["error","delete:success"],setup(o,{emit:R}){var d;const f=R,c=o,u=k=>{f("error",k)},a=k=>{f("delete:success",k)},{axiosInstance:w}=p.useAxios((d=c.config)==null?void 0:d.axiosRequestConfig),E=e.ref(""),h=e.computed(()=>{var k;return`${c.config.apiBaseUrl}${le.getVault[c.config.app]}`.replace(/{controlPlaneId}/gi,((k=c.config)==null?void 0:k.controlPlaneId)||"").replace(/{id}/gi,c.vaultId)});return e.onBeforeMount(async()=>{var k;try{const{data:s}=await w.get(h.value);E.value=(k=s==null?void 0:s.config)==null?void 0:k.config_store_id}catch(s){f("error",s)}}),(k,s)=>(e.openBlock(),e.createElementBlock("div",We,[E.value?(e.openBlock(),e.createBlock(qe,e.mergeProps({key:0},c,{"config-store-id":E.value,"onDelete:success":a,onError:u}),null,16,["config-store-id"])):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-0f9047e6"]]),Le=oe(e.defineComponent({inheritAttrs:!1,__name:"SecretFormInner",props:{config:{type:Object,required:!0,validator:o=>!(!o||o.app!=="konnect"||!o.controlPlaneId||!o.cancelRoute)},configStoreId:{type:String,required:!0},secretId:{type:String,required:!1,default:""},enableTerraform:{type:Boolean,default:!1}},emits:["update","error","loading"],setup(o,{emit:R}){var D;const f=o,c=R,{i18n:{t:u}}=ae.useI18n(),a=ie.useRouter(),{axiosInstance:w}=p.useAxios((D=f.config)==null?void 0:D.axiosRequestConfig),{getMessageFromError:E}=p.useErrors(),h=e.reactive({fields:{key:"",value:""},readonly:!1,errorMessage:""}),d=e.reactive({key:"",value:""}),k=e.computed(()=>{var m,T;return(T=le.form[(m=f.config)==null?void 0:m.app])==null?void 0:T.edit.replace(/{id}/gi,f.configStoreId).replace(/{secretId}/gi,f.secretId)}),s=()=>{var m;a.push(((m=f.config)==null?void 0:m.cancelRoute)||{name:"secret-list"})},U=m=>{c("loading",m)},B=m=>{c("error",m)},J=m=>{var T,I;h.fields.key=((T=m==null?void 0:m.item)==null?void 0:T.key)||(m==null?void 0:m.key)||"",h.fields.value=((I=m==null?void 0:m.item)==null?void 0:I.value)||(m==null?void 0:m.value)||"",Object.assign(d,h.fields)},W=e.computed(()=>f.secretId?p.EntityBaseFormType.Edit:p.EntityBaseFormType.Create),l=e.computed(()=>{var m;return`${f.config.apiBaseUrl}${le.form[f.config.app][W.value]}`.replace(/{controlPlaneId}/gi,((m=f.config)==null?void 0:m.controlPlaneId)||"").replace(/{id}/gi,f.configStoreId).replace(/{secretId}/gi,f.secretId)}),F=e.computed(()=>!!h.fields.key&&!!h.fields.value),j=e.computed(()=>JSON.stringify(h.fields)!==JSON.stringify(d)),$=e.computed(()=>({key:h.fields.key,value:h.fields.value})),L=async()=>{try{h.readonly=!0;let m;W.value==="create"?m=await w.post(l.value,$.value):W.value==="edit"&&(m=await w.put(l.value,$.value)),J(m==null?void 0:m.data),c("update",m==null?void 0:m.data)}catch(m){h.errorMessage=E(m),c("error",m)}finally{h.readonly=!1}};return(m,T)=>{const I=e.resolveComponent("KInput"),M=e.resolveComponent("KTextArea"),z=e.resolveComponent("KAlert");return e.openBlock(),e.createBlock(e.unref(p.EntityBaseForm),{"can-submit":F.value&&j.value,config:o.config,"edit-id":o.secretId,"enable-terraform":o.enableTerraform,"entity-type":e.unref(p.SupportedEntityType).Other,"error-message":h.errorMessage,"fetch-url":k.value,"form-fields":$.value,"is-readonly":h.readonly,onCancel:s,"onFetch:error":B,"onFetch:success":J,onLoading:U,onSubmit:L},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createVNode(e.unref(p.EntityFormSection),{description:e.unref(u)("secrets.form.info.description"),"has-divider":"",title:e.unref(u)("secrets.form.info.title")},{default:e.withCtx(()=>[e.createVNode(I,{modelValue:h.fields.key,"onUpdate:modelValue":T[0]||(T[0]=O=>h.fields.key=O),modelModifiers:{trim:!0},autocomplete:"off",class:"key-field","data-testid":"secret-form-key",disabled:W.value===e.unref(p.EntityBaseFormType).Edit,label:e.unref(u)("secrets.form.fields.key.label"),placeholder:e.unref(u)("secrets.form.fields.key.placeholder"),readonly:h.readonly,required:"",type:"text"},null,8,["modelValue","disabled","label","placeholder","readonly"]),e.createVNode(M,{modelValue:h.fields.value,"onUpdate:modelValue":T[1]||(T[1]=O=>h.fields.value=O),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"secret-form-value",label:e.unref(u)("secrets.form.fields.value.label"),placeholder:e.unref(u)("secrets.form.fields.value.placeholder"),readonly:h.readonly,required:"",resizable:"",type:"text"},null,8,["modelValue","label","placeholder","readonly"]),e.createVNode(z,{appearance:"warning",message:e.unref(u)("secrets.form.hint")},null,8,["message"])]),_:1},8,["description","title"])])]),_:1},8,["can-submit","config","edit-id","enable-terraform","entity-type","error-message","fetch-url","form-fields","is-readonly"])}}}),[["__scopeId","data-v-d6916dd4"]]),ze={class:"kong-ui-entities-secret-form"},Ge=oe(e.defineComponent({__name:"SecretForm",props:{config:{type:Object,required:!0,validator:o=>!(!o||o.app!=="konnect"||!o.controlPlaneId||!o.cancelRoute)},vaultId:{type:String,required:!0},secretId:{type:String,required:!1,default:""},enableTerraform:{type:Boolean,default:!1}},emits:["update","error","loading"],setup(o,{emit:R}){var k;const f=o,c=R,u=s=>{c("update",s)},a=s=>{c("error",s)},w=s=>{c("loading",s)},{axiosInstance:E}=p.useAxios((k=f.config)==null?void 0:k.axiosRequestConfig),h=e.ref(""),d=e.computed(()=>{var s;return`${f.config.apiBaseUrl}${le.getVault[f.config.app]}`.replace(/{controlPlaneId}/gi,((s=f.config)==null?void 0:s.controlPlaneId)||"").replace(/{id}/gi,f.vaultId)});return e.onBeforeMount(async()=>{var s;try{const{data:U}=await E.get(d.value);h.value=(s=U==null?void 0:U.config)==null?void 0:s.config_store_id}catch(U){c("error",U)}}),(s,U)=>(e.openBlock(),e.createElementBlock("div",ze,[h.value?(e.openBlock(),e.createBlock(Le,e.mergeProps({key:0},f,{"config-store-id":h.value,onError:a,onLoading:w,onUpdate:u}),null,16,["config-store-id"])):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-20f3b1b6"]]);A.SecretForm=Ge,A.SecretList=je,A.VaultAuthMethods=N,A.VaultConfigCard=De,A.VaultForm=Ke,A.VaultList=ke,A.VaultProviders=t,A.secretsEndpoints=le,A.vaultsEndpoints=Q,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})});
1
+ (function(A,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vue-router"),require("@kong/icons"),require("@kong-ui-public/entities-shared"),require("@kong-ui-public/i18n")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong/icons","@kong-ui-public/entities-shared","@kong-ui-public/i18n"],e):(A=typeof globalThis<"u"?globalThis:A||self,e(A["kong-ui-public-entities-vaults"]={},A.Vue,A.VueRouter,A.KongIcons,A["kong-ui-public-entities-shared"],A["kong-ui-public-i18n"]))})(this,function(A,e,ie,Z,p,de){"use strict";const ge={actions:{create:"New Vault",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",view:"View Details"},delete:{title:"Delete a Vault",title_for_secret:"Delete a Secret",description:"This action cannot be reversed."},errors:{general:"Vaults could not be retrieved",delete:"The vault could not be deleted at this time.",copy:"Failed to copy to clipboard"},search:{placeholder_for_vaults:{konnect:"Filter by exact prefix or ID"},placeholder_for_secrets:{konnect:"Filter by exact key"}},vaults:{title:"Vaults",list:{toolbar_actions:{new_vault:"New Vault"},table_headers:{prefix:"Prefix",name:"Vault Type",description:"Description",tags:"Tags",id:"ID"},empty_state:{title:"Configure a New Vault",description:"Improve the security of your Kong Gateway deployment with centralized secrets."}}},secrets:{title:"Secrets",list:{toolbar_actions:{new_secret:"Store New Secret"},table_headers:{key:"Secret Key",updated_at:"Updated At"},empty_state:{title:"No Secrets Stored",description:"Improve the security of your Kong Gateway deployment with centralized secrets."}},form:{info:{title:"Secret",description:"Enter the secret key and secret value to be stored in Konnect vault"},fields:{key:{label:"Key",placeholder:"Enter key"},value:{label:"Value",placeholder:"Enter value here, can be simple values or multi-line"}},hint:"Once saved, the secret value will not be visible"}},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},labels:{vault_type:"Vault Type"},form:{sections:{general:{title:"General Information",description:"General information helps identify and manage this Vault instance."},config:{title:"Vault Configuration",description:"Select a type of Vault and configure properties specific to each type of Vault."}},fields:{prefix:{label:"Prefix",placeholder:"Enter a unique prefix for this vault",help:"e.g. my-vault",tooltip:"The prefix is used to load the right Vault configuration and implementation when referencing secrets with the other entities."},description:{label:"Description",placeholder:"Enter some description for this vault"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3"}},config:{konnect:{label:"Konnect",description:"Access secrets stored directly in Konnect's unified platform to easily reference in Kong Gateway configuration."},env:{label:"Environment Variables",description:"Access secrets stored via variables to be made available in Kong Gateway at runtime.",fields:{prefix:{label:"Environment Variable Prefix",placeholder:"Enter your environment variable vault prefix",tooltip:"Data plane will access all the environment variables starting with this prefix."}}},aws:{label:"AWS Secrets Manager",description:"Access secrets stored in AWS Secrets Manager for Kong Gateway configuration.",fields:{region:{label:"Region",placeholder:"Select an AWS region",tooltip:"The AWS region your vault is located in",locations:{"us-east-1":{location:"N. Virginia"},"us-east-2":{location:"Ohio"},"us-west-1":{location:"N. California"},"us-west-2":{location:"Oregon"},"af-south-1":{location:"Cape Town"},"ap-east-1":{location:"Hong Kong"},"ap-southeast-3":{location:"Jakarta"},"ap-south-1":{location:"Mumbai"},"ap-northeast-1":{location:"Tokyo"},"ap-northeast-2":{location:"Seoul"},"ap-northeast-3":{location:"Osaka"},"ap-southeast-1":{location:"Singapore"},"ap-southeast-2":{location:"Sydney"},"ca-central-1":{location:"Canada"},"eu-central-1":{location:"Frankfurt"},"eu-west-1":{location:"Ireland"},"eu-west-2":{location:"London"},"eu-west-3":{location:"Paris"},"eu-south-1":{location:"Milan"},"eu-north-1":{location:"Stockholm"},"me-south-1":{location:"Bahrain"},"sa-east-1":{location:"São Paulo"},"us-gov-east-1":{location:"US East"},"us-gov-west-1":{location:"US West"}}},endpoint_url:{label:"Endpoint URL",tooltip:'The AWS SecretsManager service endpoint url. If not specified, the value used by vault will be the official AWS SecretsManager service url which is `https://secretsmanager.<region>.amazonaws.com`. You can specify a complete URL(including the "http/https" scheme) to override the endpoint that vault will connect to.'},assume_role_arn:{label:"Assume Role ARN",tooltip:"The target AWS IAM role ARN that will be assumed. Typically this is used for operating between multiple roles or cross-accounts. If you are not using assume role you should not specify this value."},role_session_name:{label:"Role Session Name",tooltip:"The role session name used for role assuming."},sts_endpoint_url:{label:"STS Endpoint URL",tooltip:"The custom STS endpoint URL used for role assuming in AWS Vault. Note that this value will override the default STS endpoint URL(which should be `https: //sts.amazonaws.com`, or `https: //sts.<region>.amazonaws.com` if you have `AWS_STS_REGIONAL_ENDPOINTS` set to `regional`). If you are not using private VPC endpoint for STS service, you should not specify this value."}}},gcp:{label:"Google Secret Manager",description:"Access secrets stored in Google Secret Manager for Kong Gateway configuration.",fields:{project_id:{label:"Project ID",placeholder:"Enter your Google Cloud Project ID",tooltip:{text:"Visit your Google API Console and select {italic-text} in the projects list to see your project ID",italicText:"Manage all projects"}}}},hcv:{label:"HashiCorp Vault",description:"Access secrets stored in HashiCorp Vault for Kong Gateway configuration.",fields:{protocol:{label:"Protocol"},host:{label:"Host"},port:{label:"Port"},mount:{label:"Mount"},kv:{label:"Kv"},namespace:{label:"Namespace"},auth_method:{label:"Authentication Method"},token:{label:"Token"},kube_role:{label:"Kubernetes Role"},kube_auth_path:{label:"Kubernetes Auth Path"},kube_api_token_file:{label:"Kubernetes API Token File"},approle_auth_path:{label:"App Role Auth Path"},approle_role_id:{label:"App Role Role ID"},approle_secret_id:{label:"App Role Secret ID"},approle_secret_id_file:{label:"App Role Secret ID File"},approle_response_wrapping:{label:"App Role Response Wrapping"}}},azure:{label:"Azure Vault",description:"Access secrets stored in Azure Key Vault for Kong Gateway configuration.",fields:{location:{label:"Location"},vault_uri:{label:"Vault URI"},credential_prefix:{label:"Credential Prefix"},type:{label:"Type",placeholder:"Select a type"},client_id:{label:"Client ID"},tenant_id:{label:"Tenant ID"}}},advancedFields:{title:"View Advanced Fields",ttl:"Time-to-Live",ttlTooltip:"Time-to-live (in seconds) of a secret from a vault when cached by this reference",negTtl:"Negative Time-to-Live",negTtlTooltip:"Time-to-live (in seconds) of a vault miss (no secret)",resurrectTtl:"Time-to-Live Resurrection",resurrectTtlTooltip:"Time (in seconds) for which stale secrets from the vault are resurrected for when they cannot be refreshed"}},unavailable:"This vault provider is available on Enterprise."}};function ye(){const o=de.createI18n("en-us",ge);return{i18n:o,i18nT:de.i18nTComponent(o)}}const ae={useI18n:ye},se="/v2/control-planes/{controlPlaneId}/core-entities",fe="/v2/control-planes/{controlPlaneId}/config-stores",ce="/{workspace}",Q={list:{konnect:{getAll:`${se}/vaults`,deleteConfigStore:`${fe}/{id}?force=true`},kongManager:{getAll:`${ce}/vaults`}},form:{konnect:{create:`${se}/vaults`,createConfigStore:fe,edit:`${se}/vaults/{id}`},kongManager:{create:`${ce}/vaults`,edit:`${ce}/vaults/{id}`}}},be={class:"kong-ui-entities-vaults-list"},he={class:"table-content-overflow-wrapper"},_e={class:"table-content-overflow-wrapper"},Ve={key:1},Ce=e.defineComponent({__name:"VaultList",props:{config:{type:Object,required:!0,validator:o=>!(!o||!["konnect","kongManager"].includes(o==null?void 0:o.app)||!o.createRoute||!o.getViewRoute||!o.getEditRoute||o.app==="kongManager"&&!o.isExactMatch&&!o.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(o,{emit:R}){var G;const f=R,c=o,{i18n:{t:u}}=ae.useI18n(),a=ie.useRouter(),{axiosInstance:w}=p.useAxios((G=c.config)==null?void 0:G.axiosRequestConfig),E=e.computed(()=>c.config.app!=="kongManager"||!!c.config.disableSorting),h={prefix:{label:u("vaults.list.table_headers.prefix"),searchable:!0,sortable:!0,hidable:!1},name:{label:u("vaults.list.table_headers.name"),searchable:!0,sortable:!0},description:{label:u("vaults.list.table_headers.description"),sortable:!1},tags:{label:u("vaults.list.table_headers.tags"),sortable:!1}},d=h,k=e.computed(()=>{var _,C;let g=`${c.config.apiBaseUrl}${Q.list[c.config.app].getAll}`;return c.config.app==="konnect"?g=g.replace(/{controlPlaneId}/gi,((_=c.config)==null?void 0:_.controlPlaneId)||""):c.config.app==="kongManager"&&(g=g.replace(/\/{workspace}/gi,(C=c.config)!=null&&C.workspace?`/${c.config.workspace}`:"")),g}),s=e.ref(""),U=e.computed(()=>{if(c.config.app==="konnect"||c.config.isExactMatch)return{isExactMatch:!0,placeholder:u("search.placeholder_for_vaults.konnect")};const{prefix:_,name:C}=h;return{isExactMatch:!1,fields:{name:C,prefix:_},schema:c.config.filterSchema}}),B=e.ref(1),{fetcher:J,fetcherState:W}=p.useFetcher(c.config,k.value),l=()=>{s.value=""},F=()=>{B.value++},j=e.ref(null),$=(g,_)=>{const C=g.id;if(!_(C)){f("copy:error",{entity:g,field:"id",message:u("errors.copy")});return}f("copy:success",{entity:g,field:"id",message:u("copy.success",{val:C})})},L=(g,_)=>{const C=JSON.stringify(g);if(!_(C)){f("copy:error",{entity:g,message:u("errors.copy")});return}f("copy:success",{entity:g,message:u("copy.success_brief")})},D=async g=>{var C;await((C=c.canRetrieve)==null?void 0:C.call(c,g))&&a.push(c.config.getViewRoute(g.id))},m=g=>({label:u("actions.view"),to:c.config.getViewRoute(g)}),T=g=>({label:u("actions.edit"),to:c.config.getEditRoute(g)}),I=e.ref(void 0),M=e.ref(!1),z=e.ref(!1),O=e.ref(""),Y=p.useDeleteUrlBuilder(c.config,k.value),X=g=>{I.value=g,M.value=!0},V=()=>{M.value=!1},P=async g=>{const{apiBaseUrl:_,app:C,controlPlaneId:K}=c.config,H=`${_}${Q.list[C].deleteConfigStore}`.replace(/{controlPlaneId}/gi,K||"").replace(/{id}/gi,g);try{await w.delete(H)}catch{}},q=async()=>{var g,_,C,K;if((g=I.value)!=null&&g.id){z.value=!0;try{await w.delete(Y(I.value.id)),c.config.app==="konnect"&&((_=I.value.config)!=null&&_.config_store_id)&&P(I.value.config.config_store_id),z.value=!1,M.value=!1,B.value++,f("delete:success",I.value)}catch(H){O.value=((K=(C=H.response)==null?void 0:C.data)==null?void 0:K.message)||H.message||u("errors.delete"),f("error",H)}finally{z.value=!1}}},v=e.ref(!1);e.watch(W,g=>{var _,C,K,H;if(Array.isArray((_=g==null?void 0:g.response)==null?void 0:_.data)&&(v.value=g.response.data.length>0),g.status===p.FetcherStatus.Error){j.value={title:u("errors.general")},(H=(K=(C=g.error)==null?void 0:C.response)==null?void 0:K.data)!=null&&H.message&&(j.value.message=g.error.response.data.message),f("error",g.error);return}j.value=null});const S=e.ref({ctaPath:c.config.createRoute,ctaText:void 0,message:`${u("vaults.list.empty_state.description")}${c.config.additionMessageForEmptyState?` ${c.config.additionMessageForEmptyState}`:""}`,title:u("vaults.title")});return e.onBeforeMount(async()=>{await c.canCreate()&&(S.value.title=u("vaults.list.empty_state.title"),S.value.ctaText=u("actions.create"))}),(g,_)=>{const C=e.resolveComponent("KButton"),K=e.resolveComponent("KBadge"),H=e.resolveComponent("KTruncate"),i=e.resolveComponent("KDropdownItem"),r=e.resolveComponent("KClipboardProvider");return e.openBlock(),e.createElementBlock("div",be,[e.createVNode(e.unref(p.EntityBaseTable),{"cache-identifier":o.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":E.value,"empty-state-options":S.value,"enable-entity-actions":"","error-message":j.value,fetcher:e.unref(J),"fetcher-cache-key":B.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-vaults-list",query:s.value,"table-headers":e.unref(d),onClearSearchInput:l,"onClick:row":_[2]||(_[2]=y=>D(y)),onSort:F},{"toolbar-filter":e.withCtx(()=>[e.createVNode(e.unref(p.EntityFilter),{modelValue:s.value,"onUpdate:modelValue":_[0]||(_[0]=y=>s.value=y),config:U.value},null,8,["modelValue","config"])]),"toolbar-button":e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!o.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[e.createVNode(e.unref(p.PermissionsWrapper),{"auth-function":()=>o.canCreate()},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(C,{appearance:"primary","data-testid":"toolbar-add-vault",size:o.useActionOutside?"medium":"large",to:o.config.createRoute},{default:e.withCtx(()=>[e.createVNode(e.unref(Z.AddIcon)),e.createTextVNode(" "+e.toDisplayString(e.unref(u)("vaults.list.toolbar_actions.new_vault")),1)]),_:1},8,["size","to"]),[[e.vShow,v.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),prefix:e.withCtx(({rowValue:y})=>[e.createElementVNode("div",he,[e.createElementVNode("b",null,e.toDisplayString(y??"-"),1)])]),name:e.withCtx(({rowValue:y})=>[e.createElementVNode("b",null,e.toDisplayString(y??"-"),1)]),description:e.withCtx(({rowValue:y})=>[e.createElementVNode("div",_e,e.toDisplayString(y??"-"),1)]),tags:e.withCtx(({rowValue:y})=>[(y==null?void 0:y.length)>0?(e.openBlock(),e.createBlock(H,{key:0},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y,x=>(e.openBlock(),e.createBlock(K,{key:x,onClick:_[1]||(_[1]=e.withModifiers(()=>{},["stop"]))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x),1)]),_:2},1024))),128))]),_:2},1024)):(e.openBlock(),e.createElementBlock("span",Ve,"-"))]),actions:e.withCtx(({row:y})=>[e.createVNode(r,null,{default:e.withCtx(({copyToClipboard:x})=>[e.createVNode(i,{"data-testid":"action-entity-copy-id",onClick:b=>$(y,x)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(r,null,{default:e.withCtx(({copyToClipboard:x})=>[e.createVNode(i,{"data-testid":"action-entity-copy-json",onClick:b=>L(y,x)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(e.unref(p.PermissionsWrapper),{"auth-function":()=>o.canRetrieve(y)},{default:e.withCtx(()=>[e.createVNode(i,{"data-testid":"action-entity-view","has-divider":"",item:m(y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(p.PermissionsWrapper),{"auth-function":()=>o.canEdit(y)},{default:e.withCtx(()=>[e.createVNode(i,{"data-testid":"action-entity-edit",item:T(y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(p.PermissionsWrapper),{"auth-function":()=>o.canDelete(y)},{default:e.withCtx(()=>[e.createVNode(i,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:x=>X(y)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers"]),e.createVNode(e.unref(p.EntityDeleteModal),{"action-pending":z.value,description:e.unref(u)("delete.description"),"entity-name":I.value&&(I.value.prefix||I.value.id),"entity-type":e.unref(p.EntityTypes).Vault,error:O.value,title:e.unref(u)("delete.title"),visible:M.value,onCancel:V,onProceed:q},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"])])}}}),oe=(o,R)=>{const f=o.__vccOpts||o;for(const[c,u]of R)f[c]=u;return f},ke=oe(Ce,[["__scopeId","data-v-fdf96cd9"]]);var t=(o=>(o.AWS="aws",o.GCP="gcp",o.HCV="hcv",o.ENV="env",o.AZURE="azure",o.KONNECT="konnect",o))(t||{}),N=(o=>(o.TOKEN="token",o.K8S="kubernetes",o.APP_ROLE="approle",o))(N||{});const we={class:"kong-ui-entities-vault-form"},Ee={class:"vault-form-provider-cards-container"},xe=["data-testid"],Ne={class:"provider-item-title-container"},Se={class:"provider-item-title"},Ae={class:"provider-item-description"},Ie={key:"kong-vault-config-fields",class:"vault-form-config-fields-container"},Te={key:0,class:"vault-form-config-auth-method-container"},Re={key:1,class:"vault-form-config-auth-method-container"},Ue={key:2,class:"vault-form-config-auth-method-container"},Be={key:5},$e={class:"wrapper"},ve={class:"item-50"},Me={class:"item-50"},Pe={class:"wrapper"},He={class:"item-100"},Ke=oe(e.defineComponent({__name:"VaultForm",props:{config:{type:Object,required:!0,validator:o=>!(!o||!["konnect","kongManager"].includes(o==null?void 0:o.app)||(o==null?void 0:o.app)==="konnect"&&!(o!=null&&o.controlPlaneId)||(o==null?void 0:o.app)==="kongManager"&&typeof(o==null?void 0:o.workspace)!="string"||!(o!=null&&o.cancelRoute))},vaultId:{type:String,required:!1,default:""},enableTerraform:{type:Boolean,default:!1}},emits:["update","error","loading"],setup(o,{emit:R}){var H;const f=o,c=R,{i18nT:u,i18n:{t:a}}=ae.useI18n(),w=ie.useRouter(),{axiosInstance:E}=p.useAxios((H=f.config)==null?void 0:H.axiosRequestConfig),{getMessageFromError:h}=p.useErrors(),d=e.reactive({fields:{prefix:"",description:"",tags:""},isReadonly:!1,errorMessage:""}),k=e.reactive({prefix:"",description:"",tags:""}),s=e.ref(f.config.konnectConfigStoreAvailable?t.KONNECT:t.ENV),U=e.ref(null),B=e.ref(),J=e.computed(()=>[t.AWS,t.GCP,t.HCV,t.AZURE].includes(s.value)),W=e.computed(()=>[...f.config.konnectConfigStoreAvailable?[{label:a("form.config.konnect.label"),value:t.KONNECT}]:[],{label:a("form.config.env.label"),value:t.ENV},{label:a("form.config.aws.label"),value:t.AWS,disabled:!M.value},{label:a("form.config.gcp.label"),value:t.GCP,disabled:!M.value},{label:a("form.config.hcv.label"),value:t.HCV,disabled:!M.value},...f.config.azureVaultProviderAvailable?[{label:a("form.config.azure.label"),value:t.AZURE,disabled:!M.value}]:[]]),l=e.reactive({[t.KONNECT]:{},[t.ENV]:{prefix:""},[t.AWS]:{region:"",endpoint_url:"",assume_role_arn:"",role_session_name:"KongVault"},[t.GCP]:{project_id:""},[t.HCV]:{protocol:"http",host:"127.0.0.1",port:8200,mount:"secret",kv:"v1",namespace:"",auth_method:N.TOKEN,token:"",kube_role:"",kube_auth_path:"",kube_api_token_file:"",approle_auth_path:"",approle_role_id:"",approle_secret_id:"",approle_secret_id_file:"",approle_response_wrapping:!1},[t.AZURE]:{location:"",vault_uri:"",type:"secrets",credentials_prefix:"AZURE",client_id:"",tenant_id:""}}),F=e.reactive({[t.KONNECT]:{},[t.ENV]:{prefix:""},[t.AWS]:{region:"",endpoint_url:"",assume_role_arn:"",role_session_name:"KongVault"},[t.GCP]:{project_id:""},[t.HCV]:{protocol:"http",host:"127.0.0.1",port:8200,mount:"secret",kv:"v1",namespace:"",auth_method:N.TOKEN,token:"",kube_role:"",kube_auth_path:"",kube_api_token_file:"",approle_auth_path:"",approle_role_id:"",approle_secret_id:"",approle_secret_id_file:"",approle_response_wrapping:!1},[t.AZURE]:{location:"",vault_uri:"",type:"secrets",credentials_prefix:"AZURE",client_id:"",tenant_id:""}}),j=[{label:`${a("form.config.aws.fields.region.locations.us-east-1.location")} (us-east-1)`,value:"us-east-1"},{label:`${a("form.config.aws.fields.region.locations.us-east-2.location")} (us-east-2)`,value:"us-east-2"},{label:`${a("form.config.aws.fields.region.locations.us-west-1.location")} (us-west-1)`,value:"us-west-1"},{label:`${a("form.config.aws.fields.region.locations.us-west-2.location")} (us-west-2)`,value:"us-west-2"},{label:`${a("form.config.aws.fields.region.locations.af-south-1.location")} (af-south-1)`,value:"af-south-1"},{label:`${a("form.config.aws.fields.region.locations.ap-east-1.location")} (ap-east-1)`,value:"ap-east-1"},{label:`${a("form.config.aws.fields.region.locations.ap-southeast-3.location")} (ap-southeast-3)`,value:"ap-southeast-3"},{label:`${a("form.config.aws.fields.region.locations.ap-south-1.location")} (ap-south-1)`,value:"ap-south-1"},{label:`${a("form.config.aws.fields.region.locations.ap-northeast-1.location")} (ap-northeast-1)`,value:"ap-northeast-1"},{label:`${a("form.config.aws.fields.region.locations.ap-northeast-2.location")} (ap-northeast-2)`,value:"ap-northeast-2"},{label:`${a("form.config.aws.fields.region.locations.ap-northeast-3.location")} (ap-northeast-3)`,value:"ap-northeast-3"},{label:`${a("form.config.aws.fields.region.locations.ap-southeast-1.location")} (ap-southeast-1)`,value:"ap-southeast-1"},{label:`${a("form.config.aws.fields.region.locations.ap-southeast-2.location")} (ap-southeast-2)`,value:"ap-southeast-2"},{label:`${a("form.config.aws.fields.region.locations.ca-central-1.location")} (ca-central-1)`,value:"ca-central-1"},{label:`${a("form.config.aws.fields.region.locations.eu-central-1.location")} (eu-central-1)`,value:"eu-central-1"},{label:`${a("form.config.aws.fields.region.locations.eu-west-1.location")} (eu-west-1)`,value:"eu-west-1"},{label:`${a("form.config.aws.fields.region.locations.eu-west-2.location")} (eu-west-2)`,value:"eu-west-2"},{label:`${a("form.config.aws.fields.region.locations.eu-west-3.location")} (eu-west-3)`,value:"eu-west-3"},{label:`${a("form.config.aws.fields.region.locations.eu-south-1.location")} (eu-south-1)`,value:"eu-south-1"},{label:`${a("form.config.aws.fields.region.locations.eu-north-1.location")} (eu-north-1)`,value:"eu-north-1"},{label:`${a("form.config.aws.fields.region.locations.me-south-1.location")} (me-south-1)`,value:"me-south-1"},{label:`${a("form.config.aws.fields.region.locations.sa-east-1.location")} (sa-east-1)`,value:"sa-east-1"},{label:`${a("form.config.aws.fields.region.locations.us-gov-east-1.location")} (us-gov-east-1)`,value:"us-gov-east-1"},{label:`${a("form.config.aws.fields.region.locations.us-gov-west-1.location")} (us-gov-west-1)`,value:"us-gov-west-1"}],$=[{label:"secrets",value:"secrets"}],L=[{label:"http",value:"http"},{label:"https",value:"https"}],D=[{label:"v1",value:"v1"},{label:"v2",value:"v2"}],m=e.computed(()=>f.vaultId?p.EntityBaseFormType.Edit:p.EntityBaseFormType.Create),T=e.computed(()=>{var i,r;return(r=Q.form[(i=f.config)==null?void 0:i.app])==null?void 0:r.edit}),I=e.computed(()=>m.value===p.EntityBaseFormType.Edit&&f.config.app==="kongManager"),M=e.computed(()=>f.config.app==="konnect"||p.useGatewayFeatureSupported({gatewayInfo:f.config.gatewayInfo,supportedRange:{enterprise:[]}})),z=()=>{var i;w.push(((i=f.config)==null?void 0:i.cancelRoute)||{name:"vault-list"})},O=i=>{c("loading",i)},Y=i=>{c("error",i)},X=i=>{switch(i){case t.KONNECT:return Z.KongIcon;case t.ENV:return Z.CodeIcon;case t.AWS:return Z.AwsIcon;case t.GCP:return Z.GoogleCloudIcon;case t.HCV:return Z.HashicorpIcon;case t.AZURE:return Z.AzureIcon}},V=i=>{switch(i){case t.KONNECT:return a("form.config.konnect.description");case t.ENV:return a("form.config.env.description");case t.AWS:return a("form.config.aws.description");case t.GCP:return a("form.config.gcp.description");case t.HCV:return a("form.config.hcv.description");case t.AZURE:return a("form.config.azure.description")}},P=i=>{var x,b,re,ee,te,n;d.fields.prefix=((x=i==null?void 0:i.item)==null?void 0:x.prefix)||(i==null?void 0:i.prefix)||"",d.fields.description=((b=i==null?void 0:i.item)==null?void 0:b.description)||(i==null?void 0:i.description)||"";const r=((re=i==null?void 0:i.item)==null?void 0:re.tags)||(i==null?void 0:i.tags)||[];d.fields.tags=(r==null?void 0:r.join(", "))||"",Object.assign(k,d.fields);const y=((ee=i==null?void 0:i.item)==null?void 0:ee.config)||(i==null?void 0:i.config)||null;y&&(Object.keys(y).length||(i==null?void 0:i.name)===t.KONNECT)?(s.value=((te=i==null?void 0:i.item)==null?void 0:te.name)||(i==null?void 0:i.name)||"",U.value=s.value,B.value=((n=i==null?void 0:i.config)==null?void 0:n.config_store_id)||void 0,Object.assign(l[s.value],y),Object.assign(F[s.value],y)):d.errorMessage="Error loading vault config"},q=e.computed(()=>s.value===t.HCV?!Object.keys(l[t.HCV]).filter(i=>["namespace","ttl","neg_ttl","resurrect_ttl","kube_auth_path","approle_auth_path","approle_secret_id","approle_secret_id_file"].includes(i)||l[t.HCV].auth_method!==N.K8S&&(i==="kube_role"||i==="kube_api_token_file")||l[t.HCV].auth_method!==N.TOKEN&&i==="token"||l[t.HCV].auth_method!==N.APP_ROLE&&(i==="approle_role_id"||i==="approle_response_wrapping")||l[t.HCV].auth_method===N.APP_ROLE&&i==="approle_response_wrapping"&&typeof l[s.value][i]=="boolean"?!1:!l[s.value][i]).length:s.value===t.AZURE?!Object.keys(l[t.AZURE]).filter(i=>["client_id","tenant_id","ttl","neg_ttl","resurrect_ttl"].includes(i)?!1:!l[s.value][i]).length:s.value===t.AWS?!Object.keys(l[t.AWS]).filter(i=>["endpoint_url","assume_role_arn","ttl","neg_ttl","resurrect_ttl","sts_endpoint_url"].includes(i)?!1:!l[s.value][i]).length:!Object.keys(l[s.value]).filter(i=>["ttl","neg_ttl","resurrect_ttl"].includes(i)?!1:!l[s.value][i]).length),v=e.computed(()=>!!d.fields.prefix&&q.value),S=e.computed(()=>JSON.stringify(d.fields)!==JSON.stringify(k)||s.value!==U.value||JSON.stringify(l[s.value])!==JSON.stringify(F[s.value])),G=e.computed(()=>{var r,y;let i=`${f.config.apiBaseUrl}${Q.form[f.config.app][m.value]}`;return f.config.app==="konnect"?i=i.replace(/{controlPlaneId}/gi,((r=f.config)==null?void 0:r.controlPlaneId)||""):f.config.app==="kongManager"&&(i=i.replace(/\/{workspace}/gi,(y=f.config)!=null&&y.workspace?`/${f.config.workspace}`:"")),i=i.replace(/{id}/gi,f.vaultId),i}),g=e.computed(()=>{var ee,te;const i={protocol:l[t.HCV].protocol,host:l[t.HCV].host,port:parseInt(l[t.HCV].port.toString()),mount:l[t.HCV].mount,kv:l[t.HCV].kv,namespace:l[t.HCV].namespace||null,auth_method:l[t.HCV].auth_method,...l[t.HCV].auth_method===N.TOKEN&&{token:l[t.HCV].token},...l[t.HCV].auth_method===N.K8S&&{kube_role:l[t.HCV].kube_role,kube_auth_path:l[t.HCV].kube_auth_path||void 0,kube_api_token_file:l[t.HCV].kube_api_token_file,token:null},...l[t.HCV].auth_method===N.APP_ROLE&&{approle_auth_path:l[t.HCV].approle_auth_path||void 0,approle_role_id:l[t.HCV].approle_role_id,approle_secret_id:l[t.HCV].approle_secret_id||void 0,approle_secret_id_file:l[t.HCV].approle_secret_id_file||void 0,approle_response_wrapping:l[t.HCV].approle_response_wrapping??!1}},r={...l[s.value],client_id:l[s.value].client_id||null,tenant_id:l[s.value].tenant_id||null},y={...l[s.value],endpoint_url:l[s.value].endpoint_url||null,assume_role_arn:l[s.value].assume_role_arn||null,...f.config.awsStsEndpointUrlAvailable?{sts_endpoint_url:l[s.value].sts_endpoint_url||null}:{}};let x=l[s.value];s.value===t.HCV?x=i:s.value===t.AZURE?x=r:s.value===t.AWS&&(x=y);let b={};if(![t.KONNECT,t.ENV].includes(s.value)){const n=l[s.value],ue=n.ttl,pe=n.neg_ttl,me=n.resurrect_ttl;b={ttl:ue?parseInt(ue.toString(),10):null,neg_ttl:pe?parseInt(pe.toString(),10):null,resurrect_ttl:me?parseInt(me.toString(),10):null}}return{prefix:d.fields.prefix,description:d.fields.description||null,tags:(te=(ee=d.fields.tags.split(","))==null?void 0:ee.map(n=>String(n||"").trim()))==null?void 0:te.filter(n=>n!==""),name:s.value,config:{...x,...b}}}),_=e.computed(()=>({...g.value,config:{...g.value.config,config_store_id:B.value}})),C=async()=>{var i;try{d.isReadonly=!0;const r=`${f.config.apiBaseUrl}${Q.form.konnect.createConfigStore}`.replace(/{controlPlaneId}/gi,((i=f.config)==null?void 0:i.controlPlaneId)||""),y=await E.post(r);return y==null?void 0:y.data.id}catch(r){d.errorMessage=h(r),c("error",r)}finally{d.isReadonly=!1}},K=async()=>{var i;try{d.isReadonly=!0;let r;m.value==="create"?s.value===t.KONNECT?(B.value=await C(),r=await E.post(G.value,_.value)):r=await E.post(G.value,g.value):m.value==="edit"&&(s.value===t.KONNECT&&!B.value?(B.value=await C(),r=await E.put(G.value,_.value)):r=((i=f.config)==null?void 0:i.app)==="konnect"?await E.put(G.value,_.value):await E.patch(G.value,g.value)),P(r==null?void 0:r.data),c("update",r==null?void 0:r.data)}catch(r){d.errorMessage=h(r),c("error",r)}finally{d.isReadonly=!1}};return(i,r)=>{const y=e.resolveComponent("KTooltip"),x=e.resolveComponent("KSelect"),b=e.resolveComponent("KInput"),re=e.resolveComponent("KCheckbox"),ee=e.resolveComponent("KCollapse"),te=e.resolveComponent("KTextArea");return e.openBlock(),e.createElementBlock("div",we,[e.createVNode(e.unref(p.EntityBaseForm),{"can-submit":v.value&&S.value,config:o.config,"edit-id":o.vaultId,"enable-terraform":o.enableTerraform,"entity-type":e.unref(p.SupportedEntityType).Vault,"error-message":d.errorMessage,"fetch-url":T.value,"form-fields":g.value,"is-readonly":d.isReadonly,onCancel:z,"onFetch:error":Y,"onFetch:success":P,onLoading:O,onSubmit:K},{default:e.withCtx(()=>[e.createVNode(e.unref(p.EntityFormSection),{description:e.unref(a)("form.sections.config.description"),title:e.unref(a)("form.sections.config.title")},{default:e.withCtx(()=>[e.createElementVNode("div",Ee,[e.createVNode(x,{modelValue:s.value,"onUpdate:modelValue":r[0]||(r[0]=n=>s.value=n),"data-testid":"provider-select",disabled:I.value,"dropdown-max-height":"500",items:W.value},{"selected-item-template":e.withCtx(({item:n})=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(X(n.value)))),e.createTextVNode(" "+e.toDisplayString(n==null?void 0:n.label),1)]),"item-template":e.withCtx(({item:n})=>[e.createVNode(y,{placement:"top",text:n.disabled?e.unref(a)("form.unavailable"):""},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"provider-item","data-testid":`vault-form-provider-${n.value}`},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(X(n.value)))),e.createElementVNode("div",Ne,[e.createElementVNode("span",Se,e.toDisplayString(n==null?void 0:n.label),1),e.createElementVNode("span",Ae,e.toDisplayString(V(n.value)),1)])],8,xe)]),_:2},1032,["text"])]),_:1},8,["modelValue","disabled","items"])]),e.createVNode(e.TransitionGroup,{name:"appear"},{default:e.withCtx(()=>[s.value===e.unref(t).ENV?(e.openBlock(),e.createElementBlock("div",Ie,[e.createVNode(b,{modelValue:l[e.unref(t).ENV].prefix,"onUpdate:modelValue":r[1]||(r[1]=n=>l[e.unref(t).ENV].prefix=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-kong-prefix","is-readonly":d.isReadonly,label:e.unref(a)("form.config.env.fields.prefix.label"),"label-attributes":{info:e.unref(a)("form.config.env.fields.prefix.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(a)("form.config.env.fields.prefix.placeholder"),required:"",type:"text"},null,8,["modelValue","is-readonly","label","label-attributes","placeholder"])])):e.createCommentVNode("",!0),s.value===e.unref(t).AWS?(e.openBlock(),e.createElementBlock("div",{key:`${e.unref(t).AWS}-vault-config-fields`,class:"vault-form-config-fields-container"},[e.createVNode(x,{modelValue:l[e.unref(t).AWS].region,"onUpdate:modelValue":r[2]||(r[2]=n=>l[e.unref(t).AWS].region=n),"data-testid":"vault-form-config-aws-region",items:j,label:e.unref(a)("form.config.aws.fields.region.label"),"label-attributes":{info:e.unref(a)("form.config.aws.fields.region.tooltip")},placeholder:e.unref(a)("form.config.aws.fields.region.placeholder"),readonly:d.isReadonly,required:"",width:"100%"},null,8,["modelValue","label","label-attributes","placeholder","readonly"]),e.createVNode(b,{modelValue:l[e.unref(t).AWS].endpoint_url,"onUpdate:modelValue":r[3]||(r[3]=n=>l[e.unref(t).AWS].endpoint_url=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-aws-endpoint_url","is-readonly":d.isReadonly,label:e.unref(a)("form.config.aws.fields.endpoint_url.label"),"label-attributes":{info:e.unref(a)("form.config.aws.fields.endpoint_url.tooltip"),tooltipAttributes:{maxWidth:"400"}},type:"text"},null,8,["modelValue","is-readonly","label","label-attributes"]),e.createVNode(b,{modelValue:l[e.unref(t).AWS].assume_role_arn,"onUpdate:modelValue":r[4]||(r[4]=n=>l[e.unref(t).AWS].assume_role_arn=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-aws-assume_role_arn","is-readonly":d.isReadonly,label:e.unref(a)("form.config.aws.fields.assume_role_arn.label"),"label-attributes":{info:e.unref(a)("form.config.aws.fields.assume_role_arn.tooltip"),tooltipAttributes:{maxWidth:"400"}},type:"text"},null,8,["modelValue","is-readonly","label","label-attributes"]),e.createVNode(b,{modelValue:l[e.unref(t).AWS].role_session_name,"onUpdate:modelValue":r[5]||(r[5]=n=>l[e.unref(t).AWS].role_session_name=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-aws-role_session_name","is-readonly":d.isReadonly,label:e.unref(a)("form.config.aws.fields.role_session_name.label"),"label-attributes":{info:e.unref(a)("form.config.aws.fields.role_session_name.tooltip"),tooltipAttributes:{maxWidth:"400"}},required:"",type:"text"},null,8,["modelValue","is-readonly","label","label-attributes"]),o.config.awsStsEndpointUrlAvailable?(e.openBlock(),e.createBlock(b,{key:0,modelValue:l[e.unref(t).AWS].sts_endpoint_url,"onUpdate:modelValue":r[6]||(r[6]=n=>l[e.unref(t).AWS].sts_endpoint_url=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-aws-sts_endpoint_url","is-readonly":d.isReadonly,label:e.unref(a)("form.config.aws.fields.sts_endpoint_url.label"),"label-attributes":{info:e.unref(a)("form.config.aws.fields.sts_endpoint_url.tooltip"),tooltipAttributes:{maxWidth:"400"}},type:"text"},null,8,["modelValue","is-readonly","label","label-attributes"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),s.value===e.unref(t).GCP?(e.openBlock(),e.createElementBlock("div",{key:`${e.unref(t).GCP}-vault-config-fields`,class:"vault-form-config-fields-container"},[e.createVNode(b,{modelValue:l[e.unref(t).GCP].project_id,"onUpdate:modelValue":r[7]||(r[7]=n=>l[e.unref(t).GCP].project_id=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-gcp-project-id","is-readonly":d.isReadonly,label:e.unref(a)("form.config.gcp.fields.project_id.label"),placeholder:e.unref(a)("form.config.gcp.fields.project_id.placeholder"),required:"",type:"text"},{"label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(u),{keypath:"form.config.gcp.fields.project_id.tooltip.text",scope:"global"},{"italic-text":e.withCtx(()=>[e.createElementVNode("em",null,e.toDisplayString(e.unref(a)("form.config.gcp.fields.project_id.tooltip.italicText")),1)]),_:1})]),_:1},8,["modelValue","is-readonly","label","placeholder"])])):e.createCommentVNode("",!0),s.value===e.unref(t).HCV?(e.openBlock(),e.createElementBlock("div",{key:`${e.unref(t).HCV}-vault-config-fields`,class:"vault-form-config-fields-container"},[e.createVNode(x,{modelValue:l[e.unref(t).HCV].protocol,"onUpdate:modelValue":r[8]||(r[8]=n=>l[e.unref(t).HCV].protocol=n),"data-testid":"vault-form-config-hcv-protocol",items:L,label:e.unref(a)("form.config.hcv.fields.protocol.label"),readonly:d.isReadonly,required:"",width:"100%"},null,8,["modelValue","label","readonly"]),e.createVNode(b,{modelValue:l[e.unref(t).HCV].host,"onUpdate:modelValue":r[9]||(r[9]=n=>l[e.unref(t).HCV].host=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-hcv-host","is-readonly":d.isReadonly,label:e.unref(a)("form.config.hcv.fields.host.label"),required:"",type:"text"},null,8,["modelValue","is-readonly","label"]),e.createVNode(b,{modelValue:l[e.unref(t).HCV].port,"onUpdate:modelValue":r[10]||(r[10]=n=>l[e.unref(t).HCV].port=n),autocomplete:"off","data-testid":"vault-form-config-hcv-port","is-readonly":d.isReadonly,label:e.unref(a)("form.config.hcv.fields.port.label"),min:"0",required:"",type:"number"},null,8,["modelValue","is-readonly","label"]),e.createVNode(b,{modelValue:l[e.unref(t).HCV].mount,"onUpdate:modelValue":r[11]||(r[11]=n=>l[e.unref(t).HCV].mount=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-hcv-mount","is-readonly":d.isReadonly,label:e.unref(a)("form.config.hcv.fields.mount.label"),required:"",type:"text"},null,8,["modelValue","is-readonly","label"]),e.createVNode(x,{modelValue:l[e.unref(t).HCV].kv,"onUpdate:modelValue":r[12]||(r[12]=n=>l[e.unref(t).HCV].kv=n),"data-testid":"vault-form-config-hcv-kv",items:D,label:e.unref(a)("form.config.hcv.fields.kv.label"),readonly:d.isReadonly,required:"",width:"100%"},null,8,["modelValue","label","readonly"]),e.createVNode(b,{modelValue:l[e.unref(t).HCV].namespace,"onUpdate:modelValue":r[13]||(r[13]=n=>l[e.unref(t).HCV].namespace=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-hcv-namespace","is-readonly":d.isReadonly,label:e.unref(a)("form.config.hcv.fields.namespace.label"),type:"text"},null,8,["modelValue","is-readonly","label"]),e.createVNode(x,{modelValue:l[e.unref(t).HCV].auth_method,"onUpdate:modelValue":r[14]||(r[14]=n=>l[e.unref(t).HCV].auth_method=n),"data-testid":"vault-form-config-hcv-auth_method",items:[{label:e.unref(N).TOKEN,value:e.unref(N).TOKEN},{label:e.unref(N).K8S,value:e.unref(N).K8S},...o.config.hcvAppRoleMethodAvailable?[{label:e.unref(N).APP_ROLE,value:e.unref(N).APP_ROLE}]:[]],label:e.unref(a)("form.config.hcv.fields.auth_method.label"),readonly:d.isReadonly,required:"",width:"100%"},null,8,["modelValue","items","label","readonly"]),l[e.unref(t).HCV].auth_method===e.unref(N).TOKEN?(e.openBlock(),e.createElementBlock("div",Te,[e.createVNode(b,{modelValue:l[e.unref(t).HCV].token,"onUpdate:modelValue":r[15]||(r[15]=n=>l[e.unref(t).HCV].token=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-hcv-token","is-readonly":d.isReadonly,label:e.unref(a)("form.config.hcv.fields.token.label"),required:"",type:"text"},null,8,["modelValue","is-readonly","label"])])):l[e.unref(t).HCV].auth_method===e.unref(N).K8S?(e.openBlock(),e.createElementBlock("div",Re,[e.createVNode(b,{modelValue:l[e.unref(t).HCV].kube_role,"onUpdate:modelValue":r[16]||(r[16]=n=>l[e.unref(t).HCV].kube_role=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-hcv-kube_role","is-readonly":d.isReadonly,label:e.unref(a)("form.config.hcv.fields.kube_role.label"),required:"",type:"text"},null,8,["modelValue","is-readonly","label"]),e.createVNode(b,{modelValue:l[e.unref(t).HCV].kube_auth_path,"onUpdate:modelValue":r[17]||(r[17]=n=>l[e.unref(t).HCV].kube_auth_path=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-hcv-kube_auth_path","is-readonly":d.isReadonly,label:e.unref(a)("form.config.hcv.fields.kube_auth_path.label"),type:"text"},null,8,["modelValue","is-readonly","label"]),e.createVNode(b,{modelValue:l[e.unref(t).HCV].kube_api_token_file,"onUpdate:modelValue":r[18]||(r[18]=n=>l[e.unref(t).HCV].kube_api_token_file=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-hcv-kube_api_token_file","is-readonly":d.isReadonly,label:e.unref(a)("form.config.hcv.fields.kube_api_token_file.label"),required:"",type:"text"},null,8,["modelValue","is-readonly","label"])])):l[e.unref(t).HCV].auth_method===e.unref(N).APP_ROLE?(e.openBlock(),e.createElementBlock("div",Ue,[e.createVNode(b,{modelValue:l[e.unref(t).HCV].approle_auth_path,"onUpdate:modelValue":r[19]||(r[19]=n=>l[e.unref(t).HCV].approle_auth_path=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-hcv-approle_auth_path","is-readonly":d.isReadonly,label:e.unref(a)("form.config.hcv.fields.approle_auth_path.label"),type:"text"},null,8,["modelValue","is-readonly","label"]),e.createVNode(b,{modelValue:l[e.unref(t).HCV].approle_role_id,"onUpdate:modelValue":r[20]||(r[20]=n=>l[e.unref(t).HCV].approle_role_id=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-hcv-approle_role_id","is-readonly":d.isReadonly,label:e.unref(a)("form.config.hcv.fields.approle_role_id.label"),required:"",type:"text"},null,8,["modelValue","is-readonly","label"]),e.createVNode(b,{modelValue:l[e.unref(t).HCV].approle_secret_id,"onUpdate:modelValue":r[21]||(r[21]=n=>l[e.unref(t).HCV].approle_secret_id=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-hcv-approle_secret_id","is-readonly":d.isReadonly,label:e.unref(a)("form.config.hcv.fields.approle_secret_id.label"),type:"text"},null,8,["modelValue","is-readonly","label"]),e.createVNode(b,{modelValue:l[e.unref(t).HCV].approle_secret_id_file,"onUpdate:modelValue":r[22]||(r[22]=n=>l[e.unref(t).HCV].approle_secret_id_file=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-hcv-approle_secret_id_file","is-readonly":d.isReadonly,label:e.unref(a)("form.config.hcv.fields.approle_secret_id_file.label"),type:"text"},null,8,["modelValue","is-readonly","label"]),e.createVNode(re,{modelValue:l[e.unref(t).HCV].approle_response_wrapping,"onUpdate:modelValue":r[23]||(r[23]=n=>l[e.unref(t).HCV].approle_response_wrapping=n),"data-testid":"vault-form-config-hcv-approle_response_wrapping",label:e.unref(a)("form.config.hcv.fields.approle_response_wrapping.label")},null,8,["modelValue","label"])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),s.value===e.unref(t).AZURE?(e.openBlock(),e.createElementBlock("div",{key:`${e.unref(t).HCV}-vault-config-fields`,class:"vault-form-config-fields-container"},[e.createVNode(b,{modelValue:l[e.unref(t).AZURE].location,"onUpdate:modelValue":r[24]||(r[24]=n=>l[e.unref(t).AZURE].location=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-azure-location","is-readonly":d.isReadonly,label:e.unref(a)("form.config.azure.fields.location.label"),required:"",type:"text"},null,8,["modelValue","is-readonly","label"]),e.createVNode(b,{modelValue:l[e.unref(t).AZURE].vault_uri,"onUpdate:modelValue":r[25]||(r[25]=n=>l[e.unref(t).AZURE].vault_uri=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-azure-uri","is-readonly":d.isReadonly,label:e.unref(a)("form.config.azure.fields.vault_uri.label"),required:"",type:"text"},null,8,["modelValue","is-readonly","label"]),e.createVNode(b,{modelValue:l[e.unref(t).AZURE].credentials_prefix,"onUpdate:modelValue":r[26]||(r[26]=n=>l[e.unref(t).AZURE].credentials_prefix=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-azure-prefix","is-readonly":d.isReadonly,label:e.unref(a)("form.config.azure.fields.credential_prefix.label"),required:"",type:"text"},null,8,["modelValue","is-readonly","label"]),e.createVNode(x,{modelValue:l[e.unref(t).AZURE].type,"onUpdate:modelValue":r[27]||(r[27]=n=>l[e.unref(t).AZURE].type=n),"data-testid":"vault-form-config-azure-type",items:$,label:e.unref(a)("form.config.azure.fields.type.label"),placeholder:e.unref(a)("form.config.azure.fields.type.placeholder"),readonly:d.isReadonly,required:"",width:"100%"},null,8,["modelValue","label","placeholder","readonly"]),e.createVNode(b,{modelValue:l[e.unref(t).AZURE].client_id,"onUpdate:modelValue":r[28]||(r[28]=n=>l[e.unref(t).AZURE].client_id=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-azure-client-id","is-readonly":d.isReadonly,label:e.unref(a)("form.config.azure.fields.client_id.label"),type:"text"},null,8,["modelValue","is-readonly","label"]),e.createVNode(b,{modelValue:l[e.unref(t).AZURE].tenant_id,"onUpdate:modelValue":r[29]||(r[29]=n=>l[e.unref(t).AZURE].tenant_id=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-config-azure-tenant-id","is-readonly":d.isReadonly,label:e.unref(a)("form.config.azure.fields.tenant_id.label"),type:"text"},null,8,["modelValue","is-readonly","label"])])):e.createCommentVNode("",!0),o.config.ttl?(e.openBlock(),e.createElementBlock("div",Be,[J.value?(e.openBlock(),e.createBlock(ee,{key:0,class:"advanced-fields-collapse","data-testid":"advanced-fields-collapse","trigger-alignment":"leading","trigger-label":e.unref(a)("form.config.advancedFields.title")},{default:e.withCtx(()=>[e.createElementVNode("div",$e,[e.createElementVNode("div",ve,[e.createVNode(b,{modelValue:l[s.value].ttl,"onUpdate:modelValue":r[30]||(r[30]=n=>l[s.value].ttl=n),"data-testid":"vault-ttl-input",label:e.unref(a)("form.config.advancedFields.ttl"),"label-attributes":{info:e.unref(a)("form.config.advancedFields.ttlTooltip"),tooltipAttributes:{maxWidth:"400"}},type:"number"},null,8,["modelValue","label","label-attributes"])]),e.createElementVNode("div",Me,[e.createVNode(b,{modelValue:l[s.value].neg_ttl,"onUpdate:modelValue":r[31]||(r[31]=n=>l[s.value].neg_ttl=n),"data-testid":"vault-neg-ttl-input",label:e.unref(a)("form.config.advancedFields.negTtl"),"label-attributes":{info:e.unref(a)("form.config.advancedFields.negTtlTooltip"),tooltipAttributes:{maxWidth:"400"}},type:"number"},null,8,["modelValue","label","label-attributes"])])]),e.createElementVNode("div",Pe,[e.createElementVNode("div",He,[e.createVNode(b,{modelValue:l[s.value].resurrect_ttl,"onUpdate:modelValue":r[32]||(r[32]=n=>l[s.value].resurrect_ttl=n),"data-testid":"vault-resurrect-ttl-input",label:e.unref(a)("form.config.advancedFields.resurrectTtl"),"label-attributes":{info:e.unref(a)("form.config.advancedFields.resurrectTtlTooltip"),tooltipAttributes:{maxWidth:"400"}},type:"number"},null,8,["modelValue","label","label-attributes"])])])]),_:1},8,["trigger-label"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["description","title"]),e.createVNode(e.unref(p.EntityFormSection),{description:e.unref(a)("form.sections.general.description"),title:e.unref(a)("form.sections.general.title")},{default:e.withCtx(()=>[e.createVNode(b,{modelValue:d.fields.prefix,"onUpdate:modelValue":r[33]||(r[33]=n=>d.fields.prefix=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-prefix",help:e.unref(a)("form.fields.prefix.help"),"is-readonly":d.isReadonly,label:e.unref(a)("form.fields.prefix.label"),"label-attributes":{info:e.unref(a)("form.fields.prefix.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(a)("form.fields.prefix.placeholder"),required:"",type:"text"},null,8,["modelValue","help","is-readonly","label","label-attributes","placeholder"]),e.createVNode(te,{modelValue:d.fields.description,"onUpdate:modelValue":r[34]||(r[34]=n=>d.fields.description=n),modelModifiers:{trim:!0},"character-limit":1e3,class:"vault-form-textarea","data-testid":"vault-form-description",label:e.unref(a)("form.fields.description.label"),placeholder:e.unref(a)("form.fields.description.placeholder"),readonly:d.isReadonly},null,8,["modelValue","label","placeholder","readonly"]),e.createVNode(b,{modelValue:d.fields.tags,"onUpdate:modelValue":r[35]||(r[35]=n=>d.fields.tags=n),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"vault-form-tags",help:e.unref(a)("form.fields.tags.help"),"is-readonly":d.isReadonly,label:e.unref(a)("form.fields.tags.label"),placeholder:e.unref(a)("form.fields.tags.placeholder"),type:"text"},null,8,["modelValue","help","is-readonly","label","placeholder"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","enable-terraform","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-f9f68024"]]),Fe={class:"kong-ui-vault-entity-config-card"},De=e.defineComponent({__name:"VaultConfigCard",props:{config:{type:Object,required:!0,validator:o=>!(!o||!["konnect","kongManager"].includes(o==null?void 0:o.app)||o.app==="konnect"&&!o.controlPlaneId||o.app==="kongManager"&&typeof o.workspace!="string"||!o.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1},enableTerraform:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(o){const R=o,f=e.computed(()=>{var a,w;return(w=Q.form[(a=R.config)==null?void 0:a.app])==null?void 0:w.edit}),{i18n:{t:c}}=ae.useI18n(),u=e.ref({id:{},name:{label:c("labels.vault_type")},updated_at:{},created_at:{},prefix:{order:5,section:p.ConfigurationSchemaSection.Basic},description:{order:6,section:p.ConfigurationSchemaSection.Basic},tags:{order:7},config:{order:8,type:p.ConfigurationSchemaType.Json}});return(a,w)=>(e.openBlock(),e.createElementBlock("div",Fe,[e.createVNode(e.unref(p.EntityBaseConfigCard),{config:o.config,"config-card-doc":o.configCardDoc,"config-schema":u.value,"enable-terraform":o.enableTerraform,"entity-type":e.unref(p.SupportedEntityType).Vault,"fetch-url":f.value,"hide-title":o.hideTitle,"onFetch:error":w[0]||(w[0]=E=>a.$emit("fetch:error",E)),"onFetch:success":w[1]||(w[1]=E=>a.$emit("fetch:success",E)),onLoading:w[2]||(w[2]=E=>a.$emit("loading",E))},null,8,["config","config-card-doc","config-schema","enable-terraform","entity-type","fetch-url","hide-title"])]))}}),ne="/v2/control-planes/{controlPlaneId}",le={getVault:{konnect:`${ne}/core-entities/vaults/{id}`},list:{konnect:`${ne}/config-stores/{id}/secrets`},form:{konnect:{create:`${ne}/config-stores/{id}/secrets`,edit:`${ne}/config-stores/{id}/secrets/{secretId}`}}},Oe={class:"table-content-overflow-wrapper"},qe=oe(e.defineComponent({inheritAttrs:!1,__name:"SecretListInner",props:{config:{type:Object,required:!0,validator:o=>!(!o||(o==null?void 0:o.app)!=="konnect"||!o.createRoute||!o.getEditRoute)},configStoreId:{type:String,required:!0},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0}},emits:["error","delete:success"],setup(o,{emit:R}){var X;const f=R,c=o,{i18n:{t:u,formatUnixTimeStamp:a}}=ae.useI18n(),{axiosInstance:w}=p.useAxios((X=c.config)==null?void 0:X.axiosRequestConfig),h={key:{label:u("secrets.list.table_headers.key"),sortable:!1,hidable:!1},updated_at:{label:u("secrets.list.table_headers.updated_at"),sortable:!1}},d=V=>({"data-testid":V.key}),k=e.computed(()=>{var V;return`${c.config.apiBaseUrl}${le.list[c.config.app]}`.replace(/{controlPlaneId}/gi,((V=c.config)==null?void 0:V.controlPlaneId)||"").replace(/{id}/gi,c.configStoreId||"")}),s=e.ref(""),U={isExactMatch:!0,placeholder:u("search.placeholder_for_secrets.konnect")},B=e.ref(1),{fetcher:J,fetcherState:W}=p.useFetcher(c.config,k.value),l=()=>{s.value=""},F=e.ref(null),j=V=>({label:u("actions.edit"),to:c.config.getEditRoute(V)}),$=e.ref(void 0),L=e.ref(!1),D=e.ref(!1),m=e.ref(""),T=p.useDeleteUrlBuilder(c.config,k.value),I=V=>{$.value=V,L.value=!0},M=()=>{L.value=!1},z=async()=>{var V,P,q;if((V=$.value)!=null&&V.key){D.value=!0;try{await w.delete(T($.value.key)),D.value=!1,L.value=!1,B.value++,f("delete:success",$.value)}catch(v){m.value=((q=(P=v.response)==null?void 0:P.data)==null?void 0:q.message)||v.message||u("errors.delete"),f("error",v)}finally{D.value=!1}}},O=e.ref(!1);e.watch(W,V=>{var P,q,v,S;if(Array.isArray((P=V==null?void 0:V.response)==null?void 0:P.data)&&(O.value=V.response.data.length>0),V.status===p.FetcherStatus.Error){F.value={title:u("errors.general")},(S=(v=(q=V.error)==null?void 0:q.response)==null?void 0:v.data)!=null&&S.message&&(F.value.message=V.error.response.data.message),f("error",V.error);return}F.value=null});const Y=e.ref({ctaPath:c.config.createRoute,ctaText:void 0,message:`${u("secrets.list.empty_state.description")}${c.config.additionMessageForEmptyState?` ${c.config.additionMessageForEmptyState}`:""}`,title:u("secrets.title")});return e.onBeforeMount(async()=>{await c.canCreate()&&(Y.value.title=u("secrets.list.empty_state.title"),Y.value.ctaText=u("secrets.list.toolbar_actions.new_secret"))}),(V,P)=>{const q=e.resolveComponent("KButton"),v=e.resolveComponent("KDropdownItem");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(p.EntityBaseTable),{"cache-identifier":o.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":"","empty-state-options":Y.value,"enable-entity-actions":"","error-message":F.value,fetcher:e.unref(J),"fetcher-cache-key":B.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-secrets-list",query:s.value,"row-attributes":d,"table-headers":e.unref(h),onClearSearchInput:l},{"toolbar-filter":e.withCtx(()=>[e.createVNode(e.unref(p.EntityFilter),{modelValue:s.value,"onUpdate:modelValue":P[0]||(P[0]=S=>s.value=S),config:U},null,8,["modelValue"])]),"toolbar-button":e.withCtx(()=>[e.createVNode(e.unref(p.PermissionsWrapper),{"auth-function":()=>o.canCreate()},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(q,{appearance:"primary","data-testid":"toolbar-add-secret",size:"large",to:o.config.createRoute},{default:e.withCtx(()=>[e.createVNode(e.unref(Z.AddIcon)),e.createTextVNode(" "+e.toDisplayString(e.unref(u)("secrets.list.toolbar_actions.new_secret")),1)]),_:1},8,["to"]),[[e.vShow,O.value]])]),_:1},8,["auth-function"])]),key:e.withCtx(({rowValue:S})=>[e.createElementVNode("div",Oe,[e.createElementVNode("b",null,e.toDisplayString(S??"-"),1)])]),updated_at:e.withCtx(({rowValue:S})=>[e.createElementVNode("span",null,e.toDisplayString(S?e.unref(a)(new Date(S).getTime()/1e3):"-"),1)]),actions:e.withCtx(({row:S})=>[e.createVNode(e.unref(p.PermissionsWrapper),{"auth-function":()=>o.canEdit(S)},{default:e.withCtx(()=>[e.createVNode(v,{"data-testid":"action-entity-edit",item:j(S.key)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(p.PermissionsWrapper),{"auth-function":()=>o.canDelete(S)},{default:e.withCtx(()=>[e.createVNode(v,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:G=>I(S)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u)("actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers"]),e.createVNode(e.unref(p.EntityDeleteModal),{"action-pending":D.value,description:e.unref(u)("delete.description"),"entity-name":$.value&&$.value.key,"entity-type":e.unref(p.EntityTypes).Secret,error:m.value,title:e.unref(u)("delete.title_for_secret"),visible:L.value,onCancel:M,onProceed:z},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"])],64)}}}),[["__scopeId","data-v-c5d1b687"]]),We={class:"kong-ui-entities-secrets-list"},je=oe(e.defineComponent({__name:"SecretList",props:{config:{type:Object,required:!0,validator:o=>!(!o||(o==null?void 0:o.app)!=="konnect"||!o.createRoute||!o.getEditRoute)},vaultId:{type:String,required:!0},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0}},emits:["error","delete:success"],setup(o,{emit:R}){var d;const f=R,c=o,u=k=>{f("error",k)},a=k=>{f("delete:success",k)},{axiosInstance:w}=p.useAxios((d=c.config)==null?void 0:d.axiosRequestConfig),E=e.ref(""),h=e.computed(()=>{var k;return`${c.config.apiBaseUrl}${le.getVault[c.config.app]}`.replace(/{controlPlaneId}/gi,((k=c.config)==null?void 0:k.controlPlaneId)||"").replace(/{id}/gi,c.vaultId)});return e.onBeforeMount(async()=>{var k;try{const{data:s}=await w.get(h.value);E.value=(k=s==null?void 0:s.config)==null?void 0:k.config_store_id}catch(s){f("error",s)}}),(k,s)=>(e.openBlock(),e.createElementBlock("div",We,[E.value?(e.openBlock(),e.createBlock(qe,e.mergeProps({key:0},c,{"config-store-id":E.value,"onDelete:success":a,onError:u}),null,16,["config-store-id"])):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-0f9047e6"]]),Le=oe(e.defineComponent({inheritAttrs:!1,__name:"SecretFormInner",props:{config:{type:Object,required:!0,validator:o=>!(!o||o.app!=="konnect"||!o.controlPlaneId||!o.cancelRoute)},configStoreId:{type:String,required:!0},secretId:{type:String,required:!1,default:""},enableTerraform:{type:Boolean,default:!1}},emits:["update","error","loading"],setup(o,{emit:R}){var D;const f=o,c=R,{i18n:{t:u}}=ae.useI18n(),a=ie.useRouter(),{axiosInstance:w}=p.useAxios((D=f.config)==null?void 0:D.axiosRequestConfig),{getMessageFromError:E}=p.useErrors(),h=e.reactive({fields:{key:"",value:""},readonly:!1,errorMessage:""}),d=e.reactive({key:"",value:""}),k=e.computed(()=>{var m,T;return(T=le.form[(m=f.config)==null?void 0:m.app])==null?void 0:T.edit.replace(/{id}/gi,f.configStoreId).replace(/{secretId}/gi,f.secretId)}),s=()=>{var m;a.push(((m=f.config)==null?void 0:m.cancelRoute)||{name:"secret-list"})},U=m=>{c("loading",m)},B=m=>{c("error",m)},J=m=>{var T,I;h.fields.key=((T=m==null?void 0:m.item)==null?void 0:T.key)||(m==null?void 0:m.key)||"",h.fields.value=((I=m==null?void 0:m.item)==null?void 0:I.value)||(m==null?void 0:m.value)||"",Object.assign(d,h.fields)},W=e.computed(()=>f.secretId?p.EntityBaseFormType.Edit:p.EntityBaseFormType.Create),l=e.computed(()=>{var m;return`${f.config.apiBaseUrl}${le.form[f.config.app][W.value]}`.replace(/{controlPlaneId}/gi,((m=f.config)==null?void 0:m.controlPlaneId)||"").replace(/{id}/gi,f.configStoreId).replace(/{secretId}/gi,f.secretId)}),F=e.computed(()=>!!h.fields.key&&!!h.fields.value),j=e.computed(()=>JSON.stringify(h.fields)!==JSON.stringify(d)),$=e.computed(()=>({key:h.fields.key,value:h.fields.value})),L=async()=>{try{h.readonly=!0;let m;W.value==="create"?m=await w.post(l.value,$.value):W.value==="edit"&&(m=await w.put(l.value,$.value)),J(m==null?void 0:m.data),c("update",m==null?void 0:m.data)}catch(m){h.errorMessage=E(m),c("error",m)}finally{h.readonly=!1}};return(m,T)=>{const I=e.resolveComponent("KInput"),M=e.resolveComponent("KTextArea"),z=e.resolveComponent("KAlert");return e.openBlock(),e.createBlock(e.unref(p.EntityBaseForm),{"can-submit":F.value&&j.value,config:o.config,"edit-id":o.secretId,"enable-terraform":o.enableTerraform,"entity-type":e.unref(p.SupportedEntityType).Other,"error-message":h.errorMessage,"fetch-url":k.value,"form-fields":$.value,"is-readonly":h.readonly,onCancel:s,"onFetch:error":B,"onFetch:success":J,onLoading:U,onSubmit:L},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createVNode(e.unref(p.EntityFormSection),{description:e.unref(u)("secrets.form.info.description"),"has-divider":"",title:e.unref(u)("secrets.form.info.title")},{default:e.withCtx(()=>[e.createVNode(I,{modelValue:h.fields.key,"onUpdate:modelValue":T[0]||(T[0]=O=>h.fields.key=O),modelModifiers:{trim:!0},autocomplete:"off",class:"key-field","data-testid":"secret-form-key",disabled:W.value===e.unref(p.EntityBaseFormType).Edit,label:e.unref(u)("secrets.form.fields.key.label"),placeholder:e.unref(u)("secrets.form.fields.key.placeholder"),readonly:h.readonly,required:"",type:"text"},null,8,["modelValue","disabled","label","placeholder","readonly"]),e.createVNode(M,{modelValue:h.fields.value,"onUpdate:modelValue":T[1]||(T[1]=O=>h.fields.value=O),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"secret-form-value",label:e.unref(u)("secrets.form.fields.value.label"),placeholder:e.unref(u)("secrets.form.fields.value.placeholder"),readonly:h.readonly,required:"",resizable:"",type:"text"},null,8,["modelValue","label","placeholder","readonly"]),e.createVNode(z,{appearance:"warning",message:e.unref(u)("secrets.form.hint")},null,8,["message"])]),_:1},8,["description","title"])])]),_:1},8,["can-submit","config","edit-id","enable-terraform","entity-type","error-message","fetch-url","form-fields","is-readonly"])}}}),[["__scopeId","data-v-d6916dd4"]]),ze={class:"kong-ui-entities-secret-form"},Ge=oe(e.defineComponent({__name:"SecretForm",props:{config:{type:Object,required:!0,validator:o=>!(!o||o.app!=="konnect"||!o.controlPlaneId||!o.cancelRoute)},vaultId:{type:String,required:!0},secretId:{type:String,required:!1,default:""},enableTerraform:{type:Boolean,default:!1}},emits:["update","error","loading"],setup(o,{emit:R}){var k;const f=o,c=R,u=s=>{c("update",s)},a=s=>{c("error",s)},w=s=>{c("loading",s)},{axiosInstance:E}=p.useAxios((k=f.config)==null?void 0:k.axiosRequestConfig),h=e.ref(""),d=e.computed(()=>{var s;return`${f.config.apiBaseUrl}${le.getVault[f.config.app]}`.replace(/{controlPlaneId}/gi,((s=f.config)==null?void 0:s.controlPlaneId)||"").replace(/{id}/gi,f.vaultId)});return e.onBeforeMount(async()=>{var s;try{const{data:U}=await E.get(d.value);h.value=(s=U==null?void 0:U.config)==null?void 0:s.config_store_id}catch(U){c("error",U)}}),(s,U)=>(e.openBlock(),e.createElementBlock("div",ze,[h.value?(e.openBlock(),e.createBlock(Le,e.mergeProps({key:0},f,{"config-store-id":h.value,onError:a,onLoading:w,onUpdate:u}),null,16,["config-store-id"])):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-20f3b1b6"]]);A.SecretForm=Ge,A.SecretList=je,A.VaultAuthMethods=N,A.VaultConfigCard=De,A.VaultForm=Ke,A.VaultList=ke,A.VaultProviders=t,A.secretsEndpoints=le,A.vaultsEndpoints=Q,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kong-ui-public/entities-vaults",
3
- "version": "3.12.4",
3
+ "version": "3.13.1",
4
4
  "type": "module",
5
5
  "main": "./dist/entities-vaults.umd.js",
6
6
  "module": "./dist/entities-vaults.es.js",
@@ -27,7 +27,7 @@
27
27
  "vue": ">= 3.3.13 < 4",
28
28
  "vue-router": "^4.3.3",
29
29
  "@kong-ui-public/i18n": "^2.2.2",
30
- "@kong-ui-public/entities-shared": "^3.8.5"
30
+ "@kong-ui-public/entities-shared": "^3.8.6"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@kong/design-tokens": "1.17.2",
@@ -35,8 +35,8 @@
35
35
  "axios": "^1.6.8",
36
36
  "vue": "^3.4.38",
37
37
  "vue-router": "^4.4.3",
38
- "@kong-ui-public/i18n": "^2.2.2",
39
- "@kong-ui-public/entities-shared": "^3.8.5"
38
+ "@kong-ui-public/entities-shared": "^3.8.6",
39
+ "@kong-ui-public/i18n": "^2.2.2"
40
40
  },
41
41
  "repository": {
42
42
  "type": "git",