@kong-ui-public/entities-vaults 3.13.35 → 3.13.36
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,27 +1,27 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as de, computed as V, ref as k, watch as He, onBeforeMount as Ve, resolveComponent as q, openBlock as x, createElementBlock as F, createVNode as c, unref as e, withCtx as v, createBlock as ie, Teleport as Le, withDirectives as Me, createTextVNode as ce, toDisplayString as O, vShow as Ke, createElementVNode as T, reactive as fe, resolveDynamicComponent as Te, TransitionGroup as Ge, createCommentVNode as Z, Fragment as Ze, mergeProps as Pe } from "vue";
|
|
2
2
|
import { useRouter as Ee } from "vue-router";
|
|
3
|
-
import { AddIcon as
|
|
4
|
-
import { useAxios as
|
|
5
|
-
import { createI18n as
|
|
6
|
-
const
|
|
3
|
+
import { AddIcon as Ne, AzureIcon as Je, HashicorpIcon as Qe, GoogleCloudIcon as Ye, AwsIcon as Xe, CodeIcon as et, KongIcon as tt } from "@kong/icons";
|
|
4
|
+
import { useAxios as ge, useFetcher as Fe, useDeleteUrlBuilder as Oe, FetcherStatus as we, EntityBaseTable as De, EntityFilter as qe, PermissionsWrapper as ue, TableTags as lt, EntityDeleteModal as We, EntityTypes as je, useErrors as Be, EntityBaseFormType as pe, useGatewayFeatureSupported as ot, EntityBaseForm as ze, SupportedEntityType as xe, EntityFormSection as Se, ConfigurationSchemaSection as Ue, ConfigurationSchemaType as at, EntityBaseConfigCard as it } from "@kong-ui-public/entities-shared";
|
|
5
|
+
import { createI18n as rt, i18nTComponent as nt } from "@kong-ui-public/i18n";
|
|
6
|
+
const st = {
|
|
7
7
|
create: "New Vault",
|
|
8
8
|
copy_id: "Copy ID",
|
|
9
9
|
copy_json: "Copy JSON",
|
|
10
10
|
edit: "Edit",
|
|
11
11
|
delete: "Delete",
|
|
12
12
|
view: "View Details"
|
|
13
|
-
},
|
|
13
|
+
}, ct = {
|
|
14
14
|
general: "Vaults could not be retrieved",
|
|
15
15
|
delete: "The vault could not be deleted at this time.",
|
|
16
16
|
copy: "Failed to copy to clipboard"
|
|
17
|
-
},
|
|
17
|
+
}, ut = {
|
|
18
18
|
placeholder_for_vaults: {
|
|
19
19
|
konnect: "Filter by exact prefix or ID"
|
|
20
20
|
},
|
|
21
21
|
placeholder_for_secrets: {
|
|
22
22
|
konnect: "Filter by exact key"
|
|
23
23
|
}
|
|
24
|
-
},
|
|
24
|
+
}, dt = {
|
|
25
25
|
title: "Vaults",
|
|
26
26
|
list: {
|
|
27
27
|
toolbar_actions: {
|
|
@@ -39,7 +39,7 @@ const ct = {
|
|
|
39
39
|
description: "Improve the security of your Kong Gateway deployment with centralized secrets."
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
},
|
|
42
|
+
}, ft = {
|
|
43
43
|
title: "Secrets",
|
|
44
44
|
list: {
|
|
45
45
|
toolbar_actions: {
|
|
@@ -71,12 +71,12 @@ const ct = {
|
|
|
71
71
|
},
|
|
72
72
|
hint: "Once saved, the secret value will not be visible"
|
|
73
73
|
}
|
|
74
|
-
},
|
|
74
|
+
}, pt = {
|
|
75
75
|
success: "Copied {val} to clipboard",
|
|
76
76
|
success_brief: "Successfully copied to clipboard"
|
|
77
|
-
},
|
|
77
|
+
}, mt = {
|
|
78
78
|
vault_type: "Vault Type"
|
|
79
|
-
},
|
|
79
|
+
}, gt = {
|
|
80
80
|
sections: {
|
|
81
81
|
general: {
|
|
82
82
|
title: "General Information",
|
|
@@ -325,32 +325,32 @@ const ct = {
|
|
|
325
325
|
}
|
|
326
326
|
},
|
|
327
327
|
unavailable: "This vault provider is available on Enterprise."
|
|
328
|
-
},
|
|
329
|
-
actions:
|
|
328
|
+
}, vt = {
|
|
329
|
+
actions: st,
|
|
330
330
|
delete: {
|
|
331
331
|
title: "Delete a Vault",
|
|
332
332
|
title_for_secret: "Delete a Secret",
|
|
333
333
|
description: "This action cannot be reversed."
|
|
334
334
|
},
|
|
335
|
-
errors:
|
|
336
|
-
search:
|
|
337
|
-
vaults:
|
|
338
|
-
secrets:
|
|
339
|
-
copy:
|
|
340
|
-
labels:
|
|
341
|
-
form:
|
|
335
|
+
errors: ct,
|
|
336
|
+
search: ut,
|
|
337
|
+
vaults: dt,
|
|
338
|
+
secrets: ft,
|
|
339
|
+
copy: pt,
|
|
340
|
+
labels: mt,
|
|
341
|
+
form: gt
|
|
342
342
|
};
|
|
343
|
-
function
|
|
344
|
-
const
|
|
343
|
+
function bt() {
|
|
344
|
+
const o = rt("en-us", vt);
|
|
345
345
|
return {
|
|
346
|
-
i18n:
|
|
347
|
-
i18nT:
|
|
346
|
+
i18n: o,
|
|
347
|
+
i18nT: nt(o)
|
|
348
348
|
// Translation component <i18n-t>
|
|
349
349
|
};
|
|
350
350
|
}
|
|
351
351
|
const he = {
|
|
352
|
-
useI18n:
|
|
353
|
-
}, ke = "/v2/control-planes/{controlPlaneId}/core-entities", $e = "/v2/control-planes/{controlPlaneId}/config-stores", Ce = "/{workspace}",
|
|
352
|
+
useI18n: bt
|
|
353
|
+
}, ke = "/v2/control-planes/{controlPlaneId}/core-entities", $e = "/v2/control-planes/{controlPlaneId}/config-stores", Ce = "/{workspace}", me = {
|
|
354
354
|
list: {
|
|
355
355
|
konnect: {
|
|
356
356
|
getAll: `${ke}/vaults`,
|
|
@@ -371,14 +371,14 @@ const he = {
|
|
|
371
371
|
edit: `${Ce}/vaults/{id}`
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
|
-
},
|
|
374
|
+
}, yt = { class: "kong-ui-entities-vaults-list" }, ht = { class: "table-content-overflow-wrapper" }, _t = { class: "table-content-overflow-wrapper" }, Vt = /* @__PURE__ */ de({
|
|
375
375
|
__name: "VaultList",
|
|
376
376
|
props: {
|
|
377
377
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
378
378
|
config: {
|
|
379
379
|
type: Object,
|
|
380
380
|
required: !0,
|
|
381
|
-
validator: (
|
|
381
|
+
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)
|
|
382
382
|
},
|
|
383
383
|
// used to override the default identifier for the cache entry
|
|
384
384
|
cacheIdentifier: {
|
|
@@ -416,38 +416,38 @@ const he = {
|
|
|
416
416
|
}
|
|
417
417
|
},
|
|
418
418
|
emits: ["error", "copy:success", "copy:error", "delete:success"],
|
|
419
|
-
setup(
|
|
420
|
-
var
|
|
421
|
-
const f =
|
|
419
|
+
setup(o, { emit: P }) {
|
|
420
|
+
var ae;
|
|
421
|
+
const f = P, u = o, { i18n: { t: p } } = he.useI18n(), i = Ee(), { axiosInstance: S } = ge((ae = u.config) == null ? void 0 : ae.axiosRequestConfig), E = V(() => u.config.app !== "kongManager" || !!u.config.disableSorting), y = {
|
|
422
422
|
// the Prefix column is non-hidable
|
|
423
423
|
prefix: { label: p("vaults.list.table_headers.prefix"), searchable: !0, sortable: !0, hidable: !1 },
|
|
424
424
|
// it's "Vault Type" on display, but we still use "name" to fit API schema
|
|
425
425
|
name: { label: p("vaults.list.table_headers.name"), searchable: !0, sortable: !0 },
|
|
426
426
|
description: { label: p("vaults.list.table_headers.description"), sortable: !1 },
|
|
427
427
|
tags: { label: p("vaults.list.table_headers.tags"), sortable: !1 }
|
|
428
|
-
}, d =
|
|
429
|
-
var _,
|
|
430
|
-
let g = `${u.config.apiBaseUrl}${
|
|
431
|
-
return u.config.app === "konnect" ? g = g.replace(/{controlPlaneId}/gi, ((_ = u.config) == null ? void 0 : _.controlPlaneId) || "") : u.config.app === "kongManager" && (g = g.replace(/\/{workspace}/gi, (
|
|
432
|
-
}), s =
|
|
428
|
+
}, d = y, C = V(() => {
|
|
429
|
+
var _, w;
|
|
430
|
+
let g = `${u.config.apiBaseUrl}${me.list[u.config.app].getAll}`;
|
|
431
|
+
return u.config.app === "konnect" ? g = g.replace(/{controlPlaneId}/gi, ((_ = u.config) == null ? void 0 : _.controlPlaneId) || "") : u.config.app === "kongManager" && (g = g.replace(/\/{workspace}/gi, (w = u.config) != null && w.workspace ? `/${u.config.workspace}` : "")), g;
|
|
432
|
+
}), s = k(""), N = V(() => {
|
|
433
433
|
if (u.config.app === "konnect" || u.config.isExactMatch)
|
|
434
434
|
return {
|
|
435
435
|
isExactMatch: !0,
|
|
436
436
|
placeholder: p("search.placeholder_for_vaults.konnect")
|
|
437
437
|
};
|
|
438
|
-
const { prefix: _, name:
|
|
438
|
+
const { prefix: _, name: w } = y;
|
|
439
439
|
return {
|
|
440
440
|
isExactMatch: !1,
|
|
441
|
-
fields: { name:
|
|
441
|
+
fields: { name: w, prefix: _ },
|
|
442
442
|
schema: u.config.filterSchema
|
|
443
443
|
};
|
|
444
|
-
}), D =
|
|
444
|
+
}), D = k(1), { fetcher: le, fetcherState: J } = Fe(u.config, C.value), a = () => {
|
|
445
445
|
s.value = "";
|
|
446
446
|
}, z = () => {
|
|
447
447
|
D.value++;
|
|
448
|
-
}, Q =
|
|
449
|
-
const
|
|
450
|
-
if (!_(
|
|
448
|
+
}, Q = k(null), H = k(!1), Y = (g, _) => {
|
|
449
|
+
const w = g.id;
|
|
450
|
+
if (!_(w)) {
|
|
451
451
|
f("copy:error", {
|
|
452
452
|
entity: g,
|
|
453
453
|
field: "id",
|
|
@@ -458,11 +458,11 @@ const he = {
|
|
|
458
458
|
f("copy:success", {
|
|
459
459
|
entity: g,
|
|
460
460
|
field: "id",
|
|
461
|
-
message: p("copy.success", { val:
|
|
461
|
+
message: p("copy.success", { val: w })
|
|
462
462
|
});
|
|
463
463
|
}, L = (g, _) => {
|
|
464
|
-
const
|
|
465
|
-
if (!_(
|
|
464
|
+
const w = JSON.stringify(g);
|
|
465
|
+
if (!_(w)) {
|
|
466
466
|
f("copy:error", {
|
|
467
467
|
entity: g,
|
|
468
468
|
message: p("errors.copy")
|
|
@@ -474,48 +474,48 @@ const he = {
|
|
|
474
474
|
message: p("copy.success_brief")
|
|
475
475
|
});
|
|
476
476
|
}, m = async (g) => {
|
|
477
|
-
var
|
|
478
|
-
await ((
|
|
479
|
-
},
|
|
477
|
+
var w;
|
|
478
|
+
await ((w = u.canRetrieve) == null ? void 0 : w.call(u, g)) && i.push(u.config.getViewRoute(g.id));
|
|
479
|
+
}, M = (g) => ({
|
|
480
480
|
label: p("actions.view"),
|
|
481
481
|
to: u.config.getViewRoute(g)
|
|
482
482
|
}), X = (g) => ({
|
|
483
483
|
label: p("actions.edit"),
|
|
484
484
|
to: u.config.getEditRoute(g)
|
|
485
|
-
}), U =
|
|
485
|
+
}), U = k(void 0), ee = k(!1), W = k(!1), oe = k(""), re = Oe(u.config, C.value), h = (g) => {
|
|
486
486
|
U.value = g, ee.value = !0;
|
|
487
|
-
},
|
|
487
|
+
}, j = () => {
|
|
488
488
|
ee.value = !1;
|
|
489
489
|
}, G = async (g) => {
|
|
490
|
-
const { apiBaseUrl: _, app:
|
|
490
|
+
const { apiBaseUrl: _, app: w, controlPlaneId: $ } = u.config, r = `${_}${me.list[w].deleteConfigStore}`.replace(/{controlPlaneId}/gi, $ || "").replace(/{id}/gi, g);
|
|
491
491
|
try {
|
|
492
|
-
await
|
|
492
|
+
await S.delete(r);
|
|
493
493
|
} catch {
|
|
494
494
|
}
|
|
495
|
-
},
|
|
496
|
-
var g, _,
|
|
495
|
+
}, B = async () => {
|
|
496
|
+
var g, _, w, $;
|
|
497
497
|
if ((g = U.value) != null && g.id) {
|
|
498
|
-
|
|
498
|
+
W.value = !0;
|
|
499
499
|
try {
|
|
500
|
-
await
|
|
500
|
+
await S.delete(re(U.value.id)), u.config.app === "konnect" && ((_ = U.value.config) != null && _.config_store_id) && G(U.value.config.config_store_id), W.value = !1, ee.value = !1, D.value++, f("delete:success", U.value);
|
|
501
501
|
} catch (r) {
|
|
502
|
-
|
|
502
|
+
oe.value = (($ = (w = r.response) == null ? void 0 : w.data) == null ? void 0 : $.message) || r.message || p("errors.delete"), f("error", r);
|
|
503
503
|
} finally {
|
|
504
|
-
|
|
504
|
+
W.value = !1;
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
|
-
}, I =
|
|
507
|
+
}, I = k(!1);
|
|
508
508
|
He(J, (g) => {
|
|
509
|
-
var _,
|
|
510
|
-
if (Array.isArray((_ = g == null ? void 0 : g.response) == null ? void 0 : _.data) && (I.value = g.response.data.length > 0), g.status === we.NoRecords ?
|
|
509
|
+
var _, w, $, r;
|
|
510
|
+
if (Array.isArray((_ = g == null ? void 0 : g.response) == null ? void 0 : _.data) && (I.value = g.response.data.length > 0), g.status === we.NoRecords ? H.value = !0 : H.value = !1, g.status === we.Error) {
|
|
511
511
|
Q.value = {
|
|
512
512
|
title: p("errors.general")
|
|
513
|
-
}, (r = (
|
|
513
|
+
}, (r = ($ = (w = g.error) == null ? void 0 : w.response) == null ? void 0 : $.data) != null && r.message && (Q.value.message = g.error.response.data.message), f("error", g.error);
|
|
514
514
|
return;
|
|
515
515
|
}
|
|
516
516
|
Q.value = null;
|
|
517
517
|
});
|
|
518
|
-
const te =
|
|
518
|
+
const te = k({
|
|
519
519
|
ctaPath: u.config.createRoute,
|
|
520
520
|
ctaText: void 0,
|
|
521
521
|
message: `${p("vaults.list.empty_state.description")}${u.config.additionMessageForEmptyState ? ` ${u.config.additionMessageForEmptyState}` : ""}`,
|
|
@@ -524,50 +524,50 @@ const he = {
|
|
|
524
524
|
return Ve(async () => {
|
|
525
525
|
await u.canCreate() && (te.value.title = p("vaults.list.empty_state.title"), te.value.ctaText = p("actions.create"));
|
|
526
526
|
}), (g, _) => {
|
|
527
|
-
const
|
|
528
|
-
return
|
|
529
|
-
c(e(
|
|
530
|
-
"cache-identifier":
|
|
531
|
-
"disable-sorting":
|
|
527
|
+
const w = q("KButton"), $ = q("KDropdownItem"), r = q("KClipboardProvider");
|
|
528
|
+
return x(), F("div", yt, [
|
|
529
|
+
c(e(De), {
|
|
530
|
+
"cache-identifier": o.cacheIdentifier,
|
|
531
|
+
"disable-sorting": E.value,
|
|
532
532
|
"empty-state-options": te.value,
|
|
533
533
|
"enable-entity-actions": "",
|
|
534
534
|
"error-message": Q.value,
|
|
535
|
-
fetcher: e(
|
|
535
|
+
fetcher: e(le),
|
|
536
536
|
"fetcher-cache-key": D.value,
|
|
537
|
-
"hide-toolbar":
|
|
537
|
+
"hide-toolbar": H.value,
|
|
538
538
|
"pagination-type": "offset",
|
|
539
539
|
"preferences-storage-key": "kong-ui-entities-vaults-list",
|
|
540
540
|
query: s.value,
|
|
541
541
|
"table-headers": e(d),
|
|
542
|
-
onClearSearchInput:
|
|
543
|
-
"onClick:row": _[
|
|
542
|
+
onClearSearchInput: a,
|
|
543
|
+
"onClick:row": _[1] || (_[1] = (l) => m(l)),
|
|
544
544
|
onSort: z
|
|
545
545
|
}, {
|
|
546
|
-
"toolbar-filter":
|
|
547
|
-
c(e(
|
|
546
|
+
"toolbar-filter": v(() => [
|
|
547
|
+
c(e(qe), {
|
|
548
548
|
modelValue: s.value,
|
|
549
|
-
"onUpdate:modelValue": _[0] || (_[0] = (
|
|
550
|
-
config:
|
|
549
|
+
"onUpdate:modelValue": _[0] || (_[0] = (l) => s.value = l),
|
|
550
|
+
config: N.value
|
|
551
551
|
}, null, 8, ["modelValue", "config"])
|
|
552
552
|
]),
|
|
553
|
-
"toolbar-button":
|
|
554
|
-
(
|
|
555
|
-
disabled: !
|
|
553
|
+
"toolbar-button": v(() => [
|
|
554
|
+
(x(), ie(Le, {
|
|
555
|
+
disabled: !o.useActionOutside,
|
|
556
556
|
to: "#kong-ui-app-page-header-action-button"
|
|
557
557
|
}, [
|
|
558
|
-
c(e(
|
|
559
|
-
"auth-function": () =>
|
|
558
|
+
c(e(ue), {
|
|
559
|
+
"auth-function": () => o.canCreate()
|
|
560
560
|
}, {
|
|
561
|
-
default:
|
|
562
|
-
Me(c(
|
|
561
|
+
default: v(() => [
|
|
562
|
+
Me(c(w, {
|
|
563
563
|
appearance: "primary",
|
|
564
564
|
"data-testid": "toolbar-add-vault",
|
|
565
|
-
size:
|
|
566
|
-
to:
|
|
565
|
+
size: o.useActionOutside ? "medium" : "large",
|
|
566
|
+
to: o.config.createRoute
|
|
567
567
|
}, {
|
|
568
|
-
default:
|
|
569
|
-
c(e(
|
|
570
|
-
|
|
568
|
+
default: v(() => [
|
|
569
|
+
c(e(Ne)),
|
|
570
|
+
ce(" " + O(e(p)("vaults.list.toolbar_actions.new_vault")), 1)
|
|
571
571
|
]),
|
|
572
572
|
_: 1
|
|
573
573
|
}, 8, ["size", "to"]), [
|
|
@@ -578,98 +578,84 @@ const he = {
|
|
|
578
578
|
}, 8, ["auth-function"])
|
|
579
579
|
], 8, ["disabled"]))
|
|
580
580
|
]),
|
|
581
|
-
prefix:
|
|
582
|
-
T("div",
|
|
583
|
-
T("b", null,
|
|
581
|
+
prefix: v(({ rowValue: l }) => [
|
|
582
|
+
T("div", ht, [
|
|
583
|
+
T("b", null, O(l ?? "-"), 1)
|
|
584
584
|
])
|
|
585
585
|
]),
|
|
586
|
-
name:
|
|
587
|
-
T("b", null,
|
|
586
|
+
name: v(({ rowValue: l }) => [
|
|
587
|
+
T("b", null, O(l ?? "-"), 1)
|
|
588
588
|
]),
|
|
589
|
-
description:
|
|
590
|
-
T("div",
|
|
589
|
+
description: v(({ rowValue: l }) => [
|
|
590
|
+
T("div", _t, O(l ?? "-"), 1)
|
|
591
591
|
]),
|
|
592
|
-
tags:
|
|
593
|
-
(
|
|
594
|
-
default: b(() => [
|
|
595
|
-
(V(!0), H(Pe, null, Ze(y, (v) => (V(), le(B, {
|
|
596
|
-
key: v,
|
|
597
|
-
onClick: _[1] || (_[1] = Je(() => {
|
|
598
|
-
}, ["stop"]))
|
|
599
|
-
}, {
|
|
600
|
-
default: b(() => [
|
|
601
|
-
re(P(v), 1)
|
|
602
|
-
]),
|
|
603
|
-
_: 2
|
|
604
|
-
}, 1024))), 128))
|
|
605
|
-
]),
|
|
606
|
-
_: 2
|
|
607
|
-
}, 1024)) : (V(), H("span", kt, "-"))
|
|
592
|
+
tags: v(({ rowValue: l }) => [
|
|
593
|
+
c(e(lt), { tags: l }, null, 8, ["tags"])
|
|
608
594
|
]),
|
|
609
|
-
actions:
|
|
610
|
-
c(
|
|
611
|
-
default:
|
|
612
|
-
c(
|
|
595
|
+
actions: v(({ row: l }) => [
|
|
596
|
+
c(r, null, {
|
|
597
|
+
default: v(({ copyToClipboard: A }) => [
|
|
598
|
+
c($, {
|
|
613
599
|
"data-testid": "action-entity-copy-id",
|
|
614
|
-
onClick: (
|
|
600
|
+
onClick: (K) => Y(l, A)
|
|
615
601
|
}, {
|
|
616
|
-
default:
|
|
617
|
-
|
|
602
|
+
default: v(() => [
|
|
603
|
+
ce(O(e(p)("actions.copy_id")), 1)
|
|
618
604
|
]),
|
|
619
605
|
_: 2
|
|
620
606
|
}, 1032, ["onClick"])
|
|
621
607
|
]),
|
|
622
608
|
_: 2
|
|
623
609
|
}, 1024),
|
|
624
|
-
c(
|
|
625
|
-
default:
|
|
626
|
-
c(
|
|
610
|
+
c(r, null, {
|
|
611
|
+
default: v(({ copyToClipboard: A }) => [
|
|
612
|
+
c($, {
|
|
627
613
|
"data-testid": "action-entity-copy-json",
|
|
628
|
-
onClick: (
|
|
614
|
+
onClick: (K) => L(l, A)
|
|
629
615
|
}, {
|
|
630
|
-
default:
|
|
631
|
-
|
|
616
|
+
default: v(() => [
|
|
617
|
+
ce(O(e(p)("actions.copy_json")), 1)
|
|
632
618
|
]),
|
|
633
619
|
_: 2
|
|
634
620
|
}, 1032, ["onClick"])
|
|
635
621
|
]),
|
|
636
622
|
_: 2
|
|
637
623
|
}, 1024),
|
|
638
|
-
c(e(
|
|
639
|
-
"auth-function": () =>
|
|
624
|
+
c(e(ue), {
|
|
625
|
+
"auth-function": () => o.canRetrieve(l)
|
|
640
626
|
}, {
|
|
641
|
-
default:
|
|
642
|
-
c(
|
|
627
|
+
default: v(() => [
|
|
628
|
+
c($, {
|
|
643
629
|
"data-testid": "action-entity-view",
|
|
644
630
|
"has-divider": "",
|
|
645
|
-
item:
|
|
631
|
+
item: M(l.id)
|
|
646
632
|
}, null, 8, ["item"])
|
|
647
633
|
]),
|
|
648
634
|
_: 2
|
|
649
635
|
}, 1032, ["auth-function"]),
|
|
650
|
-
c(e(
|
|
651
|
-
"auth-function": () =>
|
|
636
|
+
c(e(ue), {
|
|
637
|
+
"auth-function": () => o.canEdit(l)
|
|
652
638
|
}, {
|
|
653
|
-
default:
|
|
654
|
-
c(
|
|
639
|
+
default: v(() => [
|
|
640
|
+
c($, {
|
|
655
641
|
"data-testid": "action-entity-edit",
|
|
656
|
-
item: X(
|
|
642
|
+
item: X(l.id)
|
|
657
643
|
}, null, 8, ["item"])
|
|
658
644
|
]),
|
|
659
645
|
_: 2
|
|
660
646
|
}, 1032, ["auth-function"]),
|
|
661
|
-
c(e(
|
|
662
|
-
"auth-function": () =>
|
|
647
|
+
c(e(ue), {
|
|
648
|
+
"auth-function": () => o.canDelete(l)
|
|
663
649
|
}, {
|
|
664
|
-
default:
|
|
665
|
-
c(
|
|
650
|
+
default: v(() => [
|
|
651
|
+
c($, {
|
|
666
652
|
danger: "",
|
|
667
653
|
"data-testid": "action-entity-delete",
|
|
668
654
|
"has-divider": "",
|
|
669
|
-
onClick: (
|
|
655
|
+
onClick: (A) => h(l)
|
|
670
656
|
}, {
|
|
671
|
-
default:
|
|
672
|
-
|
|
657
|
+
default: v(() => [
|
|
658
|
+
ce(O(e(p)("actions.delete")), 1)
|
|
673
659
|
]),
|
|
674
660
|
_: 2
|
|
675
661
|
}, 1032, ["onClick"])
|
|
@@ -679,47 +665,47 @@ const he = {
|
|
|
679
665
|
]),
|
|
680
666
|
_: 1
|
|
681
667
|
}, 8, ["cache-identifier", "disable-sorting", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "hide-toolbar", "query", "table-headers"]),
|
|
682
|
-
c(e(
|
|
683
|
-
"action-pending":
|
|
668
|
+
c(e(We), {
|
|
669
|
+
"action-pending": W.value,
|
|
684
670
|
description: e(p)("delete.description"),
|
|
685
671
|
"entity-name": U.value && (U.value.prefix || U.value.id),
|
|
686
|
-
"entity-type": e(
|
|
687
|
-
error:
|
|
672
|
+
"entity-type": e(je).Vault,
|
|
673
|
+
error: oe.value,
|
|
688
674
|
title: e(p)("delete.title"),
|
|
689
675
|
visible: ee.value,
|
|
690
|
-
onCancel:
|
|
691
|
-
onProceed:
|
|
676
|
+
onCancel: j,
|
|
677
|
+
onProceed: B
|
|
692
678
|
}, null, 8, ["action-pending", "description", "entity-name", "entity-type", "error", "title", "visible"])
|
|
693
679
|
]);
|
|
694
680
|
};
|
|
695
681
|
}
|
|
696
|
-
}),
|
|
697
|
-
const f =
|
|
698
|
-
for (const [u, p] of
|
|
682
|
+
}), ve = (o, P) => {
|
|
683
|
+
const f = o.__vccOpts || o;
|
|
684
|
+
for (const [u, p] of P)
|
|
699
685
|
f[u] = p;
|
|
700
686
|
return f;
|
|
701
|
-
},
|
|
702
|
-
var t = /* @__PURE__ */ ((
|
|
703
|
-
const
|
|
687
|
+
}, el = /* @__PURE__ */ ve(Vt, [["__scopeId", "data-v-07ad74de"]]);
|
|
688
|
+
var t = /* @__PURE__ */ ((o) => (o.AWS = "aws", o.GCP = "gcp", o.HCV = "hcv", o.ENV = "env", o.AZURE = "azure", o.KONNECT = "konnect", o))(t || {}), R = /* @__PURE__ */ ((o) => (o.TOKEN = "token", o.K8S = "kubernetes", o.APP_ROLE = "approle", o))(R || {});
|
|
689
|
+
const kt = { class: "kong-ui-entities-vault-form" }, Ct = { class: "vault-form-provider-cards-container" }, wt = ["data-testid"], St = { class: "provider-item-title-container" }, Et = { class: "provider-item-title" }, xt = { class: "provider-item-description" }, At = {
|
|
704
690
|
key: "kong-vault-config-fields",
|
|
705
691
|
class: "vault-form-config-fields-container"
|
|
706
|
-
},
|
|
692
|
+
}, It = {
|
|
707
693
|
key: 0,
|
|
708
694
|
class: "vault-form-config-auth-method-container"
|
|
709
|
-
},
|
|
695
|
+
}, Rt = {
|
|
710
696
|
key: 1,
|
|
711
697
|
class: "vault-form-config-auth-method-container"
|
|
712
|
-
},
|
|
698
|
+
}, Tt = {
|
|
713
699
|
key: 2,
|
|
714
700
|
class: "vault-form-config-auth-method-container"
|
|
715
|
-
},
|
|
701
|
+
}, Ut = { key: 5 }, $t = { class: "wrapper" }, Ht = { class: "item-50" }, Mt = { class: "item-50" }, Kt = { class: "wrapper" }, Pt = { class: "item-100" }, Nt = /* @__PURE__ */ de({
|
|
716
702
|
__name: "VaultForm",
|
|
717
703
|
props: {
|
|
718
704
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
719
705
|
config: {
|
|
720
706
|
type: Object,
|
|
721
707
|
required: !0,
|
|
722
|
-
validator: (
|
|
708
|
+
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))
|
|
723
709
|
},
|
|
724
710
|
/** If a valid vaultId is provided, it will put the form in Edit mode instead of Create */
|
|
725
711
|
vaultId: {
|
|
@@ -729,9 +715,9 @@ const wt = { class: "kong-ui-entities-vault-form" }, St = { class: "vault-form-p
|
|
|
729
715
|
}
|
|
730
716
|
},
|
|
731
717
|
emits: ["update", "error", "loading"],
|
|
732
|
-
setup(
|
|
733
|
-
var
|
|
734
|
-
const f =
|
|
718
|
+
setup(o, { emit: P }) {
|
|
719
|
+
var $;
|
|
720
|
+
const f = o, u = P, { i18nT: p, i18n: { t: i } } = he.useI18n(), S = Ee(), { axiosInstance: E } = ge(($ = f.config) == null ? void 0 : $.axiosRequestConfig), { getMessageFromError: y } = Be(), d = fe({
|
|
735
721
|
fields: {
|
|
736
722
|
prefix: "",
|
|
737
723
|
description: "",
|
|
@@ -739,40 +725,40 @@ const wt = { class: "kong-ui-entities-vault-form" }, St = { class: "vault-form-p
|
|
|
739
725
|
},
|
|
740
726
|
isReadonly: !1,
|
|
741
727
|
errorMessage: ""
|
|
742
|
-
}),
|
|
728
|
+
}), C = fe({
|
|
743
729
|
prefix: "",
|
|
744
730
|
description: "",
|
|
745
731
|
tags: ""
|
|
746
|
-
}), s =
|
|
732
|
+
}), s = k(f.config.konnectConfigStoreAvailable ? t.KONNECT : t.ENV), N = k(null), D = k(), le = V(() => [t.AWS, t.GCP, t.HCV, t.AZURE].includes(s.value)), J = V(() => [
|
|
747
733
|
...f.config.konnectConfigStoreAvailable ? [{
|
|
748
|
-
label:
|
|
734
|
+
label: i("form.config.konnect.label"),
|
|
749
735
|
value: t.KONNECT
|
|
750
736
|
}] : [],
|
|
751
737
|
{
|
|
752
|
-
label:
|
|
738
|
+
label: i("form.config.env.label"),
|
|
753
739
|
value: t.ENV
|
|
754
740
|
},
|
|
755
741
|
{
|
|
756
|
-
label:
|
|
742
|
+
label: i("form.config.aws.label"),
|
|
757
743
|
value: t.AWS,
|
|
758
744
|
disabled: !U.value
|
|
759
745
|
},
|
|
760
746
|
{
|
|
761
|
-
label:
|
|
747
|
+
label: i("form.config.gcp.label"),
|
|
762
748
|
value: t.GCP,
|
|
763
749
|
disabled: !U.value
|
|
764
750
|
},
|
|
765
751
|
{
|
|
766
|
-
label:
|
|
752
|
+
label: i("form.config.hcv.label"),
|
|
767
753
|
value: t.HCV,
|
|
768
754
|
disabled: !U.value
|
|
769
755
|
},
|
|
770
756
|
...f.config.azureVaultProviderAvailable ? [{
|
|
771
|
-
label:
|
|
757
|
+
label: i("form.config.azure.label"),
|
|
772
758
|
value: t.AZURE,
|
|
773
759
|
disabled: !U.value
|
|
774
760
|
}] : []
|
|
775
|
-
]),
|
|
761
|
+
]), a = fe({
|
|
776
762
|
[t.KONNECT]: {},
|
|
777
763
|
[t.ENV]: {
|
|
778
764
|
prefix: ""
|
|
@@ -812,7 +798,7 @@ const wt = { class: "kong-ui-entities-vault-form" }, St = { class: "vault-form-p
|
|
|
812
798
|
client_id: "",
|
|
813
799
|
tenant_id: ""
|
|
814
800
|
}
|
|
815
|
-
}), z =
|
|
801
|
+
}), z = fe({
|
|
816
802
|
[t.KONNECT]: {},
|
|
817
803
|
[t.ENV]: {
|
|
818
804
|
prefix: ""
|
|
@@ -853,34 +839,34 @@ const wt = { class: "kong-ui-entities-vault-form" }, St = { class: "vault-form-p
|
|
|
853
839
|
tenant_id: ""
|
|
854
840
|
}
|
|
855
841
|
}), Q = [
|
|
856
|
-
{ label: `${
|
|
857
|
-
{ label: `${
|
|
858
|
-
{ label: `${
|
|
859
|
-
{ label: `${
|
|
860
|
-
{ label: `${
|
|
861
|
-
{ label: `${
|
|
862
|
-
{ label: `${
|
|
863
|
-
{ label: `${
|
|
864
|
-
{ label: `${
|
|
865
|
-
{ label: `${
|
|
866
|
-
{ label: `${
|
|
867
|
-
{ label: `${
|
|
868
|
-
{ label: `${
|
|
869
|
-
{ label: `${
|
|
870
|
-
{ label: `${
|
|
871
|
-
{ label: `${
|
|
872
|
-
{ label: `${
|
|
873
|
-
{ label: `${
|
|
874
|
-
{ label: `${
|
|
875
|
-
{ label: `${
|
|
876
|
-
{ label: `${
|
|
877
|
-
{ label: `${
|
|
878
|
-
{ label: `${
|
|
879
|
-
{ label: `${
|
|
880
|
-
],
|
|
881
|
-
var r,
|
|
882
|
-
return (
|
|
883
|
-
}), X =
|
|
842
|
+
{ label: `${i("form.config.aws.fields.region.locations.us-east-1.location")} (us-east-1)`, value: "us-east-1" },
|
|
843
|
+
{ label: `${i("form.config.aws.fields.region.locations.us-east-2.location")} (us-east-2)`, value: "us-east-2" },
|
|
844
|
+
{ label: `${i("form.config.aws.fields.region.locations.us-west-1.location")} (us-west-1)`, value: "us-west-1" },
|
|
845
|
+
{ label: `${i("form.config.aws.fields.region.locations.us-west-2.location")} (us-west-2)`, value: "us-west-2" },
|
|
846
|
+
{ label: `${i("form.config.aws.fields.region.locations.af-south-1.location")} (af-south-1)`, value: "af-south-1" },
|
|
847
|
+
{ label: `${i("form.config.aws.fields.region.locations.ap-east-1.location")} (ap-east-1)`, value: "ap-east-1" },
|
|
848
|
+
{ label: `${i("form.config.aws.fields.region.locations.ap-southeast-3.location")} (ap-southeast-3)`, value: "ap-southeast-3" },
|
|
849
|
+
{ label: `${i("form.config.aws.fields.region.locations.ap-south-1.location")} (ap-south-1)`, value: "ap-south-1" },
|
|
850
|
+
{ label: `${i("form.config.aws.fields.region.locations.ap-northeast-1.location")} (ap-northeast-1)`, value: "ap-northeast-1" },
|
|
851
|
+
{ label: `${i("form.config.aws.fields.region.locations.ap-northeast-2.location")} (ap-northeast-2)`, value: "ap-northeast-2" },
|
|
852
|
+
{ label: `${i("form.config.aws.fields.region.locations.ap-northeast-3.location")} (ap-northeast-3)`, value: "ap-northeast-3" },
|
|
853
|
+
{ label: `${i("form.config.aws.fields.region.locations.ap-southeast-1.location")} (ap-southeast-1)`, value: "ap-southeast-1" },
|
|
854
|
+
{ label: `${i("form.config.aws.fields.region.locations.ap-southeast-2.location")} (ap-southeast-2)`, value: "ap-southeast-2" },
|
|
855
|
+
{ label: `${i("form.config.aws.fields.region.locations.ca-central-1.location")} (ca-central-1)`, value: "ca-central-1" },
|
|
856
|
+
{ label: `${i("form.config.aws.fields.region.locations.eu-central-1.location")} (eu-central-1)`, value: "eu-central-1" },
|
|
857
|
+
{ label: `${i("form.config.aws.fields.region.locations.eu-west-1.location")} (eu-west-1)`, value: "eu-west-1" },
|
|
858
|
+
{ label: `${i("form.config.aws.fields.region.locations.eu-west-2.location")} (eu-west-2)`, value: "eu-west-2" },
|
|
859
|
+
{ label: `${i("form.config.aws.fields.region.locations.eu-west-3.location")} (eu-west-3)`, value: "eu-west-3" },
|
|
860
|
+
{ label: `${i("form.config.aws.fields.region.locations.eu-south-1.location")} (eu-south-1)`, value: "eu-south-1" },
|
|
861
|
+
{ label: `${i("form.config.aws.fields.region.locations.eu-north-1.location")} (eu-north-1)`, value: "eu-north-1" },
|
|
862
|
+
{ label: `${i("form.config.aws.fields.region.locations.me-south-1.location")} (me-south-1)`, value: "me-south-1" },
|
|
863
|
+
{ label: `${i("form.config.aws.fields.region.locations.sa-east-1.location")} (sa-east-1)`, value: "sa-east-1" },
|
|
864
|
+
{ label: `${i("form.config.aws.fields.region.locations.us-gov-east-1.location")} (us-gov-east-1)`, value: "us-gov-east-1" },
|
|
865
|
+
{ label: `${i("form.config.aws.fields.region.locations.us-gov-west-1.location")} (us-gov-west-1)`, value: "us-gov-west-1" }
|
|
866
|
+
], H = [{ label: "secrets", value: "secrets" }], Y = [{ label: "http", value: "http" }, { label: "https", value: "https" }], L = [{ label: "v1", value: "v1" }, { label: "v2", value: "v2" }], m = V(() => f.vaultId ? pe.Edit : pe.Create), M = V(() => {
|
|
867
|
+
var r, l;
|
|
868
|
+
return (l = me.form[(r = f.config) == null ? void 0 : r.app]) == null ? void 0 : l.edit;
|
|
869
|
+
}), X = V(() => m.value === pe.Edit && f.config.app === "kongManager"), U = V(() => f.config.app === "konnect" || ot({
|
|
884
870
|
gatewayInfo: f.config.gatewayInfo,
|
|
885
871
|
// vault name can only be `env` in Gateway Community Edition
|
|
886
872
|
supportedRange: {
|
|
@@ -888,49 +874,49 @@ const wt = { class: "kong-ui-entities-vault-form" }, St = { class: "vault-form-p
|
|
|
888
874
|
}
|
|
889
875
|
})), ee = () => {
|
|
890
876
|
var r;
|
|
891
|
-
|
|
892
|
-
},
|
|
877
|
+
S.push(((r = f.config) == null ? void 0 : r.cancelRoute) || { name: "vault-list" });
|
|
878
|
+
}, W = (r) => {
|
|
893
879
|
u("loading", r);
|
|
894
|
-
},
|
|
880
|
+
}, oe = (r) => {
|
|
895
881
|
u("error", r);
|
|
896
|
-
},
|
|
882
|
+
}, re = (r) => {
|
|
897
883
|
switch (r) {
|
|
898
884
|
case t.KONNECT:
|
|
899
|
-
return
|
|
885
|
+
return tt;
|
|
900
886
|
case t.ENV:
|
|
901
|
-
return
|
|
887
|
+
return et;
|
|
902
888
|
case t.AWS:
|
|
903
|
-
return
|
|
889
|
+
return Xe;
|
|
904
890
|
case t.GCP:
|
|
905
|
-
return
|
|
891
|
+
return Ye;
|
|
906
892
|
case t.HCV:
|
|
907
|
-
return
|
|
893
|
+
return Qe;
|
|
908
894
|
case t.AZURE:
|
|
909
|
-
return
|
|
895
|
+
return Je;
|
|
910
896
|
}
|
|
911
|
-
},
|
|
897
|
+
}, h = (r) => {
|
|
912
898
|
switch (r) {
|
|
913
899
|
case t.KONNECT:
|
|
914
|
-
return
|
|
900
|
+
return i("form.config.konnect.description");
|
|
915
901
|
case t.ENV:
|
|
916
|
-
return
|
|
902
|
+
return i("form.config.env.description");
|
|
917
903
|
case t.AWS:
|
|
918
|
-
return
|
|
904
|
+
return i("form.config.aws.description");
|
|
919
905
|
case t.GCP:
|
|
920
|
-
return
|
|
906
|
+
return i("form.config.gcp.description");
|
|
921
907
|
case t.HCV:
|
|
922
|
-
return
|
|
908
|
+
return i("form.config.hcv.description");
|
|
923
909
|
case t.AZURE:
|
|
924
|
-
return
|
|
910
|
+
return i("form.config.azure.description");
|
|
925
911
|
}
|
|
926
|
-
},
|
|
927
|
-
var
|
|
928
|
-
d.fields.prefix = ((
|
|
929
|
-
const
|
|
930
|
-
d.fields.tags = (
|
|
931
|
-
const
|
|
932
|
-
|
|
933
|
-
}, G =
|
|
912
|
+
}, j = (r) => {
|
|
913
|
+
var K, b, be, ne, se, n;
|
|
914
|
+
d.fields.prefix = ((K = r == null ? void 0 : r.item) == null ? void 0 : K.prefix) || (r == null ? void 0 : r.prefix) || "", d.fields.description = ((b = r == null ? void 0 : r.item) == null ? void 0 : b.description) || (r == null ? void 0 : r.description) || "";
|
|
915
|
+
const l = ((be = r == null ? void 0 : r.item) == null ? void 0 : be.tags) || (r == null ? void 0 : r.tags) || [];
|
|
916
|
+
d.fields.tags = (l == null ? void 0 : l.join(", ")) || "", Object.assign(C, d.fields);
|
|
917
|
+
const A = ((ne = r == null ? void 0 : r.item) == null ? void 0 : ne.config) || (r == null ? void 0 : r.config) || null;
|
|
918
|
+
A && (Object.keys(A).length || (r == null ? void 0 : r.name) === t.KONNECT) ? (s.value = ((se = r == null ? void 0 : r.item) == null ? void 0 : se.name) || (r == null ? void 0 : r.name) || "", N.value = s.value, D.value = ((n = r == null ? void 0 : r.config) == null ? void 0 : n.config_store_id) || void 0, Object.assign(a[s.value], A), Object.assign(z[s.value], A)) : d.errorMessage = "Error loading vault config";
|
|
919
|
+
}, G = V(() => s.value === t.HCV ? !Object.keys(a[t.HCV]).filter((r) => [
|
|
934
920
|
"namespace",
|
|
935
921
|
"ttl",
|
|
936
922
|
"neg_ttl",
|
|
@@ -939,51 +925,51 @@ const wt = { class: "kong-ui-entities-vault-form" }, St = { class: "vault-form-p
|
|
|
939
925
|
"approle_auth_path",
|
|
940
926
|
"approle_secret_id",
|
|
941
927
|
"approle_secret_id_file"
|
|
942
|
-
].includes(r) ||
|
|
943
|
-
var
|
|
944
|
-
let r = `${f.config.apiBaseUrl}${
|
|
945
|
-
return f.config.app === "konnect" ? r = r.replace(/{controlPlaneId}/gi, ((
|
|
946
|
-
}),
|
|
947
|
-
var
|
|
928
|
+
].includes(r) || a[t.HCV].auth_method !== R.K8S && (r === "kube_role" || r === "kube_api_token_file") || a[t.HCV].auth_method !== R.TOKEN && r === "token" || a[t.HCV].auth_method !== R.APP_ROLE && (r === "approle_role_id" || r === "approle_response_wrapping") || a[t.HCV].auth_method === R.APP_ROLE && r === "approle_response_wrapping" && typeof a[s.value][r] == "boolean" ? !1 : !a[s.value][r]).length : s.value === t.AZURE ? !Object.keys(a[t.AZURE]).filter((r) => ["client_id", "tenant_id", "ttl", "neg_ttl", "resurrect_ttl"].includes(r) ? !1 : !a[s.value][r]).length : s.value === t.AWS ? !Object.keys(a[t.AWS]).filter((r) => ["endpoint_url", "assume_role_arn", "ttl", "neg_ttl", "resurrect_ttl", "sts_endpoint_url"].includes(r) ? !1 : !a[s.value][r]).length : !Object.keys(a[s.value]).filter((r) => ["ttl", "neg_ttl", "resurrect_ttl"].includes(r) ? !1 : !a[s.value][r]).length), B = V(() => !!d.fields.prefix && G.value), I = V(() => JSON.stringify(d.fields) !== JSON.stringify(C) || s.value !== N.value || JSON.stringify(a[s.value]) !== JSON.stringify(z[s.value])), te = V(() => {
|
|
929
|
+
var l, A;
|
|
930
|
+
let r = `${f.config.apiBaseUrl}${me.form[f.config.app][m.value]}`;
|
|
931
|
+
return f.config.app === "konnect" ? r = r.replace(/{controlPlaneId}/gi, ((l = f.config) == null ? void 0 : l.controlPlaneId) || "") : f.config.app === "kongManager" && (r = r.replace(/\/{workspace}/gi, (A = f.config) != null && A.workspace ? `/${f.config.workspace}` : "")), r = r.replace(/{id}/gi, f.vaultId), r;
|
|
932
|
+
}), ae = V(() => {
|
|
933
|
+
var ne, se;
|
|
948
934
|
const r = {
|
|
949
|
-
protocol:
|
|
950
|
-
host:
|
|
951
|
-
port: parseInt(
|
|
952
|
-
mount:
|
|
953
|
-
kv:
|
|
954
|
-
namespace:
|
|
955
|
-
auth_method:
|
|
956
|
-
...
|
|
935
|
+
protocol: a[t.HCV].protocol,
|
|
936
|
+
host: a[t.HCV].host,
|
|
937
|
+
port: parseInt(a[t.HCV].port.toString()),
|
|
938
|
+
mount: a[t.HCV].mount,
|
|
939
|
+
kv: a[t.HCV].kv,
|
|
940
|
+
namespace: a[t.HCV].namespace || null,
|
|
941
|
+
auth_method: a[t.HCV].auth_method,
|
|
942
|
+
...a[t.HCV].auth_method === R.TOKEN && { token: a[t.HCV].token },
|
|
957
943
|
// For Kong Admin API, when auth_method is kubernetes, token must be in the request body and its value has to be null
|
|
958
|
-
...
|
|
959
|
-
kube_role:
|
|
960
|
-
kube_auth_path:
|
|
961
|
-
kube_api_token_file:
|
|
944
|
+
...a[t.HCV].auth_method === R.K8S && {
|
|
945
|
+
kube_role: a[t.HCV].kube_role,
|
|
946
|
+
kube_auth_path: a[t.HCV].kube_auth_path || void 0,
|
|
947
|
+
kube_api_token_file: a[t.HCV].kube_api_token_file,
|
|
962
948
|
token: null
|
|
963
949
|
},
|
|
964
|
-
...
|
|
965
|
-
approle_auth_path:
|
|
966
|
-
approle_role_id:
|
|
967
|
-
approle_secret_id:
|
|
968
|
-
approle_secret_id_file:
|
|
969
|
-
approle_response_wrapping:
|
|
950
|
+
...a[t.HCV].auth_method === R.APP_ROLE && {
|
|
951
|
+
approle_auth_path: a[t.HCV].approle_auth_path || void 0,
|
|
952
|
+
approle_role_id: a[t.HCV].approle_role_id,
|
|
953
|
+
approle_secret_id: a[t.HCV].approle_secret_id || void 0,
|
|
954
|
+
approle_secret_id_file: a[t.HCV].approle_secret_id_file || void 0,
|
|
955
|
+
approle_response_wrapping: a[t.HCV].approle_response_wrapping ?? !1
|
|
970
956
|
}
|
|
971
|
-
},
|
|
972
|
-
...
|
|
973
|
-
client_id:
|
|
974
|
-
tenant_id:
|
|
975
|
-
},
|
|
976
|
-
...
|
|
977
|
-
endpoint_url:
|
|
978
|
-
assume_role_arn:
|
|
979
|
-
...f.config.awsStsEndpointUrlAvailable ? { sts_endpoint_url:
|
|
957
|
+
}, l = {
|
|
958
|
+
...a[s.value],
|
|
959
|
+
client_id: a[s.value].client_id || null,
|
|
960
|
+
tenant_id: a[s.value].tenant_id || null
|
|
961
|
+
}, A = {
|
|
962
|
+
...a[s.value],
|
|
963
|
+
endpoint_url: a[s.value].endpoint_url || null,
|
|
964
|
+
assume_role_arn: a[s.value].assume_role_arn || null,
|
|
965
|
+
...f.config.awsStsEndpointUrlAvailable ? { sts_endpoint_url: a[s.value].sts_endpoint_url || null } : {}
|
|
980
966
|
};
|
|
981
|
-
let
|
|
982
|
-
s.value === t.HCV ?
|
|
983
|
-
let
|
|
967
|
+
let K = a[s.value];
|
|
968
|
+
s.value === t.HCV ? K = r : s.value === t.AZURE ? K = l : s.value === t.AWS && (K = A);
|
|
969
|
+
let b = {};
|
|
984
970
|
if (![t.KONNECT, t.ENV].includes(s.value)) {
|
|
985
|
-
const n =
|
|
986
|
-
|
|
971
|
+
const n = a[s.value], Ae = n.ttl, Ie = n.neg_ttl, Re = n.resurrect_ttl;
|
|
972
|
+
b = {
|
|
987
973
|
ttl: Ae ? parseInt(Ae.toString(), 10) : null,
|
|
988
974
|
neg_ttl: Ie ? parseInt(Ie.toString(), 10) : null,
|
|
989
975
|
resurrect_ttl: Re ? parseInt(Re.toString(), 10) : null
|
|
@@ -992,95 +978,95 @@ const wt = { class: "kong-ui-entities-vault-form" }, St = { class: "vault-form-p
|
|
|
992
978
|
return {
|
|
993
979
|
prefix: d.fields.prefix,
|
|
994
980
|
description: d.fields.description || null,
|
|
995
|
-
tags: (
|
|
981
|
+
tags: (se = (ne = d.fields.tags.split(",")) == null ? void 0 : ne.map((n) => String(n || "").trim())) == null ? void 0 : se.filter((n) => n !== ""),
|
|
996
982
|
name: s.value,
|
|
997
983
|
config: {
|
|
998
|
-
...
|
|
999
|
-
...
|
|
984
|
+
...K,
|
|
985
|
+
...b
|
|
1000
986
|
}
|
|
1001
987
|
};
|
|
1002
|
-
}), g =
|
|
1003
|
-
...
|
|
988
|
+
}), g = V(() => ({
|
|
989
|
+
...ae.value,
|
|
1004
990
|
config: {
|
|
1005
|
-
...
|
|
991
|
+
...ae.value.config,
|
|
1006
992
|
config_store_id: D.value
|
|
1007
993
|
}
|
|
1008
994
|
})), _ = async () => {
|
|
1009
995
|
var r;
|
|
1010
996
|
try {
|
|
1011
997
|
d.isReadonly = !0;
|
|
1012
|
-
const
|
|
1013
|
-
return
|
|
1014
|
-
} catch (
|
|
1015
|
-
d.errorMessage =
|
|
998
|
+
const l = `${f.config.apiBaseUrl}${me.form.konnect.createConfigStore}`.replace(/{controlPlaneId}/gi, ((r = f.config) == null ? void 0 : r.controlPlaneId) || ""), A = await E.post(l);
|
|
999
|
+
return A == null ? void 0 : A.data.id;
|
|
1000
|
+
} catch (l) {
|
|
1001
|
+
d.errorMessage = y(l), u("error", l);
|
|
1016
1002
|
} finally {
|
|
1017
1003
|
d.isReadonly = !1;
|
|
1018
1004
|
}
|
|
1019
|
-
},
|
|
1005
|
+
}, w = async () => {
|
|
1020
1006
|
var r;
|
|
1021
1007
|
try {
|
|
1022
1008
|
d.isReadonly = !0;
|
|
1023
|
-
let
|
|
1024
|
-
m.value === "create" ? s.value === t.KONNECT ? (D.value = await _(),
|
|
1025
|
-
} catch (
|
|
1026
|
-
d.errorMessage =
|
|
1009
|
+
let l;
|
|
1010
|
+
m.value === "create" ? s.value === t.KONNECT ? (D.value = await _(), l = await E.post(te.value, g.value)) : l = await E.post(te.value, ae.value) : m.value === "edit" && (s.value === t.KONNECT && !D.value ? (D.value = await _(), l = await E.put(te.value, g.value)) : l = ((r = f.config) == null ? void 0 : r.app) === "konnect" ? await E.put(te.value, g.value) : await E.patch(te.value, ae.value)), j(l == null ? void 0 : l.data), u("update", l == null ? void 0 : l.data);
|
|
1011
|
+
} catch (l) {
|
|
1012
|
+
d.errorMessage = y(l), u("error", l);
|
|
1027
1013
|
} finally {
|
|
1028
1014
|
d.isReadonly = !1;
|
|
1029
1015
|
}
|
|
1030
1016
|
};
|
|
1031
|
-
return (r,
|
|
1032
|
-
const
|
|
1033
|
-
return
|
|
1034
|
-
c(e(
|
|
1035
|
-
"can-submit":
|
|
1036
|
-
config:
|
|
1037
|
-
"edit-id":
|
|
1017
|
+
return (r, l) => {
|
|
1018
|
+
const A = q("KTooltip"), K = q("KSelect"), b = q("KInput"), be = q("KCheckbox"), ne = q("KCollapse"), se = q("KTextArea");
|
|
1019
|
+
return x(), F("div", kt, [
|
|
1020
|
+
c(e(ze), {
|
|
1021
|
+
"can-submit": B.value && I.value,
|
|
1022
|
+
config: o.config,
|
|
1023
|
+
"edit-id": o.vaultId,
|
|
1038
1024
|
"entity-type": e(xe).Vault,
|
|
1039
1025
|
"error-message": d.errorMessage,
|
|
1040
|
-
"fetch-url":
|
|
1041
|
-
"form-fields":
|
|
1026
|
+
"fetch-url": M.value,
|
|
1027
|
+
"form-fields": ae.value,
|
|
1042
1028
|
"is-readonly": d.isReadonly,
|
|
1043
1029
|
onCancel: ee,
|
|
1044
|
-
"onFetch:error":
|
|
1045
|
-
"onFetch:success":
|
|
1046
|
-
onLoading:
|
|
1047
|
-
onSubmit:
|
|
1030
|
+
"onFetch:error": oe,
|
|
1031
|
+
"onFetch:success": j,
|
|
1032
|
+
onLoading: W,
|
|
1033
|
+
onSubmit: w
|
|
1048
1034
|
}, {
|
|
1049
|
-
default:
|
|
1035
|
+
default: v(() => [
|
|
1050
1036
|
c(e(Se), {
|
|
1051
|
-
description: e(
|
|
1052
|
-
title: e(
|
|
1037
|
+
description: e(i)("form.sections.config.description"),
|
|
1038
|
+
title: e(i)("form.sections.config.title")
|
|
1053
1039
|
}, {
|
|
1054
|
-
default:
|
|
1055
|
-
T("div",
|
|
1056
|
-
c(
|
|
1040
|
+
default: v(() => [
|
|
1041
|
+
T("div", Ct, [
|
|
1042
|
+
c(K, {
|
|
1057
1043
|
modelValue: s.value,
|
|
1058
|
-
"onUpdate:modelValue":
|
|
1044
|
+
"onUpdate:modelValue": l[0] || (l[0] = (n) => s.value = n),
|
|
1059
1045
|
"data-testid": "provider-select",
|
|
1060
1046
|
disabled: X.value,
|
|
1061
1047
|
"dropdown-max-height": "500",
|
|
1062
1048
|
items: J.value
|
|
1063
1049
|
}, {
|
|
1064
|
-
"selected-item-template":
|
|
1065
|
-
(
|
|
1066
|
-
|
|
1050
|
+
"selected-item-template": v(({ item: n }) => [
|
|
1051
|
+
(x(), ie(Te(re(n.value)))),
|
|
1052
|
+
ce(" " + O(n == null ? void 0 : n.label), 1)
|
|
1067
1053
|
]),
|
|
1068
|
-
"item-template":
|
|
1069
|
-
c(
|
|
1054
|
+
"item-template": v(({ item: n }) => [
|
|
1055
|
+
c(A, {
|
|
1070
1056
|
placement: "top",
|
|
1071
|
-
text: n.disabled ? e(
|
|
1057
|
+
text: n.disabled ? e(i)("form.unavailable") : ""
|
|
1072
1058
|
}, {
|
|
1073
|
-
default:
|
|
1059
|
+
default: v(() => [
|
|
1074
1060
|
T("div", {
|
|
1075
1061
|
class: "provider-item",
|
|
1076
1062
|
"data-testid": `vault-form-provider-${n.value}`
|
|
1077
1063
|
}, [
|
|
1078
|
-
(
|
|
1079
|
-
T("div",
|
|
1080
|
-
T("span",
|
|
1081
|
-
T("span",
|
|
1064
|
+
(x(), ie(Te(re(n.value)))),
|
|
1065
|
+
T("div", St, [
|
|
1066
|
+
T("span", Et, O(n == null ? void 0 : n.label), 1),
|
|
1067
|
+
T("span", xt, O(h(n.value)), 1)
|
|
1082
1068
|
])
|
|
1083
|
-
], 8,
|
|
1069
|
+
], 8, wt)
|
|
1084
1070
|
]),
|
|
1085
1071
|
_: 2
|
|
1086
1072
|
}, 1032, ["text"])
|
|
@@ -1088,124 +1074,124 @@ const wt = { class: "kong-ui-entities-vault-form" }, St = { class: "vault-form-p
|
|
|
1088
1074
|
_: 1
|
|
1089
1075
|
}, 8, ["modelValue", "disabled", "items"])
|
|
1090
1076
|
]),
|
|
1091
|
-
c(
|
|
1092
|
-
default:
|
|
1093
|
-
s.value === e(t).ENV ? (
|
|
1094
|
-
c(
|
|
1095
|
-
modelValue:
|
|
1096
|
-
"onUpdate:modelValue":
|
|
1077
|
+
c(Ge, { name: "appear" }, {
|
|
1078
|
+
default: v(() => [
|
|
1079
|
+
s.value === e(t).ENV ? (x(), F("div", At, [
|
|
1080
|
+
c(b, {
|
|
1081
|
+
modelValue: a[e(t).ENV].prefix,
|
|
1082
|
+
"onUpdate:modelValue": l[1] || (l[1] = (n) => a[e(t).ENV].prefix = n),
|
|
1097
1083
|
modelModifiers: { trim: !0 },
|
|
1098
1084
|
autocomplete: "off",
|
|
1099
1085
|
"data-testid": "vault-form-config-kong-prefix",
|
|
1100
1086
|
"is-readonly": d.isReadonly,
|
|
1101
|
-
label: e(
|
|
1087
|
+
label: e(i)("form.config.env.fields.prefix.label"),
|
|
1102
1088
|
"label-attributes": {
|
|
1103
|
-
info: e(
|
|
1089
|
+
info: e(i)("form.config.env.fields.prefix.tooltip"),
|
|
1104
1090
|
tooltipAttributes: { maxWidth: "400" }
|
|
1105
1091
|
},
|
|
1106
|
-
placeholder: e(
|
|
1092
|
+
placeholder: e(i)("form.config.env.fields.prefix.placeholder"),
|
|
1107
1093
|
required: "",
|
|
1108
1094
|
type: "text"
|
|
1109
1095
|
}, null, 8, ["modelValue", "is-readonly", "label", "label-attributes", "placeholder"])
|
|
1110
1096
|
])) : Z("", !0),
|
|
1111
|
-
s.value === e(t).AWS ? (
|
|
1097
|
+
s.value === e(t).AWS ? (x(), F("div", {
|
|
1112
1098
|
key: `${e(t).AWS}-vault-config-fields`,
|
|
1113
1099
|
class: "vault-form-config-fields-container"
|
|
1114
1100
|
}, [
|
|
1115
|
-
c(
|
|
1116
|
-
modelValue:
|
|
1117
|
-
"onUpdate:modelValue":
|
|
1101
|
+
c(K, {
|
|
1102
|
+
modelValue: a[e(t).AWS].region,
|
|
1103
|
+
"onUpdate:modelValue": l[2] || (l[2] = (n) => a[e(t).AWS].region = n),
|
|
1118
1104
|
"data-testid": "vault-form-config-aws-region",
|
|
1119
1105
|
items: Q,
|
|
1120
|
-
label: e(
|
|
1121
|
-
"label-attributes": { info: e(
|
|
1122
|
-
placeholder: e(
|
|
1106
|
+
label: e(i)("form.config.aws.fields.region.label"),
|
|
1107
|
+
"label-attributes": { info: e(i)("form.config.aws.fields.region.tooltip") },
|
|
1108
|
+
placeholder: e(i)("form.config.aws.fields.region.placeholder"),
|
|
1123
1109
|
readonly: d.isReadonly,
|
|
1124
1110
|
required: "",
|
|
1125
1111
|
width: "100%"
|
|
1126
1112
|
}, null, 8, ["modelValue", "label", "label-attributes", "placeholder", "readonly"]),
|
|
1127
|
-
c(
|
|
1128
|
-
modelValue:
|
|
1129
|
-
"onUpdate:modelValue":
|
|
1113
|
+
c(b, {
|
|
1114
|
+
modelValue: a[e(t).AWS].endpoint_url,
|
|
1115
|
+
"onUpdate:modelValue": l[3] || (l[3] = (n) => a[e(t).AWS].endpoint_url = n),
|
|
1130
1116
|
modelModifiers: { trim: !0 },
|
|
1131
1117
|
autocomplete: "off",
|
|
1132
1118
|
"data-testid": "vault-form-config-aws-endpoint_url",
|
|
1133
1119
|
"is-readonly": d.isReadonly,
|
|
1134
|
-
label: e(
|
|
1120
|
+
label: e(i)("form.config.aws.fields.endpoint_url.label"),
|
|
1135
1121
|
"label-attributes": {
|
|
1136
|
-
info: e(
|
|
1122
|
+
info: e(i)("form.config.aws.fields.endpoint_url.tooltip"),
|
|
1137
1123
|
tooltipAttributes: { maxWidth: "400" }
|
|
1138
1124
|
},
|
|
1139
1125
|
type: "text"
|
|
1140
1126
|
}, null, 8, ["modelValue", "is-readonly", "label", "label-attributes"]),
|
|
1141
|
-
c(
|
|
1142
|
-
modelValue:
|
|
1143
|
-
"onUpdate:modelValue":
|
|
1127
|
+
c(b, {
|
|
1128
|
+
modelValue: a[e(t).AWS].assume_role_arn,
|
|
1129
|
+
"onUpdate:modelValue": l[4] || (l[4] = (n) => a[e(t).AWS].assume_role_arn = n),
|
|
1144
1130
|
modelModifiers: { trim: !0 },
|
|
1145
1131
|
autocomplete: "off",
|
|
1146
1132
|
"data-testid": "vault-form-config-aws-assume_role_arn",
|
|
1147
1133
|
"is-readonly": d.isReadonly,
|
|
1148
|
-
label: e(
|
|
1134
|
+
label: e(i)("form.config.aws.fields.assume_role_arn.label"),
|
|
1149
1135
|
"label-attributes": {
|
|
1150
|
-
info: e(
|
|
1136
|
+
info: e(i)("form.config.aws.fields.assume_role_arn.tooltip"),
|
|
1151
1137
|
tooltipAttributes: { maxWidth: "400" }
|
|
1152
1138
|
},
|
|
1153
1139
|
type: "text"
|
|
1154
1140
|
}, null, 8, ["modelValue", "is-readonly", "label", "label-attributes"]),
|
|
1155
|
-
c(
|
|
1156
|
-
modelValue:
|
|
1157
|
-
"onUpdate:modelValue":
|
|
1141
|
+
c(b, {
|
|
1142
|
+
modelValue: a[e(t).AWS].role_session_name,
|
|
1143
|
+
"onUpdate:modelValue": l[5] || (l[5] = (n) => a[e(t).AWS].role_session_name = n),
|
|
1158
1144
|
modelModifiers: { trim: !0 },
|
|
1159
1145
|
autocomplete: "off",
|
|
1160
1146
|
"data-testid": "vault-form-config-aws-role_session_name",
|
|
1161
1147
|
"is-readonly": d.isReadonly,
|
|
1162
|
-
label: e(
|
|
1148
|
+
label: e(i)("form.config.aws.fields.role_session_name.label"),
|
|
1163
1149
|
"label-attributes": {
|
|
1164
|
-
info: e(
|
|
1150
|
+
info: e(i)("form.config.aws.fields.role_session_name.tooltip"),
|
|
1165
1151
|
tooltipAttributes: { maxWidth: "400" }
|
|
1166
1152
|
},
|
|
1167
1153
|
required: "",
|
|
1168
1154
|
type: "text"
|
|
1169
1155
|
}, null, 8, ["modelValue", "is-readonly", "label", "label-attributes"]),
|
|
1170
|
-
|
|
1156
|
+
o.config.awsStsEndpointUrlAvailable ? (x(), ie(b, {
|
|
1171
1157
|
key: 0,
|
|
1172
|
-
modelValue:
|
|
1173
|
-
"onUpdate:modelValue":
|
|
1158
|
+
modelValue: a[e(t).AWS].sts_endpoint_url,
|
|
1159
|
+
"onUpdate:modelValue": l[6] || (l[6] = (n) => a[e(t).AWS].sts_endpoint_url = n),
|
|
1174
1160
|
modelModifiers: { trim: !0 },
|
|
1175
1161
|
autocomplete: "off",
|
|
1176
1162
|
"data-testid": "vault-form-config-aws-sts_endpoint_url",
|
|
1177
1163
|
"is-readonly": d.isReadonly,
|
|
1178
|
-
label: e(
|
|
1164
|
+
label: e(i)("form.config.aws.fields.sts_endpoint_url.label"),
|
|
1179
1165
|
"label-attributes": {
|
|
1180
|
-
info: e(
|
|
1166
|
+
info: e(i)("form.config.aws.fields.sts_endpoint_url.tooltip"),
|
|
1181
1167
|
tooltipAttributes: { maxWidth: "400" }
|
|
1182
1168
|
},
|
|
1183
1169
|
type: "text"
|
|
1184
1170
|
}, null, 8, ["modelValue", "is-readonly", "label", "label-attributes"])) : Z("", !0)
|
|
1185
1171
|
])) : Z("", !0),
|
|
1186
|
-
s.value === e(t).GCP ? (
|
|
1172
|
+
s.value === e(t).GCP ? (x(), F("div", {
|
|
1187
1173
|
key: `${e(t).GCP}-vault-config-fields`,
|
|
1188
1174
|
class: "vault-form-config-fields-container"
|
|
1189
1175
|
}, [
|
|
1190
|
-
c(
|
|
1191
|
-
modelValue:
|
|
1192
|
-
"onUpdate:modelValue":
|
|
1176
|
+
c(b, {
|
|
1177
|
+
modelValue: a[e(t).GCP].project_id,
|
|
1178
|
+
"onUpdate:modelValue": l[7] || (l[7] = (n) => a[e(t).GCP].project_id = n),
|
|
1193
1179
|
modelModifiers: { trim: !0 },
|
|
1194
1180
|
autocomplete: "off",
|
|
1195
1181
|
"data-testid": "vault-form-config-gcp-project-id",
|
|
1196
1182
|
"is-readonly": d.isReadonly,
|
|
1197
|
-
label: e(
|
|
1198
|
-
placeholder: e(
|
|
1183
|
+
label: e(i)("form.config.gcp.fields.project_id.label"),
|
|
1184
|
+
placeholder: e(i)("form.config.gcp.fields.project_id.placeholder"),
|
|
1199
1185
|
required: "",
|
|
1200
1186
|
type: "text"
|
|
1201
1187
|
}, {
|
|
1202
|
-
"label-tooltip":
|
|
1188
|
+
"label-tooltip": v(() => [
|
|
1203
1189
|
c(e(p), {
|
|
1204
1190
|
keypath: "form.config.gcp.fields.project_id.tooltip.text",
|
|
1205
1191
|
scope: "global"
|
|
1206
1192
|
}, {
|
|
1207
|
-
"italic-text":
|
|
1208
|
-
T("em", null,
|
|
1193
|
+
"italic-text": v(() => [
|
|
1194
|
+
T("em", null, O(e(i)("form.config.gcp.fields.project_id.tooltip.italicText")), 1)
|
|
1209
1195
|
]),
|
|
1210
1196
|
_: 1
|
|
1211
1197
|
})
|
|
@@ -1213,297 +1199,297 @@ const wt = { class: "kong-ui-entities-vault-form" }, St = { class: "vault-form-p
|
|
|
1213
1199
|
_: 1
|
|
1214
1200
|
}, 8, ["modelValue", "is-readonly", "label", "placeholder"])
|
|
1215
1201
|
])) : Z("", !0),
|
|
1216
|
-
s.value === e(t).HCV ? (
|
|
1202
|
+
s.value === e(t).HCV ? (x(), F("div", {
|
|
1217
1203
|
key: `${e(t).HCV}-vault-config-fields`,
|
|
1218
1204
|
class: "vault-form-config-fields-container"
|
|
1219
1205
|
}, [
|
|
1220
|
-
c(
|
|
1221
|
-
modelValue:
|
|
1222
|
-
"onUpdate:modelValue":
|
|
1206
|
+
c(K, {
|
|
1207
|
+
modelValue: a[e(t).HCV].protocol,
|
|
1208
|
+
"onUpdate:modelValue": l[8] || (l[8] = (n) => a[e(t).HCV].protocol = n),
|
|
1223
1209
|
"data-testid": "vault-form-config-hcv-protocol",
|
|
1224
1210
|
items: Y,
|
|
1225
|
-
label: e(
|
|
1211
|
+
label: e(i)("form.config.hcv.fields.protocol.label"),
|
|
1226
1212
|
readonly: d.isReadonly,
|
|
1227
1213
|
required: "",
|
|
1228
1214
|
width: "100%"
|
|
1229
1215
|
}, null, 8, ["modelValue", "label", "readonly"]),
|
|
1230
|
-
c(
|
|
1231
|
-
modelValue:
|
|
1232
|
-
"onUpdate:modelValue":
|
|
1216
|
+
c(b, {
|
|
1217
|
+
modelValue: a[e(t).HCV].host,
|
|
1218
|
+
"onUpdate:modelValue": l[9] || (l[9] = (n) => a[e(t).HCV].host = n),
|
|
1233
1219
|
modelModifiers: { trim: !0 },
|
|
1234
1220
|
autocomplete: "off",
|
|
1235
1221
|
"data-testid": "vault-form-config-hcv-host",
|
|
1236
1222
|
"is-readonly": d.isReadonly,
|
|
1237
|
-
label: e(
|
|
1223
|
+
label: e(i)("form.config.hcv.fields.host.label"),
|
|
1238
1224
|
required: "",
|
|
1239
1225
|
type: "text"
|
|
1240
1226
|
}, null, 8, ["modelValue", "is-readonly", "label"]),
|
|
1241
|
-
c(
|
|
1242
|
-
modelValue:
|
|
1243
|
-
"onUpdate:modelValue":
|
|
1227
|
+
c(b, {
|
|
1228
|
+
modelValue: a[e(t).HCV].port,
|
|
1229
|
+
"onUpdate:modelValue": l[10] || (l[10] = (n) => a[e(t).HCV].port = n),
|
|
1244
1230
|
autocomplete: "off",
|
|
1245
1231
|
"data-testid": "vault-form-config-hcv-port",
|
|
1246
1232
|
"is-readonly": d.isReadonly,
|
|
1247
|
-
label: e(
|
|
1233
|
+
label: e(i)("form.config.hcv.fields.port.label"),
|
|
1248
1234
|
min: "0",
|
|
1249
1235
|
required: "",
|
|
1250
1236
|
type: "number"
|
|
1251
1237
|
}, null, 8, ["modelValue", "is-readonly", "label"]),
|
|
1252
|
-
c(
|
|
1253
|
-
modelValue:
|
|
1254
|
-
"onUpdate:modelValue":
|
|
1238
|
+
c(b, {
|
|
1239
|
+
modelValue: a[e(t).HCV].mount,
|
|
1240
|
+
"onUpdate:modelValue": l[11] || (l[11] = (n) => a[e(t).HCV].mount = n),
|
|
1255
1241
|
modelModifiers: { trim: !0 },
|
|
1256
1242
|
autocomplete: "off",
|
|
1257
1243
|
"data-testid": "vault-form-config-hcv-mount",
|
|
1258
1244
|
"is-readonly": d.isReadonly,
|
|
1259
|
-
label: e(
|
|
1245
|
+
label: e(i)("form.config.hcv.fields.mount.label"),
|
|
1260
1246
|
required: "",
|
|
1261
1247
|
type: "text"
|
|
1262
1248
|
}, null, 8, ["modelValue", "is-readonly", "label"]),
|
|
1263
|
-
c(
|
|
1264
|
-
modelValue:
|
|
1265
|
-
"onUpdate:modelValue":
|
|
1249
|
+
c(K, {
|
|
1250
|
+
modelValue: a[e(t).HCV].kv,
|
|
1251
|
+
"onUpdate:modelValue": l[12] || (l[12] = (n) => a[e(t).HCV].kv = n),
|
|
1266
1252
|
"data-testid": "vault-form-config-hcv-kv",
|
|
1267
1253
|
items: L,
|
|
1268
|
-
label: e(
|
|
1254
|
+
label: e(i)("form.config.hcv.fields.kv.label"),
|
|
1269
1255
|
readonly: d.isReadonly,
|
|
1270
1256
|
required: "",
|
|
1271
1257
|
width: "100%"
|
|
1272
1258
|
}, null, 8, ["modelValue", "label", "readonly"]),
|
|
1273
|
-
c(
|
|
1274
|
-
modelValue:
|
|
1275
|
-
"onUpdate:modelValue":
|
|
1259
|
+
c(b, {
|
|
1260
|
+
modelValue: a[e(t).HCV].namespace,
|
|
1261
|
+
"onUpdate:modelValue": l[13] || (l[13] = (n) => a[e(t).HCV].namespace = n),
|
|
1276
1262
|
modelModifiers: { trim: !0 },
|
|
1277
1263
|
autocomplete: "off",
|
|
1278
1264
|
"data-testid": "vault-form-config-hcv-namespace",
|
|
1279
1265
|
"is-readonly": d.isReadonly,
|
|
1280
|
-
label: e(
|
|
1266
|
+
label: e(i)("form.config.hcv.fields.namespace.label"),
|
|
1281
1267
|
type: "text"
|
|
1282
1268
|
}, null, 8, ["modelValue", "is-readonly", "label"]),
|
|
1283
|
-
c(
|
|
1284
|
-
modelValue:
|
|
1285
|
-
"onUpdate:modelValue":
|
|
1269
|
+
c(K, {
|
|
1270
|
+
modelValue: a[e(t).HCV].auth_method,
|
|
1271
|
+
"onUpdate:modelValue": l[14] || (l[14] = (n) => a[e(t).HCV].auth_method = n),
|
|
1286
1272
|
"data-testid": "vault-form-config-hcv-auth_method",
|
|
1287
1273
|
items: [
|
|
1288
1274
|
{ label: e(R).TOKEN, value: e(R).TOKEN },
|
|
1289
1275
|
{ label: e(R).K8S, value: e(R).K8S },
|
|
1290
|
-
...
|
|
1276
|
+
...o.config.hcvAppRoleMethodAvailable ? [{ label: e(R).APP_ROLE, value: e(R).APP_ROLE }] : []
|
|
1291
1277
|
],
|
|
1292
|
-
label: e(
|
|
1278
|
+
label: e(i)("form.config.hcv.fields.auth_method.label"),
|
|
1293
1279
|
readonly: d.isReadonly,
|
|
1294
1280
|
required: "",
|
|
1295
1281
|
width: "100%"
|
|
1296
1282
|
}, null, 8, ["modelValue", "items", "label", "readonly"]),
|
|
1297
|
-
|
|
1298
|
-
c(
|
|
1299
|
-
modelValue:
|
|
1300
|
-
"onUpdate:modelValue":
|
|
1283
|
+
a[e(t).HCV].auth_method === e(R).TOKEN ? (x(), F("div", It, [
|
|
1284
|
+
c(b, {
|
|
1285
|
+
modelValue: a[e(t).HCV].token,
|
|
1286
|
+
"onUpdate:modelValue": l[15] || (l[15] = (n) => a[e(t).HCV].token = n),
|
|
1301
1287
|
modelModifiers: { trim: !0 },
|
|
1302
1288
|
autocomplete: "off",
|
|
1303
1289
|
"data-testid": "vault-form-config-hcv-token",
|
|
1304
1290
|
"is-readonly": d.isReadonly,
|
|
1305
|
-
label: e(
|
|
1291
|
+
label: e(i)("form.config.hcv.fields.token.label"),
|
|
1306
1292
|
required: "",
|
|
1307
1293
|
type: "text"
|
|
1308
1294
|
}, null, 8, ["modelValue", "is-readonly", "label"])
|
|
1309
|
-
])) :
|
|
1310
|
-
c(
|
|
1311
|
-
modelValue:
|
|
1312
|
-
"onUpdate:modelValue":
|
|
1295
|
+
])) : a[e(t).HCV].auth_method === e(R).K8S ? (x(), F("div", Rt, [
|
|
1296
|
+
c(b, {
|
|
1297
|
+
modelValue: a[e(t).HCV].kube_role,
|
|
1298
|
+
"onUpdate:modelValue": l[16] || (l[16] = (n) => a[e(t).HCV].kube_role = n),
|
|
1313
1299
|
modelModifiers: { trim: !0 },
|
|
1314
1300
|
autocomplete: "off",
|
|
1315
1301
|
"data-testid": "vault-form-config-hcv-kube_role",
|
|
1316
1302
|
"is-readonly": d.isReadonly,
|
|
1317
|
-
label: e(
|
|
1303
|
+
label: e(i)("form.config.hcv.fields.kube_role.label"),
|
|
1318
1304
|
required: "",
|
|
1319
1305
|
type: "text"
|
|
1320
1306
|
}, null, 8, ["modelValue", "is-readonly", "label"]),
|
|
1321
|
-
c(
|
|
1322
|
-
modelValue:
|
|
1323
|
-
"onUpdate:modelValue":
|
|
1307
|
+
c(b, {
|
|
1308
|
+
modelValue: a[e(t).HCV].kube_auth_path,
|
|
1309
|
+
"onUpdate:modelValue": l[17] || (l[17] = (n) => a[e(t).HCV].kube_auth_path = n),
|
|
1324
1310
|
modelModifiers: { trim: !0 },
|
|
1325
1311
|
autocomplete: "off",
|
|
1326
1312
|
"data-testid": "vault-form-config-hcv-kube_auth_path",
|
|
1327
1313
|
"is-readonly": d.isReadonly,
|
|
1328
|
-
label: e(
|
|
1314
|
+
label: e(i)("form.config.hcv.fields.kube_auth_path.label"),
|
|
1329
1315
|
type: "text"
|
|
1330
1316
|
}, null, 8, ["modelValue", "is-readonly", "label"]),
|
|
1331
|
-
c(
|
|
1332
|
-
modelValue:
|
|
1333
|
-
"onUpdate:modelValue":
|
|
1317
|
+
c(b, {
|
|
1318
|
+
modelValue: a[e(t).HCV].kube_api_token_file,
|
|
1319
|
+
"onUpdate:modelValue": l[18] || (l[18] = (n) => a[e(t).HCV].kube_api_token_file = n),
|
|
1334
1320
|
modelModifiers: { trim: !0 },
|
|
1335
1321
|
autocomplete: "off",
|
|
1336
1322
|
"data-testid": "vault-form-config-hcv-kube_api_token_file",
|
|
1337
1323
|
"is-readonly": d.isReadonly,
|
|
1338
|
-
label: e(
|
|
1324
|
+
label: e(i)("form.config.hcv.fields.kube_api_token_file.label"),
|
|
1339
1325
|
required: "",
|
|
1340
1326
|
type: "text"
|
|
1341
1327
|
}, null, 8, ["modelValue", "is-readonly", "label"])
|
|
1342
|
-
])) :
|
|
1343
|
-
c(
|
|
1344
|
-
modelValue:
|
|
1345
|
-
"onUpdate:modelValue":
|
|
1328
|
+
])) : a[e(t).HCV].auth_method === e(R).APP_ROLE ? (x(), F("div", Tt, [
|
|
1329
|
+
c(b, {
|
|
1330
|
+
modelValue: a[e(t).HCV].approle_auth_path,
|
|
1331
|
+
"onUpdate:modelValue": l[19] || (l[19] = (n) => a[e(t).HCV].approle_auth_path = n),
|
|
1346
1332
|
modelModifiers: { trim: !0 },
|
|
1347
1333
|
autocomplete: "off",
|
|
1348
1334
|
"data-testid": "vault-form-config-hcv-approle_auth_path",
|
|
1349
1335
|
"is-readonly": d.isReadonly,
|
|
1350
|
-
label: e(
|
|
1336
|
+
label: e(i)("form.config.hcv.fields.approle_auth_path.label"),
|
|
1351
1337
|
type: "text"
|
|
1352
1338
|
}, null, 8, ["modelValue", "is-readonly", "label"]),
|
|
1353
|
-
c(
|
|
1354
|
-
modelValue:
|
|
1355
|
-
"onUpdate:modelValue":
|
|
1339
|
+
c(b, {
|
|
1340
|
+
modelValue: a[e(t).HCV].approle_role_id,
|
|
1341
|
+
"onUpdate:modelValue": l[20] || (l[20] = (n) => a[e(t).HCV].approle_role_id = n),
|
|
1356
1342
|
modelModifiers: { trim: !0 },
|
|
1357
1343
|
autocomplete: "off",
|
|
1358
1344
|
"data-testid": "vault-form-config-hcv-approle_role_id",
|
|
1359
1345
|
"is-readonly": d.isReadonly,
|
|
1360
|
-
label: e(
|
|
1346
|
+
label: e(i)("form.config.hcv.fields.approle_role_id.label"),
|
|
1361
1347
|
required: "",
|
|
1362
1348
|
type: "text"
|
|
1363
1349
|
}, null, 8, ["modelValue", "is-readonly", "label"]),
|
|
1364
|
-
c(
|
|
1365
|
-
modelValue:
|
|
1366
|
-
"onUpdate:modelValue":
|
|
1350
|
+
c(b, {
|
|
1351
|
+
modelValue: a[e(t).HCV].approle_secret_id,
|
|
1352
|
+
"onUpdate:modelValue": l[21] || (l[21] = (n) => a[e(t).HCV].approle_secret_id = n),
|
|
1367
1353
|
modelModifiers: { trim: !0 },
|
|
1368
1354
|
autocomplete: "off",
|
|
1369
1355
|
"data-testid": "vault-form-config-hcv-approle_secret_id",
|
|
1370
1356
|
"is-readonly": d.isReadonly,
|
|
1371
|
-
label: e(
|
|
1357
|
+
label: e(i)("form.config.hcv.fields.approle_secret_id.label"),
|
|
1372
1358
|
type: "text"
|
|
1373
1359
|
}, null, 8, ["modelValue", "is-readonly", "label"]),
|
|
1374
|
-
c(
|
|
1375
|
-
modelValue:
|
|
1376
|
-
"onUpdate:modelValue":
|
|
1360
|
+
c(b, {
|
|
1361
|
+
modelValue: a[e(t).HCV].approle_secret_id_file,
|
|
1362
|
+
"onUpdate:modelValue": l[22] || (l[22] = (n) => a[e(t).HCV].approle_secret_id_file = n),
|
|
1377
1363
|
modelModifiers: { trim: !0 },
|
|
1378
1364
|
autocomplete: "off",
|
|
1379
1365
|
"data-testid": "vault-form-config-hcv-approle_secret_id_file",
|
|
1380
1366
|
"is-readonly": d.isReadonly,
|
|
1381
|
-
label: e(
|
|
1367
|
+
label: e(i)("form.config.hcv.fields.approle_secret_id_file.label"),
|
|
1382
1368
|
type: "text"
|
|
1383
1369
|
}, null, 8, ["modelValue", "is-readonly", "label"]),
|
|
1384
|
-
c(
|
|
1385
|
-
modelValue:
|
|
1386
|
-
"onUpdate:modelValue":
|
|
1370
|
+
c(be, {
|
|
1371
|
+
modelValue: a[e(t).HCV].approle_response_wrapping,
|
|
1372
|
+
"onUpdate:modelValue": l[23] || (l[23] = (n) => a[e(t).HCV].approle_response_wrapping = n),
|
|
1387
1373
|
"data-testid": "vault-form-config-hcv-approle_response_wrapping",
|
|
1388
|
-
label: e(
|
|
1374
|
+
label: e(i)("form.config.hcv.fields.approle_response_wrapping.label")
|
|
1389
1375
|
}, null, 8, ["modelValue", "label"])
|
|
1390
1376
|
])) : Z("", !0)
|
|
1391
1377
|
])) : Z("", !0),
|
|
1392
|
-
s.value === e(t).AZURE ? (
|
|
1378
|
+
s.value === e(t).AZURE ? (x(), F("div", {
|
|
1393
1379
|
key: `${e(t).HCV}-vault-config-fields`,
|
|
1394
1380
|
class: "vault-form-config-fields-container"
|
|
1395
1381
|
}, [
|
|
1396
|
-
c(
|
|
1397
|
-
modelValue:
|
|
1398
|
-
"onUpdate:modelValue":
|
|
1382
|
+
c(b, {
|
|
1383
|
+
modelValue: a[e(t).AZURE].location,
|
|
1384
|
+
"onUpdate:modelValue": l[24] || (l[24] = (n) => a[e(t).AZURE].location = n),
|
|
1399
1385
|
modelModifiers: { trim: !0 },
|
|
1400
1386
|
autocomplete: "off",
|
|
1401
1387
|
"data-testid": "vault-form-config-azure-location",
|
|
1402
1388
|
"is-readonly": d.isReadonly,
|
|
1403
|
-
label: e(
|
|
1389
|
+
label: e(i)("form.config.azure.fields.location.label"),
|
|
1404
1390
|
required: "",
|
|
1405
1391
|
type: "text"
|
|
1406
1392
|
}, null, 8, ["modelValue", "is-readonly", "label"]),
|
|
1407
|
-
c(
|
|
1408
|
-
modelValue:
|
|
1409
|
-
"onUpdate:modelValue":
|
|
1393
|
+
c(b, {
|
|
1394
|
+
modelValue: a[e(t).AZURE].vault_uri,
|
|
1395
|
+
"onUpdate:modelValue": l[25] || (l[25] = (n) => a[e(t).AZURE].vault_uri = n),
|
|
1410
1396
|
modelModifiers: { trim: !0 },
|
|
1411
1397
|
autocomplete: "off",
|
|
1412
1398
|
"data-testid": "vault-form-config-azure-uri",
|
|
1413
1399
|
"is-readonly": d.isReadonly,
|
|
1414
|
-
label: e(
|
|
1400
|
+
label: e(i)("form.config.azure.fields.vault_uri.label"),
|
|
1415
1401
|
required: "",
|
|
1416
1402
|
type: "text"
|
|
1417
1403
|
}, null, 8, ["modelValue", "is-readonly", "label"]),
|
|
1418
|
-
c(
|
|
1419
|
-
modelValue:
|
|
1420
|
-
"onUpdate:modelValue":
|
|
1404
|
+
c(b, {
|
|
1405
|
+
modelValue: a[e(t).AZURE].credentials_prefix,
|
|
1406
|
+
"onUpdate:modelValue": l[26] || (l[26] = (n) => a[e(t).AZURE].credentials_prefix = n),
|
|
1421
1407
|
modelModifiers: { trim: !0 },
|
|
1422
1408
|
autocomplete: "off",
|
|
1423
1409
|
"data-testid": "vault-form-config-azure-prefix",
|
|
1424
1410
|
"is-readonly": d.isReadonly,
|
|
1425
|
-
label: e(
|
|
1411
|
+
label: e(i)("form.config.azure.fields.credential_prefix.label"),
|
|
1426
1412
|
required: "",
|
|
1427
1413
|
type: "text"
|
|
1428
1414
|
}, null, 8, ["modelValue", "is-readonly", "label"]),
|
|
1429
|
-
c(
|
|
1430
|
-
modelValue:
|
|
1431
|
-
"onUpdate:modelValue":
|
|
1415
|
+
c(K, {
|
|
1416
|
+
modelValue: a[e(t).AZURE].type,
|
|
1417
|
+
"onUpdate:modelValue": l[27] || (l[27] = (n) => a[e(t).AZURE].type = n),
|
|
1432
1418
|
"data-testid": "vault-form-config-azure-type",
|
|
1433
|
-
items:
|
|
1434
|
-
label: e(
|
|
1435
|
-
placeholder: e(
|
|
1419
|
+
items: H,
|
|
1420
|
+
label: e(i)("form.config.azure.fields.type.label"),
|
|
1421
|
+
placeholder: e(i)("form.config.azure.fields.type.placeholder"),
|
|
1436
1422
|
readonly: d.isReadonly,
|
|
1437
1423
|
required: "",
|
|
1438
1424
|
width: "100%"
|
|
1439
1425
|
}, null, 8, ["modelValue", "label", "placeholder", "readonly"]),
|
|
1440
|
-
c(
|
|
1441
|
-
modelValue:
|
|
1442
|
-
"onUpdate:modelValue":
|
|
1426
|
+
c(b, {
|
|
1427
|
+
modelValue: a[e(t).AZURE].client_id,
|
|
1428
|
+
"onUpdate:modelValue": l[28] || (l[28] = (n) => a[e(t).AZURE].client_id = n),
|
|
1443
1429
|
modelModifiers: { trim: !0 },
|
|
1444
1430
|
autocomplete: "off",
|
|
1445
1431
|
"data-testid": "vault-form-config-azure-client-id",
|
|
1446
1432
|
"is-readonly": d.isReadonly,
|
|
1447
|
-
label: e(
|
|
1433
|
+
label: e(i)("form.config.azure.fields.client_id.label"),
|
|
1448
1434
|
type: "text"
|
|
1449
1435
|
}, null, 8, ["modelValue", "is-readonly", "label"]),
|
|
1450
|
-
c(
|
|
1451
|
-
modelValue:
|
|
1452
|
-
"onUpdate:modelValue":
|
|
1436
|
+
c(b, {
|
|
1437
|
+
modelValue: a[e(t).AZURE].tenant_id,
|
|
1438
|
+
"onUpdate:modelValue": l[29] || (l[29] = (n) => a[e(t).AZURE].tenant_id = n),
|
|
1453
1439
|
modelModifiers: { trim: !0 },
|
|
1454
1440
|
autocomplete: "off",
|
|
1455
1441
|
"data-testid": "vault-form-config-azure-tenant-id",
|
|
1456
1442
|
"is-readonly": d.isReadonly,
|
|
1457
|
-
label: e(
|
|
1443
|
+
label: e(i)("form.config.azure.fields.tenant_id.label"),
|
|
1458
1444
|
type: "text"
|
|
1459
1445
|
}, null, 8, ["modelValue", "is-readonly", "label"])
|
|
1460
1446
|
])) : Z("", !0),
|
|
1461
|
-
|
|
1462
|
-
|
|
1447
|
+
o.config.ttl ? (x(), F("div", Ut, [
|
|
1448
|
+
le.value ? (x(), ie(ne, {
|
|
1463
1449
|
key: 0,
|
|
1464
1450
|
class: "advanced-fields-collapse",
|
|
1465
1451
|
"data-testid": "advanced-fields-collapse",
|
|
1466
1452
|
"trigger-alignment": "leading",
|
|
1467
|
-
"trigger-label": e(
|
|
1453
|
+
"trigger-label": e(i)("form.config.advancedFields.title")
|
|
1468
1454
|
}, {
|
|
1469
|
-
default:
|
|
1470
|
-
T("div",
|
|
1471
|
-
T("div",
|
|
1472
|
-
c(
|
|
1473
|
-
modelValue:
|
|
1474
|
-
"onUpdate:modelValue":
|
|
1455
|
+
default: v(() => [
|
|
1456
|
+
T("div", $t, [
|
|
1457
|
+
T("div", Ht, [
|
|
1458
|
+
c(b, {
|
|
1459
|
+
modelValue: a[s.value].ttl,
|
|
1460
|
+
"onUpdate:modelValue": l[30] || (l[30] = (n) => a[s.value].ttl = n),
|
|
1475
1461
|
"data-testid": "vault-ttl-input",
|
|
1476
|
-
label: e(
|
|
1462
|
+
label: e(i)("form.config.advancedFields.ttl"),
|
|
1477
1463
|
"label-attributes": {
|
|
1478
|
-
info: e(
|
|
1464
|
+
info: e(i)("form.config.advancedFields.ttlTooltip"),
|
|
1479
1465
|
tooltipAttributes: { maxWidth: "400" }
|
|
1480
1466
|
},
|
|
1481
1467
|
type: "number"
|
|
1482
1468
|
}, null, 8, ["modelValue", "label", "label-attributes"])
|
|
1483
1469
|
]),
|
|
1484
|
-
T("div",
|
|
1485
|
-
c(
|
|
1486
|
-
modelValue:
|
|
1487
|
-
"onUpdate:modelValue":
|
|
1470
|
+
T("div", Mt, [
|
|
1471
|
+
c(b, {
|
|
1472
|
+
modelValue: a[s.value].neg_ttl,
|
|
1473
|
+
"onUpdate:modelValue": l[31] || (l[31] = (n) => a[s.value].neg_ttl = n),
|
|
1488
1474
|
"data-testid": "vault-neg-ttl-input",
|
|
1489
|
-
label: e(
|
|
1475
|
+
label: e(i)("form.config.advancedFields.negTtl"),
|
|
1490
1476
|
"label-attributes": {
|
|
1491
|
-
info: e(
|
|
1477
|
+
info: e(i)("form.config.advancedFields.negTtlTooltip"),
|
|
1492
1478
|
tooltipAttributes: { maxWidth: "400" }
|
|
1493
1479
|
},
|
|
1494
1480
|
type: "number"
|
|
1495
1481
|
}, null, 8, ["modelValue", "label", "label-attributes"])
|
|
1496
1482
|
])
|
|
1497
1483
|
]),
|
|
1498
|
-
T("div",
|
|
1499
|
-
T("div",
|
|
1500
|
-
c(
|
|
1501
|
-
modelValue:
|
|
1502
|
-
"onUpdate:modelValue":
|
|
1484
|
+
T("div", Kt, [
|
|
1485
|
+
T("div", Pt, [
|
|
1486
|
+
c(b, {
|
|
1487
|
+
modelValue: a[s.value].resurrect_ttl,
|
|
1488
|
+
"onUpdate:modelValue": l[32] || (l[32] = (n) => a[s.value].resurrect_ttl = n),
|
|
1503
1489
|
"data-testid": "vault-resurrect-ttl-input",
|
|
1504
|
-
label: e(
|
|
1490
|
+
label: e(i)("form.config.advancedFields.resurrectTtl"),
|
|
1505
1491
|
"label-attributes": {
|
|
1506
|
-
info: e(
|
|
1492
|
+
info: e(i)("form.config.advancedFields.resurrectTtlTooltip"),
|
|
1507
1493
|
tooltipAttributes: { maxWidth: "400" }
|
|
1508
1494
|
},
|
|
1509
1495
|
type: "number"
|
|
@@ -1521,48 +1507,48 @@ const wt = { class: "kong-ui-entities-vault-form" }, St = { class: "vault-form-p
|
|
|
1521
1507
|
_: 1
|
|
1522
1508
|
}, 8, ["description", "title"]),
|
|
1523
1509
|
c(e(Se), {
|
|
1524
|
-
description: e(
|
|
1525
|
-
title: e(
|
|
1510
|
+
description: e(i)("form.sections.general.description"),
|
|
1511
|
+
title: e(i)("form.sections.general.title")
|
|
1526
1512
|
}, {
|
|
1527
|
-
default:
|
|
1528
|
-
c(
|
|
1513
|
+
default: v(() => [
|
|
1514
|
+
c(b, {
|
|
1529
1515
|
modelValue: d.fields.prefix,
|
|
1530
|
-
"onUpdate:modelValue":
|
|
1516
|
+
"onUpdate:modelValue": l[33] || (l[33] = (n) => d.fields.prefix = n),
|
|
1531
1517
|
modelModifiers: { trim: !0 },
|
|
1532
1518
|
autocomplete: "off",
|
|
1533
1519
|
"data-testid": "vault-form-prefix",
|
|
1534
|
-
help: e(
|
|
1520
|
+
help: e(i)("form.fields.prefix.help"),
|
|
1535
1521
|
"is-readonly": d.isReadonly,
|
|
1536
|
-
label: e(
|
|
1522
|
+
label: e(i)("form.fields.prefix.label"),
|
|
1537
1523
|
"label-attributes": {
|
|
1538
|
-
info: e(
|
|
1524
|
+
info: e(i)("form.fields.prefix.tooltip"),
|
|
1539
1525
|
tooltipAttributes: { maxWidth: "400" }
|
|
1540
1526
|
},
|
|
1541
|
-
placeholder: e(
|
|
1527
|
+
placeholder: e(i)("form.fields.prefix.placeholder"),
|
|
1542
1528
|
required: "",
|
|
1543
1529
|
type: "text"
|
|
1544
1530
|
}, null, 8, ["modelValue", "help", "is-readonly", "label", "label-attributes", "placeholder"]),
|
|
1545
|
-
c(
|
|
1531
|
+
c(se, {
|
|
1546
1532
|
modelValue: d.fields.description,
|
|
1547
|
-
"onUpdate:modelValue":
|
|
1533
|
+
"onUpdate:modelValue": l[34] || (l[34] = (n) => d.fields.description = n),
|
|
1548
1534
|
modelModifiers: { trim: !0 },
|
|
1549
1535
|
"character-limit": 1e3,
|
|
1550
1536
|
class: "vault-form-textarea",
|
|
1551
1537
|
"data-testid": "vault-form-description",
|
|
1552
|
-
label: e(
|
|
1553
|
-
placeholder: e(
|
|
1538
|
+
label: e(i)("form.fields.description.label"),
|
|
1539
|
+
placeholder: e(i)("form.fields.description.placeholder"),
|
|
1554
1540
|
readonly: d.isReadonly
|
|
1555
1541
|
}, null, 8, ["modelValue", "label", "placeholder", "readonly"]),
|
|
1556
|
-
c(
|
|
1542
|
+
c(b, {
|
|
1557
1543
|
modelValue: d.fields.tags,
|
|
1558
|
-
"onUpdate:modelValue":
|
|
1544
|
+
"onUpdate:modelValue": l[35] || (l[35] = (n) => d.fields.tags = n),
|
|
1559
1545
|
modelModifiers: { trim: !0 },
|
|
1560
1546
|
autocomplete: "off",
|
|
1561
1547
|
"data-testid": "vault-form-tags",
|
|
1562
|
-
help: e(
|
|
1548
|
+
help: e(i)("form.fields.tags.help"),
|
|
1563
1549
|
"is-readonly": d.isReadonly,
|
|
1564
|
-
label: e(
|
|
1565
|
-
placeholder: e(
|
|
1550
|
+
label: e(i)("form.fields.tags.label"),
|
|
1551
|
+
placeholder: e(i)("form.fields.tags.placeholder"),
|
|
1566
1552
|
type: "text"
|
|
1567
1553
|
}, null, 8, ["modelValue", "help", "is-readonly", "label", "placeholder"])
|
|
1568
1554
|
]),
|
|
@@ -1574,14 +1560,14 @@ const wt = { class: "kong-ui-entities-vault-form" }, St = { class: "vault-form-p
|
|
|
1574
1560
|
]);
|
|
1575
1561
|
};
|
|
1576
1562
|
}
|
|
1577
|
-
}),
|
|
1563
|
+
}), tl = /* @__PURE__ */ ve(Nt, [["__scopeId", "data-v-a4e9b325"]]), Ft = { class: "kong-ui-vault-entity-config-card" }, ll = /* @__PURE__ */ de({
|
|
1578
1564
|
__name: "VaultConfigCard",
|
|
1579
1565
|
props: {
|
|
1580
1566
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
1581
1567
|
config: {
|
|
1582
1568
|
type: Object,
|
|
1583
1569
|
required: !0,
|
|
1584
|
-
validator: (
|
|
1570
|
+
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)
|
|
1585
1571
|
},
|
|
1586
1572
|
/**
|
|
1587
1573
|
* External link for documentation that determines visibility of Documentation button
|
|
@@ -1600,11 +1586,11 @@ const wt = { class: "kong-ui-entities-vault-form" }, St = { class: "vault-form-p
|
|
|
1600
1586
|
}
|
|
1601
1587
|
},
|
|
1602
1588
|
emits: ["loading", "fetch:error", "fetch:success"],
|
|
1603
|
-
setup(
|
|
1604
|
-
const
|
|
1605
|
-
var
|
|
1606
|
-
return (
|
|
1607
|
-
}), { i18n: { t: u } } = he.useI18n(), p =
|
|
1589
|
+
setup(o) {
|
|
1590
|
+
const P = o, f = V(() => {
|
|
1591
|
+
var i, S;
|
|
1592
|
+
return (S = me.form[(i = P.config) == null ? void 0 : i.app]) == null ? void 0 : S.edit;
|
|
1593
|
+
}), { i18n: { t: u } } = he.useI18n(), p = k({
|
|
1608
1594
|
id: {},
|
|
1609
1595
|
name: {
|
|
1610
1596
|
label: u("labels.vault_type")
|
|
@@ -1624,20 +1610,20 @@ const wt = { class: "kong-ui-entities-vault-form" }, St = { class: "vault-form-p
|
|
|
1624
1610
|
},
|
|
1625
1611
|
config: {
|
|
1626
1612
|
order: 8,
|
|
1627
|
-
type:
|
|
1613
|
+
type: at.Json
|
|
1628
1614
|
}
|
|
1629
1615
|
});
|
|
1630
|
-
return (
|
|
1631
|
-
c(e(
|
|
1632
|
-
config:
|
|
1633
|
-
"config-card-doc":
|
|
1616
|
+
return (i, S) => (x(), F("div", Ft, [
|
|
1617
|
+
c(e(it), {
|
|
1618
|
+
config: o.config,
|
|
1619
|
+
"config-card-doc": o.configCardDoc,
|
|
1634
1620
|
"config-schema": p.value,
|
|
1635
1621
|
"entity-type": e(xe).Vault,
|
|
1636
1622
|
"fetch-url": f.value,
|
|
1637
|
-
"hide-title":
|
|
1638
|
-
"onFetch:error":
|
|
1639
|
-
"onFetch:success":
|
|
1640
|
-
onLoading:
|
|
1623
|
+
"hide-title": o.hideTitle,
|
|
1624
|
+
"onFetch:error": S[0] || (S[0] = (E) => i.$emit("fetch:error", E)),
|
|
1625
|
+
"onFetch:success": S[1] || (S[1] = (E) => i.$emit("fetch:success", E)),
|
|
1626
|
+
onLoading: S[2] || (S[2] = (E) => i.$emit("loading", E))
|
|
1641
1627
|
}, null, 8, ["config", "config-card-doc", "config-schema", "entity-type", "fetch-url", "hide-title"])
|
|
1642
1628
|
]));
|
|
1643
1629
|
}
|
|
@@ -1654,7 +1640,7 @@ const wt = { class: "kong-ui-entities-vault-form" }, St = { class: "vault-form-p
|
|
|
1654
1640
|
edit: `${_e}/config-stores/{id}/secrets/{secretId}`
|
|
1655
1641
|
}
|
|
1656
1642
|
}
|
|
1657
|
-
},
|
|
1643
|
+
}, Ot = { class: "table-content-overflow-wrapper" }, Dt = /* @__PURE__ */ de({
|
|
1658
1644
|
inheritAttrs: !1,
|
|
1659
1645
|
__name: "SecretListInner",
|
|
1660
1646
|
props: {
|
|
@@ -1662,7 +1648,7 @@ const wt = { class: "kong-ui-entities-vault-form" }, St = { class: "vault-form-p
|
|
|
1662
1648
|
config: {
|
|
1663
1649
|
type: Object,
|
|
1664
1650
|
required: !0,
|
|
1665
|
-
validator: (
|
|
1651
|
+
validator: (o) => !(!o || (o == null ? void 0 : o.app) !== "konnect" || !o.createRoute || !o.getEditRoute)
|
|
1666
1652
|
},
|
|
1667
1653
|
// The config store id for the secrets
|
|
1668
1654
|
configStoreId: {
|
|
@@ -1694,140 +1680,140 @@ const wt = { class: "kong-ui-entities-vault-form" }, St = { class: "vault-form-p
|
|
|
1694
1680
|
}
|
|
1695
1681
|
},
|
|
1696
1682
|
emits: ["error", "delete:success"],
|
|
1697
|
-
setup(
|
|
1698
|
-
var
|
|
1699
|
-
const f =
|
|
1683
|
+
setup(o, { emit: P }) {
|
|
1684
|
+
var re;
|
|
1685
|
+
const f = P, u = o, { i18n: { t: p, formatUnixTimeStamp: i } } = he.useI18n(), { axiosInstance: S } = ge((re = u.config) == null ? void 0 : re.axiosRequestConfig), y = {
|
|
1700
1686
|
// the Secret Key column is non-hidable
|
|
1701
1687
|
key: { label: p("secrets.list.table_headers.key"), sortable: !1, hidable: !1 },
|
|
1702
1688
|
updated_at: { label: p("secrets.list.table_headers.updated_at"), sortable: !1 }
|
|
1703
|
-
}, d = (
|
|
1704
|
-
"data-testid":
|
|
1705
|
-
}),
|
|
1706
|
-
var
|
|
1707
|
-
return `${u.config.apiBaseUrl}${ye.list[u.config.app]}`.replace(/{controlPlaneId}/gi, ((
|
|
1708
|
-
}), s =
|
|
1689
|
+
}, d = (h) => ({
|
|
1690
|
+
"data-testid": h.key
|
|
1691
|
+
}), C = V(() => {
|
|
1692
|
+
var h;
|
|
1693
|
+
return `${u.config.apiBaseUrl}${ye.list[u.config.app]}`.replace(/{controlPlaneId}/gi, ((h = u.config) == null ? void 0 : h.controlPlaneId) || "").replace(/{id}/gi, u.configStoreId || "");
|
|
1694
|
+
}), s = k(""), N = {
|
|
1709
1695
|
isExactMatch: !0,
|
|
1710
1696
|
placeholder: p("search.placeholder_for_secrets.konnect")
|
|
1711
|
-
}, D =
|
|
1697
|
+
}, D = k(1), { fetcher: le, fetcherState: J } = Fe(u.config, C.value), a = () => {
|
|
1712
1698
|
s.value = "";
|
|
1713
|
-
}, z =
|
|
1699
|
+
}, z = k(null), Q = (h) => ({
|
|
1714
1700
|
label: p("actions.edit"),
|
|
1715
|
-
to: u.config.getEditRoute(
|
|
1716
|
-
}),
|
|
1717
|
-
|
|
1701
|
+
to: u.config.getEditRoute(h)
|
|
1702
|
+
}), H = k(void 0), Y = k(!1), L = k(!1), m = k(""), M = Oe(u.config, C.value), X = (h) => {
|
|
1703
|
+
H.value = h, Y.value = !0;
|
|
1718
1704
|
}, U = () => {
|
|
1719
1705
|
Y.value = !1;
|
|
1720
1706
|
}, ee = async () => {
|
|
1721
|
-
var
|
|
1722
|
-
if ((
|
|
1707
|
+
var h, j, G;
|
|
1708
|
+
if ((h = H.value) != null && h.key) {
|
|
1723
1709
|
L.value = !0;
|
|
1724
1710
|
try {
|
|
1725
|
-
await
|
|
1726
|
-
} catch (
|
|
1727
|
-
m.value = ((G = (
|
|
1711
|
+
await S.delete(M(H.value.key)), L.value = !1, Y.value = !1, D.value++, f("delete:success", H.value);
|
|
1712
|
+
} catch (B) {
|
|
1713
|
+
m.value = ((G = (j = B.response) == null ? void 0 : j.data) == null ? void 0 : G.message) || B.message || p("errors.delete"), f("error", B);
|
|
1728
1714
|
} finally {
|
|
1729
1715
|
L.value = !1;
|
|
1730
1716
|
}
|
|
1731
1717
|
}
|
|
1732
|
-
},
|
|
1733
|
-
He(J, (
|
|
1734
|
-
var
|
|
1735
|
-
if (Array.isArray((
|
|
1718
|
+
}, W = k(!1);
|
|
1719
|
+
He(J, (h) => {
|
|
1720
|
+
var j, G, B, I;
|
|
1721
|
+
if (Array.isArray((j = h == null ? void 0 : h.response) == null ? void 0 : j.data) && (W.value = h.response.data.length > 0), h.status === we.Error) {
|
|
1736
1722
|
z.value = {
|
|
1737
1723
|
title: p("errors.general")
|
|
1738
|
-
}, (I = (
|
|
1724
|
+
}, (I = (B = (G = h.error) == null ? void 0 : G.response) == null ? void 0 : B.data) != null && I.message && (z.value.message = h.error.response.data.message), f("error", h.error);
|
|
1739
1725
|
return;
|
|
1740
1726
|
}
|
|
1741
1727
|
z.value = null;
|
|
1742
1728
|
});
|
|
1743
|
-
const
|
|
1729
|
+
const oe = k({
|
|
1744
1730
|
ctaPath: u.config.createRoute,
|
|
1745
1731
|
ctaText: void 0,
|
|
1746
1732
|
message: `${p("secrets.list.empty_state.description")}${u.config.additionMessageForEmptyState ? ` ${u.config.additionMessageForEmptyState}` : ""}`,
|
|
1747
1733
|
title: p("secrets.title")
|
|
1748
1734
|
});
|
|
1749
1735
|
return Ve(async () => {
|
|
1750
|
-
await u.canCreate() && (
|
|
1751
|
-
}), (
|
|
1752
|
-
const G =
|
|
1753
|
-
return
|
|
1754
|
-
c(e(
|
|
1755
|
-
"cache-identifier":
|
|
1736
|
+
await u.canCreate() && (oe.value.title = p("secrets.list.empty_state.title"), oe.value.ctaText = p("secrets.list.toolbar_actions.new_secret"));
|
|
1737
|
+
}), (h, j) => {
|
|
1738
|
+
const G = q("KButton"), B = q("KDropdownItem");
|
|
1739
|
+
return x(), F(Ze, null, [
|
|
1740
|
+
c(e(De), {
|
|
1741
|
+
"cache-identifier": o.cacheIdentifier,
|
|
1756
1742
|
"disable-sorting": "",
|
|
1757
|
-
"empty-state-options":
|
|
1743
|
+
"empty-state-options": oe.value,
|
|
1758
1744
|
"enable-entity-actions": "",
|
|
1759
1745
|
"error-message": z.value,
|
|
1760
|
-
fetcher: e(
|
|
1746
|
+
fetcher: e(le),
|
|
1761
1747
|
"fetcher-cache-key": D.value,
|
|
1762
1748
|
"pagination-type": "offset",
|
|
1763
1749
|
"preferences-storage-key": "kong-ui-entities-secrets-list",
|
|
1764
1750
|
query: s.value,
|
|
1765
1751
|
"row-attributes": d,
|
|
1766
|
-
"table-headers": e(
|
|
1767
|
-
onClearSearchInput:
|
|
1752
|
+
"table-headers": e(y),
|
|
1753
|
+
onClearSearchInput: a
|
|
1768
1754
|
}, {
|
|
1769
|
-
"toolbar-filter":
|
|
1770
|
-
c(e(
|
|
1755
|
+
"toolbar-filter": v(() => [
|
|
1756
|
+
c(e(qe), {
|
|
1771
1757
|
modelValue: s.value,
|
|
1772
|
-
"onUpdate:modelValue":
|
|
1773
|
-
config:
|
|
1758
|
+
"onUpdate:modelValue": j[0] || (j[0] = (I) => s.value = I),
|
|
1759
|
+
config: N
|
|
1774
1760
|
}, null, 8, ["modelValue"])
|
|
1775
1761
|
]),
|
|
1776
|
-
"toolbar-button":
|
|
1777
|
-
c(e(
|
|
1778
|
-
"auth-function": () =>
|
|
1762
|
+
"toolbar-button": v(() => [
|
|
1763
|
+
c(e(ue), {
|
|
1764
|
+
"auth-function": () => o.canCreate()
|
|
1779
1765
|
}, {
|
|
1780
|
-
default:
|
|
1766
|
+
default: v(() => [
|
|
1781
1767
|
Me(c(G, {
|
|
1782
1768
|
appearance: "primary",
|
|
1783
1769
|
"data-testid": "toolbar-add-secret",
|
|
1784
1770
|
size: "large",
|
|
1785
|
-
to:
|
|
1771
|
+
to: o.config.createRoute
|
|
1786
1772
|
}, {
|
|
1787
|
-
default:
|
|
1788
|
-
c(e(
|
|
1789
|
-
|
|
1773
|
+
default: v(() => [
|
|
1774
|
+
c(e(Ne)),
|
|
1775
|
+
ce(" " + O(e(p)("secrets.list.toolbar_actions.new_secret")), 1)
|
|
1790
1776
|
]),
|
|
1791
1777
|
_: 1
|
|
1792
1778
|
}, 8, ["to"]), [
|
|
1793
|
-
[Ke,
|
|
1779
|
+
[Ke, W.value]
|
|
1794
1780
|
])
|
|
1795
1781
|
]),
|
|
1796
1782
|
_: 1
|
|
1797
1783
|
}, 8, ["auth-function"])
|
|
1798
1784
|
]),
|
|
1799
|
-
key:
|
|
1800
|
-
T("div",
|
|
1801
|
-
T("b", null,
|
|
1785
|
+
key: v(({ rowValue: I }) => [
|
|
1786
|
+
T("div", Ot, [
|
|
1787
|
+
T("b", null, O(I ?? "-"), 1)
|
|
1802
1788
|
])
|
|
1803
1789
|
]),
|
|
1804
|
-
updated_at:
|
|
1805
|
-
T("span", null,
|
|
1790
|
+
updated_at: v(({ rowValue: I }) => [
|
|
1791
|
+
T("span", null, O(I ? e(i)(new Date(I).getTime() / 1e3) : "-"), 1)
|
|
1806
1792
|
]),
|
|
1807
|
-
actions:
|
|
1808
|
-
c(e(
|
|
1809
|
-
"auth-function": () =>
|
|
1793
|
+
actions: v(({ row: I }) => [
|
|
1794
|
+
c(e(ue), {
|
|
1795
|
+
"auth-function": () => o.canEdit(I)
|
|
1810
1796
|
}, {
|
|
1811
|
-
default:
|
|
1812
|
-
c(
|
|
1797
|
+
default: v(() => [
|
|
1798
|
+
c(B, {
|
|
1813
1799
|
"data-testid": "action-entity-edit",
|
|
1814
1800
|
item: Q(I.key)
|
|
1815
1801
|
}, null, 8, ["item"])
|
|
1816
1802
|
]),
|
|
1817
1803
|
_: 2
|
|
1818
1804
|
}, 1032, ["auth-function"]),
|
|
1819
|
-
c(e(
|
|
1820
|
-
"auth-function": () =>
|
|
1805
|
+
c(e(ue), {
|
|
1806
|
+
"auth-function": () => o.canDelete(I)
|
|
1821
1807
|
}, {
|
|
1822
|
-
default:
|
|
1823
|
-
c(
|
|
1808
|
+
default: v(() => [
|
|
1809
|
+
c(B, {
|
|
1824
1810
|
danger: "",
|
|
1825
1811
|
"data-testid": "action-entity-delete",
|
|
1826
1812
|
"has-divider": "",
|
|
1827
1813
|
onClick: (te) => X(I)
|
|
1828
1814
|
}, {
|
|
1829
|
-
default:
|
|
1830
|
-
|
|
1815
|
+
default: v(() => [
|
|
1816
|
+
ce(O(e(p)("actions.delete")), 1)
|
|
1831
1817
|
]),
|
|
1832
1818
|
_: 2
|
|
1833
1819
|
}, 1032, ["onClick"])
|
|
@@ -1837,11 +1823,11 @@ const wt = { class: "kong-ui-entities-vault-form" }, St = { class: "vault-form-p
|
|
|
1837
1823
|
]),
|
|
1838
1824
|
_: 1
|
|
1839
1825
|
}, 8, ["cache-identifier", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "query", "table-headers"]),
|
|
1840
|
-
c(e(
|
|
1826
|
+
c(e(We), {
|
|
1841
1827
|
"action-pending": L.value,
|
|
1842
1828
|
description: e(p)("delete.description"),
|
|
1843
|
-
"entity-name":
|
|
1844
|
-
"entity-type": e(
|
|
1829
|
+
"entity-name": H.value && H.value.key,
|
|
1830
|
+
"entity-type": e(je).Secret,
|
|
1845
1831
|
error: m.value,
|
|
1846
1832
|
title: e(p)("delete.title_for_secret"),
|
|
1847
1833
|
visible: Y.value,
|
|
@@ -1851,14 +1837,14 @@ const wt = { class: "kong-ui-entities-vault-form" }, St = { class: "vault-form-p
|
|
|
1851
1837
|
], 64);
|
|
1852
1838
|
};
|
|
1853
1839
|
}
|
|
1854
|
-
}),
|
|
1840
|
+
}), qt = /* @__PURE__ */ ve(Dt, [["__scopeId", "data-v-c1752393"]]), Wt = { class: "kong-ui-entities-secrets-list" }, jt = /* @__PURE__ */ de({
|
|
1855
1841
|
__name: "SecretList",
|
|
1856
1842
|
props: {
|
|
1857
1843
|
/** The base konnect config. Pass additional config props in the shared entity component as needed. */
|
|
1858
1844
|
config: {
|
|
1859
1845
|
type: Object,
|
|
1860
1846
|
required: !0,
|
|
1861
|
-
validator: (
|
|
1847
|
+
validator: (o) => !(!o || (o == null ? void 0 : o.app) !== "konnect" || !o.createRoute || !o.getEditRoute)
|
|
1862
1848
|
},
|
|
1863
1849
|
// The vault id for the secrets
|
|
1864
1850
|
vaultId: {
|
|
@@ -1890,33 +1876,33 @@ const wt = { class: "kong-ui-entities-vault-form" }, St = { class: "vault-form-p
|
|
|
1890
1876
|
}
|
|
1891
1877
|
},
|
|
1892
1878
|
emits: ["error", "delete:success"],
|
|
1893
|
-
setup(
|
|
1879
|
+
setup(o, { emit: P }) {
|
|
1894
1880
|
var d;
|
|
1895
|
-
const f =
|
|
1896
|
-
f("error",
|
|
1897
|
-
},
|
|
1898
|
-
f("delete:success",
|
|
1899
|
-
}, { axiosInstance:
|
|
1900
|
-
var
|
|
1901
|
-
return `${u.config.apiBaseUrl}${ye.getVault[u.config.app]}`.replace(/{controlPlaneId}/gi, ((
|
|
1881
|
+
const f = P, u = o, p = (C) => {
|
|
1882
|
+
f("error", C);
|
|
1883
|
+
}, i = (C) => {
|
|
1884
|
+
f("delete:success", C);
|
|
1885
|
+
}, { axiosInstance: S } = ge((d = u.config) == null ? void 0 : d.axiosRequestConfig), E = k(""), y = V(() => {
|
|
1886
|
+
var C;
|
|
1887
|
+
return `${u.config.apiBaseUrl}${ye.getVault[u.config.app]}`.replace(/{controlPlaneId}/gi, ((C = u.config) == null ? void 0 : C.controlPlaneId) || "").replace(/{id}/gi, u.vaultId);
|
|
1902
1888
|
});
|
|
1903
1889
|
return Ve(async () => {
|
|
1904
|
-
var
|
|
1890
|
+
var C;
|
|
1905
1891
|
try {
|
|
1906
|
-
const { data: s } = await
|
|
1907
|
-
|
|
1892
|
+
const { data: s } = await S.get(y.value);
|
|
1893
|
+
E.value = (C = s == null ? void 0 : s.config) == null ? void 0 : C.config_store_id;
|
|
1908
1894
|
} catch (s) {
|
|
1909
1895
|
f("error", s);
|
|
1910
1896
|
}
|
|
1911
|
-
}), (
|
|
1912
|
-
|
|
1913
|
-
"config-store-id":
|
|
1914
|
-
"onDelete:success":
|
|
1897
|
+
}), (C, s) => (x(), F("div", Wt, [
|
|
1898
|
+
E.value ? (x(), ie(qt, Pe({ key: 0 }, u, {
|
|
1899
|
+
"config-store-id": E.value,
|
|
1900
|
+
"onDelete:success": i,
|
|
1915
1901
|
onError: p
|
|
1916
1902
|
}), null, 16, ["config-store-id"])) : Z("", !0)
|
|
1917
1903
|
]));
|
|
1918
1904
|
}
|
|
1919
|
-
}),
|
|
1905
|
+
}), ol = /* @__PURE__ */ ve(jt, [["__scopeId", "data-v-0f9047e6"]]), Bt = /* @__PURE__ */ de({
|
|
1920
1906
|
inheritAttrs: !1,
|
|
1921
1907
|
__name: "SecretFormInner",
|
|
1922
1908
|
props: {
|
|
@@ -1924,7 +1910,7 @@ const wt = { class: "kong-ui-entities-vault-form" }, St = { class: "vault-form-p
|
|
|
1924
1910
|
config: {
|
|
1925
1911
|
type: Object,
|
|
1926
1912
|
required: !0,
|
|
1927
|
-
validator: (
|
|
1913
|
+
validator: (o) => !(!o || o.app !== "konnect" || !o.controlPlaneId || !o.cancelRoute)
|
|
1928
1914
|
},
|
|
1929
1915
|
/** Current config store ID */
|
|
1930
1916
|
configStoreId: {
|
|
@@ -1939,98 +1925,98 @@ const wt = { class: "kong-ui-entities-vault-form" }, St = { class: "vault-form-p
|
|
|
1939
1925
|
}
|
|
1940
1926
|
},
|
|
1941
1927
|
emits: ["update", "error", "loading"],
|
|
1942
|
-
setup(
|
|
1928
|
+
setup(o, { emit: P }) {
|
|
1943
1929
|
var L;
|
|
1944
|
-
const f =
|
|
1930
|
+
const f = o, u = P, { i18n: { t: p } } = he.useI18n(), i = Ee(), { axiosInstance: S } = ge((L = f.config) == null ? void 0 : L.axiosRequestConfig), { getMessageFromError: E } = Be(), y = fe({
|
|
1945
1931
|
fields: {
|
|
1946
1932
|
key: "",
|
|
1947
1933
|
value: ""
|
|
1948
1934
|
},
|
|
1949
1935
|
readonly: !1,
|
|
1950
1936
|
errorMessage: ""
|
|
1951
|
-
}), d =
|
|
1937
|
+
}), d = fe({
|
|
1952
1938
|
key: "",
|
|
1953
1939
|
value: ""
|
|
1954
|
-
}),
|
|
1940
|
+
}), C = V(
|
|
1955
1941
|
() => {
|
|
1956
|
-
var m,
|
|
1957
|
-
return (
|
|
1942
|
+
var m, M;
|
|
1943
|
+
return (M = ye.form[(m = f.config) == null ? void 0 : m.app]) == null ? void 0 : M.edit.replace(/{id}/gi, f.configStoreId).replace(/{secretId}/gi, f.secretId);
|
|
1958
1944
|
}
|
|
1959
1945
|
), s = () => {
|
|
1960
1946
|
var m;
|
|
1961
|
-
|
|
1962
|
-
},
|
|
1947
|
+
i.push(((m = f.config) == null ? void 0 : m.cancelRoute) || { name: "secret-list" });
|
|
1948
|
+
}, N = (m) => {
|
|
1963
1949
|
u("loading", m);
|
|
1964
1950
|
}, D = (m) => {
|
|
1965
1951
|
u("error", m);
|
|
1966
|
-
},
|
|
1967
|
-
var
|
|
1968
|
-
|
|
1969
|
-
}, J =
|
|
1952
|
+
}, le = (m) => {
|
|
1953
|
+
var M, X;
|
|
1954
|
+
y.fields.key = ((M = m == null ? void 0 : m.item) == null ? void 0 : M.key) || (m == null ? void 0 : m.key) || "", y.fields.value = ((X = m == null ? void 0 : m.item) == null ? void 0 : X.value) || (m == null ? void 0 : m.value) || "", Object.assign(d, y.fields);
|
|
1955
|
+
}, J = V(() => f.secretId ? pe.Edit : pe.Create), a = V(() => {
|
|
1970
1956
|
var m;
|
|
1971
1957
|
return `${f.config.apiBaseUrl}${ye.form[f.config.app][J.value]}`.replace(/{controlPlaneId}/gi, ((m = f.config) == null ? void 0 : m.controlPlaneId) || "").replace(/{id}/gi, f.configStoreId).replace(/{secretId}/gi, f.secretId);
|
|
1972
|
-
}), z =
|
|
1973
|
-
key:
|
|
1974
|
-
value:
|
|
1958
|
+
}), z = V(() => !!y.fields.key && !!y.fields.value), Q = V(() => JSON.stringify(y.fields) !== JSON.stringify(d)), H = V(() => ({
|
|
1959
|
+
key: y.fields.key,
|
|
1960
|
+
value: y.fields.value
|
|
1975
1961
|
})), Y = async () => {
|
|
1976
1962
|
try {
|
|
1977
|
-
|
|
1963
|
+
y.readonly = !0;
|
|
1978
1964
|
let m;
|
|
1979
|
-
J.value === "create" ? m = await
|
|
1965
|
+
J.value === "create" ? m = await S.post(a.value, H.value) : J.value === "edit" && (m = await S.put(a.value, H.value)), le(m == null ? void 0 : m.data), u("update", m == null ? void 0 : m.data);
|
|
1980
1966
|
} catch (m) {
|
|
1981
|
-
|
|
1967
|
+
y.errorMessage = E(m), u("error", m);
|
|
1982
1968
|
} finally {
|
|
1983
|
-
|
|
1969
|
+
y.readonly = !1;
|
|
1984
1970
|
}
|
|
1985
1971
|
};
|
|
1986
|
-
return (m,
|
|
1987
|
-
const X =
|
|
1988
|
-
return
|
|
1972
|
+
return (m, M) => {
|
|
1973
|
+
const X = q("KInput"), U = q("KTextArea"), ee = q("KAlert");
|
|
1974
|
+
return x(), ie(e(ze), {
|
|
1989
1975
|
"can-submit": z.value && Q.value,
|
|
1990
|
-
config:
|
|
1991
|
-
"edit-id":
|
|
1976
|
+
config: o.config,
|
|
1977
|
+
"edit-id": o.secretId,
|
|
1992
1978
|
"entity-type": e(xe).Other,
|
|
1993
|
-
"error-message":
|
|
1994
|
-
"fetch-url":
|
|
1995
|
-
"form-fields":
|
|
1996
|
-
"is-readonly":
|
|
1979
|
+
"error-message": y.errorMessage,
|
|
1980
|
+
"fetch-url": C.value,
|
|
1981
|
+
"form-fields": H.value,
|
|
1982
|
+
"is-readonly": y.readonly,
|
|
1997
1983
|
onCancel: s,
|
|
1998
1984
|
"onFetch:error": D,
|
|
1999
|
-
"onFetch:success":
|
|
2000
|
-
onLoading:
|
|
1985
|
+
"onFetch:success": le,
|
|
1986
|
+
onLoading: N,
|
|
2001
1987
|
onSubmit: Y
|
|
2002
1988
|
}, {
|
|
2003
|
-
default:
|
|
1989
|
+
default: v(() => [
|
|
2004
1990
|
T("div", null, [
|
|
2005
1991
|
c(e(Se), {
|
|
2006
1992
|
description: e(p)("secrets.form.info.description"),
|
|
2007
1993
|
"has-divider": "",
|
|
2008
1994
|
title: e(p)("secrets.form.info.title")
|
|
2009
1995
|
}, {
|
|
2010
|
-
default:
|
|
1996
|
+
default: v(() => [
|
|
2011
1997
|
c(X, {
|
|
2012
|
-
modelValue:
|
|
2013
|
-
"onUpdate:modelValue":
|
|
1998
|
+
modelValue: y.fields.key,
|
|
1999
|
+
"onUpdate:modelValue": M[0] || (M[0] = (W) => y.fields.key = W),
|
|
2014
2000
|
modelModifiers: { trim: !0 },
|
|
2015
2001
|
autocomplete: "off",
|
|
2016
2002
|
class: "key-field",
|
|
2017
2003
|
"data-testid": "secret-form-key",
|
|
2018
|
-
disabled: J.value === e(
|
|
2004
|
+
disabled: J.value === e(pe).Edit,
|
|
2019
2005
|
label: e(p)("secrets.form.fields.key.label"),
|
|
2020
2006
|
placeholder: e(p)("secrets.form.fields.key.placeholder"),
|
|
2021
|
-
readonly:
|
|
2007
|
+
readonly: y.readonly,
|
|
2022
2008
|
required: "",
|
|
2023
2009
|
type: "text"
|
|
2024
2010
|
}, null, 8, ["modelValue", "disabled", "label", "placeholder", "readonly"]),
|
|
2025
2011
|
c(U, {
|
|
2026
|
-
modelValue:
|
|
2027
|
-
"onUpdate:modelValue":
|
|
2012
|
+
modelValue: y.fields.value,
|
|
2013
|
+
"onUpdate:modelValue": M[1] || (M[1] = (W) => y.fields.value = W),
|
|
2028
2014
|
modelModifiers: { trim: !0 },
|
|
2029
2015
|
autocomplete: "off",
|
|
2030
2016
|
"data-testid": "secret-form-value",
|
|
2031
2017
|
label: e(p)("secrets.form.fields.value.label"),
|
|
2032
2018
|
placeholder: e(p)("secrets.form.fields.value.placeholder"),
|
|
2033
|
-
readonly:
|
|
2019
|
+
readonly: y.readonly,
|
|
2034
2020
|
required: "",
|
|
2035
2021
|
resizable: "",
|
|
2036
2022
|
type: "text"
|
|
@@ -2048,14 +2034,14 @@ const wt = { class: "kong-ui-entities-vault-form" }, St = { class: "vault-form-p
|
|
|
2048
2034
|
}, 8, ["can-submit", "config", "edit-id", "entity-type", "error-message", "fetch-url", "form-fields", "is-readonly"]);
|
|
2049
2035
|
};
|
|
2050
2036
|
}
|
|
2051
|
-
}),
|
|
2037
|
+
}), zt = /* @__PURE__ */ ve(Bt, [["__scopeId", "data-v-eb9c7fc4"]]), Lt = { class: "kong-ui-entities-secret-form" }, Gt = /* @__PURE__ */ de({
|
|
2052
2038
|
__name: "SecretForm",
|
|
2053
2039
|
props: {
|
|
2054
2040
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
2055
2041
|
config: {
|
|
2056
2042
|
type: Object,
|
|
2057
2043
|
required: !0,
|
|
2058
|
-
validator: (
|
|
2044
|
+
validator: (o) => !(!o || o.app !== "konnect" || !o.controlPlaneId || !o.cancelRoute)
|
|
2059
2045
|
},
|
|
2060
2046
|
/** Current vault ID */
|
|
2061
2047
|
vaultId: {
|
|
@@ -2070,44 +2056,44 @@ const wt = { class: "kong-ui-entities-vault-form" }, St = { class: "vault-form-p
|
|
|
2070
2056
|
}
|
|
2071
2057
|
},
|
|
2072
2058
|
emits: ["update", "error", "loading"],
|
|
2073
|
-
setup(
|
|
2074
|
-
var
|
|
2075
|
-
const f =
|
|
2059
|
+
setup(o, { emit: P }) {
|
|
2060
|
+
var C;
|
|
2061
|
+
const f = o, u = P, p = (s) => {
|
|
2076
2062
|
u("update", s);
|
|
2077
|
-
},
|
|
2063
|
+
}, i = (s) => {
|
|
2078
2064
|
u("error", s);
|
|
2079
|
-
},
|
|
2065
|
+
}, S = (s) => {
|
|
2080
2066
|
u("loading", s);
|
|
2081
|
-
}, { axiosInstance:
|
|
2067
|
+
}, { axiosInstance: E } = ge((C = f.config) == null ? void 0 : C.axiosRequestConfig), y = k(""), d = V(() => {
|
|
2082
2068
|
var s;
|
|
2083
2069
|
return `${f.config.apiBaseUrl}${ye.getVault[f.config.app]}`.replace(/{controlPlaneId}/gi, ((s = f.config) == null ? void 0 : s.controlPlaneId) || "").replace(/{id}/gi, f.vaultId);
|
|
2084
2070
|
});
|
|
2085
2071
|
return Ve(async () => {
|
|
2086
2072
|
var s;
|
|
2087
2073
|
try {
|
|
2088
|
-
const { data:
|
|
2089
|
-
|
|
2090
|
-
} catch (
|
|
2091
|
-
u("error",
|
|
2074
|
+
const { data: N } = await E.get(d.value);
|
|
2075
|
+
y.value = (s = N == null ? void 0 : N.config) == null ? void 0 : s.config_store_id;
|
|
2076
|
+
} catch (N) {
|
|
2077
|
+
u("error", N);
|
|
2092
2078
|
}
|
|
2093
|
-
}), (s,
|
|
2094
|
-
|
|
2095
|
-
"config-store-id":
|
|
2096
|
-
onError:
|
|
2097
|
-
onLoading:
|
|
2079
|
+
}), (s, N) => (x(), F("div", Lt, [
|
|
2080
|
+
y.value ? (x(), ie(zt, Pe({ key: 0 }, f, {
|
|
2081
|
+
"config-store-id": y.value,
|
|
2082
|
+
onError: i,
|
|
2083
|
+
onLoading: S,
|
|
2098
2084
|
onUpdate: p
|
|
2099
2085
|
}), null, 16, ["config-store-id"])) : Z("", !0)
|
|
2100
2086
|
]));
|
|
2101
2087
|
}
|
|
2102
|
-
}),
|
|
2088
|
+
}), al = /* @__PURE__ */ ve(Gt, [["__scopeId", "data-v-02e6d2f3"]]);
|
|
2103
2089
|
export {
|
|
2104
|
-
|
|
2105
|
-
|
|
2090
|
+
al as SecretForm,
|
|
2091
|
+
ol as SecretList,
|
|
2106
2092
|
R as VaultAuthMethods,
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2093
|
+
ll as VaultConfigCard,
|
|
2094
|
+
tl as VaultForm,
|
|
2095
|
+
el as VaultList,
|
|
2110
2096
|
t as VaultProviders,
|
|
2111
2097
|
ye as secretsEndpoints,
|
|
2112
|
-
|
|
2098
|
+
me as vaultsEndpoints
|
|
2113
2099
|
};
|