@kong-ui-public/entities-vaults 4.11.1 → 4.11.2
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as ye, computed as k, ref as D, watch as Ue, onBeforeMount as Ge, resolveComponent as
|
|
1
|
+
import { defineComponent as ye, computed as k, ref as D, watch as Ue, onBeforeMount as Ge, resolveComponent as Y, openBlock as v, createElementBlock as N, createVNode as u, unref as e, createSlots as Ze, withCtx as y, createTextVNode as ve, toDisplayString as O, createElementVNode as G, createBlock as H, Teleport as pt, createCommentVNode as j, reactive as Ee, resolveDynamicComponent as Be, TransitionGroup as mt, Fragment as tt, renderList as _t, mergeProps as at, normalizeClass as vt, nextTick as gt, renderSlot as yt } from "vue";
|
|
2
2
|
import { useRouter as je } from "vue-router";
|
|
3
3
|
import { BookIcon as Le, AddIcon as Ke, SecurityIcon as bt, FolderIcon as ht, ConjourIcon as wt, AzureIcon as Je, HashicorpIcon as Vt, GoogleCloudIcon as kt, AwsIcon as Ct, CodeIcon as At, KongIcon as St } from "@kong/icons";
|
|
4
4
|
import { useAxios as Ce, useTableState as Rt, useFetcher as lt, useDeleteUrlBuilder as ot, FetcherStatus as it, EntityBaseTable as rt, PermissionsWrapper as ke, TableTags as Et, EntityFilter as nt, EntityDeleteModal as st, EntityTypes as dt, useErrors as ut, EntityBaseFormType as ge, useGatewayFeatureSupported as xt, EntityBaseForm as ct, SupportedEntityType as qe, EntityFormSection as Oe, SensitiveInput as Te, useStringHelpers as It, useHelpers as Ut, ConfigurationSchemaType as Ht, ConfigurationSchemaSection as Qe, EntityBaseConfigCard as Tt, ConfigCardItem as Mt, useDebouncedFilter as Ye } from "@kong-ui-public/entities-shared";
|
|
@@ -718,7 +718,7 @@ const ft = {
|
|
|
718
718
|
emits: ["error", "click:learn-more", "copy:success", "copy:error", "delete:success"],
|
|
719
719
|
setup(l, { emit: b }) {
|
|
720
720
|
var W;
|
|
721
|
-
const s = b, d = l, { i18n: { t: p } } = Ae.useI18n(), i = je(), K = k(() => d.config.apiType === "aiGateway"),
|
|
721
|
+
const s = b, d = l, { i18n: { t: p } } = Ae.useI18n(), i = je(), K = k(() => d.config.apiType === "aiGateway"), $ = k(() => K.value ? "aiGateway" : d.config.app), w = (h) => h.replace(/{aiGatewayId}/gi, d.config.aiGatewayId || ""), { axiosInstance: S } = Ce((W = d.config) == null ? void 0 : W.axiosRequestConfig), { hasRecords: I, handleStateChange: x } = Rt(() => Q.value), g = k(() => I.value && d.config.app === "konnect"), n = k(() => d.config.app !== "kongManager" || !!d.config.disableSorting), U = {
|
|
722
722
|
// the Prefix column is non-hidable
|
|
723
723
|
prefix: { label: p("vaults.list.table_headers.prefix"), searchable: !0, sortable: !0, hidable: !1 },
|
|
724
724
|
// it's "Vault Type" on display, but we still use "name" to fit API schema
|
|
@@ -737,9 +737,9 @@ const ft = {
|
|
|
737
737
|
return U;
|
|
738
738
|
}), oe = k(() => {
|
|
739
739
|
var E, F;
|
|
740
|
-
let h = `${d.config.apiBaseUrl}${fe.list[
|
|
740
|
+
let h = `${d.config.apiBaseUrl}${fe.list[$.value].getAll}`;
|
|
741
741
|
return d.config.app === "konnect" && (h = h.replace(/{controlPlaneId}/gi, ((E = d.config) == null ? void 0 : E.controlPlaneId) || "")), w(h).replace(/\/{workspace}/gi, (F = d.config) != null && F.workspace ? `/${d.config.workspace}` : "");
|
|
742
|
-
}),
|
|
742
|
+
}), Q = D(""), ne = k(() => {
|
|
743
743
|
if (d.config.app === "konnect" || d.config.isExactMatch)
|
|
744
744
|
return {
|
|
745
745
|
isExactMatch: !0,
|
|
@@ -753,14 +753,14 @@ const ft = {
|
|
|
753
753
|
};
|
|
754
754
|
}), {
|
|
755
755
|
fetcher: pe,
|
|
756
|
-
fetcherState:
|
|
756
|
+
fetcherState: T,
|
|
757
757
|
fetcherCacheKey: a
|
|
758
758
|
} = lt(k(() => ({ ...d.config, cacheIdentifier: d.cacheIdentifier })), oe), se = K.value ? async (h) => {
|
|
759
759
|
const E = await pe(h);
|
|
760
760
|
return { ...E, data: (E.data ?? []).map(He) };
|
|
761
761
|
} : pe, V = () => {
|
|
762
|
-
|
|
763
|
-
},
|
|
762
|
+
Q.value = "";
|
|
763
|
+
}, L = () => {
|
|
764
764
|
a.value++;
|
|
765
765
|
}, ie = D(null), me = async (h, E) => {
|
|
766
766
|
const F = h.id;
|
|
@@ -790,7 +790,7 @@ const ft = {
|
|
|
790
790
|
entity: h,
|
|
791
791
|
message: p("copy.success_brief")
|
|
792
792
|
});
|
|
793
|
-
},
|
|
793
|
+
}, J = async (h) => {
|
|
794
794
|
var F;
|
|
795
795
|
await ((F = d.canRetrieve) == null ? void 0 : F.call(d, h)) && i.push(d.config.getViewRoute(h.id));
|
|
796
796
|
}, be = (h) => ({
|
|
@@ -799,8 +799,8 @@ const ft = {
|
|
|
799
799
|
}), q = (h) => ({
|
|
800
800
|
label: p("actions.edit"),
|
|
801
801
|
to: d.config.getEditRoute(h)
|
|
802
|
-
}),
|
|
803
|
-
|
|
802
|
+
}), M = D(void 0), le = D(!1), X = D(!1), ee = D(""), we = ot(d.config, oe.value), Se = (h) => {
|
|
803
|
+
M.value = h, le.value = !0;
|
|
804
804
|
}, C = () => {
|
|
805
805
|
le.value = !1;
|
|
806
806
|
}, A = async (h) => {
|
|
@@ -812,10 +812,10 @@ const ft = {
|
|
|
812
812
|
}
|
|
813
813
|
}, P = async () => {
|
|
814
814
|
var h, E, F, de;
|
|
815
|
-
if ((h =
|
|
815
|
+
if ((h = M.value) != null && h.id) {
|
|
816
816
|
X.value = !0;
|
|
817
817
|
try {
|
|
818
|
-
await S.delete(we(
|
|
818
|
+
await S.delete(we(M.value.id)), d.config.app === "konnect" && ((E = M.value.config) != null && E.config_store_id) && A(M.value.config.config_store_id), X.value = !1, le.value = !1, a.value++, s("delete:success", M.value);
|
|
819
819
|
} catch (c) {
|
|
820
820
|
ee.value = ((de = (F = c.response) == null ? void 0 : F.data) == null ? void 0 : de.message) || c.message || p("errors.delete"), s("error", c);
|
|
821
821
|
} finally {
|
|
@@ -825,7 +825,7 @@ const ft = {
|
|
|
825
825
|
}, z = () => {
|
|
826
826
|
i.push(d.config.createRoute);
|
|
827
827
|
};
|
|
828
|
-
Ue(
|
|
828
|
+
Ue(T, (h) => {
|
|
829
829
|
var E, F, de;
|
|
830
830
|
if (h.status === it.Error) {
|
|
831
831
|
ie.value = {
|
|
@@ -844,7 +844,7 @@ const ft = {
|
|
|
844
844
|
return Ge(async () => {
|
|
845
845
|
Z.value = await d.canCreate(), Z.value && (te.value.title = p("vaults.list.empty_state.title"), te.value.ctaText = p("actions.create"));
|
|
846
846
|
}), (h, E) => {
|
|
847
|
-
const F =
|
|
847
|
+
const F = Y("KButton"), de = Y("KEmptyState"), c = Y("KDropdownItem"), o = Y("KClipboardProvider");
|
|
848
848
|
return v(), N("div", ea, [
|
|
849
849
|
u(e(rt), {
|
|
850
850
|
"cache-identifier": l.cacheIdentifier,
|
|
@@ -856,17 +856,17 @@ const ft = {
|
|
|
856
856
|
"fetcher-cache-key": e(a),
|
|
857
857
|
"pagination-type": "offset",
|
|
858
858
|
"preferences-storage-key": "kong-ui-entities-vaults-list",
|
|
859
|
-
query:
|
|
859
|
+
query: Q.value,
|
|
860
860
|
"table-headers": f.value,
|
|
861
861
|
onClearSearchInput: V,
|
|
862
|
-
"onClick:row": E[3] || (E[3] = (R) =>
|
|
863
|
-
onSort:
|
|
862
|
+
"onClick:row": E[3] || (E[3] = (R) => J(R)),
|
|
863
|
+
onSort: L,
|
|
864
864
|
onState: e(x)
|
|
865
865
|
}, Ze({
|
|
866
866
|
"toolbar-filter": y(() => [
|
|
867
867
|
u(e(nt), {
|
|
868
|
-
modelValue:
|
|
869
|
-
"onUpdate:modelValue": E[0] || (E[0] = (R) =>
|
|
868
|
+
modelValue: Q.value,
|
|
869
|
+
"onUpdate:modelValue": E[0] || (E[0] = (R) => Q.value = R),
|
|
870
870
|
config: ne.value
|
|
871
871
|
}, null, 8, ["modelValue", "config"])
|
|
872
872
|
]),
|
|
@@ -875,7 +875,7 @@ const ft = {
|
|
|
875
875
|
disabled: !l.useActionOutside,
|
|
876
876
|
to: "#kong-ui-app-page-header-action-button"
|
|
877
877
|
}, [
|
|
878
|
-
|
|
878
|
+
G("div", ta, [
|
|
879
879
|
g.value ? (v(), H(F, {
|
|
880
880
|
key: 0,
|
|
881
881
|
appearance: "secondary",
|
|
@@ -912,15 +912,15 @@ const ft = {
|
|
|
912
912
|
], 8, ["disabled"]))
|
|
913
913
|
]),
|
|
914
914
|
prefix: y(({ rowValue: R }) => [
|
|
915
|
-
|
|
916
|
-
|
|
915
|
+
G("div", aa, [
|
|
916
|
+
G("b", null, O(R ?? "-"), 1)
|
|
917
917
|
])
|
|
918
918
|
]),
|
|
919
919
|
name: y(({ rowValue: R }) => [
|
|
920
|
-
|
|
920
|
+
G("b", null, O(R ?? "-"), 1)
|
|
921
921
|
]),
|
|
922
922
|
description: y(({ rowValue: R }) => [
|
|
923
|
-
|
|
923
|
+
G("div", la, O(R ?? "-"), 1)
|
|
924
924
|
]),
|
|
925
925
|
tags: y(({ rowValue: R }) => [
|
|
926
926
|
u(e(Et), { tags: R }, null, 8, ["tags"])
|
|
@@ -998,7 +998,7 @@ const ft = {
|
|
|
998
998
|
]),
|
|
999
999
|
_: 2
|
|
1000
1000
|
}, [
|
|
1001
|
-
!
|
|
1001
|
+
!Q.value && l.config.app === "konnect" ? {
|
|
1002
1002
|
name: "empty-state",
|
|
1003
1003
|
fn: y(() => {
|
|
1004
1004
|
var R;
|
|
@@ -1054,7 +1054,7 @@ const ft = {
|
|
|
1054
1054
|
u(e(st), {
|
|
1055
1055
|
"action-pending": X.value,
|
|
1056
1056
|
description: e(p)("delete.description"),
|
|
1057
|
-
"entity-name":
|
|
1057
|
+
"entity-name": M.value && (M.value.prefix || M.value.id),
|
|
1058
1058
|
"entity-type": e(dt).Vault,
|
|
1059
1059
|
error: ee.value,
|
|
1060
1060
|
title: e(p)("delete.title"),
|
|
@@ -1122,7 +1122,7 @@ const ft = {
|
|
|
1122
1122
|
emits: ["update", "error", "loading"],
|
|
1123
1123
|
setup(l, { emit: b }) {
|
|
1124
1124
|
var de;
|
|
1125
|
-
const s = l, d = b, { i18nT: p, i18n: { t: i } } = Ae.useI18n(), K = je(), { axiosInstance:
|
|
1125
|
+
const s = l, d = b, { i18nT: p, i18n: { t: i } } = Ae.useI18n(), K = je(), { axiosInstance: $ } = Ce((de = s.config) == null ? void 0 : de.axiosRequestConfig), { getMessageFromError: w } = ut(), S = k(() => s.config.apiType === "aiGateway"), I = k(() => S.value ? "aiGateway" : s.config.app), x = (c) => c.replace(/{aiGatewayId}/gi, s.config.aiGatewayId || ""), g = S.value ? "https" : "http", n = Ee({
|
|
1126
1126
|
fields: {
|
|
1127
1127
|
prefix: "",
|
|
1128
1128
|
description: "",
|
|
@@ -1134,7 +1134,7 @@ const ft = {
|
|
|
1134
1134
|
prefix: "",
|
|
1135
1135
|
description: "",
|
|
1136
1136
|
tags: ""
|
|
1137
|
-
}), f = D(s.config.app === "konnect" ? t.KONNECT : t.ENV), oe = D(null),
|
|
1137
|
+
}), f = D(s.config.app === "konnect" ? t.KONNECT : t.ENV), oe = D(null), Q = D(), ne = k(() => [t.AWS, t.GCP, t.HCV, t.AZURE, t.CONJUR, t.FS, t.AZURE_CERTS].includes(f.value)), pe = k(() => S.value ? [
|
|
1138
1138
|
{ label: i("form.config.konnect.label"), value: t.KONNECT },
|
|
1139
1139
|
{ label: i("form.config.env.label"), value: t.ENV },
|
|
1140
1140
|
{ label: i("form.config.aws.label"), value: t.AWS },
|
|
@@ -1154,54 +1154,54 @@ const ft = {
|
|
|
1154
1154
|
{
|
|
1155
1155
|
label: i("form.config.aws.label"),
|
|
1156
1156
|
value: t.AWS,
|
|
1157
|
-
disabled: !
|
|
1157
|
+
disabled: !M.value
|
|
1158
1158
|
},
|
|
1159
1159
|
{
|
|
1160
1160
|
label: i("form.config.gcp.label"),
|
|
1161
1161
|
value: t.GCP,
|
|
1162
|
-
disabled: !
|
|
1162
|
+
disabled: !M.value
|
|
1163
1163
|
},
|
|
1164
1164
|
{
|
|
1165
1165
|
label: i("form.config.hcv.label"),
|
|
1166
1166
|
value: t.HCV,
|
|
1167
|
-
disabled: !
|
|
1167
|
+
disabled: !M.value
|
|
1168
1168
|
},
|
|
1169
1169
|
...s.config.azureVaultProviderAvailable ? [{
|
|
1170
1170
|
label: i("form.config.azure.label"),
|
|
1171
1171
|
value: t.AZURE,
|
|
1172
|
-
disabled: !
|
|
1172
|
+
disabled: !M.value
|
|
1173
1173
|
}] : [],
|
|
1174
1174
|
...s.config.conjurVaultProviderAvailable ? [{
|
|
1175
1175
|
label: i("form.config.conjur.label"),
|
|
1176
1176
|
value: t.CONJUR,
|
|
1177
|
-
disabled: !
|
|
1177
|
+
disabled: !M.value
|
|
1178
1178
|
}] : [],
|
|
1179
1179
|
...s.config.fsVaultProviderAvailable ? [{
|
|
1180
1180
|
label: i("form.config.fs.label"),
|
|
1181
1181
|
value: t.FS,
|
|
1182
|
-
disabled: !
|
|
1182
|
+
disabled: !M.value
|
|
1183
1183
|
}] : [],
|
|
1184
1184
|
...s.config.azureCertsVaultProviderAvailable ? [{
|
|
1185
1185
|
label: i("form.config.azure-certs.label"),
|
|
1186
1186
|
value: t.AZURE_CERTS,
|
|
1187
|
-
disabled: !
|
|
1187
|
+
disabled: !M.value
|
|
1188
1188
|
}] : []
|
|
1189
|
-
]),
|
|
1189
|
+
]), T = s.config.base64FieldAvailable ? { base64_decode: !1 } : {}, a = Ee({
|
|
1190
1190
|
[t.KONNECT]: {},
|
|
1191
1191
|
[t.ENV]: {
|
|
1192
1192
|
prefix: "",
|
|
1193
|
-
|
|
1193
|
+
...T
|
|
1194
1194
|
},
|
|
1195
1195
|
[t.AWS]: {
|
|
1196
1196
|
region: "",
|
|
1197
1197
|
endpoint_url: "",
|
|
1198
1198
|
assume_role_arn: "",
|
|
1199
1199
|
role_session_name: "KongVault",
|
|
1200
|
-
|
|
1200
|
+
...T
|
|
1201
1201
|
},
|
|
1202
1202
|
[t.GCP]: {
|
|
1203
1203
|
project_id: "",
|
|
1204
|
-
|
|
1204
|
+
...T
|
|
1205
1205
|
},
|
|
1206
1206
|
[t.HCV]: {
|
|
1207
1207
|
protocol: g,
|
|
@@ -1244,7 +1244,7 @@ const ft = {
|
|
|
1244
1244
|
jwt_role: "",
|
|
1245
1245
|
oauth2_token_endpoint: "",
|
|
1246
1246
|
oauth2_audiences: "",
|
|
1247
|
-
|
|
1247
|
+
...T
|
|
1248
1248
|
},
|
|
1249
1249
|
[t.AZURE]: {
|
|
1250
1250
|
location: "",
|
|
@@ -1253,7 +1253,7 @@ const ft = {
|
|
|
1253
1253
|
credentials_prefix: "AZURE",
|
|
1254
1254
|
client_id: "",
|
|
1255
1255
|
tenant_id: "",
|
|
1256
|
-
|
|
1256
|
+
...T
|
|
1257
1257
|
},
|
|
1258
1258
|
[t.AZURE_CERTS]: {
|
|
1259
1259
|
vault_uri: "",
|
|
@@ -1265,28 +1265,28 @@ const ft = {
|
|
|
1265
1265
|
[t.CONJUR]: {
|
|
1266
1266
|
endpoint_url: "",
|
|
1267
1267
|
auth_method: "api_key",
|
|
1268
|
-
|
|
1268
|
+
...T
|
|
1269
1269
|
},
|
|
1270
1270
|
[t.FS]: {
|
|
1271
1271
|
prefix: "",
|
|
1272
|
-
|
|
1272
|
+
...T
|
|
1273
1273
|
}
|
|
1274
1274
|
}), se = Ee({
|
|
1275
1275
|
[t.KONNECT]: {},
|
|
1276
1276
|
[t.ENV]: {
|
|
1277
1277
|
prefix: "",
|
|
1278
|
-
|
|
1278
|
+
...T
|
|
1279
1279
|
},
|
|
1280
1280
|
[t.AWS]: {
|
|
1281
1281
|
region: "",
|
|
1282
1282
|
endpoint_url: "",
|
|
1283
1283
|
assume_role_arn: "",
|
|
1284
1284
|
role_session_name: "KongVault",
|
|
1285
|
-
|
|
1285
|
+
...T
|
|
1286
1286
|
},
|
|
1287
1287
|
[t.GCP]: {
|
|
1288
1288
|
project_id: "",
|
|
1289
|
-
|
|
1289
|
+
...T
|
|
1290
1290
|
},
|
|
1291
1291
|
[t.HCV]: {
|
|
1292
1292
|
protocol: g,
|
|
@@ -1329,7 +1329,7 @@ const ft = {
|
|
|
1329
1329
|
jwt_role: "",
|
|
1330
1330
|
oauth2_token_endpoint: "",
|
|
1331
1331
|
oauth2_audiences: "",
|
|
1332
|
-
|
|
1332
|
+
...T
|
|
1333
1333
|
},
|
|
1334
1334
|
[t.AZURE]: {
|
|
1335
1335
|
location: "",
|
|
@@ -1338,7 +1338,7 @@ const ft = {
|
|
|
1338
1338
|
credentials_prefix: "AZURE",
|
|
1339
1339
|
client_id: "",
|
|
1340
1340
|
tenant_id: "",
|
|
1341
|
-
|
|
1341
|
+
...T
|
|
1342
1342
|
},
|
|
1343
1343
|
[t.AZURE_CERTS]: {
|
|
1344
1344
|
vault_uri: "",
|
|
@@ -1350,11 +1350,11 @@ const ft = {
|
|
|
1350
1350
|
[t.CONJUR]: {
|
|
1351
1351
|
endpoint_url: "",
|
|
1352
1352
|
auth_method: "api_key",
|
|
1353
|
-
|
|
1353
|
+
...T
|
|
1354
1354
|
},
|
|
1355
1355
|
[t.FS]: {
|
|
1356
1356
|
prefix: "",
|
|
1357
|
-
|
|
1357
|
+
...T
|
|
1358
1358
|
}
|
|
1359
1359
|
}), V = [
|
|
1360
1360
|
{ label: `${i("form.config.aws.fields.region.locations.us-east-1.location")} (us-east-1)`, value: "us-east-1" },
|
|
@@ -1381,10 +1381,10 @@ const ft = {
|
|
|
1381
1381
|
{ label: `${i("form.config.aws.fields.region.locations.sa-east-1.location")} (sa-east-1)`, value: "sa-east-1" },
|
|
1382
1382
|
{ label: `${i("form.config.aws.fields.region.locations.us-gov-east-1.location")} (us-gov-east-1)`, value: "us-gov-east-1" },
|
|
1383
1383
|
{ label: `${i("form.config.aws.fields.region.locations.us-gov-west-1.location")} (us-gov-west-1)`, value: "us-gov-west-1" }
|
|
1384
|
-
],
|
|
1384
|
+
], L = [{ label: "secrets", value: "secrets" }], ie = [{ label: "http", value: "http" }, { label: "https", value: "https" }], me = [{ label: "v1", value: "v1" }, { label: "v2", value: "v2" }], re = k(() => s.vaultId ? ge.Edit : ge.Create), J = k(() => re.value === ge.Edit ? "edit" : "create"), be = k(() => {
|
|
1385
1385
|
var c;
|
|
1386
1386
|
return x((c = fe.form[I.value]) == null ? void 0 : c.edit);
|
|
1387
|
-
}), q = k(() => re.value === ge.Edit && (s.config.app === "kongManager" || S.value)),
|
|
1387
|
+
}), q = k(() => re.value === ge.Edit && (s.config.app === "kongManager" || S.value)), M = k(() => s.config.app === "konnect" || xt({
|
|
1388
1388
|
gatewayInfo: s.config.gatewayInfo,
|
|
1389
1389
|
// vault name can only be `env` in Gateway Community Edition
|
|
1390
1390
|
supportedRange: {
|
|
@@ -1446,7 +1446,7 @@ const ft = {
|
|
|
1446
1446
|
const R = ((_e = o == null ? void 0 : o.item) == null ? void 0 : _e.tags) || (o == null ? void 0 : o.tags) || [];
|
|
1447
1447
|
n.fields.tags = (R == null ? void 0 : R.join(", ")) || "", Object.assign(U, n.fields);
|
|
1448
1448
|
const B = ((Ve = o == null ? void 0 : o.item) == null ? void 0 : Ve.config) || (o == null ? void 0 : o.config) || null;
|
|
1449
|
-
B && (Object.keys(B).length || (o == null ? void 0 : o.name) === t.KONNECT) ? (f.value = ((r = o == null ? void 0 : o.item) == null ? void 0 : r.name) || (o == null ? void 0 : o.name) || "", oe.value = f.value,
|
|
1449
|
+
B && (Object.keys(B).length || (o == null ? void 0 : o.name) === t.KONNECT) ? (f.value = ((r = o == null ? void 0 : o.item) == null ? void 0 : r.name) || (o == null ? void 0 : o.name) || "", oe.value = f.value, Q.value = ((xe = o == null ? void 0 : o.config) == null ? void 0 : xe.config_store_id) || void 0, Object.assign(a[f.value], B), Object.assign(se[f.value], B)) : n.errorMessage = "Error loading vault config";
|
|
1450
1450
|
}, A = (c) => c === "" || c == null, P = k(() => f.value === t.HCV ? !Object.keys(a[t.HCV]).filter((c) => [
|
|
1451
1451
|
"namespace",
|
|
1452
1452
|
"ttl",
|
|
@@ -1583,13 +1583,13 @@ const ft = {
|
|
|
1583
1583
|
...W.value,
|
|
1584
1584
|
config: {
|
|
1585
1585
|
...W.value.config,
|
|
1586
|
-
config_store_id:
|
|
1586
|
+
config_store_id: Q.value
|
|
1587
1587
|
}
|
|
1588
1588
|
})), E = async () => {
|
|
1589
1589
|
var c, o;
|
|
1590
1590
|
try {
|
|
1591
1591
|
n.isReadonly = !0;
|
|
1592
|
-
const R = x(`${s.config.apiBaseUrl}${fe.form[S.value ? "aiGateway" : "konnect"].createConfigStore}`).replace(/{controlPlaneId}/gi, ((c = s.config) == null ? void 0 : c.controlPlaneId) || "").replace(/\/{workspace}/gi, (o = s.config) != null && o.workspace ? `/${s.config.workspace}` : ""), B = S.value ? { name: n.fields.prefix } : void 0, m = await
|
|
1592
|
+
const R = x(`${s.config.apiBaseUrl}${fe.form[S.value ? "aiGateway" : "konnect"].createConfigStore}`).replace(/{controlPlaneId}/gi, ((c = s.config) == null ? void 0 : c.controlPlaneId) || "").replace(/\/{workspace}/gi, (o = s.config) != null && o.workspace ? `/${s.config.workspace}` : ""), B = S.value ? { name: n.fields.prefix } : void 0, m = await $.post(R, B);
|
|
1593
1593
|
return m == null ? void 0 : m.data.id;
|
|
1594
1594
|
} catch (R) {
|
|
1595
1595
|
n.errorMessage = w(R), d("error", R);
|
|
@@ -1601,7 +1601,7 @@ const ft = {
|
|
|
1601
1601
|
try {
|
|
1602
1602
|
n.isReadonly = !0;
|
|
1603
1603
|
let o;
|
|
1604
|
-
re.value === "create" ? f.value === t.KONNECT ? (
|
|
1604
|
+
re.value === "create" ? f.value === t.KONNECT ? (Q.value = await E(), o = await $.post(Z.value, h.value)) : o = await $.post(Z.value, W.value) : re.value === "edit" && (f.value === t.KONNECT && !Q.value ? (Q.value = await E(), o = await $.put(Z.value, h.value)) : o = ((c = s.config) == null ? void 0 : c.app) === "konnect" ? await $.put(Z.value, h.value) : await $.patch(Z.value, W.value)), C(o == null ? void 0 : o.data), d("update", o == null ? void 0 : o.data);
|
|
1605
1605
|
} catch (o) {
|
|
1606
1606
|
n.errorMessage = w(o), d("error", o);
|
|
1607
1607
|
} finally {
|
|
@@ -1609,7 +1609,7 @@ const ft = {
|
|
|
1609
1609
|
}
|
|
1610
1610
|
};
|
|
1611
1611
|
return (c, o) => {
|
|
1612
|
-
const R =
|
|
1612
|
+
const R = Y("KTooltip"), B = Y("KSelect"), m = Y("KInput"), ae = Y("KCheckbox"), _e = Y("KTextArea"), Ve = Y("KCollapse");
|
|
1613
1613
|
return v(), N("div", ia, [
|
|
1614
1614
|
u(e(ct), {
|
|
1615
1615
|
"can-submit": z.value && te.value,
|
|
@@ -1633,7 +1633,7 @@ const ft = {
|
|
|
1633
1633
|
title: e(i)("form.sections.config.title")
|
|
1634
1634
|
}, {
|
|
1635
1635
|
default: y(() => [
|
|
1636
|
-
|
|
1636
|
+
G("div", ra, [
|
|
1637
1637
|
u(B, {
|
|
1638
1638
|
modelValue: f.value,
|
|
1639
1639
|
"onUpdate:modelValue": o[0] || (o[0] = (r) => f.value = r),
|
|
@@ -1645,7 +1645,7 @@ const ft = {
|
|
|
1645
1645
|
}, {
|
|
1646
1646
|
"selected-item-template": y(({ item: r }) => [
|
|
1647
1647
|
(v(), H(Be(we(r.value)))),
|
|
1648
|
-
|
|
1648
|
+
G("span", null, O(r == null ? void 0 : r.label), 1)
|
|
1649
1649
|
]),
|
|
1650
1650
|
"item-template": y(({ item: r }) => [
|
|
1651
1651
|
u(R, {
|
|
@@ -1653,14 +1653,14 @@ const ft = {
|
|
|
1653
1653
|
text: r.disabled ? e(i)("form.unavailable") : ""
|
|
1654
1654
|
}, {
|
|
1655
1655
|
default: y(() => [
|
|
1656
|
-
|
|
1656
|
+
G("div", {
|
|
1657
1657
|
class: "provider-item",
|
|
1658
1658
|
"data-testid": `vault-form-provider-${r.value}`
|
|
1659
1659
|
}, [
|
|
1660
1660
|
(v(), H(Be(we(r.value)))),
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1661
|
+
G("div", sa, [
|
|
1662
|
+
G("span", da, O(r == null ? void 0 : r.label), 1),
|
|
1663
|
+
G("span", ua, O(Se(r.value)), 1)
|
|
1664
1664
|
])
|
|
1665
1665
|
], 8, na)
|
|
1666
1666
|
]),
|
|
@@ -1811,7 +1811,7 @@ const ft = {
|
|
|
1811
1811
|
scope: "global"
|
|
1812
1812
|
}, {
|
|
1813
1813
|
"italic-text": y(() => [
|
|
1814
|
-
|
|
1814
|
+
G("em", null, O(e(i)("form.config.gcp.fields.project_id.tooltip.italicText")), 1)
|
|
1815
1815
|
]),
|
|
1816
1816
|
_: 1
|
|
1817
1817
|
})
|
|
@@ -1936,9 +1936,9 @@ const ft = {
|
|
|
1936
1936
|
"onUpdate:modelValue": o[20] || (o[20] = (r) => a[e(t).HCV].token = r),
|
|
1937
1937
|
"data-testid": "vault-form-config-hcv-token",
|
|
1938
1938
|
label: e(i)("form.config.hcv.fields.token.label"),
|
|
1939
|
-
mode:
|
|
1939
|
+
mode: J.value,
|
|
1940
1940
|
readonly: n.isReadonly,
|
|
1941
|
-
required:
|
|
1941
|
+
required: J.value === "create"
|
|
1942
1942
|
}, null, 8, ["modelValue", "label", "mode", "readonly", "required"])) : (v(), H(m, {
|
|
1943
1943
|
key: 0,
|
|
1944
1944
|
modelValue: a[e(t).HCV].token,
|
|
@@ -2035,7 +2035,7 @@ const ft = {
|
|
|
2035
2035
|
"onUpdate:modelValue": o[29] || (o[29] = (r) => a[e(t).HCV].aws_secret_access_key = r),
|
|
2036
2036
|
"data-testid": "vault-form-config-hcv-aws_secret_access_key",
|
|
2037
2037
|
label: e(i)("form.config.hcv.fields.aws_secret_access_key.label"),
|
|
2038
|
-
mode:
|
|
2038
|
+
mode: J.value,
|
|
2039
2039
|
readonly: n.isReadonly
|
|
2040
2040
|
}, null, 8, ["modelValue", "label", "mode", "readonly"])) : (v(), H(m, {
|
|
2041
2041
|
key: 0,
|
|
@@ -2297,9 +2297,9 @@ const ft = {
|
|
|
2297
2297
|
"onUpdate:modelValue": o[54] || (o[54] = (r) => a[e(t).HCV].oauth2_client_secret = r),
|
|
2298
2298
|
"data-testid": "vault-form-config-hcv-oauth2_client_secret",
|
|
2299
2299
|
label: e(i)("form.config.hcv.fields.oauth2_client_secret.label"),
|
|
2300
|
-
mode:
|
|
2300
|
+
mode: J.value,
|
|
2301
2301
|
readonly: n.isReadonly,
|
|
2302
|
-
required:
|
|
2302
|
+
required: J.value === "create"
|
|
2303
2303
|
}, null, 8, ["modelValue", "label", "mode", "readonly", "required"])) : (v(), H(m, {
|
|
2304
2304
|
key: 0,
|
|
2305
2305
|
modelValue: a[e(t).HCV].oauth2_client_secret,
|
|
@@ -2405,7 +2405,7 @@ const ft = {
|
|
|
2405
2405
|
modelValue: a[e(t).AZURE].type,
|
|
2406
2406
|
"onUpdate:modelValue": o[62] || (o[62] = (r) => a[e(t).AZURE].type = r),
|
|
2407
2407
|
"data-testid": "vault-form-config-azure-type",
|
|
2408
|
-
items:
|
|
2408
|
+
items: L,
|
|
2409
2409
|
label: e(i)("form.config.azure.fields.type.label"),
|
|
2410
2410
|
placeholder: e(i)("form.config.azure.fields.type.placeholder"),
|
|
2411
2411
|
readonly: n.isReadonly,
|
|
@@ -2551,9 +2551,9 @@ const ft = {
|
|
|
2551
2551
|
info: e(i)("form.config.conjur.fields.api_key.tooltip"),
|
|
2552
2552
|
tooltipAttributes: { maxWidth: "400" }
|
|
2553
2553
|
},
|
|
2554
|
-
mode:
|
|
2554
|
+
mode: J.value,
|
|
2555
2555
|
readonly: n.isReadonly,
|
|
2556
|
-
required:
|
|
2556
|
+
required: J.value === "create"
|
|
2557
2557
|
}, null, 8, ["modelValue", "label", "label-attributes", "mode", "readonly", "required"])) : (v(), H(m, {
|
|
2558
2558
|
key: 0,
|
|
2559
2559
|
modelValue: a[e(t).CONJUR].api_key,
|
|
@@ -2625,8 +2625,8 @@ const ft = {
|
|
|
2625
2625
|
"trigger-label": e(i)("form.config.advancedFields.title")
|
|
2626
2626
|
}, {
|
|
2627
2627
|
default: y(() => [
|
|
2628
|
-
|
|
2629
|
-
|
|
2628
|
+
G("div", ka, [
|
|
2629
|
+
G("div", Ca, [
|
|
2630
2630
|
u(m, {
|
|
2631
2631
|
modelValue: a[f.value].ttl,
|
|
2632
2632
|
"onUpdate:modelValue": o[78] || (o[78] = (r) => a[f.value].ttl = r),
|
|
@@ -2639,7 +2639,7 @@ const ft = {
|
|
|
2639
2639
|
type: "number"
|
|
2640
2640
|
}, null, 8, ["modelValue", "label", "label-attributes"])
|
|
2641
2641
|
]),
|
|
2642
|
-
|
|
2642
|
+
G("div", Aa, [
|
|
2643
2643
|
u(m, {
|
|
2644
2644
|
modelValue: a[f.value].neg_ttl,
|
|
2645
2645
|
"onUpdate:modelValue": o[79] || (o[79] = (r) => a[f.value].neg_ttl = r),
|
|
@@ -2653,8 +2653,8 @@ const ft = {
|
|
|
2653
2653
|
}, null, 8, ["modelValue", "label", "label-attributes"])
|
|
2654
2654
|
])
|
|
2655
2655
|
]),
|
|
2656
|
-
|
|
2657
|
-
|
|
2656
|
+
G("div", Sa, [
|
|
2657
|
+
G("div", Ra, [
|
|
2658
2658
|
u(m, {
|
|
2659
2659
|
modelValue: a[f.value].resurrect_ttl,
|
|
2660
2660
|
"onUpdate:modelValue": o[80] || (o[80] = (r) => a[f.value].resurrect_ttl = r),
|
|
@@ -2764,7 +2764,7 @@ const ft = {
|
|
|
2764
2764
|
var n, U, f;
|
|
2765
2765
|
const g = d.value ? (n = fe.form.aiGateway) == null ? void 0 : n.edit : (f = fe.form[(U = b.config) == null ? void 0 : U.app]) == null ? void 0 : f.edit;
|
|
2766
2766
|
return g == null ? void 0 : g.replace(/{aiGatewayId}/gi, b.config.aiGatewayId || "");
|
|
2767
|
-
}), i = (g) => d.value ? He(g) : g, { i18n: { t: K } } = Ae.useI18n(), { convertKeyToTitle:
|
|
2767
|
+
}), i = (g) => d.value ? He(g) : g, { i18n: { t: K } } = Ae.useI18n(), { convertKeyToTitle: $ } = It(), { getPropValue: w } = Ut(), S = k(() => ({
|
|
2768
2768
|
id: {},
|
|
2769
2769
|
name: {
|
|
2770
2770
|
label: K(d.value ? "labels.vault_type_ai_gateway" : "labels.vault_type")
|
|
@@ -2803,7 +2803,7 @@ const ft = {
|
|
|
2803
2803
|
return U;
|
|
2804
2804
|
}, x = (g) => {
|
|
2805
2805
|
var n, U;
|
|
2806
|
-
return ((U = (n = S.value) == null ? void 0 : n[g]) == null ? void 0 : U.label) ||
|
|
2806
|
+
return ((U = (n = S.value) == null ? void 0 : n[g]) == null ? void 0 : U.label) || $(g);
|
|
2807
2807
|
};
|
|
2808
2808
|
return (g, n) => (v(), N("div", xa, [
|
|
2809
2809
|
u(e(Tt), {
|
|
@@ -2902,8 +2902,8 @@ const ft = {
|
|
|
2902
2902
|
}, S = (q) => ({
|
|
2903
2903
|
"data-testid": q.key
|
|
2904
2904
|
}), I = k(() => d.config.apiType === "aiGateway" ? ce.list.aiGateway : ce.list[d.config.app]), x = k(() => {
|
|
2905
|
-
var q,
|
|
2906
|
-
return `${d.config.apiBaseUrl}${I.value}`.replace(/{aiGatewayId}/gi, d.config.aiGatewayId || "").replace(/{controlPlaneId}/gi, ((q = d.config) == null ? void 0 : q.controlPlaneId) || "").replace(/\/{workspace}/gi, (
|
|
2905
|
+
var q, M;
|
|
2906
|
+
return `${d.config.apiBaseUrl}${I.value}`.replace(/{aiGatewayId}/gi, d.config.aiGatewayId || "").replace(/{controlPlaneId}/gi, ((q = d.config) == null ? void 0 : q.controlPlaneId) || "").replace(/\/{workspace}/gi, (M = d.config) != null && M.workspace ? `/${d.config.workspace}` : "").replace(/{id}/gi, d.configStoreId || "");
|
|
2907
2907
|
}), g = D(""), n = {
|
|
2908
2908
|
isExactMatch: !0,
|
|
2909
2909
|
placeholder: p("search.placeholder_for_secrets.konnect")
|
|
@@ -2911,53 +2911,53 @@ const ft = {
|
|
|
2911
2911
|
fetcher: U,
|
|
2912
2912
|
fetcherState: f,
|
|
2913
2913
|
fetcherCacheKey: oe
|
|
2914
|
-
} = lt(k(() => ({ ...d.config, cacheIdentifier: d.cacheIdentifier })), x),
|
|
2914
|
+
} = lt(k(() => ({ ...d.config, cacheIdentifier: d.cacheIdentifier })), x), Q = () => {
|
|
2915
2915
|
g.value = "";
|
|
2916
2916
|
}, ne = D(null), pe = (q) => ({
|
|
2917
2917
|
label: p("actions.edit"),
|
|
2918
2918
|
to: d.config.getEditRoute(q)
|
|
2919
|
-
}),
|
|
2920
|
-
|
|
2919
|
+
}), T = D(void 0), a = D(!1), se = D(!1), V = D(""), L = ot(d.config, x.value), ie = (q) => {
|
|
2920
|
+
T.value = q, a.value = !0;
|
|
2921
2921
|
}, me = () => {
|
|
2922
2922
|
a.value = !1;
|
|
2923
2923
|
}, re = async () => {
|
|
2924
|
-
var q,
|
|
2925
|
-
if ((q =
|
|
2924
|
+
var q, M, le;
|
|
2925
|
+
if ((q = T.value) != null && q.key) {
|
|
2926
2926
|
se.value = !0;
|
|
2927
2927
|
try {
|
|
2928
|
-
await K.delete(
|
|
2928
|
+
await K.delete(L(T.value.key)), se.value = !1, a.value = !1, oe.value++, s("delete:success", T.value);
|
|
2929
2929
|
} catch (X) {
|
|
2930
|
-
V.value = ((le = (
|
|
2930
|
+
V.value = ((le = (M = X.response) == null ? void 0 : M.data) == null ? void 0 : le.message) || X.message || p("errors.delete"), s("error", X);
|
|
2931
2931
|
} finally {
|
|
2932
2932
|
se.value = !1;
|
|
2933
2933
|
}
|
|
2934
2934
|
}
|
|
2935
2935
|
};
|
|
2936
2936
|
Ue(f, (q) => {
|
|
2937
|
-
var
|
|
2937
|
+
var M, le, X;
|
|
2938
2938
|
if (q.status === it.Error) {
|
|
2939
2939
|
ne.value = {
|
|
2940
2940
|
title: p("errors.general")
|
|
2941
|
-
}, (X = (le = (
|
|
2941
|
+
}, (X = (le = (M = q.error) == null ? void 0 : M.response) == null ? void 0 : le.data) != null && X.message && (ne.value.message = q.error.response.data.message), s("error", q.error);
|
|
2942
2942
|
return;
|
|
2943
2943
|
}
|
|
2944
2944
|
ne.value = null;
|
|
2945
2945
|
});
|
|
2946
|
-
const
|
|
2946
|
+
const J = D({
|
|
2947
2947
|
ctaPath: d.config.createRoute,
|
|
2948
2948
|
ctaText: void 0,
|
|
2949
2949
|
message: `${p("secrets.list.empty_state.description")}${d.config.additionMessageForEmptyState ? ` ${d.config.additionMessageForEmptyState}` : ""}`,
|
|
2950
2950
|
title: p("secrets.title")
|
|
2951
2951
|
});
|
|
2952
2952
|
return Ge(async () => {
|
|
2953
|
-
await d.canCreate() && (
|
|
2954
|
-
}), (q,
|
|
2955
|
-
const le =
|
|
2953
|
+
await d.canCreate() && (J.value.title = p("secrets.list.empty_state.title"), J.value.ctaText = p("secrets.list.toolbar_actions.new_secret"));
|
|
2954
|
+
}), (q, M) => {
|
|
2955
|
+
const le = Y("KButton"), X = Y("KDropdownItem");
|
|
2956
2956
|
return v(), N(tt, null, [
|
|
2957
2957
|
u(e(rt), {
|
|
2958
2958
|
"cache-identifier": l.cacheIdentifier,
|
|
2959
2959
|
"disable-sorting": "",
|
|
2960
|
-
"empty-state-options":
|
|
2960
|
+
"empty-state-options": J.value,
|
|
2961
2961
|
"enable-entity-actions": "",
|
|
2962
2962
|
"error-message": ne.value,
|
|
2963
2963
|
fetcher: e(U),
|
|
@@ -2967,12 +2967,12 @@ const ft = {
|
|
|
2967
2967
|
query: g.value,
|
|
2968
2968
|
"row-attributes": S,
|
|
2969
2969
|
"table-headers": e(w),
|
|
2970
|
-
onClearSearchInput:
|
|
2970
|
+
onClearSearchInput: Q
|
|
2971
2971
|
}, {
|
|
2972
2972
|
"toolbar-filter": y(() => [
|
|
2973
2973
|
u(e(nt), {
|
|
2974
2974
|
modelValue: g.value,
|
|
2975
|
-
"onUpdate:modelValue":
|
|
2975
|
+
"onUpdate:modelValue": M[0] || (M[0] = (ee) => g.value = ee),
|
|
2976
2976
|
config: n
|
|
2977
2977
|
}, null, 8, ["modelValue"])
|
|
2978
2978
|
]),
|
|
@@ -2998,12 +2998,12 @@ const ft = {
|
|
|
2998
2998
|
}, 8, ["auth-function"])
|
|
2999
2999
|
]),
|
|
3000
3000
|
key: y(({ rowValue: ee }) => [
|
|
3001
|
-
|
|
3002
|
-
|
|
3001
|
+
G("div", Ua, [
|
|
3002
|
+
G("b", null, O(ee ?? "-"), 1)
|
|
3003
3003
|
])
|
|
3004
3004
|
]),
|
|
3005
3005
|
updated_at: y(({ rowValue: ee }) => [
|
|
3006
|
-
|
|
3006
|
+
G("span", null, O(ee ? e(i)(new Date(ee).getTime() / 1e3) : "-"), 1)
|
|
3007
3007
|
]),
|
|
3008
3008
|
actions: y(({ row: ee }) => [
|
|
3009
3009
|
u(e(ke), {
|
|
@@ -3041,7 +3041,7 @@ const ft = {
|
|
|
3041
3041
|
u(e(st), {
|
|
3042
3042
|
"action-pending": se.value,
|
|
3043
3043
|
description: e(p)("delete.description"),
|
|
3044
|
-
"entity-name":
|
|
3044
|
+
"entity-name": T.value && T.value.key,
|
|
3045
3045
|
"entity-type": e(dt).Secret,
|
|
3046
3046
|
error: V.value,
|
|
3047
3047
|
title: e(p)("delete.title_for_secret"),
|
|
@@ -3097,7 +3097,7 @@ const ft = {
|
|
|
3097
3097
|
s("error", x);
|
|
3098
3098
|
}, i = (x) => {
|
|
3099
3099
|
s("delete:success", x);
|
|
3100
|
-
}, { axiosInstance: K } = Ce((I = d.config) == null ? void 0 : I.axiosRequestConfig),
|
|
3100
|
+
}, { axiosInstance: K } = Ce((I = d.config) == null ? void 0 : I.axiosRequestConfig), $ = D(""), w = k(() => d.config.apiType === "aiGateway" ? ce.getVault.aiGateway : ce.getVault[d.config.app]), S = k(() => {
|
|
3101
3101
|
var x, g;
|
|
3102
3102
|
return `${d.config.apiBaseUrl}${w.value}`.replace(/{aiGatewayId}/gi, d.config.aiGatewayId || "").replace(/{controlPlaneId}/gi, ((x = d.config) == null ? void 0 : x.controlPlaneId) || "").replace(/\/{workspace}/gi, (g = d.config) != null && g.workspace ? `/${d.config.workspace}` : "").replace(/{id}/gi, d.vaultId);
|
|
3103
3103
|
});
|
|
@@ -3105,13 +3105,13 @@ const ft = {
|
|
|
3105
3105
|
var x;
|
|
3106
3106
|
try {
|
|
3107
3107
|
const { data: g } = await K.get(S.value);
|
|
3108
|
-
|
|
3108
|
+
$.value = (x = g == null ? void 0 : g.config) == null ? void 0 : x.config_store_id;
|
|
3109
3109
|
} catch (g) {
|
|
3110
3110
|
s("error", g);
|
|
3111
3111
|
}
|
|
3112
3112
|
}), (x, g) => (v(), N("div", Ma, [
|
|
3113
|
-
|
|
3114
|
-
"config-store-id":
|
|
3113
|
+
$.value ? (v(), H(Ta, at({ key: 0 }, d, {
|
|
3114
|
+
"config-store-id": $.value,
|
|
3115
3115
|
"onDelete:success": i,
|
|
3116
3116
|
onError: p
|
|
3117
3117
|
}), null, 16, ["config-store-id"])) : j("", !0)
|
|
@@ -3142,7 +3142,7 @@ const ft = {
|
|
|
3142
3142
|
emits: ["update", "error", "loading"],
|
|
3143
3143
|
setup(l, { emit: b }) {
|
|
3144
3144
|
var se;
|
|
3145
|
-
const s = l, d = b, { i18n: { t: p } } = Ae.useI18n(), i = je(), { axiosInstance: K } = Ce((se = s.config) == null ? void 0 : se.axiosRequestConfig), { getMessageFromError:
|
|
3145
|
+
const s = l, d = b, { i18n: { t: p } } = Ae.useI18n(), i = je(), { axiosInstance: K } = Ce((se = s.config) == null ? void 0 : se.axiosRequestConfig), { getMessageFromError: $ } = ut(), w = Ee({
|
|
3146
3146
|
fields: {
|
|
3147
3147
|
key: "",
|
|
3148
3148
|
value: ""
|
|
@@ -3165,27 +3165,33 @@ const ft = {
|
|
|
3165
3165
|
}, U = (V) => {
|
|
3166
3166
|
d("error", V);
|
|
3167
3167
|
}, f = (V) => {
|
|
3168
|
-
var
|
|
3169
|
-
w.fields.key = ((
|
|
3170
|
-
}, oe = k(() => s.secretId ? ge.Edit : ge.Create),
|
|
3171
|
-
var V,
|
|
3172
|
-
return `${s.config.apiBaseUrl}${I.value[oe.value]}`.replace(/{aiGatewayId}/gi, s.config.aiGatewayId || "").replace(/{controlPlaneId}/gi, ((V = s.config) == null ? void 0 : V.controlPlaneId) || "").replace(/\/{workspace}/gi, (
|
|
3173
|
-
}), ne = k(() => !!w.fields.key && !!w.fields.value), pe = k(() => JSON.stringify(w.fields) !== JSON.stringify(S)),
|
|
3168
|
+
var L, ie;
|
|
3169
|
+
w.fields.key = ((L = V == null ? void 0 : V.item) == null ? void 0 : L.key) || (V == null ? void 0 : V.key) || "", w.fields.value = ((ie = V == null ? void 0 : V.item) == null ? void 0 : ie.value) || (V == null ? void 0 : V.value) || "", Object.assign(S, w.fields);
|
|
3170
|
+
}, oe = k(() => s.secretId ? ge.Edit : ge.Create), Q = k(() => {
|
|
3171
|
+
var V, L;
|
|
3172
|
+
return `${s.config.apiBaseUrl}${I.value[oe.value]}`.replace(/{aiGatewayId}/gi, s.config.aiGatewayId || "").replace(/{controlPlaneId}/gi, ((V = s.config) == null ? void 0 : V.controlPlaneId) || "").replace(/\/{workspace}/gi, (L = s.config) != null && L.workspace ? `/${s.config.workspace}` : "").replace(/{id}/gi, s.configStoreId).replace(/{secretId}/gi, s.secretId);
|
|
3173
|
+
}), ne = k(() => !!w.fields.key && !!w.fields.value), pe = k(() => JSON.stringify(w.fields) !== JSON.stringify(S)), T = k(() => ({
|
|
3174
3174
|
key: w.fields.key,
|
|
3175
3175
|
value: w.fields.value
|
|
3176
3176
|
})), a = async () => {
|
|
3177
3177
|
try {
|
|
3178
3178
|
w.readonly = !0;
|
|
3179
3179
|
let V;
|
|
3180
|
-
|
|
3180
|
+
if (oe.value === "create")
|
|
3181
|
+
V = await K.post(Q.value, T.value);
|
|
3182
|
+
else if (oe.value === "edit") {
|
|
3183
|
+
const L = s.config.apiType === "aiGateway" ? { value: T.value.value } : T.value;
|
|
3184
|
+
V = await K.put(Q.value, L);
|
|
3185
|
+
}
|
|
3186
|
+
f(V == null ? void 0 : V.data), d("update", V == null ? void 0 : V.data);
|
|
3181
3187
|
} catch (V) {
|
|
3182
|
-
w.errorMessage =
|
|
3188
|
+
w.errorMessage = $(V), d("error", V);
|
|
3183
3189
|
} finally {
|
|
3184
3190
|
w.readonly = !1;
|
|
3185
3191
|
}
|
|
3186
3192
|
};
|
|
3187
|
-
return (V,
|
|
3188
|
-
const ie =
|
|
3193
|
+
return (V, L) => {
|
|
3194
|
+
const ie = Y("KInput"), me = Y("KTextArea"), re = Y("KAlert");
|
|
3189
3195
|
return v(), H(e(ct), {
|
|
3190
3196
|
"can-submit": ne.value && pe.value,
|
|
3191
3197
|
config: l.config,
|
|
@@ -3193,7 +3199,7 @@ const ft = {
|
|
|
3193
3199
|
"entity-type": e(qe).Other,
|
|
3194
3200
|
"error-message": w.errorMessage,
|
|
3195
3201
|
"fetch-url": x.value,
|
|
3196
|
-
"form-fields":
|
|
3202
|
+
"form-fields": T.value,
|
|
3197
3203
|
"is-readonly": w.readonly,
|
|
3198
3204
|
onCancel: g,
|
|
3199
3205
|
"onFetch:error": U,
|
|
@@ -3202,7 +3208,7 @@ const ft = {
|
|
|
3202
3208
|
onSubmit: a
|
|
3203
3209
|
}, {
|
|
3204
3210
|
default: y(() => [
|
|
3205
|
-
|
|
3211
|
+
G("div", null, [
|
|
3206
3212
|
u(e(Oe), {
|
|
3207
3213
|
description: e(p)("secrets.form.info.description"),
|
|
3208
3214
|
"has-divider": "",
|
|
@@ -3211,7 +3217,7 @@ const ft = {
|
|
|
3211
3217
|
default: y(() => [
|
|
3212
3218
|
u(ie, {
|
|
3213
3219
|
modelValue: w.fields.key,
|
|
3214
|
-
"onUpdate:modelValue":
|
|
3220
|
+
"onUpdate:modelValue": L[0] || (L[0] = (J) => w.fields.key = J),
|
|
3215
3221
|
modelModifiers: { trim: !0 },
|
|
3216
3222
|
autocomplete: "off",
|
|
3217
3223
|
class: "key-field",
|
|
@@ -3225,7 +3231,7 @@ const ft = {
|
|
|
3225
3231
|
}, null, 8, ["modelValue", "disabled", "label", "placeholder", "readonly"]),
|
|
3226
3232
|
u(me, {
|
|
3227
3233
|
modelValue: w.fields.value,
|
|
3228
|
-
"onUpdate:modelValue":
|
|
3234
|
+
"onUpdate:modelValue": L[1] || (L[1] = (J) => w.fields.value = J),
|
|
3229
3235
|
modelModifiers: { trim: !0 },
|
|
3230
3236
|
autocomplete: "off",
|
|
3231
3237
|
"character-limit": !1,
|
|
@@ -3250,7 +3256,7 @@ const ft = {
|
|
|
3250
3256
|
}, 8, ["can-submit", "config", "edit-id", "entity-type", "error-message", "fetch-url", "form-fields", "is-readonly"]);
|
|
3251
3257
|
};
|
|
3252
3258
|
}
|
|
3253
|
-
}), Pa = /* @__PURE__ */ he($a, [["__scopeId", "data-v-
|
|
3259
|
+
}), Pa = /* @__PURE__ */ he($a, [["__scopeId", "data-v-7b128b40"]]), Fa = { class: "kong-ui-entities-secret-form" }, Na = /* @__PURE__ */ ye({
|
|
3254
3260
|
__name: "SecretForm",
|
|
3255
3261
|
props: {
|
|
3256
3262
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
@@ -3280,14 +3286,14 @@ const ft = {
|
|
|
3280
3286
|
d("error", g);
|
|
3281
3287
|
}, K = (g) => {
|
|
3282
3288
|
d("loading", g);
|
|
3283
|
-
}, { axiosInstance:
|
|
3289
|
+
}, { axiosInstance: $ } = Ce((x = s.config) == null ? void 0 : x.axiosRequestConfig), w = D(""), S = k(() => s.config.apiType === "aiGateway" ? ce.getVault.aiGateway : ce.getVault[s.config.app]), I = k(() => {
|
|
3284
3290
|
var g, n;
|
|
3285
3291
|
return `${s.config.apiBaseUrl}${S.value}`.replace(/{aiGatewayId}/gi, s.config.aiGatewayId || "").replace(/{controlPlaneId}/gi, ((g = s.config) == null ? void 0 : g.controlPlaneId) || "").replace(/\/{workspace}/gi, (n = s.config) != null && n.workspace ? `/${s.config.workspace}` : "").replace(/{id}/gi, s.vaultId);
|
|
3286
3292
|
});
|
|
3287
3293
|
return Ge(async () => {
|
|
3288
3294
|
var g;
|
|
3289
3295
|
try {
|
|
3290
|
-
const { data: n } = await
|
|
3296
|
+
const { data: n } = await $.get(I.value);
|
|
3291
3297
|
w.value = (g = n == null ? void 0 : n.config) == null ? void 0 : g.config_store_id;
|
|
3292
3298
|
} catch (n) {
|
|
3293
3299
|
d("error", n);
|
|
@@ -3324,16 +3330,16 @@ const ft = {
|
|
|
3324
3330
|
},
|
|
3325
3331
|
i18nT: i
|
|
3326
3332
|
} = Ae.useI18n();
|
|
3327
|
-
return (K,
|
|
3333
|
+
return (K, $) => (v(), N("div", Ka, [u(e(i), {
|
|
3328
3334
|
keypath: "vault_secret_picker.provider.complete_action",
|
|
3329
3335
|
scope: "global"
|
|
3330
3336
|
}, {
|
|
3331
|
-
cta: y(() => [
|
|
3337
|
+
cta: y(() => [G("span", {
|
|
3332
3338
|
class: vt({
|
|
3333
3339
|
"vault-secret-picker-provider-action": !0,
|
|
3334
3340
|
disabled: s.disabled
|
|
3335
3341
|
}),
|
|
3336
|
-
onClick:
|
|
3342
|
+
onClick: $[0] || ($[0] = () => !s.disabled && d("open", s.value, s.update))
|
|
3337
3343
|
}, O(e(p)("vault_secret_picker.provider.cta")), 3)]),
|
|
3338
3344
|
_: 1
|
|
3339
3345
|
})]));
|
|
@@ -3412,7 +3418,7 @@ const ft = {
|
|
|
3412
3418
|
validateStatus: (C) => C === 404 || C >= 200 && C < 300,
|
|
3413
3419
|
// Spread the passed-in config later to allow overriding
|
|
3414
3420
|
...(Se = d.config) == null ? void 0 : Se.axiosRequestConfig
|
|
3415
|
-
}), K = D(!1),
|
|
3421
|
+
}), K = D(!1), $ = D(""), w = D(""), S = D(""), I = D(), x = k(() => d.config.apiType === "aiGateway"), g = (C) => C.replace(/{aiGatewayId}/gi, d.config.aiGatewayId || ""), n = k(() => x.value ? g(fe.list.aiGateway.getAll) : fe.list[d.config.app].getAll), U = k(() => {
|
|
3416
3422
|
var C, A, P, z;
|
|
3417
3423
|
return x.value ? g(ce.list.aiGateway).replace(/{id}/gi, ((A = (C = I.value) == null ? void 0 : C.config) == null ? void 0 : A.config_store_id) ?? "") : d.config.app === "konnect" ? ce.list[d.config.app].replace(/{id}/gi, ((z = (P = I.value) == null ? void 0 : P.config) == null ? void 0 : z.config_store_id) ?? "") : "<not_applicable>";
|
|
3418
3424
|
}), f = k(() => {
|
|
@@ -3424,10 +3430,10 @@ const ft = {
|
|
|
3424
3430
|
return s("vault_secret_picker.fetch_error.secrets");
|
|
3425
3431
|
}), {
|
|
3426
3432
|
debouncedQueryChange: oe,
|
|
3427
|
-
loading:
|
|
3433
|
+
loading: Q,
|
|
3428
3434
|
error: ne,
|
|
3429
3435
|
loadItems: pe,
|
|
3430
|
-
results:
|
|
3436
|
+
results: T
|
|
3431
3437
|
} = Ye(d.config, n, void 0, {
|
|
3432
3438
|
fetchedItemsKey: "data",
|
|
3433
3439
|
// AI Gateway vaults carry the identifier in `name`; gateway vaults in `prefix`.
|
|
@@ -3436,7 +3442,7 @@ const ft = {
|
|
|
3436
3442
|
debouncedQueryChange: a,
|
|
3437
3443
|
loading: se,
|
|
3438
3444
|
error: V,
|
|
3439
|
-
loadItems:
|
|
3445
|
+
loadItems: L,
|
|
3440
3446
|
results: ie
|
|
3441
3447
|
} = Ye(d.config, U, void 0, {
|
|
3442
3448
|
fetchedItemsKey: "data",
|
|
@@ -3445,9 +3451,9 @@ const ft = {
|
|
|
3445
3451
|
}), me = (C) => {
|
|
3446
3452
|
var A;
|
|
3447
3453
|
return (A = d.allowedProviders) != null && A.length ? d.allowedProviders.includes(C) : C !== t.AZURE_CERTS;
|
|
3448
|
-
}, re = k(() => x.value ? (
|
|
3454
|
+
}, re = k(() => x.value ? (T.value ?? []).map((C) => He(C)) : T.value ?? []), J = k(() => {
|
|
3449
3455
|
let C = !1;
|
|
3450
|
-
const A = (re.value ?? []).filter((P) => me(P.name)).map((P) => (P.prefix ===
|
|
3456
|
+
const A = (re.value ?? []).filter((P) => me(P.name)).map((P) => (P.prefix === $.value && (C = !0), { label: P.prefix, value: P.prefix, vault: P }));
|
|
3451
3457
|
return !C && I.value && A.push({
|
|
3452
3458
|
label: I.value.prefix,
|
|
3453
3459
|
value: I.value.prefix,
|
|
@@ -3461,7 +3467,7 @@ const ft = {
|
|
|
3461
3467
|
}), q = k(() => {
|
|
3462
3468
|
var C;
|
|
3463
3469
|
return ((C = I == null ? void 0 : I.value) == null ? void 0 : C.name) === "konnect";
|
|
3464
|
-
}),
|
|
3470
|
+
}), M = k(() => !!I.value && !!w.value && !d.additionalDisabled), le = (C) => C.label ? `${C.label} - (${C.vault.name} - ${C.vault.id})` : C.value, X = (C) => {
|
|
3465
3471
|
var z, te;
|
|
3466
3472
|
const A = x.value ? fe.form.aiGateway.edit : fe.form[d.config.app].edit;
|
|
3467
3473
|
let P = `${d.config.apiBaseUrl}${A}`;
|
|
@@ -3474,7 +3480,7 @@ const ft = {
|
|
|
3474
3480
|
return g(`${d.config.apiBaseUrl}${P}`).replace(/{controlPlaneId}/gi, ((z = d.config) == null ? void 0 : z.controlPlaneId) || "").replace(/\/{workspace}/gi, (te = d.config) != null && te.workspace ? `/${d.config.workspace}` : "").replace(/{id}/gi, A).replace(/{secretId}/gi, C);
|
|
3475
3481
|
}, we = () => {
|
|
3476
3482
|
p("proceed", ja({
|
|
3477
|
-
vaultPrefix:
|
|
3483
|
+
vaultPrefix: $.value,
|
|
3478
3484
|
secretId: w.value || void 0,
|
|
3479
3485
|
// Either a non-empty string or undefined
|
|
3480
3486
|
optionalSecretKey: S.value || void 0
|
|
@@ -3483,7 +3489,7 @@ const ft = {
|
|
|
3483
3489
|
};
|
|
3484
3490
|
return Ue(() => d.setup, async (C) => {
|
|
3485
3491
|
if (C !== !1) {
|
|
3486
|
-
if (K.value = !0,
|
|
3492
|
+
if (K.value = !0, $.value = "", I.value = void 0, w.value = "", S.value = "", typeof C == "string" && C.trim().length > 0)
|
|
3487
3493
|
try {
|
|
3488
3494
|
let A, P = "", z = "", te = "";
|
|
3489
3495
|
const Z = Wa(C), { data: W } = await i.get(X(Z.vaultPrefix)), h = W && x.value ? He(W) : W;
|
|
@@ -3496,22 +3502,22 @@ const ft = {
|
|
|
3496
3502
|
} else
|
|
3497
3503
|
z = Z.secretId ?? "", te = Z.optionalSecretKey ?? "";
|
|
3498
3504
|
await gt(() => {
|
|
3499
|
-
|
|
3505
|
+
$.value = P, I.value = A, w.value = z, S.value = te;
|
|
3500
3506
|
});
|
|
3501
3507
|
} catch (A) {
|
|
3502
3508
|
console.debug(A);
|
|
3503
3509
|
}
|
|
3504
3510
|
K.value = !1, await pe();
|
|
3505
3511
|
}
|
|
3506
|
-
}, { immediate: !0 }), Ue(
|
|
3512
|
+
}, { immediate: !0 }), Ue($, async (C, A) => {
|
|
3507
3513
|
var P;
|
|
3508
|
-
K.value || C === A || (I.value = (P =
|
|
3514
|
+
K.value || C === A || (I.value = (P = J.value.find((z) => z.value === C)) == null ? void 0 : P.vault, w.value = "", S.value = "");
|
|
3509
3515
|
}), Ue(U, async () => {
|
|
3510
|
-
q.value && await
|
|
3516
|
+
q.value && await L();
|
|
3511
3517
|
}, { immediate: !0 }), (C, A) => {
|
|
3512
|
-
const P =
|
|
3518
|
+
const P = Y("KEmptyState"), z = Y("KSelect"), te = Y("KInput"), Z = Y("KModal");
|
|
3513
3519
|
return v(), H(Z, {
|
|
3514
|
-
"action-button-disabled": !
|
|
3520
|
+
"action-button-disabled": !M.value,
|
|
3515
3521
|
"action-button-text": l.proceedButtonText || e(s)("vault_secret_picker.actions.use_key"),
|
|
3516
3522
|
class: "vault-secret-picker",
|
|
3517
3523
|
"data-testid": "vault-secret-picker-modal",
|
|
@@ -3529,17 +3535,17 @@ const ft = {
|
|
|
3529
3535
|
}, null, 8, ["message"])) : (v(), N("div", qa, [
|
|
3530
3536
|
yt(C.$slots, "form-prefix", {}, void 0, !0),
|
|
3531
3537
|
u(z, {
|
|
3532
|
-
modelValue:
|
|
3533
|
-
"onUpdate:modelValue": A[0] || (A[0] = (W) =>
|
|
3538
|
+
modelValue: $.value,
|
|
3539
|
+
"onUpdate:modelValue": A[0] || (A[0] = (W) => $.value = W),
|
|
3534
3540
|
clearable: "",
|
|
3535
3541
|
"data-testid": "vault-secret-picker-vault-select",
|
|
3536
3542
|
disabled: K.value,
|
|
3537
3543
|
"enable-filtering": "",
|
|
3538
3544
|
"filter-function": () => !0,
|
|
3539
|
-
items:
|
|
3545
|
+
items: J.value,
|
|
3540
3546
|
"kpop-attributes": { "data-testid": "vault-secret-picker-vault-popover" },
|
|
3541
3547
|
label: e(s)("vault_secret_picker.vault.label"),
|
|
3542
|
-
loading: e(
|
|
3548
|
+
loading: e(Q),
|
|
3543
3549
|
placeholder: e(s)("vault_secret_picker.vault.placeholder"),
|
|
3544
3550
|
required: "",
|
|
3545
3551
|
"reuse-item-template": "",
|
|
@@ -3547,19 +3553,19 @@ const ft = {
|
|
|
3547
3553
|
onQueryChange: e(oe)
|
|
3548
3554
|
}, {
|
|
3549
3555
|
loading: y(() => [
|
|
3550
|
-
|
|
3556
|
+
G("div", null, O(e(s)("actions.loading")), 1)
|
|
3551
3557
|
]),
|
|
3552
3558
|
empty: y(() => [
|
|
3553
|
-
|
|
3559
|
+
G("div", za, O(e(s)("vault_secret_picker.no_results")), 1)
|
|
3554
3560
|
]),
|
|
3555
3561
|
"selected-item-template": y(({ item: W }) => [
|
|
3556
|
-
|
|
3562
|
+
G("span", Da, O(le(W)), 1)
|
|
3557
3563
|
]),
|
|
3558
3564
|
"item-template": y(({ item: W }) => [
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3565
|
+
G("div", Za, [
|
|
3566
|
+
G("span", Ba, O(W.label), 1),
|
|
3567
|
+
G("span", La, O(W.vault.name), 1),
|
|
3568
|
+
G("span", Ja, O(W.vault.id), 1)
|
|
3563
3569
|
])
|
|
3564
3570
|
]),
|
|
3565
3571
|
_: 1
|
|
@@ -3584,10 +3590,10 @@ const ft = {
|
|
|
3584
3590
|
onQueryChange: e(a)
|
|
3585
3591
|
}, {
|
|
3586
3592
|
loading: y(() => [
|
|
3587
|
-
|
|
3593
|
+
G("div", null, O(e(s)("actions.loading")), 1)
|
|
3588
3594
|
]),
|
|
3589
3595
|
empty: y(() => [
|
|
3590
|
-
|
|
3596
|
+
G("div", Qa, O(e(s)("vault_secret_picker.no_results")), 1)
|
|
3591
3597
|
]),
|
|
3592
3598
|
_: 1
|
|
3593
3599
|
}, 8, ["modelValue", "disabled", "items", "label", "loading", "placeholder", "onQueryChange"])) : (v(), H(te, {
|