@kong-ui-public/entities-vaults 3.13.48 → 3.13.49
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.
- package/dist/entities-vaults.es.js +1154 -840
- package/dist/entities-vaults.umd.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/components/SecretForm.vue.d.ts +2 -2
- package/dist/types/components/SecretFormInner.vue.d.ts +2 -2
- package/dist/types/components/VaultForm.vue.d.ts +2 -2
- package/dist/types/components/VaultSecretPicker.vue.d.ts +40 -0
- package/dist/types/components/VaultSecretPicker.vue.d.ts.map +1 -0
- package/dist/types/components/VaultSecretPickerProvider.vue.d.ts +11 -0
- package/dist/types/components/VaultSecretPickerProvider.vue.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/utils.d.ts +37 -0
- package/dist/types/utils.d.ts.map +1 -0
- package/package.json +3 -3
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useRouter as
|
|
3
|
-
import { AddIcon as Me, AzureIcon as
|
|
4
|
-
import { useAxios as
|
|
5
|
-
import { createI18n as
|
|
6
|
-
const
|
|
1
|
+
import { defineComponent as ie, computed as E, ref as U, watch as he, onBeforeMount as ke, resolveComponent as N, openBlock as A, createElementBlock as q, createVNode as d, unref as e, withCtx as y, createBlock as oe, Teleport as Le, createTextVNode as pe, toDisplayString as P, createElementVNode as R, reactive as _e, resolveDynamicComponent as Ue, TransitionGroup as ze, createCommentVNode as ae, Fragment as Ge, mergeProps as Pe, nextTick as Ze } from "vue";
|
|
2
|
+
import { useRouter as Ie } from "vue-router";
|
|
3
|
+
import { AddIcon as Me, 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 ve, useFetcher as He, useDeleteUrlBuilder as Fe, FetcherStatus as Ne, EntityBaseTable as Oe, EntityFilter as qe, PermissionsWrapper as fe, TableTags as lt, EntityDeleteModal as De, EntityTypes as We, useErrors as je, EntityBaseFormType as be, useGatewayFeatureSupported as ot, EntityBaseForm as Be, SupportedEntityType as xe, EntityFormSection as Se, ConfigurationSchemaSection as $e, ConfigurationSchemaType as at, EntityBaseConfigCard as rt, useDebouncedFilter as Te } from "@kong-ui-public/entities-shared";
|
|
5
|
+
import { createI18n as it, 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
|
-
view: "View Details"
|
|
13
|
-
|
|
12
|
+
view: "View Details",
|
|
13
|
+
loading: "Loading..."
|
|
14
|
+
}, ct = {
|
|
14
15
|
general: "Vaults could not be retrieved",
|
|
15
16
|
delete: "The vault could not be deleted at this time.",
|
|
16
17
|
copy: "Failed to copy to clipboard"
|
|
17
|
-
},
|
|
18
|
+
}, ut = {
|
|
18
19
|
placeholder_for_vaults: {
|
|
19
20
|
konnect: "Filter by exact prefix or ID"
|
|
20
21
|
},
|
|
21
22
|
placeholder_for_secrets: {
|
|
22
23
|
konnect: "Filter by exact key"
|
|
23
24
|
}
|
|
24
|
-
},
|
|
25
|
+
}, dt = {
|
|
25
26
|
title: "Vaults",
|
|
26
27
|
list: {
|
|
27
28
|
toolbar_actions: {
|
|
@@ -39,7 +40,7 @@ const rt = {
|
|
|
39
40
|
description: "Improve the security of your Kong Gateway deployment with centralized secrets."
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
|
-
},
|
|
43
|
+
}, pt = {
|
|
43
44
|
title: "Secrets",
|
|
44
45
|
list: {
|
|
45
46
|
toolbar_actions: {
|
|
@@ -71,12 +72,12 @@ const rt = {
|
|
|
71
72
|
},
|
|
72
73
|
hint: "Once saved, the secret value will not be visible"
|
|
73
74
|
}
|
|
74
|
-
},
|
|
75
|
+
}, ft = {
|
|
75
76
|
success: "Copied {val} to clipboard",
|
|
76
77
|
success_brief: "Successfully copied to clipboard"
|
|
77
|
-
},
|
|
78
|
+
}, mt = {
|
|
78
79
|
vault_type: "Vault Type"
|
|
79
|
-
},
|
|
80
|
+
}, vt = {
|
|
80
81
|
sections: {
|
|
81
82
|
general: {
|
|
82
83
|
title: "General Information",
|
|
@@ -325,36 +326,66 @@ const rt = {
|
|
|
325
326
|
}
|
|
326
327
|
},
|
|
327
328
|
unavailable: "This vault provider is available on Enterprise."
|
|
328
|
-
},
|
|
329
|
-
|
|
329
|
+
}, gt = {
|
|
330
|
+
title: "Look up Key in Vault",
|
|
331
|
+
vault: {
|
|
332
|
+
label: "Vault",
|
|
333
|
+
placeholder: "Select a vault"
|
|
334
|
+
},
|
|
335
|
+
secret_id: {
|
|
336
|
+
label: "Secret ID",
|
|
337
|
+
input_placeholder: "Enter a secret ID",
|
|
338
|
+
select_placeholder: "Select or enter a complete secret ID"
|
|
339
|
+
},
|
|
340
|
+
optional_secret_key: {
|
|
341
|
+
label: "Secret Key",
|
|
342
|
+
placeholder: "Enter the key or key path to access a nested secret value",
|
|
343
|
+
help: "Optional. e.g. tokens, tokens/refresh_token"
|
|
344
|
+
},
|
|
345
|
+
fetch_error: {
|
|
346
|
+
vaults: "Could not fetch available vaults",
|
|
347
|
+
secrets: "Could not fetch available secrets",
|
|
348
|
+
vaults_and_secrets: "Could not fetch available vaults and secrets"
|
|
349
|
+
},
|
|
350
|
+
no_results: "No results found",
|
|
351
|
+
actions: {
|
|
352
|
+
use_key: "Use Key"
|
|
353
|
+
},
|
|
354
|
+
provider: {
|
|
355
|
+
complete_action: "Look up {cta}",
|
|
356
|
+
cta: "Key in Vault"
|
|
357
|
+
}
|
|
358
|
+
}, _t = {
|
|
359
|
+
actions: st,
|
|
330
360
|
delete: {
|
|
331
361
|
title: "Delete a Vault",
|
|
332
362
|
title_for_secret: "Delete a Secret",
|
|
333
363
|
description: "This action cannot be reversed."
|
|
334
364
|
},
|
|
335
|
-
errors:
|
|
336
|
-
search:
|
|
337
|
-
vaults:
|
|
338
|
-
secrets:
|
|
339
|
-
copy:
|
|
340
|
-
labels:
|
|
341
|
-
form:
|
|
365
|
+
errors: ct,
|
|
366
|
+
search: ut,
|
|
367
|
+
vaults: dt,
|
|
368
|
+
secrets: pt,
|
|
369
|
+
copy: ft,
|
|
370
|
+
labels: mt,
|
|
371
|
+
form: vt,
|
|
372
|
+
vault_secret_picker: gt
|
|
342
373
|
};
|
|
343
|
-
function
|
|
344
|
-
const l =
|
|
374
|
+
function bt() {
|
|
375
|
+
const l = it("en-us", _t);
|
|
345
376
|
return {
|
|
346
377
|
i18n: l,
|
|
347
|
-
i18nT:
|
|
378
|
+
i18nT: nt(l)
|
|
348
379
|
// Translation component <i18n-t>
|
|
349
380
|
};
|
|
350
381
|
}
|
|
351
|
-
const
|
|
352
|
-
useI18n:
|
|
353
|
-
},
|
|
382
|
+
const ge = {
|
|
383
|
+
useI18n: bt
|
|
384
|
+
}, we = "/v2/control-planes/{controlPlaneId}/core-entities", Ke = "/v2/control-planes/{controlPlaneId}/config-stores", Ce = "/{workspace}", se = {
|
|
354
385
|
list: {
|
|
355
386
|
konnect: {
|
|
356
|
-
getAll: `${
|
|
357
|
-
deleteConfigStore: `${
|
|
387
|
+
getAll: `${we}/vaults`,
|
|
388
|
+
deleteConfigStore: `${Ke}/{id}?force=true`
|
|
358
389
|
},
|
|
359
390
|
kongManager: {
|
|
360
391
|
getAll: `${Ce}/vaults`
|
|
@@ -362,16 +393,16 @@ const he = {
|
|
|
362
393
|
},
|
|
363
394
|
form: {
|
|
364
395
|
konnect: {
|
|
365
|
-
create: `${
|
|
366
|
-
createConfigStore:
|
|
367
|
-
edit: `${
|
|
396
|
+
create: `${we}/vaults`,
|
|
397
|
+
createConfigStore: Ke,
|
|
398
|
+
edit: `${we}/vaults/{id}`
|
|
368
399
|
},
|
|
369
400
|
kongManager: {
|
|
370
401
|
create: `${Ce}/vaults`,
|
|
371
402
|
edit: `${Ce}/vaults/{id}`
|
|
372
403
|
}
|
|
373
404
|
}
|
|
374
|
-
},
|
|
405
|
+
}, yt = { class: "kong-ui-entities-vaults-list" }, ht = { class: "table-content-overflow-wrapper" }, Vt = { class: "table-content-overflow-wrapper" }, kt = /* @__PURE__ */ ie({
|
|
375
406
|
__name: "VaultList",
|
|
376
407
|
props: {
|
|
377
408
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
@@ -416,157 +447,157 @@ const he = {
|
|
|
416
447
|
}
|
|
417
448
|
},
|
|
418
449
|
emits: ["error", "copy:success", "copy:error", "delete:success"],
|
|
419
|
-
setup(l, { emit:
|
|
420
|
-
var
|
|
421
|
-
const
|
|
450
|
+
setup(l, { emit: I }) {
|
|
451
|
+
var T;
|
|
452
|
+
const c = I, n = l, { i18n: { t: f } } = ge.useI18n(), o = Ie(), { axiosInstance: x } = ve((T = n.config) == null ? void 0 : T.axiosRequestConfig), C = E(() => n.config.app !== "kongManager" || !!n.config.disableSorting), b = {
|
|
422
453
|
// the Prefix column is non-hidable
|
|
423
|
-
prefix: { label:
|
|
454
|
+
prefix: { label: f("vaults.list.table_headers.prefix"), searchable: !0, sortable: !0, hidable: !1 },
|
|
424
455
|
// it's "Vault Type" on display, but we still use "name" to fit API schema
|
|
425
|
-
name: { label:
|
|
426
|
-
description: { label:
|
|
427
|
-
tags: { label:
|
|
428
|
-
},
|
|
429
|
-
var
|
|
430
|
-
let
|
|
431
|
-
return
|
|
432
|
-
}),
|
|
433
|
-
if (
|
|
456
|
+
name: { label: f("vaults.list.table_headers.name"), searchable: !0, sortable: !0 },
|
|
457
|
+
description: { label: f("vaults.list.table_headers.description"), sortable: !1 },
|
|
458
|
+
tags: { label: f("vaults.list.table_headers.tags"), sortable: !1 }
|
|
459
|
+
}, p = b, h = E(() => {
|
|
460
|
+
var w, V;
|
|
461
|
+
let m = `${n.config.apiBaseUrl}${se.list[n.config.app].getAll}`;
|
|
462
|
+
return n.config.app === "konnect" ? m = m.replace(/{controlPlaneId}/gi, ((w = n.config) == null ? void 0 : w.controlPlaneId) || "") : n.config.app === "kongManager" && (m = m.replace(/\/{workspace}/gi, (V = n.config) != null && V.workspace ? `/${n.config.workspace}` : "")), m;
|
|
463
|
+
}), u = U(""), O = E(() => {
|
|
464
|
+
if (n.config.app === "konnect" || n.config.isExactMatch)
|
|
434
465
|
return {
|
|
435
466
|
isExactMatch: !0,
|
|
436
|
-
placeholder:
|
|
467
|
+
placeholder: f("search.placeholder_for_vaults.konnect")
|
|
437
468
|
};
|
|
438
|
-
const { prefix:
|
|
469
|
+
const { prefix: w, name: V } = b;
|
|
439
470
|
return {
|
|
440
471
|
isExactMatch: !1,
|
|
441
|
-
fields: { name:
|
|
442
|
-
schema:
|
|
472
|
+
fields: { name: V, prefix: w },
|
|
473
|
+
schema: n.config.filterSchema
|
|
443
474
|
};
|
|
444
|
-
}),
|
|
445
|
-
|
|
446
|
-
},
|
|
447
|
-
|
|
448
|
-
},
|
|
449
|
-
const
|
|
450
|
-
if (!
|
|
451
|
-
|
|
452
|
-
entity:
|
|
475
|
+
}), D = U(1), { fetcher: re, fetcherState: z } = He(n.config, h.value), a = () => {
|
|
476
|
+
u.value = "";
|
|
477
|
+
}, Y = () => {
|
|
478
|
+
D.value++;
|
|
479
|
+
}, ee = U(null), W = (m, w) => {
|
|
480
|
+
const V = m.id;
|
|
481
|
+
if (!w(V)) {
|
|
482
|
+
c("copy:error", {
|
|
483
|
+
entity: m,
|
|
453
484
|
field: "id",
|
|
454
|
-
message:
|
|
485
|
+
message: f("errors.copy")
|
|
455
486
|
});
|
|
456
487
|
return;
|
|
457
488
|
}
|
|
458
|
-
|
|
459
|
-
entity:
|
|
489
|
+
c("copy:success", {
|
|
490
|
+
entity: m,
|
|
460
491
|
field: "id",
|
|
461
|
-
message:
|
|
492
|
+
message: f("copy.success", { val: V })
|
|
462
493
|
});
|
|
463
|
-
},
|
|
464
|
-
const
|
|
465
|
-
if (!
|
|
466
|
-
|
|
467
|
-
entity:
|
|
468
|
-
message:
|
|
494
|
+
}, G = (m, w) => {
|
|
495
|
+
const V = JSON.stringify(m);
|
|
496
|
+
if (!w(V)) {
|
|
497
|
+
c("copy:error", {
|
|
498
|
+
entity: m,
|
|
499
|
+
message: f("errors.copy")
|
|
469
500
|
});
|
|
470
501
|
return;
|
|
471
502
|
}
|
|
472
|
-
|
|
473
|
-
entity:
|
|
474
|
-
message:
|
|
503
|
+
c("copy:success", {
|
|
504
|
+
entity: m,
|
|
505
|
+
message: f("copy.success_brief")
|
|
475
506
|
});
|
|
476
|
-
},
|
|
477
|
-
var
|
|
478
|
-
await ((
|
|
479
|
-
},
|
|
480
|
-
label:
|
|
481
|
-
to:
|
|
482
|
-
}), H = (
|
|
483
|
-
label:
|
|
484
|
-
to:
|
|
485
|
-
}),
|
|
486
|
-
|
|
487
|
-
},
|
|
507
|
+
}, X = async (m) => {
|
|
508
|
+
var V;
|
|
509
|
+
await ((V = n.canRetrieve) == null ? void 0 : V.call(n, m)) && o.push(n.config.getViewRoute(m.id));
|
|
510
|
+
}, g = (m) => ({
|
|
511
|
+
label: f("actions.view"),
|
|
512
|
+
to: n.config.getViewRoute(m)
|
|
513
|
+
}), H = (m) => ({
|
|
514
|
+
label: f("actions.edit"),
|
|
515
|
+
to: n.config.getEditRoute(m)
|
|
516
|
+
}), M = U(void 0), j = U(!1), te = U(!1), Z = U(""), ne = Fe(n.config, h.value), $ = (m) => {
|
|
517
|
+
M.value = m, j.value = !0;
|
|
518
|
+
}, J = () => {
|
|
488
519
|
j.value = !1;
|
|
489
|
-
},
|
|
490
|
-
const { apiBaseUrl:
|
|
520
|
+
}, B = async (m) => {
|
|
521
|
+
const { apiBaseUrl: w, app: V, controlPlaneId: k } = n.config, le = `${w}${se.list[V].deleteConfigStore}`.replace(/{controlPlaneId}/gi, k || "").replace(/{id}/gi, m);
|
|
491
522
|
try {
|
|
492
|
-
await
|
|
523
|
+
await x.delete(le);
|
|
493
524
|
} catch {
|
|
494
525
|
}
|
|
495
|
-
},
|
|
496
|
-
var
|
|
497
|
-
if ((
|
|
526
|
+
}, _ = async () => {
|
|
527
|
+
var m, w, V, k;
|
|
528
|
+
if ((m = M.value) != null && m.id) {
|
|
498
529
|
te.value = !0;
|
|
499
530
|
try {
|
|
500
|
-
await
|
|
531
|
+
await x.delete(ne(M.value.id)), n.config.app === "konnect" && ((w = M.value.config) != null && w.config_store_id) && B(M.value.config.config_store_id), te.value = !1, j.value = !1, D.value++, c("delete:success", M.value);
|
|
501
532
|
} catch (le) {
|
|
502
|
-
|
|
533
|
+
Z.value = ((k = (V = le.response) == null ? void 0 : V.data) == null ? void 0 : k.message) || le.message || f("errors.delete"), c("error", le);
|
|
503
534
|
} finally {
|
|
504
535
|
te.value = !1;
|
|
505
536
|
}
|
|
506
537
|
}
|
|
507
538
|
};
|
|
508
|
-
|
|
509
|
-
var
|
|
510
|
-
if (
|
|
511
|
-
|
|
512
|
-
title:
|
|
513
|
-
}, (
|
|
539
|
+
he(z, (m) => {
|
|
540
|
+
var w, V, k;
|
|
541
|
+
if (m.status === Ne.Error) {
|
|
542
|
+
ee.value = {
|
|
543
|
+
title: f("errors.general")
|
|
544
|
+
}, (k = (V = (w = m.error) == null ? void 0 : w.response) == null ? void 0 : V.data) != null && k.message && (ee.value.message = m.error.response.data.message), c("error", m.error);
|
|
514
545
|
return;
|
|
515
546
|
}
|
|
516
|
-
|
|
547
|
+
ee.value = null;
|
|
517
548
|
});
|
|
518
|
-
const
|
|
519
|
-
ctaPath:
|
|
549
|
+
const v = U({
|
|
550
|
+
ctaPath: n.config.createRoute,
|
|
520
551
|
ctaText: void 0,
|
|
521
|
-
message: `${
|
|
522
|
-
title:
|
|
552
|
+
message: `${f("vaults.list.empty_state.description")}${n.config.additionMessageForEmptyState ? ` ${n.config.additionMessageForEmptyState}` : ""}`,
|
|
553
|
+
title: f("vaults.title")
|
|
523
554
|
});
|
|
524
|
-
return
|
|
525
|
-
await
|
|
526
|
-
}), (
|
|
527
|
-
const
|
|
528
|
-
return
|
|
529
|
-
|
|
555
|
+
return ke(async () => {
|
|
556
|
+
await n.canCreate() && (v.value.title = f("vaults.list.empty_state.title"), v.value.ctaText = f("actions.create"));
|
|
557
|
+
}), (m, w) => {
|
|
558
|
+
const V = N("KButton"), k = N("KDropdownItem"), le = N("KClipboardProvider");
|
|
559
|
+
return A(), q("div", yt, [
|
|
560
|
+
d(e(Oe), {
|
|
530
561
|
"cache-identifier": l.cacheIdentifier,
|
|
531
|
-
"disable-sorting":
|
|
532
|
-
"empty-state-options":
|
|
562
|
+
"disable-sorting": C.value,
|
|
563
|
+
"empty-state-options": v.value,
|
|
533
564
|
"enable-entity-actions": "",
|
|
534
|
-
"error-message":
|
|
535
|
-
fetcher: e(
|
|
536
|
-
"fetcher-cache-key":
|
|
565
|
+
"error-message": ee.value,
|
|
566
|
+
fetcher: e(re),
|
|
567
|
+
"fetcher-cache-key": D.value,
|
|
537
568
|
"pagination-type": "offset",
|
|
538
569
|
"preferences-storage-key": "kong-ui-entities-vaults-list",
|
|
539
|
-
query:
|
|
540
|
-
"table-headers": e(
|
|
541
|
-
onClearSearchInput:
|
|
542
|
-
"onClick:row":
|
|
543
|
-
onSort:
|
|
570
|
+
query: u.value,
|
|
571
|
+
"table-headers": e(p),
|
|
572
|
+
onClearSearchInput: a,
|
|
573
|
+
"onClick:row": w[1] || (w[1] = (K) => X(K)),
|
|
574
|
+
onSort: Y
|
|
544
575
|
}, {
|
|
545
|
-
"toolbar-filter":
|
|
546
|
-
|
|
547
|
-
modelValue:
|
|
548
|
-
"onUpdate:modelValue":
|
|
549
|
-
config:
|
|
576
|
+
"toolbar-filter": y(() => [
|
|
577
|
+
d(e(qe), {
|
|
578
|
+
modelValue: u.value,
|
|
579
|
+
"onUpdate:modelValue": w[0] || (w[0] = (K) => u.value = K),
|
|
580
|
+
config: O.value
|
|
550
581
|
}, null, 8, ["modelValue", "config"])
|
|
551
582
|
]),
|
|
552
|
-
"toolbar-button":
|
|
553
|
-
(
|
|
583
|
+
"toolbar-button": y(() => [
|
|
584
|
+
(A(), oe(Le, {
|
|
554
585
|
disabled: !l.useActionOutside,
|
|
555
586
|
to: "#kong-ui-app-page-header-action-button"
|
|
556
587
|
}, [
|
|
557
|
-
|
|
588
|
+
d(e(fe), {
|
|
558
589
|
"auth-function": () => l.canCreate()
|
|
559
590
|
}, {
|
|
560
|
-
default:
|
|
561
|
-
|
|
591
|
+
default: y(() => [
|
|
592
|
+
d(V, {
|
|
562
593
|
appearance: "primary",
|
|
563
594
|
"data-testid": "toolbar-add-vault",
|
|
564
595
|
size: l.useActionOutside ? "medium" : "large",
|
|
565
596
|
to: l.config.createRoute
|
|
566
597
|
}, {
|
|
567
|
-
default:
|
|
568
|
-
|
|
569
|
-
|
|
598
|
+
default: y(() => [
|
|
599
|
+
d(e(Me)),
|
|
600
|
+
pe(" " + P(e(f)("vaults.list.toolbar_actions.new_vault")), 1)
|
|
570
601
|
]),
|
|
571
602
|
_: 1
|
|
572
603
|
}, 8, ["size", "to"])
|
|
@@ -575,84 +606,84 @@ const he = {
|
|
|
575
606
|
}, 8, ["auth-function"])
|
|
576
607
|
], 8, ["disabled"]))
|
|
577
608
|
]),
|
|
578
|
-
prefix:
|
|
579
|
-
R("div",
|
|
580
|
-
R("b", null,
|
|
609
|
+
prefix: y(({ rowValue: K }) => [
|
|
610
|
+
R("div", ht, [
|
|
611
|
+
R("b", null, P(K ?? "-"), 1)
|
|
581
612
|
])
|
|
582
613
|
]),
|
|
583
|
-
name:
|
|
584
|
-
R("b", null,
|
|
614
|
+
name: y(({ rowValue: K }) => [
|
|
615
|
+
R("b", null, P(K ?? "-"), 1)
|
|
585
616
|
]),
|
|
586
|
-
description:
|
|
587
|
-
R("div",
|
|
617
|
+
description: y(({ rowValue: K }) => [
|
|
618
|
+
R("div", Vt, P(K ?? "-"), 1)
|
|
588
619
|
]),
|
|
589
|
-
tags:
|
|
590
|
-
|
|
620
|
+
tags: y(({ rowValue: K }) => [
|
|
621
|
+
d(e(lt), { tags: K }, null, 8, ["tags"])
|
|
591
622
|
]),
|
|
592
|
-
actions:
|
|
593
|
-
|
|
594
|
-
default:
|
|
595
|
-
|
|
623
|
+
actions: y(({ row: K }) => [
|
|
624
|
+
d(le, null, {
|
|
625
|
+
default: y(({ copyToClipboard: s }) => [
|
|
626
|
+
d(k, {
|
|
596
627
|
"data-testid": "action-entity-copy-id",
|
|
597
|
-
onClick: (
|
|
628
|
+
onClick: (r) => W(K, s)
|
|
598
629
|
}, {
|
|
599
|
-
default:
|
|
600
|
-
|
|
630
|
+
default: y(() => [
|
|
631
|
+
pe(P(e(f)("actions.copy_id")), 1)
|
|
601
632
|
]),
|
|
602
633
|
_: 2
|
|
603
634
|
}, 1032, ["onClick"])
|
|
604
635
|
]),
|
|
605
636
|
_: 2
|
|
606
637
|
}, 1024),
|
|
607
|
-
|
|
608
|
-
default:
|
|
609
|
-
|
|
638
|
+
d(le, null, {
|
|
639
|
+
default: y(({ copyToClipboard: s }) => [
|
|
640
|
+
d(k, {
|
|
610
641
|
"data-testid": "action-entity-copy-json",
|
|
611
|
-
onClick: (
|
|
642
|
+
onClick: (r) => G(K, s)
|
|
612
643
|
}, {
|
|
613
|
-
default:
|
|
614
|
-
|
|
644
|
+
default: y(() => [
|
|
645
|
+
pe(P(e(f)("actions.copy_json")), 1)
|
|
615
646
|
]),
|
|
616
647
|
_: 2
|
|
617
648
|
}, 1032, ["onClick"])
|
|
618
649
|
]),
|
|
619
650
|
_: 2
|
|
620
651
|
}, 1024),
|
|
621
|
-
|
|
622
|
-
"auth-function": () => l.canRetrieve(
|
|
652
|
+
d(e(fe), {
|
|
653
|
+
"auth-function": () => l.canRetrieve(K)
|
|
623
654
|
}, {
|
|
624
|
-
default:
|
|
625
|
-
|
|
655
|
+
default: y(() => [
|
|
656
|
+
d(k, {
|
|
626
657
|
"data-testid": "action-entity-view",
|
|
627
658
|
"has-divider": "",
|
|
628
|
-
item:
|
|
659
|
+
item: g(K.id)
|
|
629
660
|
}, null, 8, ["item"])
|
|
630
661
|
]),
|
|
631
662
|
_: 2
|
|
632
663
|
}, 1032, ["auth-function"]),
|
|
633
|
-
|
|
634
|
-
"auth-function": () => l.canEdit(
|
|
664
|
+
d(e(fe), {
|
|
665
|
+
"auth-function": () => l.canEdit(K)
|
|
635
666
|
}, {
|
|
636
|
-
default:
|
|
637
|
-
|
|
667
|
+
default: y(() => [
|
|
668
|
+
d(k, {
|
|
638
669
|
"data-testid": "action-entity-edit",
|
|
639
|
-
item: H(
|
|
670
|
+
item: H(K.id)
|
|
640
671
|
}, null, 8, ["item"])
|
|
641
672
|
]),
|
|
642
673
|
_: 2
|
|
643
674
|
}, 1032, ["auth-function"]),
|
|
644
|
-
|
|
645
|
-
"auth-function": () => l.canDelete(
|
|
675
|
+
d(e(fe), {
|
|
676
|
+
"auth-function": () => l.canDelete(K)
|
|
646
677
|
}, {
|
|
647
|
-
default:
|
|
648
|
-
|
|
678
|
+
default: y(() => [
|
|
679
|
+
d(k, {
|
|
649
680
|
danger: "",
|
|
650
681
|
"data-testid": "action-entity-delete",
|
|
651
682
|
"has-divider": "",
|
|
652
|
-
onClick: (
|
|
683
|
+
onClick: (s) => $(K)
|
|
653
684
|
}, {
|
|
654
|
-
default:
|
|
655
|
-
|
|
685
|
+
default: y(() => [
|
|
686
|
+
pe(P(e(f)("actions.delete")), 1)
|
|
656
687
|
]),
|
|
657
688
|
_: 2
|
|
658
689
|
}, 1032, ["onClick"])
|
|
@@ -662,40 +693,40 @@ const he = {
|
|
|
662
693
|
]),
|
|
663
694
|
_: 1
|
|
664
695
|
}, 8, ["cache-identifier", "disable-sorting", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "query", "table-headers"]),
|
|
665
|
-
|
|
696
|
+
d(e(De), {
|
|
666
697
|
"action-pending": te.value,
|
|
667
|
-
description: e(
|
|
668
|
-
"entity-name":
|
|
669
|
-
"entity-type": e(
|
|
670
|
-
error:
|
|
671
|
-
title: e(
|
|
698
|
+
description: e(f)("delete.description"),
|
|
699
|
+
"entity-name": M.value && (M.value.prefix || M.value.id),
|
|
700
|
+
"entity-type": e(We).Vault,
|
|
701
|
+
error: Z.value,
|
|
702
|
+
title: e(f)("delete.title"),
|
|
672
703
|
visible: j.value,
|
|
673
|
-
onCancel:
|
|
674
|
-
onProceed:
|
|
704
|
+
onCancel: J,
|
|
705
|
+
onProceed: _
|
|
675
706
|
}, null, 8, ["action-pending", "description", "entity-name", "entity-type", "error", "title", "visible"])
|
|
676
707
|
]);
|
|
677
708
|
};
|
|
678
709
|
}
|
|
679
|
-
}),
|
|
680
|
-
const
|
|
681
|
-
for (const [
|
|
682
|
-
|
|
683
|
-
return
|
|
684
|
-
},
|
|
685
|
-
var t = /* @__PURE__ */ ((l) => (l.AWS = "aws", l.GCP = "gcp", l.HCV = "hcv", l.ENV = "env", l.AZURE = "azure", l.KONNECT = "konnect", l))(t || {}),
|
|
686
|
-
const
|
|
710
|
+
}), ce = (l, I) => {
|
|
711
|
+
const c = l.__vccOpts || l;
|
|
712
|
+
for (const [n, f] of I)
|
|
713
|
+
c[n] = f;
|
|
714
|
+
return c;
|
|
715
|
+
}, ml = /* @__PURE__ */ ce(kt, [["__scopeId", "data-v-6704960c"]]);
|
|
716
|
+
var t = /* @__PURE__ */ ((l) => (l.AWS = "aws", l.GCP = "gcp", l.HCV = "hcv", l.ENV = "env", l.AZURE = "azure", l.KONNECT = "konnect", l))(t || {}), F = /* @__PURE__ */ ((l) => (l.TOKEN = "token", l.K8S = "kubernetes", l.APP_ROLE = "approle", l))(F || {});
|
|
717
|
+
const wt = { class: "kong-ui-entities-vault-form" }, Ct = { class: "vault-form-provider-cards-container" }, St = ["data-testid"], It = { class: "provider-item-title-container" }, xt = { class: "provider-item-title" }, Et = { class: "provider-item-description" }, At = {
|
|
687
718
|
key: "kong-vault-config-fields",
|
|
688
719
|
class: "vault-form-config-fields-container"
|
|
689
|
-
},
|
|
720
|
+
}, Rt = {
|
|
690
721
|
key: 0,
|
|
691
722
|
class: "vault-form-config-auth-method-container"
|
|
692
|
-
},
|
|
723
|
+
}, Ut = {
|
|
693
724
|
key: 1,
|
|
694
725
|
class: "vault-form-config-auth-method-container"
|
|
695
|
-
},
|
|
726
|
+
}, $t = {
|
|
696
727
|
key: 2,
|
|
697
728
|
class: "vault-form-config-auth-method-container"
|
|
698
|
-
},
|
|
729
|
+
}, Tt = { key: 5 }, Kt = { class: "wrapper" }, Pt = { class: "item-50" }, Mt = { class: "item-50" }, Ht = { class: "wrapper" }, Ft = { class: "item-100" }, Nt = /* @__PURE__ */ ie({
|
|
699
730
|
__name: "VaultForm",
|
|
700
731
|
props: {
|
|
701
732
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
@@ -712,9 +743,9 @@ const _t = { class: "kong-ui-entities-vault-form" }, Vt = { class: "vault-form-p
|
|
|
712
743
|
}
|
|
713
744
|
},
|
|
714
745
|
emits: ["update", "error", "loading"],
|
|
715
|
-
setup(l, { emit:
|
|
716
|
-
var
|
|
717
|
-
const
|
|
746
|
+
setup(l, { emit: I }) {
|
|
747
|
+
var K;
|
|
748
|
+
const c = l, n = I, { i18nT: f, i18n: { t: o } } = ge.useI18n(), x = Ie(), { axiosInstance: C } = ve((K = c.config) == null ? void 0 : K.axiosRequestConfig), { getMessageFromError: b } = je(), p = _e({
|
|
718
749
|
fields: {
|
|
719
750
|
prefix: "",
|
|
720
751
|
description: "",
|
|
@@ -722,40 +753,40 @@ const _t = { class: "kong-ui-entities-vault-form" }, Vt = { class: "vault-form-p
|
|
|
722
753
|
},
|
|
723
754
|
isReadonly: !1,
|
|
724
755
|
errorMessage: ""
|
|
725
|
-
}),
|
|
756
|
+
}), h = _e({
|
|
726
757
|
prefix: "",
|
|
727
758
|
description: "",
|
|
728
759
|
tags: ""
|
|
729
|
-
}),
|
|
730
|
-
...
|
|
731
|
-
label:
|
|
760
|
+
}), u = U(c.config.konnectConfigStoreAvailable ? t.KONNECT : t.ENV), O = U(null), D = U(), re = E(() => [t.AWS, t.GCP, t.HCV, t.AZURE].includes(u.value)), z = E(() => [
|
|
761
|
+
...c.config.konnectConfigStoreAvailable ? [{
|
|
762
|
+
label: o("form.config.konnect.label"),
|
|
732
763
|
value: t.KONNECT
|
|
733
764
|
}] : [],
|
|
734
765
|
{
|
|
735
|
-
label:
|
|
766
|
+
label: o("form.config.env.label"),
|
|
736
767
|
value: t.ENV
|
|
737
768
|
},
|
|
738
769
|
{
|
|
739
|
-
label:
|
|
770
|
+
label: o("form.config.aws.label"),
|
|
740
771
|
value: t.AWS,
|
|
741
772
|
disabled: !j.value
|
|
742
773
|
},
|
|
743
774
|
{
|
|
744
|
-
label:
|
|
775
|
+
label: o("form.config.gcp.label"),
|
|
745
776
|
value: t.GCP,
|
|
746
777
|
disabled: !j.value
|
|
747
778
|
},
|
|
748
779
|
{
|
|
749
|
-
label:
|
|
780
|
+
label: o("form.config.hcv.label"),
|
|
750
781
|
value: t.HCV,
|
|
751
782
|
disabled: !j.value
|
|
752
783
|
},
|
|
753
|
-
...
|
|
754
|
-
label:
|
|
784
|
+
...c.config.azureVaultProviderAvailable ? [{
|
|
785
|
+
label: o("form.config.azure.label"),
|
|
755
786
|
value: t.AZURE,
|
|
756
787
|
disabled: !j.value
|
|
757
788
|
}] : []
|
|
758
|
-
]),
|
|
789
|
+
]), a = _e({
|
|
759
790
|
[t.KONNECT]: {},
|
|
760
791
|
[t.ENV]: {
|
|
761
792
|
prefix: ""
|
|
@@ -776,7 +807,7 @@ const _t = { class: "kong-ui-entities-vault-form" }, Vt = { class: "vault-form-p
|
|
|
776
807
|
mount: "secret",
|
|
777
808
|
kv: "v1",
|
|
778
809
|
namespace: "",
|
|
779
|
-
auth_method:
|
|
810
|
+
auth_method: F.TOKEN,
|
|
780
811
|
token: "",
|
|
781
812
|
kube_role: "",
|
|
782
813
|
kube_auth_path: "",
|
|
@@ -795,7 +826,7 @@ const _t = { class: "kong-ui-entities-vault-form" }, Vt = { class: "vault-form-p
|
|
|
795
826
|
client_id: "",
|
|
796
827
|
tenant_id: ""
|
|
797
828
|
}
|
|
798
|
-
}),
|
|
829
|
+
}), Y = _e({
|
|
799
830
|
[t.KONNECT]: {},
|
|
800
831
|
[t.ENV]: {
|
|
801
832
|
prefix: ""
|
|
@@ -816,7 +847,7 @@ const _t = { class: "kong-ui-entities-vault-form" }, Vt = { class: "vault-form-p
|
|
|
816
847
|
mount: "secret",
|
|
817
848
|
kv: "v1",
|
|
818
849
|
namespace: "",
|
|
819
|
-
auth_method:
|
|
850
|
+
auth_method: F.TOKEN,
|
|
820
851
|
token: "",
|
|
821
852
|
kube_role: "",
|
|
822
853
|
kube_auth_path: "",
|
|
@@ -835,85 +866,85 @@ const _t = { class: "kong-ui-entities-vault-form" }, Vt = { class: "vault-form-p
|
|
|
835
866
|
client_id: "",
|
|
836
867
|
tenant_id: ""
|
|
837
868
|
}
|
|
838
|
-
}),
|
|
839
|
-
{ label: `${
|
|
840
|
-
{ label: `${
|
|
841
|
-
{ label: `${
|
|
842
|
-
{ label: `${
|
|
843
|
-
{ label: `${
|
|
844
|
-
{ label: `${
|
|
845
|
-
{ label: `${
|
|
846
|
-
{ label: `${
|
|
847
|
-
{ label: `${
|
|
848
|
-
{ label: `${
|
|
849
|
-
{ label: `${
|
|
850
|
-
{ label: `${
|
|
851
|
-
{ label: `${
|
|
852
|
-
{ label: `${
|
|
853
|
-
{ label: `${
|
|
854
|
-
{ label: `${
|
|
855
|
-
{ label: `${
|
|
856
|
-
{ label: `${
|
|
857
|
-
{ label: `${
|
|
858
|
-
{ label: `${
|
|
859
|
-
{ label: `${
|
|
860
|
-
{ label: `${
|
|
861
|
-
{ label: `${
|
|
862
|
-
{ label: `${
|
|
863
|
-
],
|
|
864
|
-
var
|
|
865
|
-
return (
|
|
866
|
-
}),
|
|
867
|
-
gatewayInfo:
|
|
869
|
+
}), ee = [
|
|
870
|
+
{ label: `${o("form.config.aws.fields.region.locations.us-east-1.location")} (us-east-1)`, value: "us-east-1" },
|
|
871
|
+
{ label: `${o("form.config.aws.fields.region.locations.us-east-2.location")} (us-east-2)`, value: "us-east-2" },
|
|
872
|
+
{ label: `${o("form.config.aws.fields.region.locations.us-west-1.location")} (us-west-1)`, value: "us-west-1" },
|
|
873
|
+
{ label: `${o("form.config.aws.fields.region.locations.us-west-2.location")} (us-west-2)`, value: "us-west-2" },
|
|
874
|
+
{ label: `${o("form.config.aws.fields.region.locations.af-south-1.location")} (af-south-1)`, value: "af-south-1" },
|
|
875
|
+
{ label: `${o("form.config.aws.fields.region.locations.ap-east-1.location")} (ap-east-1)`, value: "ap-east-1" },
|
|
876
|
+
{ label: `${o("form.config.aws.fields.region.locations.ap-southeast-3.location")} (ap-southeast-3)`, value: "ap-southeast-3" },
|
|
877
|
+
{ label: `${o("form.config.aws.fields.region.locations.ap-south-1.location")} (ap-south-1)`, value: "ap-south-1" },
|
|
878
|
+
{ label: `${o("form.config.aws.fields.region.locations.ap-northeast-1.location")} (ap-northeast-1)`, value: "ap-northeast-1" },
|
|
879
|
+
{ label: `${o("form.config.aws.fields.region.locations.ap-northeast-2.location")} (ap-northeast-2)`, value: "ap-northeast-2" },
|
|
880
|
+
{ label: `${o("form.config.aws.fields.region.locations.ap-northeast-3.location")} (ap-northeast-3)`, value: "ap-northeast-3" },
|
|
881
|
+
{ label: `${o("form.config.aws.fields.region.locations.ap-southeast-1.location")} (ap-southeast-1)`, value: "ap-southeast-1" },
|
|
882
|
+
{ label: `${o("form.config.aws.fields.region.locations.ap-southeast-2.location")} (ap-southeast-2)`, value: "ap-southeast-2" },
|
|
883
|
+
{ label: `${o("form.config.aws.fields.region.locations.ca-central-1.location")} (ca-central-1)`, value: "ca-central-1" },
|
|
884
|
+
{ label: `${o("form.config.aws.fields.region.locations.eu-central-1.location")} (eu-central-1)`, value: "eu-central-1" },
|
|
885
|
+
{ label: `${o("form.config.aws.fields.region.locations.eu-west-1.location")} (eu-west-1)`, value: "eu-west-1" },
|
|
886
|
+
{ label: `${o("form.config.aws.fields.region.locations.eu-west-2.location")} (eu-west-2)`, value: "eu-west-2" },
|
|
887
|
+
{ label: `${o("form.config.aws.fields.region.locations.eu-west-3.location")} (eu-west-3)`, value: "eu-west-3" },
|
|
888
|
+
{ label: `${o("form.config.aws.fields.region.locations.eu-south-1.location")} (eu-south-1)`, value: "eu-south-1" },
|
|
889
|
+
{ label: `${o("form.config.aws.fields.region.locations.eu-north-1.location")} (eu-north-1)`, value: "eu-north-1" },
|
|
890
|
+
{ label: `${o("form.config.aws.fields.region.locations.me-south-1.location")} (me-south-1)`, value: "me-south-1" },
|
|
891
|
+
{ label: `${o("form.config.aws.fields.region.locations.sa-east-1.location")} (sa-east-1)`, value: "sa-east-1" },
|
|
892
|
+
{ label: `${o("form.config.aws.fields.region.locations.us-gov-east-1.location")} (us-gov-east-1)`, value: "us-gov-east-1" },
|
|
893
|
+
{ label: `${o("form.config.aws.fields.region.locations.us-gov-west-1.location")} (us-gov-west-1)`, value: "us-gov-west-1" }
|
|
894
|
+
], W = [{ label: "secrets", value: "secrets" }], G = [{ label: "http", value: "http" }, { label: "https", value: "https" }], X = [{ label: "v1", value: "v1" }, { label: "v2", value: "v2" }], g = E(() => c.vaultId ? be.Edit : be.Create), H = E(() => {
|
|
895
|
+
var s, r;
|
|
896
|
+
return (r = se.form[(s = c.config) == null ? void 0 : s.app]) == null ? void 0 : r.edit;
|
|
897
|
+
}), M = E(() => g.value === be.Edit && c.config.app === "kongManager"), j = E(() => c.config.app === "konnect" || ot({
|
|
898
|
+
gatewayInfo: c.config.gatewayInfo,
|
|
868
899
|
// vault name can only be `env` in Gateway Community Edition
|
|
869
900
|
supportedRange: {
|
|
870
901
|
enterprise: []
|
|
871
902
|
}
|
|
872
903
|
})), te = () => {
|
|
873
|
-
var
|
|
874
|
-
|
|
875
|
-
},
|
|
876
|
-
|
|
877
|
-
},
|
|
878
|
-
|
|
879
|
-
},
|
|
880
|
-
switch (
|
|
904
|
+
var s;
|
|
905
|
+
x.push(((s = c.config) == null ? void 0 : s.cancelRoute) || { name: "vault-list" });
|
|
906
|
+
}, Z = (s) => {
|
|
907
|
+
n("loading", s);
|
|
908
|
+
}, ne = (s) => {
|
|
909
|
+
n("error", s);
|
|
910
|
+
}, $ = (s) => {
|
|
911
|
+
switch (s) {
|
|
881
912
|
case t.KONNECT:
|
|
882
|
-
return
|
|
913
|
+
return tt;
|
|
883
914
|
case t.ENV:
|
|
884
|
-
return
|
|
915
|
+
return et;
|
|
885
916
|
case t.AWS:
|
|
886
|
-
return
|
|
917
|
+
return Xe;
|
|
887
918
|
case t.GCP:
|
|
888
|
-
return
|
|
919
|
+
return Ye;
|
|
889
920
|
case t.HCV:
|
|
890
|
-
return
|
|
921
|
+
return Qe;
|
|
891
922
|
case t.AZURE:
|
|
892
|
-
return
|
|
923
|
+
return Je;
|
|
893
924
|
}
|
|
894
|
-
},
|
|
895
|
-
switch (
|
|
925
|
+
}, J = (s) => {
|
|
926
|
+
switch (s) {
|
|
896
927
|
case t.KONNECT:
|
|
897
|
-
return
|
|
928
|
+
return o("form.config.konnect.description");
|
|
898
929
|
case t.ENV:
|
|
899
|
-
return
|
|
930
|
+
return o("form.config.env.description");
|
|
900
931
|
case t.AWS:
|
|
901
|
-
return
|
|
932
|
+
return o("form.config.aws.description");
|
|
902
933
|
case t.GCP:
|
|
903
|
-
return
|
|
934
|
+
return o("form.config.gcp.description");
|
|
904
935
|
case t.HCV:
|
|
905
|
-
return
|
|
936
|
+
return o("form.config.hcv.description");
|
|
906
937
|
case t.AZURE:
|
|
907
|
-
return
|
|
938
|
+
return o("form.config.azure.description");
|
|
908
939
|
}
|
|
909
|
-
},
|
|
910
|
-
var
|
|
911
|
-
|
|
912
|
-
const
|
|
913
|
-
|
|
914
|
-
const
|
|
915
|
-
|
|
916
|
-
},
|
|
940
|
+
}, B = (s) => {
|
|
941
|
+
var Q, S, ye, ue, de, i;
|
|
942
|
+
p.fields.prefix = ((Q = s == null ? void 0 : s.item) == null ? void 0 : Q.prefix) || (s == null ? void 0 : s.prefix) || "", p.fields.description = ((S = s == null ? void 0 : s.item) == null ? void 0 : S.description) || (s == null ? void 0 : s.description) || "";
|
|
943
|
+
const r = ((ye = s == null ? void 0 : s.item) == null ? void 0 : ye.tags) || (s == null ? void 0 : s.tags) || [];
|
|
944
|
+
p.fields.tags = (r == null ? void 0 : r.join(", ")) || "", Object.assign(h, p.fields);
|
|
945
|
+
const L = ((ue = s == null ? void 0 : s.item) == null ? void 0 : ue.config) || (s == null ? void 0 : s.config) || null;
|
|
946
|
+
L && (Object.keys(L).length || (s == null ? void 0 : s.name) === t.KONNECT) ? (u.value = ((de = s == null ? void 0 : s.item) == null ? void 0 : de.name) || (s == null ? void 0 : s.name) || "", O.value = u.value, D.value = ((i = s == null ? void 0 : s.config) == null ? void 0 : i.config_store_id) || void 0, Object.assign(a[u.value], L), Object.assign(Y[u.value], L)) : p.errorMessage = "Error loading vault config";
|
|
947
|
+
}, _ = E(() => u.value === t.HCV ? !Object.keys(a[t.HCV]).filter((s) => [
|
|
917
948
|
"namespace",
|
|
918
949
|
"ttl",
|
|
919
950
|
"neg_ttl",
|
|
@@ -922,148 +953,148 @@ const _t = { class: "kong-ui-entities-vault-form" }, Vt = { class: "vault-form-p
|
|
|
922
953
|
"approle_auth_path",
|
|
923
954
|
"approle_secret_id",
|
|
924
955
|
"approle_secret_id_file"
|
|
925
|
-
].includes(
|
|
926
|
-
var
|
|
927
|
-
let
|
|
928
|
-
return
|
|
929
|
-
}),
|
|
930
|
-
var
|
|
931
|
-
const
|
|
932
|
-
protocol:
|
|
933
|
-
host:
|
|
934
|
-
port: parseInt(
|
|
935
|
-
mount:
|
|
936
|
-
kv:
|
|
937
|
-
namespace:
|
|
938
|
-
auth_method:
|
|
939
|
-
...
|
|
956
|
+
].includes(s) || a[t.HCV].auth_method !== F.K8S && (s === "kube_role" || s === "kube_api_token_file") || a[t.HCV].auth_method !== F.TOKEN && s === "token" || a[t.HCV].auth_method !== F.APP_ROLE && (s === "approle_role_id" || s === "approle_response_wrapping") || a[t.HCV].auth_method === F.APP_ROLE && s === "approle_response_wrapping" && typeof a[u.value][s] == "boolean" ? !1 : !a[u.value][s]).length : u.value === t.AZURE ? !Object.keys(a[t.AZURE]).filter((s) => ["client_id", "tenant_id", "ttl", "neg_ttl", "resurrect_ttl"].includes(s) ? !1 : !a[u.value][s]).length : u.value === t.AWS ? !Object.keys(a[t.AWS]).filter((s) => ["endpoint_url", "assume_role_arn", "ttl", "neg_ttl", "resurrect_ttl", "sts_endpoint_url"].includes(s) ? !1 : !a[u.value][s]).length : !Object.keys(a[u.value]).filter((s) => ["ttl", "neg_ttl", "resurrect_ttl"].includes(s) ? !1 : !a[u.value][s]).length), v = E(() => !!p.fields.prefix && _.value), T = E(() => JSON.stringify(p.fields) !== JSON.stringify(h) || u.value !== O.value || JSON.stringify(a[u.value]) !== JSON.stringify(Y[u.value])), m = E(() => {
|
|
957
|
+
var r, L;
|
|
958
|
+
let s = `${c.config.apiBaseUrl}${se.form[c.config.app][g.value]}`;
|
|
959
|
+
return c.config.app === "konnect" ? s = s.replace(/{controlPlaneId}/gi, ((r = c.config) == null ? void 0 : r.controlPlaneId) || "") : c.config.app === "kongManager" && (s = s.replace(/\/{workspace}/gi, (L = c.config) != null && L.workspace ? `/${c.config.workspace}` : "")), s = s.replace(/{id}/gi, c.vaultId), s;
|
|
960
|
+
}), w = E(() => {
|
|
961
|
+
var ue, de;
|
|
962
|
+
const s = {
|
|
963
|
+
protocol: a[t.HCV].protocol,
|
|
964
|
+
host: a[t.HCV].host,
|
|
965
|
+
port: parseInt(a[t.HCV].port.toString()),
|
|
966
|
+
mount: a[t.HCV].mount,
|
|
967
|
+
kv: a[t.HCV].kv,
|
|
968
|
+
namespace: a[t.HCV].namespace || null,
|
|
969
|
+
auth_method: a[t.HCV].auth_method,
|
|
970
|
+
...a[t.HCV].auth_method === F.TOKEN && { token: a[t.HCV].token },
|
|
940
971
|
// For Kong Admin API, when auth_method is kubernetes, token must be in the request body and its value has to be null
|
|
941
|
-
...
|
|
942
|
-
kube_role:
|
|
943
|
-
kube_auth_path:
|
|
944
|
-
kube_api_token_file:
|
|
972
|
+
...a[t.HCV].auth_method === F.K8S && {
|
|
973
|
+
kube_role: a[t.HCV].kube_role,
|
|
974
|
+
kube_auth_path: a[t.HCV].kube_auth_path || void 0,
|
|
975
|
+
kube_api_token_file: a[t.HCV].kube_api_token_file,
|
|
945
976
|
token: null
|
|
946
977
|
},
|
|
947
|
-
...
|
|
948
|
-
approle_auth_path:
|
|
949
|
-
approle_role_id:
|
|
950
|
-
approle_secret_id:
|
|
951
|
-
approle_secret_id_file:
|
|
952
|
-
approle_response_wrapping:
|
|
978
|
+
...a[t.HCV].auth_method === F.APP_ROLE && {
|
|
979
|
+
approle_auth_path: a[t.HCV].approle_auth_path || void 0,
|
|
980
|
+
approle_role_id: a[t.HCV].approle_role_id,
|
|
981
|
+
approle_secret_id: a[t.HCV].approle_secret_id || void 0,
|
|
982
|
+
approle_secret_id_file: a[t.HCV].approle_secret_id_file || void 0,
|
|
983
|
+
approle_response_wrapping: a[t.HCV].approle_response_wrapping ?? !1
|
|
953
984
|
}
|
|
954
|
-
},
|
|
955
|
-
...
|
|
956
|
-
client_id:
|
|
957
|
-
tenant_id:
|
|
958
|
-
},
|
|
959
|
-
...
|
|
960
|
-
endpoint_url:
|
|
961
|
-
assume_role_arn:
|
|
962
|
-
...
|
|
985
|
+
}, r = {
|
|
986
|
+
...a[u.value],
|
|
987
|
+
client_id: a[u.value].client_id || null,
|
|
988
|
+
tenant_id: a[u.value].tenant_id || null
|
|
989
|
+
}, L = {
|
|
990
|
+
...a[u.value],
|
|
991
|
+
endpoint_url: a[u.value].endpoint_url || null,
|
|
992
|
+
assume_role_arn: a[u.value].assume_role_arn || null,
|
|
993
|
+
...c.config.awsStsEndpointUrlAvailable ? { sts_endpoint_url: a[u.value].sts_endpoint_url || null } : {}
|
|
963
994
|
};
|
|
964
|
-
let
|
|
965
|
-
|
|
966
|
-
let
|
|
967
|
-
if (![t.KONNECT, t.ENV].includes(
|
|
968
|
-
const
|
|
969
|
-
|
|
970
|
-
ttl:
|
|
971
|
-
neg_ttl:
|
|
972
|
-
resurrect_ttl:
|
|
995
|
+
let Q = a[u.value];
|
|
996
|
+
u.value === t.HCV ? Q = s : u.value === t.AZURE ? Q = r : u.value === t.AWS && (Q = L);
|
|
997
|
+
let S = {};
|
|
998
|
+
if (![t.KONNECT, t.ENV].includes(u.value)) {
|
|
999
|
+
const i = a[u.value], Ee = i.ttl, Ae = i.neg_ttl, Re = i.resurrect_ttl;
|
|
1000
|
+
S = {
|
|
1001
|
+
ttl: Ee ? parseInt(Ee.toString(), 10) : null,
|
|
1002
|
+
neg_ttl: Ae ? parseInt(Ae.toString(), 10) : null,
|
|
1003
|
+
resurrect_ttl: Re ? parseInt(Re.toString(), 10) : null
|
|
973
1004
|
};
|
|
974
1005
|
}
|
|
975
1006
|
return {
|
|
976
|
-
prefix:
|
|
977
|
-
description:
|
|
978
|
-
tags: (
|
|
979
|
-
name:
|
|
1007
|
+
prefix: p.fields.prefix,
|
|
1008
|
+
description: p.fields.description || null,
|
|
1009
|
+
tags: (de = (ue = p.fields.tags.split(",")) == null ? void 0 : ue.map((i) => String(i || "").trim())) == null ? void 0 : de.filter((i) => i !== ""),
|
|
1010
|
+
name: u.value,
|
|
980
1011
|
config: {
|
|
981
|
-
...
|
|
982
|
-
...
|
|
1012
|
+
...Q,
|
|
1013
|
+
...S
|
|
983
1014
|
}
|
|
984
1015
|
};
|
|
985
|
-
}),
|
|
986
|
-
...
|
|
1016
|
+
}), V = E(() => ({
|
|
1017
|
+
...w.value,
|
|
987
1018
|
config: {
|
|
988
|
-
...
|
|
989
|
-
config_store_id:
|
|
1019
|
+
...w.value.config,
|
|
1020
|
+
config_store_id: D.value
|
|
990
1021
|
}
|
|
991
|
-
})),
|
|
992
|
-
var
|
|
1022
|
+
})), k = async () => {
|
|
1023
|
+
var s;
|
|
993
1024
|
try {
|
|
994
|
-
|
|
995
|
-
const
|
|
996
|
-
return
|
|
997
|
-
} catch (
|
|
998
|
-
|
|
1025
|
+
p.isReadonly = !0;
|
|
1026
|
+
const r = `${c.config.apiBaseUrl}${se.form.konnect.createConfigStore}`.replace(/{controlPlaneId}/gi, ((s = c.config) == null ? void 0 : s.controlPlaneId) || ""), L = await C.post(r);
|
|
1027
|
+
return L == null ? void 0 : L.data.id;
|
|
1028
|
+
} catch (r) {
|
|
1029
|
+
p.errorMessage = b(r), n("error", r);
|
|
999
1030
|
} finally {
|
|
1000
|
-
|
|
1031
|
+
p.isReadonly = !1;
|
|
1001
1032
|
}
|
|
1002
1033
|
}, le = async () => {
|
|
1003
|
-
var
|
|
1034
|
+
var s;
|
|
1004
1035
|
try {
|
|
1005
|
-
|
|
1006
|
-
let
|
|
1007
|
-
|
|
1008
|
-
} catch (
|
|
1009
|
-
|
|
1036
|
+
p.isReadonly = !0;
|
|
1037
|
+
let r;
|
|
1038
|
+
g.value === "create" ? u.value === t.KONNECT ? (D.value = await k(), r = await C.post(m.value, V.value)) : r = await C.post(m.value, w.value) : g.value === "edit" && (u.value === t.KONNECT && !D.value ? (D.value = await k(), r = await C.put(m.value, V.value)) : r = ((s = c.config) == null ? void 0 : s.app) === "konnect" ? await C.put(m.value, V.value) : await C.patch(m.value, w.value)), B(r == null ? void 0 : r.data), n("update", r == null ? void 0 : r.data);
|
|
1039
|
+
} catch (r) {
|
|
1040
|
+
p.errorMessage = b(r), n("error", r);
|
|
1010
1041
|
} finally {
|
|
1011
|
-
|
|
1042
|
+
p.isReadonly = !1;
|
|
1012
1043
|
}
|
|
1013
1044
|
};
|
|
1014
|
-
return (
|
|
1015
|
-
const
|
|
1016
|
-
return
|
|
1017
|
-
|
|
1018
|
-
"can-submit":
|
|
1045
|
+
return (s, r) => {
|
|
1046
|
+
const L = N("KTooltip"), Q = N("KSelect"), S = N("KInput"), ye = N("KCheckbox"), ue = N("KCollapse"), de = N("KTextArea");
|
|
1047
|
+
return A(), q("div", wt, [
|
|
1048
|
+
d(e(Be), {
|
|
1049
|
+
"can-submit": v.value && T.value,
|
|
1019
1050
|
config: l.config,
|
|
1020
1051
|
"edit-id": l.vaultId,
|
|
1021
|
-
"entity-type": e(
|
|
1022
|
-
"error-message":
|
|
1052
|
+
"entity-type": e(xe).Vault,
|
|
1053
|
+
"error-message": p.errorMessage,
|
|
1023
1054
|
"fetch-url": H.value,
|
|
1024
|
-
"form-fields":
|
|
1025
|
-
"is-readonly":
|
|
1055
|
+
"form-fields": w.value,
|
|
1056
|
+
"is-readonly": p.isReadonly,
|
|
1026
1057
|
onCancel: te,
|
|
1027
|
-
"onFetch:error":
|
|
1028
|
-
"onFetch:success":
|
|
1029
|
-
onLoading:
|
|
1058
|
+
"onFetch:error": ne,
|
|
1059
|
+
"onFetch:success": B,
|
|
1060
|
+
onLoading: Z,
|
|
1030
1061
|
onSubmit: le
|
|
1031
1062
|
}, {
|
|
1032
|
-
default:
|
|
1033
|
-
|
|
1034
|
-
description: e(
|
|
1035
|
-
title: e(
|
|
1063
|
+
default: y(() => [
|
|
1064
|
+
d(e(Se), {
|
|
1065
|
+
description: e(o)("form.sections.config.description"),
|
|
1066
|
+
title: e(o)("form.sections.config.title")
|
|
1036
1067
|
}, {
|
|
1037
|
-
default:
|
|
1038
|
-
R("div",
|
|
1039
|
-
|
|
1040
|
-
modelValue:
|
|
1041
|
-
"onUpdate:modelValue":
|
|
1068
|
+
default: y(() => [
|
|
1069
|
+
R("div", Ct, [
|
|
1070
|
+
d(Q, {
|
|
1071
|
+
modelValue: u.value,
|
|
1072
|
+
"onUpdate:modelValue": r[0] || (r[0] = (i) => u.value = i),
|
|
1042
1073
|
"data-testid": "provider-select",
|
|
1043
|
-
disabled:
|
|
1074
|
+
disabled: M.value,
|
|
1044
1075
|
"dropdown-max-height": "500",
|
|
1045
|
-
items:
|
|
1076
|
+
items: z.value
|
|
1046
1077
|
}, {
|
|
1047
|
-
"selected-item-template":
|
|
1048
|
-
(
|
|
1049
|
-
|
|
1078
|
+
"selected-item-template": y(({ item: i }) => [
|
|
1079
|
+
(A(), oe(Ue($(i.value)))),
|
|
1080
|
+
pe(" " + P(i == null ? void 0 : i.label), 1)
|
|
1050
1081
|
]),
|
|
1051
|
-
"item-template":
|
|
1052
|
-
|
|
1082
|
+
"item-template": y(({ item: i }) => [
|
|
1083
|
+
d(L, {
|
|
1053
1084
|
placement: "top",
|
|
1054
|
-
text:
|
|
1085
|
+
text: i.disabled ? e(o)("form.unavailable") : ""
|
|
1055
1086
|
}, {
|
|
1056
|
-
default:
|
|
1087
|
+
default: y(() => [
|
|
1057
1088
|
R("div", {
|
|
1058
1089
|
class: "provider-item",
|
|
1059
|
-
"data-testid": `vault-form-provider-${
|
|
1090
|
+
"data-testid": `vault-form-provider-${i.value}`
|
|
1060
1091
|
}, [
|
|
1061
|
-
(
|
|
1062
|
-
R("div",
|
|
1063
|
-
R("span",
|
|
1064
|
-
R("span",
|
|
1092
|
+
(A(), oe(Ue($(i.value)))),
|
|
1093
|
+
R("div", It, [
|
|
1094
|
+
R("span", xt, P(i == null ? void 0 : i.label), 1),
|
|
1095
|
+
R("span", Et, P(J(i.value)), 1)
|
|
1065
1096
|
])
|
|
1066
|
-
], 8,
|
|
1097
|
+
], 8, St)
|
|
1067
1098
|
]),
|
|
1068
1099
|
_: 2
|
|
1069
1100
|
}, 1032, ["text"])
|
|
@@ -1071,407 +1102,407 @@ const _t = { class: "kong-ui-entities-vault-form" }, Vt = { class: "vault-form-p
|
|
|
1071
1102
|
_: 1
|
|
1072
1103
|
}, 8, ["modelValue", "disabled", "items"])
|
|
1073
1104
|
]),
|
|
1074
|
-
|
|
1075
|
-
default:
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
modelValue:
|
|
1079
|
-
"onUpdate:modelValue":
|
|
1105
|
+
d(ze, { name: "appear" }, {
|
|
1106
|
+
default: y(() => [
|
|
1107
|
+
u.value === e(t).ENV ? (A(), q("div", At, [
|
|
1108
|
+
d(S, {
|
|
1109
|
+
modelValue: a[e(t).ENV].prefix,
|
|
1110
|
+
"onUpdate:modelValue": r[1] || (r[1] = (i) => a[e(t).ENV].prefix = i),
|
|
1080
1111
|
modelModifiers: { trim: !0 },
|
|
1081
1112
|
autocomplete: "off",
|
|
1082
1113
|
"data-testid": "vault-form-config-kong-prefix",
|
|
1083
|
-
"is-readonly":
|
|
1084
|
-
label: e(
|
|
1114
|
+
"is-readonly": p.isReadonly,
|
|
1115
|
+
label: e(o)("form.config.env.fields.prefix.label"),
|
|
1085
1116
|
"label-attributes": {
|
|
1086
|
-
info: e(
|
|
1117
|
+
info: e(o)("form.config.env.fields.prefix.tooltip"),
|
|
1087
1118
|
tooltipAttributes: { maxWidth: "400" }
|
|
1088
1119
|
},
|
|
1089
|
-
placeholder: e(
|
|
1120
|
+
placeholder: e(o)("form.config.env.fields.prefix.placeholder"),
|
|
1090
1121
|
required: "",
|
|
1091
1122
|
type: "text"
|
|
1092
1123
|
}, null, 8, ["modelValue", "is-readonly", "label", "label-attributes", "placeholder"])
|
|
1093
|
-
])) :
|
|
1094
|
-
|
|
1124
|
+
])) : ae("", !0),
|
|
1125
|
+
u.value === e(t).AWS ? (A(), q("div", {
|
|
1095
1126
|
key: `${e(t).AWS}-vault-config-fields`,
|
|
1096
1127
|
class: "vault-form-config-fields-container"
|
|
1097
1128
|
}, [
|
|
1098
|
-
|
|
1099
|
-
modelValue:
|
|
1100
|
-
"onUpdate:modelValue":
|
|
1129
|
+
d(Q, {
|
|
1130
|
+
modelValue: a[e(t).AWS].region,
|
|
1131
|
+
"onUpdate:modelValue": r[2] || (r[2] = (i) => a[e(t).AWS].region = i),
|
|
1101
1132
|
"data-testid": "vault-form-config-aws-region",
|
|
1102
|
-
items:
|
|
1103
|
-
label: e(
|
|
1104
|
-
"label-attributes": { info: e(
|
|
1105
|
-
placeholder: e(
|
|
1106
|
-
readonly:
|
|
1133
|
+
items: ee,
|
|
1134
|
+
label: e(o)("form.config.aws.fields.region.label"),
|
|
1135
|
+
"label-attributes": { info: e(o)("form.config.aws.fields.region.tooltip") },
|
|
1136
|
+
placeholder: e(o)("form.config.aws.fields.region.placeholder"),
|
|
1137
|
+
readonly: p.isReadonly,
|
|
1107
1138
|
required: "",
|
|
1108
1139
|
width: "100%"
|
|
1109
1140
|
}, null, 8, ["modelValue", "label", "label-attributes", "placeholder", "readonly"]),
|
|
1110
|
-
|
|
1111
|
-
modelValue:
|
|
1112
|
-
"onUpdate:modelValue":
|
|
1141
|
+
d(S, {
|
|
1142
|
+
modelValue: a[e(t).AWS].endpoint_url,
|
|
1143
|
+
"onUpdate:modelValue": r[3] || (r[3] = (i) => a[e(t).AWS].endpoint_url = i),
|
|
1113
1144
|
modelModifiers: { trim: !0 },
|
|
1114
1145
|
autocomplete: "off",
|
|
1115
1146
|
"data-testid": "vault-form-config-aws-endpoint_url",
|
|
1116
|
-
"is-readonly":
|
|
1117
|
-
label: e(
|
|
1147
|
+
"is-readonly": p.isReadonly,
|
|
1148
|
+
label: e(o)("form.config.aws.fields.endpoint_url.label"),
|
|
1118
1149
|
"label-attributes": {
|
|
1119
|
-
info: e(
|
|
1150
|
+
info: e(o)("form.config.aws.fields.endpoint_url.tooltip"),
|
|
1120
1151
|
tooltipAttributes: { maxWidth: "400" }
|
|
1121
1152
|
},
|
|
1122
1153
|
type: "text"
|
|
1123
1154
|
}, null, 8, ["modelValue", "is-readonly", "label", "label-attributes"]),
|
|
1124
|
-
|
|
1125
|
-
modelValue:
|
|
1126
|
-
"onUpdate:modelValue":
|
|
1155
|
+
d(S, {
|
|
1156
|
+
modelValue: a[e(t).AWS].assume_role_arn,
|
|
1157
|
+
"onUpdate:modelValue": r[4] || (r[4] = (i) => a[e(t).AWS].assume_role_arn = i),
|
|
1127
1158
|
modelModifiers: { trim: !0 },
|
|
1128
1159
|
autocomplete: "off",
|
|
1129
1160
|
"data-testid": "vault-form-config-aws-assume_role_arn",
|
|
1130
|
-
"is-readonly":
|
|
1131
|
-
label: e(
|
|
1161
|
+
"is-readonly": p.isReadonly,
|
|
1162
|
+
label: e(o)("form.config.aws.fields.assume_role_arn.label"),
|
|
1132
1163
|
"label-attributes": {
|
|
1133
|
-
info: e(
|
|
1164
|
+
info: e(o)("form.config.aws.fields.assume_role_arn.tooltip"),
|
|
1134
1165
|
tooltipAttributes: { maxWidth: "400" }
|
|
1135
1166
|
},
|
|
1136
1167
|
type: "text"
|
|
1137
1168
|
}, null, 8, ["modelValue", "is-readonly", "label", "label-attributes"]),
|
|
1138
|
-
|
|
1139
|
-
modelValue:
|
|
1140
|
-
"onUpdate:modelValue":
|
|
1169
|
+
d(S, {
|
|
1170
|
+
modelValue: a[e(t).AWS].role_session_name,
|
|
1171
|
+
"onUpdate:modelValue": r[5] || (r[5] = (i) => a[e(t).AWS].role_session_name = i),
|
|
1141
1172
|
modelModifiers: { trim: !0 },
|
|
1142
1173
|
autocomplete: "off",
|
|
1143
1174
|
"data-testid": "vault-form-config-aws-role_session_name",
|
|
1144
|
-
"is-readonly":
|
|
1145
|
-
label: e(
|
|
1175
|
+
"is-readonly": p.isReadonly,
|
|
1176
|
+
label: e(o)("form.config.aws.fields.role_session_name.label"),
|
|
1146
1177
|
"label-attributes": {
|
|
1147
|
-
info: e(
|
|
1178
|
+
info: e(o)("form.config.aws.fields.role_session_name.tooltip"),
|
|
1148
1179
|
tooltipAttributes: { maxWidth: "400" }
|
|
1149
1180
|
},
|
|
1150
1181
|
required: "",
|
|
1151
1182
|
type: "text"
|
|
1152
1183
|
}, null, 8, ["modelValue", "is-readonly", "label", "label-attributes"]),
|
|
1153
|
-
l.config.awsStsEndpointUrlAvailable ? (
|
|
1184
|
+
l.config.awsStsEndpointUrlAvailable ? (A(), oe(S, {
|
|
1154
1185
|
key: 0,
|
|
1155
|
-
modelValue:
|
|
1156
|
-
"onUpdate:modelValue":
|
|
1186
|
+
modelValue: a[e(t).AWS].sts_endpoint_url,
|
|
1187
|
+
"onUpdate:modelValue": r[6] || (r[6] = (i) => a[e(t).AWS].sts_endpoint_url = i),
|
|
1157
1188
|
modelModifiers: { trim: !0 },
|
|
1158
1189
|
autocomplete: "off",
|
|
1159
1190
|
"data-testid": "vault-form-config-aws-sts_endpoint_url",
|
|
1160
|
-
"is-readonly":
|
|
1161
|
-
label: e(
|
|
1191
|
+
"is-readonly": p.isReadonly,
|
|
1192
|
+
label: e(o)("form.config.aws.fields.sts_endpoint_url.label"),
|
|
1162
1193
|
"label-attributes": {
|
|
1163
|
-
info: e(
|
|
1194
|
+
info: e(o)("form.config.aws.fields.sts_endpoint_url.tooltip"),
|
|
1164
1195
|
tooltipAttributes: { maxWidth: "400" }
|
|
1165
1196
|
},
|
|
1166
1197
|
type: "text"
|
|
1167
|
-
}, null, 8, ["modelValue", "is-readonly", "label", "label-attributes"])) :
|
|
1168
|
-
])) :
|
|
1169
|
-
|
|
1198
|
+
}, null, 8, ["modelValue", "is-readonly", "label", "label-attributes"])) : ae("", !0)
|
|
1199
|
+
])) : ae("", !0),
|
|
1200
|
+
u.value === e(t).GCP ? (A(), q("div", {
|
|
1170
1201
|
key: `${e(t).GCP}-vault-config-fields`,
|
|
1171
1202
|
class: "vault-form-config-fields-container"
|
|
1172
1203
|
}, [
|
|
1173
|
-
|
|
1174
|
-
modelValue:
|
|
1175
|
-
"onUpdate:modelValue":
|
|
1204
|
+
d(S, {
|
|
1205
|
+
modelValue: a[e(t).GCP].project_id,
|
|
1206
|
+
"onUpdate:modelValue": r[7] || (r[7] = (i) => a[e(t).GCP].project_id = i),
|
|
1176
1207
|
modelModifiers: { trim: !0 },
|
|
1177
1208
|
autocomplete: "off",
|
|
1178
1209
|
"data-testid": "vault-form-config-gcp-project-id",
|
|
1179
|
-
"is-readonly":
|
|
1180
|
-
label: e(
|
|
1181
|
-
placeholder: e(
|
|
1210
|
+
"is-readonly": p.isReadonly,
|
|
1211
|
+
label: e(o)("form.config.gcp.fields.project_id.label"),
|
|
1212
|
+
placeholder: e(o)("form.config.gcp.fields.project_id.placeholder"),
|
|
1182
1213
|
required: "",
|
|
1183
1214
|
type: "text"
|
|
1184
1215
|
}, {
|
|
1185
|
-
"label-tooltip":
|
|
1186
|
-
|
|
1216
|
+
"label-tooltip": y(() => [
|
|
1217
|
+
d(e(f), {
|
|
1187
1218
|
keypath: "form.config.gcp.fields.project_id.tooltip.text",
|
|
1188
1219
|
scope: "global"
|
|
1189
1220
|
}, {
|
|
1190
|
-
"italic-text":
|
|
1191
|
-
R("em", null,
|
|
1221
|
+
"italic-text": y(() => [
|
|
1222
|
+
R("em", null, P(e(o)("form.config.gcp.fields.project_id.tooltip.italicText")), 1)
|
|
1192
1223
|
]),
|
|
1193
1224
|
_: 1
|
|
1194
1225
|
})
|
|
1195
1226
|
]),
|
|
1196
1227
|
_: 1
|
|
1197
1228
|
}, 8, ["modelValue", "is-readonly", "label", "placeholder"])
|
|
1198
|
-
])) :
|
|
1199
|
-
|
|
1229
|
+
])) : ae("", !0),
|
|
1230
|
+
u.value === e(t).HCV ? (A(), q("div", {
|
|
1200
1231
|
key: `${e(t).HCV}-vault-config-fields`,
|
|
1201
1232
|
class: "vault-form-config-fields-container"
|
|
1202
1233
|
}, [
|
|
1203
|
-
|
|
1204
|
-
modelValue:
|
|
1205
|
-
"onUpdate:modelValue":
|
|
1234
|
+
d(Q, {
|
|
1235
|
+
modelValue: a[e(t).HCV].protocol,
|
|
1236
|
+
"onUpdate:modelValue": r[8] || (r[8] = (i) => a[e(t).HCV].protocol = i),
|
|
1206
1237
|
"data-testid": "vault-form-config-hcv-protocol",
|
|
1207
|
-
items:
|
|
1208
|
-
label: e(
|
|
1209
|
-
readonly:
|
|
1238
|
+
items: G,
|
|
1239
|
+
label: e(o)("form.config.hcv.fields.protocol.label"),
|
|
1240
|
+
readonly: p.isReadonly,
|
|
1210
1241
|
required: "",
|
|
1211
1242
|
width: "100%"
|
|
1212
1243
|
}, null, 8, ["modelValue", "label", "readonly"]),
|
|
1213
|
-
|
|
1214
|
-
modelValue:
|
|
1215
|
-
"onUpdate:modelValue":
|
|
1244
|
+
d(S, {
|
|
1245
|
+
modelValue: a[e(t).HCV].host,
|
|
1246
|
+
"onUpdate:modelValue": r[9] || (r[9] = (i) => a[e(t).HCV].host = i),
|
|
1216
1247
|
modelModifiers: { trim: !0 },
|
|
1217
1248
|
autocomplete: "off",
|
|
1218
1249
|
"data-testid": "vault-form-config-hcv-host",
|
|
1219
|
-
"is-readonly":
|
|
1220
|
-
label: e(
|
|
1250
|
+
"is-readonly": p.isReadonly,
|
|
1251
|
+
label: e(o)("form.config.hcv.fields.host.label"),
|
|
1221
1252
|
required: "",
|
|
1222
1253
|
type: "text"
|
|
1223
1254
|
}, null, 8, ["modelValue", "is-readonly", "label"]),
|
|
1224
|
-
|
|
1225
|
-
modelValue:
|
|
1226
|
-
"onUpdate:modelValue":
|
|
1255
|
+
d(S, {
|
|
1256
|
+
modelValue: a[e(t).HCV].port,
|
|
1257
|
+
"onUpdate:modelValue": r[10] || (r[10] = (i) => a[e(t).HCV].port = i),
|
|
1227
1258
|
autocomplete: "off",
|
|
1228
1259
|
"data-testid": "vault-form-config-hcv-port",
|
|
1229
|
-
"is-readonly":
|
|
1230
|
-
label: e(
|
|
1260
|
+
"is-readonly": p.isReadonly,
|
|
1261
|
+
label: e(o)("form.config.hcv.fields.port.label"),
|
|
1231
1262
|
min: "0",
|
|
1232
1263
|
required: "",
|
|
1233
1264
|
type: "number"
|
|
1234
1265
|
}, null, 8, ["modelValue", "is-readonly", "label"]),
|
|
1235
|
-
|
|
1236
|
-
modelValue:
|
|
1237
|
-
"onUpdate:modelValue":
|
|
1266
|
+
d(S, {
|
|
1267
|
+
modelValue: a[e(t).HCV].mount,
|
|
1268
|
+
"onUpdate:modelValue": r[11] || (r[11] = (i) => a[e(t).HCV].mount = i),
|
|
1238
1269
|
modelModifiers: { trim: !0 },
|
|
1239
1270
|
autocomplete: "off",
|
|
1240
1271
|
"data-testid": "vault-form-config-hcv-mount",
|
|
1241
|
-
"is-readonly":
|
|
1242
|
-
label: e(
|
|
1272
|
+
"is-readonly": p.isReadonly,
|
|
1273
|
+
label: e(o)("form.config.hcv.fields.mount.label"),
|
|
1243
1274
|
required: "",
|
|
1244
1275
|
type: "text"
|
|
1245
1276
|
}, null, 8, ["modelValue", "is-readonly", "label"]),
|
|
1246
|
-
|
|
1247
|
-
modelValue:
|
|
1248
|
-
"onUpdate:modelValue":
|
|
1277
|
+
d(Q, {
|
|
1278
|
+
modelValue: a[e(t).HCV].kv,
|
|
1279
|
+
"onUpdate:modelValue": r[12] || (r[12] = (i) => a[e(t).HCV].kv = i),
|
|
1249
1280
|
"data-testid": "vault-form-config-hcv-kv",
|
|
1250
|
-
items:
|
|
1251
|
-
label: e(
|
|
1252
|
-
readonly:
|
|
1281
|
+
items: X,
|
|
1282
|
+
label: e(o)("form.config.hcv.fields.kv.label"),
|
|
1283
|
+
readonly: p.isReadonly,
|
|
1253
1284
|
required: "",
|
|
1254
1285
|
width: "100%"
|
|
1255
1286
|
}, null, 8, ["modelValue", "label", "readonly"]),
|
|
1256
|
-
|
|
1257
|
-
modelValue:
|
|
1258
|
-
"onUpdate:modelValue":
|
|
1287
|
+
d(S, {
|
|
1288
|
+
modelValue: a[e(t).HCV].namespace,
|
|
1289
|
+
"onUpdate:modelValue": r[13] || (r[13] = (i) => a[e(t).HCV].namespace = i),
|
|
1259
1290
|
modelModifiers: { trim: !0 },
|
|
1260
1291
|
autocomplete: "off",
|
|
1261
1292
|
"data-testid": "vault-form-config-hcv-namespace",
|
|
1262
|
-
"is-readonly":
|
|
1263
|
-
label: e(
|
|
1293
|
+
"is-readonly": p.isReadonly,
|
|
1294
|
+
label: e(o)("form.config.hcv.fields.namespace.label"),
|
|
1264
1295
|
type: "text"
|
|
1265
1296
|
}, null, 8, ["modelValue", "is-readonly", "label"]),
|
|
1266
|
-
|
|
1267
|
-
modelValue:
|
|
1268
|
-
"onUpdate:modelValue":
|
|
1297
|
+
d(Q, {
|
|
1298
|
+
modelValue: a[e(t).HCV].auth_method,
|
|
1299
|
+
"onUpdate:modelValue": r[14] || (r[14] = (i) => a[e(t).HCV].auth_method = i),
|
|
1269
1300
|
"data-testid": "vault-form-config-hcv-auth_method",
|
|
1270
1301
|
items: [
|
|
1271
|
-
{ label: e(
|
|
1272
|
-
{ label: e(
|
|
1273
|
-
...l.config.hcvAppRoleMethodAvailable ? [{ label: e(
|
|
1302
|
+
{ label: e(F).TOKEN, value: e(F).TOKEN },
|
|
1303
|
+
{ label: e(F).K8S, value: e(F).K8S },
|
|
1304
|
+
...l.config.hcvAppRoleMethodAvailable ? [{ label: e(F).APP_ROLE, value: e(F).APP_ROLE }] : []
|
|
1274
1305
|
],
|
|
1275
|
-
label: e(
|
|
1276
|
-
readonly:
|
|
1306
|
+
label: e(o)("form.config.hcv.fields.auth_method.label"),
|
|
1307
|
+
readonly: p.isReadonly,
|
|
1277
1308
|
required: "",
|
|
1278
1309
|
width: "100%"
|
|
1279
1310
|
}, null, 8, ["modelValue", "items", "label", "readonly"]),
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
modelValue:
|
|
1283
|
-
"onUpdate:modelValue":
|
|
1311
|
+
a[e(t).HCV].auth_method === e(F).TOKEN ? (A(), q("div", Rt, [
|
|
1312
|
+
d(S, {
|
|
1313
|
+
modelValue: a[e(t).HCV].token,
|
|
1314
|
+
"onUpdate:modelValue": r[15] || (r[15] = (i) => a[e(t).HCV].token = i),
|
|
1284
1315
|
modelModifiers: { trim: !0 },
|
|
1285
1316
|
autocomplete: "off",
|
|
1286
1317
|
"data-testid": "vault-form-config-hcv-token",
|
|
1287
|
-
"is-readonly":
|
|
1288
|
-
label: e(
|
|
1318
|
+
"is-readonly": p.isReadonly,
|
|
1319
|
+
label: e(o)("form.config.hcv.fields.token.label"),
|
|
1289
1320
|
required: "",
|
|
1290
1321
|
type: "text"
|
|
1291
1322
|
}, null, 8, ["modelValue", "is-readonly", "label"])
|
|
1292
|
-
])) :
|
|
1293
|
-
|
|
1294
|
-
modelValue:
|
|
1295
|
-
"onUpdate:modelValue":
|
|
1323
|
+
])) : a[e(t).HCV].auth_method === e(F).K8S ? (A(), q("div", Ut, [
|
|
1324
|
+
d(S, {
|
|
1325
|
+
modelValue: a[e(t).HCV].kube_role,
|
|
1326
|
+
"onUpdate:modelValue": r[16] || (r[16] = (i) => a[e(t).HCV].kube_role = i),
|
|
1296
1327
|
modelModifiers: { trim: !0 },
|
|
1297
1328
|
autocomplete: "off",
|
|
1298
1329
|
"data-testid": "vault-form-config-hcv-kube_role",
|
|
1299
|
-
"is-readonly":
|
|
1300
|
-
label: e(
|
|
1330
|
+
"is-readonly": p.isReadonly,
|
|
1331
|
+
label: e(o)("form.config.hcv.fields.kube_role.label"),
|
|
1301
1332
|
required: "",
|
|
1302
1333
|
type: "text"
|
|
1303
1334
|
}, null, 8, ["modelValue", "is-readonly", "label"]),
|
|
1304
|
-
|
|
1305
|
-
modelValue:
|
|
1306
|
-
"onUpdate:modelValue":
|
|
1335
|
+
d(S, {
|
|
1336
|
+
modelValue: a[e(t).HCV].kube_auth_path,
|
|
1337
|
+
"onUpdate:modelValue": r[17] || (r[17] = (i) => a[e(t).HCV].kube_auth_path = i),
|
|
1307
1338
|
modelModifiers: { trim: !0 },
|
|
1308
1339
|
autocomplete: "off",
|
|
1309
1340
|
"data-testid": "vault-form-config-hcv-kube_auth_path",
|
|
1310
|
-
"is-readonly":
|
|
1311
|
-
label: e(
|
|
1341
|
+
"is-readonly": p.isReadonly,
|
|
1342
|
+
label: e(o)("form.config.hcv.fields.kube_auth_path.label"),
|
|
1312
1343
|
type: "text"
|
|
1313
1344
|
}, null, 8, ["modelValue", "is-readonly", "label"]),
|
|
1314
|
-
|
|
1315
|
-
modelValue:
|
|
1316
|
-
"onUpdate:modelValue":
|
|
1345
|
+
d(S, {
|
|
1346
|
+
modelValue: a[e(t).HCV].kube_api_token_file,
|
|
1347
|
+
"onUpdate:modelValue": r[18] || (r[18] = (i) => a[e(t).HCV].kube_api_token_file = i),
|
|
1317
1348
|
modelModifiers: { trim: !0 },
|
|
1318
1349
|
autocomplete: "off",
|
|
1319
1350
|
"data-testid": "vault-form-config-hcv-kube_api_token_file",
|
|
1320
|
-
"is-readonly":
|
|
1321
|
-
label: e(
|
|
1351
|
+
"is-readonly": p.isReadonly,
|
|
1352
|
+
label: e(o)("form.config.hcv.fields.kube_api_token_file.label"),
|
|
1322
1353
|
required: "",
|
|
1323
1354
|
type: "text"
|
|
1324
1355
|
}, null, 8, ["modelValue", "is-readonly", "label"])
|
|
1325
|
-
])) :
|
|
1326
|
-
|
|
1327
|
-
modelValue:
|
|
1328
|
-
"onUpdate:modelValue":
|
|
1356
|
+
])) : a[e(t).HCV].auth_method === e(F).APP_ROLE ? (A(), q("div", $t, [
|
|
1357
|
+
d(S, {
|
|
1358
|
+
modelValue: a[e(t).HCV].approle_auth_path,
|
|
1359
|
+
"onUpdate:modelValue": r[19] || (r[19] = (i) => a[e(t).HCV].approle_auth_path = i),
|
|
1329
1360
|
modelModifiers: { trim: !0 },
|
|
1330
1361
|
autocomplete: "off",
|
|
1331
1362
|
"data-testid": "vault-form-config-hcv-approle_auth_path",
|
|
1332
|
-
"is-readonly":
|
|
1333
|
-
label: e(
|
|
1363
|
+
"is-readonly": p.isReadonly,
|
|
1364
|
+
label: e(o)("form.config.hcv.fields.approle_auth_path.label"),
|
|
1334
1365
|
type: "text"
|
|
1335
1366
|
}, null, 8, ["modelValue", "is-readonly", "label"]),
|
|
1336
|
-
|
|
1337
|
-
modelValue:
|
|
1338
|
-
"onUpdate:modelValue":
|
|
1367
|
+
d(S, {
|
|
1368
|
+
modelValue: a[e(t).HCV].approle_role_id,
|
|
1369
|
+
"onUpdate:modelValue": r[20] || (r[20] = (i) => a[e(t).HCV].approle_role_id = i),
|
|
1339
1370
|
modelModifiers: { trim: !0 },
|
|
1340
1371
|
autocomplete: "off",
|
|
1341
1372
|
"data-testid": "vault-form-config-hcv-approle_role_id",
|
|
1342
|
-
"is-readonly":
|
|
1343
|
-
label: e(
|
|
1373
|
+
"is-readonly": p.isReadonly,
|
|
1374
|
+
label: e(o)("form.config.hcv.fields.approle_role_id.label"),
|
|
1344
1375
|
required: "",
|
|
1345
1376
|
type: "text"
|
|
1346
1377
|
}, null, 8, ["modelValue", "is-readonly", "label"]),
|
|
1347
|
-
|
|
1348
|
-
modelValue:
|
|
1349
|
-
"onUpdate:modelValue":
|
|
1378
|
+
d(S, {
|
|
1379
|
+
modelValue: a[e(t).HCV].approle_secret_id,
|
|
1380
|
+
"onUpdate:modelValue": r[21] || (r[21] = (i) => a[e(t).HCV].approle_secret_id = i),
|
|
1350
1381
|
modelModifiers: { trim: !0 },
|
|
1351
1382
|
autocomplete: "off",
|
|
1352
1383
|
"data-testid": "vault-form-config-hcv-approle_secret_id",
|
|
1353
|
-
"is-readonly":
|
|
1354
|
-
label: e(
|
|
1384
|
+
"is-readonly": p.isReadonly,
|
|
1385
|
+
label: e(o)("form.config.hcv.fields.approle_secret_id.label"),
|
|
1355
1386
|
type: "text"
|
|
1356
1387
|
}, null, 8, ["modelValue", "is-readonly", "label"]),
|
|
1357
|
-
|
|
1358
|
-
modelValue:
|
|
1359
|
-
"onUpdate:modelValue":
|
|
1388
|
+
d(S, {
|
|
1389
|
+
modelValue: a[e(t).HCV].approle_secret_id_file,
|
|
1390
|
+
"onUpdate:modelValue": r[22] || (r[22] = (i) => a[e(t).HCV].approle_secret_id_file = i),
|
|
1360
1391
|
modelModifiers: { trim: !0 },
|
|
1361
1392
|
autocomplete: "off",
|
|
1362
1393
|
"data-testid": "vault-form-config-hcv-approle_secret_id_file",
|
|
1363
|
-
"is-readonly":
|
|
1364
|
-
label: e(
|
|
1394
|
+
"is-readonly": p.isReadonly,
|
|
1395
|
+
label: e(o)("form.config.hcv.fields.approle_secret_id_file.label"),
|
|
1365
1396
|
type: "text"
|
|
1366
1397
|
}, null, 8, ["modelValue", "is-readonly", "label"]),
|
|
1367
|
-
|
|
1368
|
-
modelValue:
|
|
1369
|
-
"onUpdate:modelValue":
|
|
1398
|
+
d(ye, {
|
|
1399
|
+
modelValue: a[e(t).HCV].approle_response_wrapping,
|
|
1400
|
+
"onUpdate:modelValue": r[23] || (r[23] = (i) => a[e(t).HCV].approle_response_wrapping = i),
|
|
1370
1401
|
"data-testid": "vault-form-config-hcv-approle_response_wrapping",
|
|
1371
|
-
label: e(
|
|
1402
|
+
label: e(o)("form.config.hcv.fields.approle_response_wrapping.label")
|
|
1372
1403
|
}, null, 8, ["modelValue", "label"])
|
|
1373
|
-
])) :
|
|
1374
|
-
])) :
|
|
1375
|
-
|
|
1404
|
+
])) : ae("", !0)
|
|
1405
|
+
])) : ae("", !0),
|
|
1406
|
+
u.value === e(t).AZURE ? (A(), q("div", {
|
|
1376
1407
|
key: `${e(t).HCV}-vault-config-fields`,
|
|
1377
1408
|
class: "vault-form-config-fields-container"
|
|
1378
1409
|
}, [
|
|
1379
|
-
|
|
1380
|
-
modelValue:
|
|
1381
|
-
"onUpdate:modelValue":
|
|
1410
|
+
d(S, {
|
|
1411
|
+
modelValue: a[e(t).AZURE].location,
|
|
1412
|
+
"onUpdate:modelValue": r[24] || (r[24] = (i) => a[e(t).AZURE].location = i),
|
|
1382
1413
|
modelModifiers: { trim: !0 },
|
|
1383
1414
|
autocomplete: "off",
|
|
1384
1415
|
"data-testid": "vault-form-config-azure-location",
|
|
1385
|
-
"is-readonly":
|
|
1386
|
-
label: e(
|
|
1416
|
+
"is-readonly": p.isReadonly,
|
|
1417
|
+
label: e(o)("form.config.azure.fields.location.label"),
|
|
1387
1418
|
required: "",
|
|
1388
1419
|
type: "text"
|
|
1389
1420
|
}, null, 8, ["modelValue", "is-readonly", "label"]),
|
|
1390
|
-
|
|
1391
|
-
modelValue:
|
|
1392
|
-
"onUpdate:modelValue":
|
|
1421
|
+
d(S, {
|
|
1422
|
+
modelValue: a[e(t).AZURE].vault_uri,
|
|
1423
|
+
"onUpdate:modelValue": r[25] || (r[25] = (i) => a[e(t).AZURE].vault_uri = i),
|
|
1393
1424
|
modelModifiers: { trim: !0 },
|
|
1394
1425
|
autocomplete: "off",
|
|
1395
1426
|
"data-testid": "vault-form-config-azure-uri",
|
|
1396
|
-
"is-readonly":
|
|
1397
|
-
label: e(
|
|
1427
|
+
"is-readonly": p.isReadonly,
|
|
1428
|
+
label: e(o)("form.config.azure.fields.vault_uri.label"),
|
|
1398
1429
|
required: "",
|
|
1399
1430
|
type: "text"
|
|
1400
1431
|
}, null, 8, ["modelValue", "is-readonly", "label"]),
|
|
1401
|
-
|
|
1402
|
-
modelValue:
|
|
1403
|
-
"onUpdate:modelValue":
|
|
1432
|
+
d(S, {
|
|
1433
|
+
modelValue: a[e(t).AZURE].credentials_prefix,
|
|
1434
|
+
"onUpdate:modelValue": r[26] || (r[26] = (i) => a[e(t).AZURE].credentials_prefix = i),
|
|
1404
1435
|
modelModifiers: { trim: !0 },
|
|
1405
1436
|
autocomplete: "off",
|
|
1406
1437
|
"data-testid": "vault-form-config-azure-prefix",
|
|
1407
|
-
"is-readonly":
|
|
1408
|
-
label: e(
|
|
1438
|
+
"is-readonly": p.isReadonly,
|
|
1439
|
+
label: e(o)("form.config.azure.fields.credential_prefix.label"),
|
|
1409
1440
|
required: "",
|
|
1410
1441
|
type: "text"
|
|
1411
1442
|
}, null, 8, ["modelValue", "is-readonly", "label"]),
|
|
1412
|
-
|
|
1413
|
-
modelValue:
|
|
1414
|
-
"onUpdate:modelValue":
|
|
1443
|
+
d(Q, {
|
|
1444
|
+
modelValue: a[e(t).AZURE].type,
|
|
1445
|
+
"onUpdate:modelValue": r[27] || (r[27] = (i) => a[e(t).AZURE].type = i),
|
|
1415
1446
|
"data-testid": "vault-form-config-azure-type",
|
|
1416
|
-
items:
|
|
1417
|
-
label: e(
|
|
1418
|
-
placeholder: e(
|
|
1419
|
-
readonly:
|
|
1447
|
+
items: W,
|
|
1448
|
+
label: e(o)("form.config.azure.fields.type.label"),
|
|
1449
|
+
placeholder: e(o)("form.config.azure.fields.type.placeholder"),
|
|
1450
|
+
readonly: p.isReadonly,
|
|
1420
1451
|
required: "",
|
|
1421
1452
|
width: "100%"
|
|
1422
1453
|
}, null, 8, ["modelValue", "label", "placeholder", "readonly"]),
|
|
1423
|
-
|
|
1424
|
-
modelValue:
|
|
1425
|
-
"onUpdate:modelValue":
|
|
1454
|
+
d(S, {
|
|
1455
|
+
modelValue: a[e(t).AZURE].client_id,
|
|
1456
|
+
"onUpdate:modelValue": r[28] || (r[28] = (i) => a[e(t).AZURE].client_id = i),
|
|
1426
1457
|
modelModifiers: { trim: !0 },
|
|
1427
1458
|
autocomplete: "off",
|
|
1428
1459
|
"data-testid": "vault-form-config-azure-client-id",
|
|
1429
|
-
"is-readonly":
|
|
1430
|
-
label: e(
|
|
1460
|
+
"is-readonly": p.isReadonly,
|
|
1461
|
+
label: e(o)("form.config.azure.fields.client_id.label"),
|
|
1431
1462
|
type: "text"
|
|
1432
1463
|
}, null, 8, ["modelValue", "is-readonly", "label"]),
|
|
1433
|
-
|
|
1434
|
-
modelValue:
|
|
1435
|
-
"onUpdate:modelValue":
|
|
1464
|
+
d(S, {
|
|
1465
|
+
modelValue: a[e(t).AZURE].tenant_id,
|
|
1466
|
+
"onUpdate:modelValue": r[29] || (r[29] = (i) => a[e(t).AZURE].tenant_id = i),
|
|
1436
1467
|
modelModifiers: { trim: !0 },
|
|
1437
1468
|
autocomplete: "off",
|
|
1438
1469
|
"data-testid": "vault-form-config-azure-tenant-id",
|
|
1439
|
-
"is-readonly":
|
|
1440
|
-
label: e(
|
|
1470
|
+
"is-readonly": p.isReadonly,
|
|
1471
|
+
label: e(o)("form.config.azure.fields.tenant_id.label"),
|
|
1441
1472
|
type: "text"
|
|
1442
1473
|
}, null, 8, ["modelValue", "is-readonly", "label"])
|
|
1443
|
-
])) :
|
|
1444
|
-
l.config.ttl ? (
|
|
1445
|
-
|
|
1474
|
+
])) : ae("", !0),
|
|
1475
|
+
l.config.ttl ? (A(), q("div", Tt, [
|
|
1476
|
+
re.value ? (A(), oe(ue, {
|
|
1446
1477
|
key: 0,
|
|
1447
1478
|
class: "advanced-fields-collapse",
|
|
1448
1479
|
"data-testid": "advanced-fields-collapse",
|
|
1449
1480
|
"trigger-alignment": "leading",
|
|
1450
|
-
"trigger-label": e(
|
|
1481
|
+
"trigger-label": e(o)("form.config.advancedFields.title")
|
|
1451
1482
|
}, {
|
|
1452
|
-
default:
|
|
1453
|
-
R("div",
|
|
1454
|
-
R("div",
|
|
1455
|
-
|
|
1456
|
-
modelValue:
|
|
1457
|
-
"onUpdate:modelValue":
|
|
1483
|
+
default: y(() => [
|
|
1484
|
+
R("div", Kt, [
|
|
1485
|
+
R("div", Pt, [
|
|
1486
|
+
d(S, {
|
|
1487
|
+
modelValue: a[u.value].ttl,
|
|
1488
|
+
"onUpdate:modelValue": r[30] || (r[30] = (i) => a[u.value].ttl = i),
|
|
1458
1489
|
"data-testid": "vault-ttl-input",
|
|
1459
|
-
label: e(
|
|
1490
|
+
label: e(o)("form.config.advancedFields.ttl"),
|
|
1460
1491
|
"label-attributes": {
|
|
1461
|
-
info: e(
|
|
1492
|
+
info: e(o)("form.config.advancedFields.ttlTooltip"),
|
|
1462
1493
|
tooltipAttributes: { maxWidth: "400" }
|
|
1463
1494
|
},
|
|
1464
1495
|
type: "number"
|
|
1465
1496
|
}, null, 8, ["modelValue", "label", "label-attributes"])
|
|
1466
1497
|
]),
|
|
1467
|
-
R("div",
|
|
1468
|
-
|
|
1469
|
-
modelValue:
|
|
1470
|
-
"onUpdate:modelValue":
|
|
1498
|
+
R("div", Mt, [
|
|
1499
|
+
d(S, {
|
|
1500
|
+
modelValue: a[u.value].neg_ttl,
|
|
1501
|
+
"onUpdate:modelValue": r[31] || (r[31] = (i) => a[u.value].neg_ttl = i),
|
|
1471
1502
|
"data-testid": "vault-neg-ttl-input",
|
|
1472
|
-
label: e(
|
|
1503
|
+
label: e(o)("form.config.advancedFields.negTtl"),
|
|
1473
1504
|
"label-attributes": {
|
|
1474
|
-
info: e(
|
|
1505
|
+
info: e(o)("form.config.advancedFields.negTtlTooltip"),
|
|
1475
1506
|
tooltipAttributes: { maxWidth: "400" }
|
|
1476
1507
|
},
|
|
1477
1508
|
type: "number"
|
|
@@ -1479,14 +1510,14 @@ const _t = { class: "kong-ui-entities-vault-form" }, Vt = { class: "vault-form-p
|
|
|
1479
1510
|
])
|
|
1480
1511
|
]),
|
|
1481
1512
|
R("div", Ht, [
|
|
1482
|
-
R("div",
|
|
1483
|
-
|
|
1484
|
-
modelValue:
|
|
1485
|
-
"onUpdate:modelValue":
|
|
1513
|
+
R("div", Ft, [
|
|
1514
|
+
d(S, {
|
|
1515
|
+
modelValue: a[u.value].resurrect_ttl,
|
|
1516
|
+
"onUpdate:modelValue": r[32] || (r[32] = (i) => a[u.value].resurrect_ttl = i),
|
|
1486
1517
|
"data-testid": "vault-resurrect-ttl-input",
|
|
1487
|
-
label: e(
|
|
1518
|
+
label: e(o)("form.config.advancedFields.resurrectTtl"),
|
|
1488
1519
|
"label-attributes": {
|
|
1489
|
-
info: e(
|
|
1520
|
+
info: e(o)("form.config.advancedFields.resurrectTtlTooltip"),
|
|
1490
1521
|
tooltipAttributes: { maxWidth: "400" }
|
|
1491
1522
|
},
|
|
1492
1523
|
type: "number"
|
|
@@ -1495,57 +1526,57 @@ const _t = { class: "kong-ui-entities-vault-form" }, Vt = { class: "vault-form-p
|
|
|
1495
1526
|
])
|
|
1496
1527
|
]),
|
|
1497
1528
|
_: 1
|
|
1498
|
-
}, 8, ["trigger-label"])) :
|
|
1499
|
-
])) :
|
|
1529
|
+
}, 8, ["trigger-label"])) : ae("", !0)
|
|
1530
|
+
])) : ae("", !0)
|
|
1500
1531
|
]),
|
|
1501
1532
|
_: 1
|
|
1502
1533
|
})
|
|
1503
1534
|
]),
|
|
1504
1535
|
_: 1
|
|
1505
1536
|
}, 8, ["description", "title"]),
|
|
1506
|
-
|
|
1507
|
-
description: e(
|
|
1508
|
-
title: e(
|
|
1537
|
+
d(e(Se), {
|
|
1538
|
+
description: e(o)("form.sections.general.description"),
|
|
1539
|
+
title: e(o)("form.sections.general.title")
|
|
1509
1540
|
}, {
|
|
1510
|
-
default:
|
|
1511
|
-
|
|
1512
|
-
modelValue:
|
|
1513
|
-
"onUpdate:modelValue":
|
|
1541
|
+
default: y(() => [
|
|
1542
|
+
d(S, {
|
|
1543
|
+
modelValue: p.fields.prefix,
|
|
1544
|
+
"onUpdate:modelValue": r[33] || (r[33] = (i) => p.fields.prefix = i),
|
|
1514
1545
|
modelModifiers: { trim: !0 },
|
|
1515
1546
|
autocomplete: "off",
|
|
1516
1547
|
"data-testid": "vault-form-prefix",
|
|
1517
|
-
help: e(
|
|
1518
|
-
"is-readonly":
|
|
1519
|
-
label: e(
|
|
1548
|
+
help: e(o)("form.fields.prefix.help"),
|
|
1549
|
+
"is-readonly": p.isReadonly,
|
|
1550
|
+
label: e(o)("form.fields.prefix.label"),
|
|
1520
1551
|
"label-attributes": {
|
|
1521
|
-
info: e(
|
|
1552
|
+
info: e(o)("form.fields.prefix.tooltip"),
|
|
1522
1553
|
tooltipAttributes: { maxWidth: "400" }
|
|
1523
1554
|
},
|
|
1524
|
-
placeholder: e(
|
|
1555
|
+
placeholder: e(o)("form.fields.prefix.placeholder"),
|
|
1525
1556
|
required: "",
|
|
1526
1557
|
type: "text"
|
|
1527
1558
|
}, null, 8, ["modelValue", "help", "is-readonly", "label", "label-attributes", "placeholder"]),
|
|
1528
|
-
|
|
1529
|
-
modelValue:
|
|
1530
|
-
"onUpdate:modelValue":
|
|
1559
|
+
d(de, {
|
|
1560
|
+
modelValue: p.fields.description,
|
|
1561
|
+
"onUpdate:modelValue": r[34] || (r[34] = (i) => p.fields.description = i),
|
|
1531
1562
|
modelModifiers: { trim: !0 },
|
|
1532
1563
|
"character-limit": 1e3,
|
|
1533
1564
|
class: "vault-form-textarea",
|
|
1534
1565
|
"data-testid": "vault-form-description",
|
|
1535
|
-
label: e(
|
|
1536
|
-
placeholder: e(
|
|
1537
|
-
readonly:
|
|
1566
|
+
label: e(o)("form.fields.description.label"),
|
|
1567
|
+
placeholder: e(o)("form.fields.description.placeholder"),
|
|
1568
|
+
readonly: p.isReadonly
|
|
1538
1569
|
}, null, 8, ["modelValue", "label", "placeholder", "readonly"]),
|
|
1539
|
-
|
|
1540
|
-
modelValue:
|
|
1541
|
-
"onUpdate:modelValue":
|
|
1570
|
+
d(S, {
|
|
1571
|
+
modelValue: p.fields.tags,
|
|
1572
|
+
"onUpdate:modelValue": r[35] || (r[35] = (i) => p.fields.tags = i),
|
|
1542
1573
|
modelModifiers: { trim: !0 },
|
|
1543
1574
|
autocomplete: "off",
|
|
1544
1575
|
"data-testid": "vault-form-tags",
|
|
1545
|
-
help: e(
|
|
1546
|
-
"is-readonly":
|
|
1547
|
-
label: e(
|
|
1548
|
-
placeholder: e(
|
|
1576
|
+
help: e(o)("form.fields.tags.help"),
|
|
1577
|
+
"is-readonly": p.isReadonly,
|
|
1578
|
+
label: e(o)("form.fields.tags.label"),
|
|
1579
|
+
placeholder: e(o)("form.fields.tags.placeholder"),
|
|
1549
1580
|
type: "text"
|
|
1550
1581
|
}, null, 8, ["modelValue", "help", "is-readonly", "label", "placeholder"])
|
|
1551
1582
|
]),
|
|
@@ -1557,7 +1588,7 @@ const _t = { class: "kong-ui-entities-vault-form" }, Vt = { class: "vault-form-p
|
|
|
1557
1588
|
]);
|
|
1558
1589
|
};
|
|
1559
1590
|
}
|
|
1560
|
-
}),
|
|
1591
|
+
}), vl = /* @__PURE__ */ ce(Nt, [["__scopeId", "data-v-a4e9b325"]]), Ot = { class: "kong-ui-vault-entity-config-card" }, gl = /* @__PURE__ */ ie({
|
|
1561
1592
|
__name: "VaultConfigCard",
|
|
1562
1593
|
props: {
|
|
1563
1594
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
@@ -1584,60 +1615,60 @@ const _t = { class: "kong-ui-entities-vault-form" }, Vt = { class: "vault-form-p
|
|
|
1584
1615
|
},
|
|
1585
1616
|
emits: ["loading", "fetch:error", "fetch:success"],
|
|
1586
1617
|
setup(l) {
|
|
1587
|
-
const
|
|
1588
|
-
var
|
|
1589
|
-
return (
|
|
1590
|
-
}), { i18n: { t:
|
|
1618
|
+
const I = l, c = E(() => {
|
|
1619
|
+
var o, x;
|
|
1620
|
+
return (x = se.form[(o = I.config) == null ? void 0 : o.app]) == null ? void 0 : x.edit;
|
|
1621
|
+
}), { i18n: { t: n } } = ge.useI18n(), f = U({
|
|
1591
1622
|
id: {},
|
|
1592
1623
|
name: {
|
|
1593
|
-
label:
|
|
1624
|
+
label: n("labels.vault_type")
|
|
1594
1625
|
},
|
|
1595
1626
|
updated_at: {},
|
|
1596
1627
|
created_at: {},
|
|
1597
1628
|
prefix: {
|
|
1598
1629
|
order: 5,
|
|
1599
|
-
section:
|
|
1630
|
+
section: $e.Basic
|
|
1600
1631
|
},
|
|
1601
1632
|
description: {
|
|
1602
1633
|
order: 6,
|
|
1603
|
-
section:
|
|
1634
|
+
section: $e.Basic
|
|
1604
1635
|
},
|
|
1605
1636
|
tags: {
|
|
1606
1637
|
order: 7
|
|
1607
1638
|
},
|
|
1608
1639
|
config: {
|
|
1609
1640
|
order: 8,
|
|
1610
|
-
type:
|
|
1641
|
+
type: at.Json
|
|
1611
1642
|
}
|
|
1612
1643
|
});
|
|
1613
|
-
return (
|
|
1614
|
-
|
|
1644
|
+
return (o, x) => (A(), q("div", Ot, [
|
|
1645
|
+
d(e(rt), {
|
|
1615
1646
|
config: l.config,
|
|
1616
1647
|
"config-card-doc": l.configCardDoc,
|
|
1617
|
-
"config-schema":
|
|
1618
|
-
"entity-type": e(
|
|
1619
|
-
"fetch-url":
|
|
1648
|
+
"config-schema": f.value,
|
|
1649
|
+
"entity-type": e(xe).Vault,
|
|
1650
|
+
"fetch-url": c.value,
|
|
1620
1651
|
"hide-title": l.hideTitle,
|
|
1621
|
-
"onFetch:error":
|
|
1622
|
-
"onFetch:success":
|
|
1623
|
-
onLoading:
|
|
1652
|
+
"onFetch:error": x[0] || (x[0] = (C) => o.$emit("fetch:error", C)),
|
|
1653
|
+
"onFetch:success": x[1] || (x[1] = (C) => o.$emit("fetch:success", C)),
|
|
1654
|
+
onLoading: x[2] || (x[2] = (C) => o.$emit("loading", C))
|
|
1624
1655
|
}, null, 8, ["config", "config-card-doc", "config-schema", "entity-type", "fetch-url", "hide-title"])
|
|
1625
1656
|
]));
|
|
1626
1657
|
}
|
|
1627
|
-
}),
|
|
1658
|
+
}), Ve = "/v2/control-planes/{controlPlaneId}", me = {
|
|
1628
1659
|
getVault: {
|
|
1629
|
-
konnect: `${
|
|
1660
|
+
konnect: `${Ve}/core-entities/vaults/{id}`
|
|
1630
1661
|
},
|
|
1631
1662
|
list: {
|
|
1632
|
-
konnect: `${
|
|
1663
|
+
konnect: `${Ve}/config-stores/{id}/secrets`
|
|
1633
1664
|
},
|
|
1634
1665
|
form: {
|
|
1635
1666
|
konnect: {
|
|
1636
|
-
create: `${
|
|
1637
|
-
edit: `${
|
|
1667
|
+
create: `${Ve}/config-stores/{id}/secrets`,
|
|
1668
|
+
edit: `${Ve}/config-stores/{id}/secrets/{secretId}`
|
|
1638
1669
|
}
|
|
1639
1670
|
}
|
|
1640
|
-
},
|
|
1671
|
+
}, qt = { class: "table-content-overflow-wrapper" }, Dt = /* @__PURE__ */ ie({
|
|
1641
1672
|
inheritAttrs: !1,
|
|
1642
1673
|
__name: "SecretListInner",
|
|
1643
1674
|
props: {
|
|
@@ -1677,99 +1708,99 @@ const _t = { class: "kong-ui-entities-vault-form" }, Vt = { class: "vault-form-p
|
|
|
1677
1708
|
}
|
|
1678
1709
|
},
|
|
1679
1710
|
emits: ["error", "delete:success"],
|
|
1680
|
-
setup(l, { emit:
|
|
1681
|
-
var
|
|
1682
|
-
const
|
|
1711
|
+
setup(l, { emit: I }) {
|
|
1712
|
+
var ne;
|
|
1713
|
+
const c = I, n = l, { i18n: { t: f, formatUnixTimeStamp: o } } = ge.useI18n(), { axiosInstance: x } = ve((ne = n.config) == null ? void 0 : ne.axiosRequestConfig), b = {
|
|
1683
1714
|
// the Secret Key column is non-hidable
|
|
1684
|
-
key: { label:
|
|
1685
|
-
updated_at: { label:
|
|
1686
|
-
},
|
|
1687
|
-
"data-testid":
|
|
1688
|
-
}),
|
|
1689
|
-
var
|
|
1690
|
-
return `${
|
|
1691
|
-
}),
|
|
1715
|
+
key: { label: f("secrets.list.table_headers.key"), sortable: !1, hidable: !1 },
|
|
1716
|
+
updated_at: { label: f("secrets.list.table_headers.updated_at"), sortable: !1 }
|
|
1717
|
+
}, p = ($) => ({
|
|
1718
|
+
"data-testid": $.key
|
|
1719
|
+
}), h = E(() => {
|
|
1720
|
+
var $;
|
|
1721
|
+
return `${n.config.apiBaseUrl}${me.list[n.config.app]}`.replace(/{controlPlaneId}/gi, (($ = n.config) == null ? void 0 : $.controlPlaneId) || "").replace(/{id}/gi, n.configStoreId || "");
|
|
1722
|
+
}), u = U(""), O = {
|
|
1692
1723
|
isExactMatch: !0,
|
|
1693
|
-
placeholder:
|
|
1694
|
-
},
|
|
1695
|
-
|
|
1696
|
-
},
|
|
1697
|
-
label:
|
|
1698
|
-
to:
|
|
1699
|
-
}),
|
|
1700
|
-
|
|
1724
|
+
placeholder: f("search.placeholder_for_secrets.konnect")
|
|
1725
|
+
}, D = U(1), { fetcher: re, fetcherState: z } = He(n.config, h.value), a = () => {
|
|
1726
|
+
u.value = "";
|
|
1727
|
+
}, Y = U(null), ee = ($) => ({
|
|
1728
|
+
label: f("actions.edit"),
|
|
1729
|
+
to: n.config.getEditRoute($)
|
|
1730
|
+
}), W = U(void 0), G = U(!1), X = U(!1), g = U(""), H = Fe(n.config, h.value), M = ($) => {
|
|
1731
|
+
W.value = $, G.value = !0;
|
|
1701
1732
|
}, j = () => {
|
|
1702
|
-
|
|
1733
|
+
G.value = !1;
|
|
1703
1734
|
}, te = async () => {
|
|
1704
|
-
var
|
|
1705
|
-
if ((
|
|
1706
|
-
|
|
1735
|
+
var $, J, B;
|
|
1736
|
+
if (($ = W.value) != null && $.key) {
|
|
1737
|
+
X.value = !0;
|
|
1707
1738
|
try {
|
|
1708
|
-
await
|
|
1709
|
-
} catch (
|
|
1710
|
-
|
|
1739
|
+
await x.delete(H(W.value.key)), X.value = !1, G.value = !1, D.value++, c("delete:success", W.value);
|
|
1740
|
+
} catch (_) {
|
|
1741
|
+
g.value = ((B = (J = _.response) == null ? void 0 : J.data) == null ? void 0 : B.message) || _.message || f("errors.delete"), c("error", _);
|
|
1711
1742
|
} finally {
|
|
1712
|
-
|
|
1743
|
+
X.value = !1;
|
|
1713
1744
|
}
|
|
1714
1745
|
}
|
|
1715
1746
|
};
|
|
1716
|
-
|
|
1717
|
-
var
|
|
1718
|
-
if (
|
|
1719
|
-
|
|
1720
|
-
title:
|
|
1721
|
-
}, (
|
|
1747
|
+
he(z, ($) => {
|
|
1748
|
+
var J, B, _;
|
|
1749
|
+
if ($.status === Ne.Error) {
|
|
1750
|
+
Y.value = {
|
|
1751
|
+
title: f("errors.general")
|
|
1752
|
+
}, (_ = (B = (J = $.error) == null ? void 0 : J.response) == null ? void 0 : B.data) != null && _.message && (Y.value.message = $.error.response.data.message), c("error", $.error);
|
|
1722
1753
|
return;
|
|
1723
1754
|
}
|
|
1724
|
-
|
|
1755
|
+
Y.value = null;
|
|
1725
1756
|
});
|
|
1726
|
-
const
|
|
1727
|
-
ctaPath:
|
|
1757
|
+
const Z = U({
|
|
1758
|
+
ctaPath: n.config.createRoute,
|
|
1728
1759
|
ctaText: void 0,
|
|
1729
|
-
message: `${
|
|
1730
|
-
title:
|
|
1760
|
+
message: `${f("secrets.list.empty_state.description")}${n.config.additionMessageForEmptyState ? ` ${n.config.additionMessageForEmptyState}` : ""}`,
|
|
1761
|
+
title: f("secrets.title")
|
|
1731
1762
|
});
|
|
1732
|
-
return
|
|
1733
|
-
await
|
|
1734
|
-
}), (
|
|
1735
|
-
const
|
|
1736
|
-
return
|
|
1737
|
-
|
|
1763
|
+
return ke(async () => {
|
|
1764
|
+
await n.canCreate() && (Z.value.title = f("secrets.list.empty_state.title"), Z.value.ctaText = f("secrets.list.toolbar_actions.new_secret"));
|
|
1765
|
+
}), ($, J) => {
|
|
1766
|
+
const B = N("KButton"), _ = N("KDropdownItem");
|
|
1767
|
+
return A(), q(Ge, null, [
|
|
1768
|
+
d(e(Oe), {
|
|
1738
1769
|
"cache-identifier": l.cacheIdentifier,
|
|
1739
1770
|
"disable-sorting": "",
|
|
1740
|
-
"empty-state-options":
|
|
1771
|
+
"empty-state-options": Z.value,
|
|
1741
1772
|
"enable-entity-actions": "",
|
|
1742
|
-
"error-message":
|
|
1743
|
-
fetcher: e(
|
|
1744
|
-
"fetcher-cache-key":
|
|
1773
|
+
"error-message": Y.value,
|
|
1774
|
+
fetcher: e(re),
|
|
1775
|
+
"fetcher-cache-key": D.value,
|
|
1745
1776
|
"pagination-type": "offset",
|
|
1746
1777
|
"preferences-storage-key": "kong-ui-entities-secrets-list",
|
|
1747
|
-
query:
|
|
1748
|
-
"row-attributes":
|
|
1749
|
-
"table-headers": e(
|
|
1750
|
-
onClearSearchInput:
|
|
1778
|
+
query: u.value,
|
|
1779
|
+
"row-attributes": p,
|
|
1780
|
+
"table-headers": e(b),
|
|
1781
|
+
onClearSearchInput: a
|
|
1751
1782
|
}, {
|
|
1752
|
-
"toolbar-filter":
|
|
1753
|
-
|
|
1754
|
-
modelValue:
|
|
1755
|
-
"onUpdate:modelValue":
|
|
1756
|
-
config:
|
|
1783
|
+
"toolbar-filter": y(() => [
|
|
1784
|
+
d(e(qe), {
|
|
1785
|
+
modelValue: u.value,
|
|
1786
|
+
"onUpdate:modelValue": J[0] || (J[0] = (v) => u.value = v),
|
|
1787
|
+
config: O
|
|
1757
1788
|
}, null, 8, ["modelValue"])
|
|
1758
1789
|
]),
|
|
1759
|
-
"toolbar-button":
|
|
1760
|
-
|
|
1790
|
+
"toolbar-button": y(() => [
|
|
1791
|
+
d(e(fe), {
|
|
1761
1792
|
"auth-function": () => l.canCreate()
|
|
1762
1793
|
}, {
|
|
1763
|
-
default:
|
|
1764
|
-
|
|
1794
|
+
default: y(() => [
|
|
1795
|
+
d(B, {
|
|
1765
1796
|
appearance: "primary",
|
|
1766
1797
|
"data-testid": "toolbar-add-secret",
|
|
1767
1798
|
size: "large",
|
|
1768
1799
|
to: l.config.createRoute
|
|
1769
1800
|
}, {
|
|
1770
|
-
default:
|
|
1771
|
-
|
|
1772
|
-
|
|
1801
|
+
default: y(() => [
|
|
1802
|
+
d(e(Me)),
|
|
1803
|
+
pe(" " + P(e(f)("secrets.list.toolbar_actions.new_secret")), 1)
|
|
1773
1804
|
]),
|
|
1774
1805
|
_: 1
|
|
1775
1806
|
}, 8, ["to"])
|
|
@@ -1777,38 +1808,38 @@ const _t = { class: "kong-ui-entities-vault-form" }, Vt = { class: "vault-form-p
|
|
|
1777
1808
|
_: 1
|
|
1778
1809
|
}, 8, ["auth-function"])
|
|
1779
1810
|
]),
|
|
1780
|
-
key:
|
|
1781
|
-
R("div",
|
|
1782
|
-
R("b", null,
|
|
1811
|
+
key: y(({ rowValue: v }) => [
|
|
1812
|
+
R("div", qt, [
|
|
1813
|
+
R("b", null, P(v ?? "-"), 1)
|
|
1783
1814
|
])
|
|
1784
1815
|
]),
|
|
1785
|
-
updated_at:
|
|
1786
|
-
R("span", null,
|
|
1816
|
+
updated_at: y(({ rowValue: v }) => [
|
|
1817
|
+
R("span", null, P(v ? e(o)(new Date(v).getTime() / 1e3) : "-"), 1)
|
|
1787
1818
|
]),
|
|
1788
|
-
actions:
|
|
1789
|
-
|
|
1790
|
-
"auth-function": () => l.canEdit(
|
|
1819
|
+
actions: y(({ row: v }) => [
|
|
1820
|
+
d(e(fe), {
|
|
1821
|
+
"auth-function": () => l.canEdit(v)
|
|
1791
1822
|
}, {
|
|
1792
|
-
default:
|
|
1793
|
-
|
|
1823
|
+
default: y(() => [
|
|
1824
|
+
d(_, {
|
|
1794
1825
|
"data-testid": "action-entity-edit",
|
|
1795
|
-
item:
|
|
1826
|
+
item: ee(v.key)
|
|
1796
1827
|
}, null, 8, ["item"])
|
|
1797
1828
|
]),
|
|
1798
1829
|
_: 2
|
|
1799
1830
|
}, 1032, ["auth-function"]),
|
|
1800
|
-
|
|
1801
|
-
"auth-function": () => l.canDelete(
|
|
1831
|
+
d(e(fe), {
|
|
1832
|
+
"auth-function": () => l.canDelete(v)
|
|
1802
1833
|
}, {
|
|
1803
|
-
default:
|
|
1804
|
-
|
|
1834
|
+
default: y(() => [
|
|
1835
|
+
d(_, {
|
|
1805
1836
|
danger: "",
|
|
1806
1837
|
"data-testid": "action-entity-delete",
|
|
1807
1838
|
"has-divider": "",
|
|
1808
|
-
onClick: (
|
|
1839
|
+
onClick: (T) => M(v)
|
|
1809
1840
|
}, {
|
|
1810
|
-
default:
|
|
1811
|
-
|
|
1841
|
+
default: y(() => [
|
|
1842
|
+
pe(P(e(f)("actions.delete")), 1)
|
|
1812
1843
|
]),
|
|
1813
1844
|
_: 2
|
|
1814
1845
|
}, 1032, ["onClick"])
|
|
@@ -1818,21 +1849,21 @@ const _t = { class: "kong-ui-entities-vault-form" }, Vt = { class: "vault-form-p
|
|
|
1818
1849
|
]),
|
|
1819
1850
|
_: 1
|
|
1820
1851
|
}, 8, ["cache-identifier", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "query", "table-headers"]),
|
|
1821
|
-
|
|
1822
|
-
"action-pending":
|
|
1823
|
-
description: e(
|
|
1824
|
-
"entity-name":
|
|
1825
|
-
"entity-type": e(
|
|
1826
|
-
error:
|
|
1827
|
-
title: e(
|
|
1828
|
-
visible:
|
|
1852
|
+
d(e(De), {
|
|
1853
|
+
"action-pending": X.value,
|
|
1854
|
+
description: e(f)("delete.description"),
|
|
1855
|
+
"entity-name": W.value && W.value.key,
|
|
1856
|
+
"entity-type": e(We).Secret,
|
|
1857
|
+
error: g.value,
|
|
1858
|
+
title: e(f)("delete.title_for_secret"),
|
|
1859
|
+
visible: G.value,
|
|
1829
1860
|
onCancel: j,
|
|
1830
1861
|
onProceed: te
|
|
1831
1862
|
}, null, 8, ["action-pending", "description", "entity-name", "entity-type", "error", "title", "visible"])
|
|
1832
1863
|
], 64);
|
|
1833
1864
|
};
|
|
1834
1865
|
}
|
|
1835
|
-
}),
|
|
1866
|
+
}), Wt = /* @__PURE__ */ ce(Dt, [["__scopeId", "data-v-692e0f7e"]]), jt = { class: "kong-ui-entities-secrets-list" }, Bt = /* @__PURE__ */ ie({
|
|
1836
1867
|
__name: "SecretList",
|
|
1837
1868
|
props: {
|
|
1838
1869
|
/** The base konnect config. Pass additional config props in the shared entity component as needed. */
|
|
@@ -1871,33 +1902,33 @@ const _t = { class: "kong-ui-entities-vault-form" }, Vt = { class: "vault-form-p
|
|
|
1871
1902
|
}
|
|
1872
1903
|
},
|
|
1873
1904
|
emits: ["error", "delete:success"],
|
|
1874
|
-
setup(l, { emit:
|
|
1875
|
-
var
|
|
1876
|
-
const
|
|
1877
|
-
|
|
1878
|
-
},
|
|
1879
|
-
|
|
1880
|
-
}, { axiosInstance:
|
|
1881
|
-
var
|
|
1882
|
-
return `${
|
|
1905
|
+
setup(l, { emit: I }) {
|
|
1906
|
+
var p;
|
|
1907
|
+
const c = I, n = l, f = (h) => {
|
|
1908
|
+
c("error", h);
|
|
1909
|
+
}, o = (h) => {
|
|
1910
|
+
c("delete:success", h);
|
|
1911
|
+
}, { axiosInstance: x } = ve((p = n.config) == null ? void 0 : p.axiosRequestConfig), C = U(""), b = E(() => {
|
|
1912
|
+
var h;
|
|
1913
|
+
return `${n.config.apiBaseUrl}${me.getVault[n.config.app]}`.replace(/{controlPlaneId}/gi, ((h = n.config) == null ? void 0 : h.controlPlaneId) || "").replace(/{id}/gi, n.vaultId);
|
|
1883
1914
|
});
|
|
1884
|
-
return
|
|
1885
|
-
var
|
|
1915
|
+
return ke(async () => {
|
|
1916
|
+
var h;
|
|
1886
1917
|
try {
|
|
1887
|
-
const { data:
|
|
1888
|
-
|
|
1889
|
-
} catch (
|
|
1890
|
-
|
|
1918
|
+
const { data: u } = await x.get(b.value);
|
|
1919
|
+
C.value = (h = u == null ? void 0 : u.config) == null ? void 0 : h.config_store_id;
|
|
1920
|
+
} catch (u) {
|
|
1921
|
+
c("error", u);
|
|
1891
1922
|
}
|
|
1892
|
-
}), (
|
|
1893
|
-
|
|
1894
|
-
"config-store-id":
|
|
1895
|
-
"onDelete:success":
|
|
1896
|
-
onError:
|
|
1897
|
-
}), null, 16, ["config-store-id"])) :
|
|
1923
|
+
}), (h, u) => (A(), q("div", jt, [
|
|
1924
|
+
C.value ? (A(), oe(Wt, Pe({ key: 0 }, n, {
|
|
1925
|
+
"config-store-id": C.value,
|
|
1926
|
+
"onDelete:success": o,
|
|
1927
|
+
onError: f
|
|
1928
|
+
}), null, 16, ["config-store-id"])) : ae("", !0)
|
|
1898
1929
|
]));
|
|
1899
1930
|
}
|
|
1900
|
-
}),
|
|
1931
|
+
}), _l = /* @__PURE__ */ ce(Bt, [["__scopeId", "data-v-0f9047e6"]]), Lt = /* @__PURE__ */ ie({
|
|
1901
1932
|
inheritAttrs: !1,
|
|
1902
1933
|
__name: "SecretFormInner",
|
|
1903
1934
|
props: {
|
|
@@ -1920,105 +1951,105 @@ const _t = { class: "kong-ui-entities-vault-form" }, Vt = { class: "vault-form-p
|
|
|
1920
1951
|
}
|
|
1921
1952
|
},
|
|
1922
1953
|
emits: ["update", "error", "loading"],
|
|
1923
|
-
setup(l, { emit:
|
|
1924
|
-
var
|
|
1925
|
-
const
|
|
1954
|
+
setup(l, { emit: I }) {
|
|
1955
|
+
var X;
|
|
1956
|
+
const c = l, n = I, { i18n: { t: f } } = ge.useI18n(), o = Ie(), { axiosInstance: x } = ve((X = c.config) == null ? void 0 : X.axiosRequestConfig), { getMessageFromError: C } = je(), b = _e({
|
|
1926
1957
|
fields: {
|
|
1927
1958
|
key: "",
|
|
1928
1959
|
value: ""
|
|
1929
1960
|
},
|
|
1930
1961
|
readonly: !1,
|
|
1931
1962
|
errorMessage: ""
|
|
1932
|
-
}),
|
|
1963
|
+
}), p = _e({
|
|
1933
1964
|
key: "",
|
|
1934
1965
|
value: ""
|
|
1935
|
-
}),
|
|
1966
|
+
}), h = E(
|
|
1936
1967
|
() => {
|
|
1937
|
-
var
|
|
1938
|
-
return (H =
|
|
1968
|
+
var g, H;
|
|
1969
|
+
return (H = me.form[(g = c.config) == null ? void 0 : g.app]) == null ? void 0 : H.edit.replace(/{id}/gi, c.configStoreId).replace(/{secretId}/gi, c.secretId);
|
|
1939
1970
|
}
|
|
1940
|
-
),
|
|
1941
|
-
var
|
|
1942
|
-
|
|
1943
|
-
},
|
|
1944
|
-
|
|
1945
|
-
},
|
|
1946
|
-
|
|
1947
|
-
},
|
|
1948
|
-
var H,
|
|
1949
|
-
|
|
1950
|
-
},
|
|
1951
|
-
var
|
|
1952
|
-
return `${
|
|
1953
|
-
}),
|
|
1954
|
-
key:
|
|
1955
|
-
value:
|
|
1956
|
-
})),
|
|
1971
|
+
), u = () => {
|
|
1972
|
+
var g;
|
|
1973
|
+
o.push(((g = c.config) == null ? void 0 : g.cancelRoute) || { name: "secret-list" });
|
|
1974
|
+
}, O = (g) => {
|
|
1975
|
+
n("loading", g);
|
|
1976
|
+
}, D = (g) => {
|
|
1977
|
+
n("error", g);
|
|
1978
|
+
}, re = (g) => {
|
|
1979
|
+
var H, M;
|
|
1980
|
+
b.fields.key = ((H = g == null ? void 0 : g.item) == null ? void 0 : H.key) || (g == null ? void 0 : g.key) || "", b.fields.value = ((M = g == null ? void 0 : g.item) == null ? void 0 : M.value) || (g == null ? void 0 : g.value) || "", Object.assign(p, b.fields);
|
|
1981
|
+
}, z = E(() => c.secretId ? be.Edit : be.Create), a = E(() => {
|
|
1982
|
+
var g;
|
|
1983
|
+
return `${c.config.apiBaseUrl}${me.form[c.config.app][z.value]}`.replace(/{controlPlaneId}/gi, ((g = c.config) == null ? void 0 : g.controlPlaneId) || "").replace(/{id}/gi, c.configStoreId).replace(/{secretId}/gi, c.secretId);
|
|
1984
|
+
}), Y = E(() => !!b.fields.key && !!b.fields.value), ee = E(() => JSON.stringify(b.fields) !== JSON.stringify(p)), W = E(() => ({
|
|
1985
|
+
key: b.fields.key,
|
|
1986
|
+
value: b.fields.value
|
|
1987
|
+
})), G = async () => {
|
|
1957
1988
|
try {
|
|
1958
|
-
|
|
1959
|
-
let
|
|
1960
|
-
|
|
1961
|
-
} catch (
|
|
1962
|
-
|
|
1989
|
+
b.readonly = !0;
|
|
1990
|
+
let g;
|
|
1991
|
+
z.value === "create" ? g = await x.post(a.value, W.value) : z.value === "edit" && (g = await x.put(a.value, W.value)), re(g == null ? void 0 : g.data), n("update", g == null ? void 0 : g.data);
|
|
1992
|
+
} catch (g) {
|
|
1993
|
+
b.errorMessage = C(g), n("error", g);
|
|
1963
1994
|
} finally {
|
|
1964
|
-
|
|
1995
|
+
b.readonly = !1;
|
|
1965
1996
|
}
|
|
1966
1997
|
};
|
|
1967
|
-
return (
|
|
1968
|
-
const
|
|
1969
|
-
return
|
|
1970
|
-
"can-submit":
|
|
1998
|
+
return (g, H) => {
|
|
1999
|
+
const M = N("KInput"), j = N("KTextArea"), te = N("KAlert");
|
|
2000
|
+
return A(), oe(e(Be), {
|
|
2001
|
+
"can-submit": Y.value && ee.value,
|
|
1971
2002
|
config: l.config,
|
|
1972
2003
|
"edit-id": l.secretId,
|
|
1973
|
-
"entity-type": e(
|
|
1974
|
-
"error-message":
|
|
1975
|
-
"fetch-url":
|
|
1976
|
-
"form-fields":
|
|
1977
|
-
"is-readonly":
|
|
1978
|
-
onCancel:
|
|
1979
|
-
"onFetch:error":
|
|
1980
|
-
"onFetch:success":
|
|
1981
|
-
onLoading:
|
|
1982
|
-
onSubmit:
|
|
2004
|
+
"entity-type": e(xe).Other,
|
|
2005
|
+
"error-message": b.errorMessage,
|
|
2006
|
+
"fetch-url": h.value,
|
|
2007
|
+
"form-fields": W.value,
|
|
2008
|
+
"is-readonly": b.readonly,
|
|
2009
|
+
onCancel: u,
|
|
2010
|
+
"onFetch:error": D,
|
|
2011
|
+
"onFetch:success": re,
|
|
2012
|
+
onLoading: O,
|
|
2013
|
+
onSubmit: G
|
|
1983
2014
|
}, {
|
|
1984
|
-
default:
|
|
2015
|
+
default: y(() => [
|
|
1985
2016
|
R("div", null, [
|
|
1986
|
-
|
|
1987
|
-
description: e(
|
|
2017
|
+
d(e(Se), {
|
|
2018
|
+
description: e(f)("secrets.form.info.description"),
|
|
1988
2019
|
"has-divider": "",
|
|
1989
|
-
title: e(
|
|
2020
|
+
title: e(f)("secrets.form.info.title")
|
|
1990
2021
|
}, {
|
|
1991
|
-
default:
|
|
1992
|
-
|
|
1993
|
-
modelValue:
|
|
1994
|
-
"onUpdate:modelValue": H[0] || (H[0] = (
|
|
2022
|
+
default: y(() => [
|
|
2023
|
+
d(M, {
|
|
2024
|
+
modelValue: b.fields.key,
|
|
2025
|
+
"onUpdate:modelValue": H[0] || (H[0] = (Z) => b.fields.key = Z),
|
|
1995
2026
|
modelModifiers: { trim: !0 },
|
|
1996
2027
|
autocomplete: "off",
|
|
1997
2028
|
class: "key-field",
|
|
1998
2029
|
"data-testid": "secret-form-key",
|
|
1999
|
-
disabled:
|
|
2000
|
-
label: e(
|
|
2001
|
-
placeholder: e(
|
|
2002
|
-
readonly:
|
|
2030
|
+
disabled: z.value === e(be).Edit,
|
|
2031
|
+
label: e(f)("secrets.form.fields.key.label"),
|
|
2032
|
+
placeholder: e(f)("secrets.form.fields.key.placeholder"),
|
|
2033
|
+
readonly: b.readonly,
|
|
2003
2034
|
required: "",
|
|
2004
2035
|
type: "text"
|
|
2005
2036
|
}, null, 8, ["modelValue", "disabled", "label", "placeholder", "readonly"]),
|
|
2006
|
-
|
|
2007
|
-
modelValue:
|
|
2008
|
-
"onUpdate:modelValue": H[1] || (H[1] = (
|
|
2037
|
+
d(j, {
|
|
2038
|
+
modelValue: b.fields.value,
|
|
2039
|
+
"onUpdate:modelValue": H[1] || (H[1] = (Z) => b.fields.value = Z),
|
|
2009
2040
|
modelModifiers: { trim: !0 },
|
|
2010
2041
|
autocomplete: "off",
|
|
2011
2042
|
"data-testid": "secret-form-value",
|
|
2012
|
-
label: e(
|
|
2013
|
-
placeholder: e(
|
|
2014
|
-
readonly:
|
|
2043
|
+
label: e(f)("secrets.form.fields.value.label"),
|
|
2044
|
+
placeholder: e(f)("secrets.form.fields.value.placeholder"),
|
|
2045
|
+
readonly: b.readonly,
|
|
2015
2046
|
required: "",
|
|
2016
2047
|
resizable: "",
|
|
2017
2048
|
type: "text"
|
|
2018
2049
|
}, null, 8, ["modelValue", "label", "placeholder", "readonly"]),
|
|
2019
|
-
|
|
2050
|
+
d(te, {
|
|
2020
2051
|
appearance: "warning",
|
|
2021
|
-
message: e(
|
|
2052
|
+
message: e(f)("secrets.form.hint")
|
|
2022
2053
|
}, null, 8, ["message"])
|
|
2023
2054
|
]),
|
|
2024
2055
|
_: 1
|
|
@@ -2029,7 +2060,7 @@ const _t = { class: "kong-ui-entities-vault-form" }, Vt = { class: "vault-form-p
|
|
|
2029
2060
|
}, 8, ["can-submit", "config", "edit-id", "entity-type", "error-message", "fetch-url", "form-fields", "is-readonly"]);
|
|
2030
2061
|
};
|
|
2031
2062
|
}
|
|
2032
|
-
}),
|
|
2063
|
+
}), zt = /* @__PURE__ */ ce(Lt, [["__scopeId", "data-v-eb9c7fc4"]]), Gt = { class: "kong-ui-entities-secret-form" }, Zt = /* @__PURE__ */ ie({
|
|
2033
2064
|
__name: "SecretForm",
|
|
2034
2065
|
props: {
|
|
2035
2066
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
@@ -2051,44 +2082,327 @@ const _t = { class: "kong-ui-entities-vault-form" }, Vt = { class: "vault-form-p
|
|
|
2051
2082
|
}
|
|
2052
2083
|
},
|
|
2053
2084
|
emits: ["update", "error", "loading"],
|
|
2054
|
-
setup(l, { emit:
|
|
2055
|
-
var
|
|
2056
|
-
const
|
|
2057
|
-
|
|
2058
|
-
},
|
|
2059
|
-
|
|
2060
|
-
},
|
|
2061
|
-
|
|
2062
|
-
}, { axiosInstance:
|
|
2063
|
-
var
|
|
2064
|
-
return `${
|
|
2085
|
+
setup(l, { emit: I }) {
|
|
2086
|
+
var h;
|
|
2087
|
+
const c = l, n = I, f = (u) => {
|
|
2088
|
+
n("update", u);
|
|
2089
|
+
}, o = (u) => {
|
|
2090
|
+
n("error", u);
|
|
2091
|
+
}, x = (u) => {
|
|
2092
|
+
n("loading", u);
|
|
2093
|
+
}, { axiosInstance: C } = ve((h = c.config) == null ? void 0 : h.axiosRequestConfig), b = U(""), p = E(() => {
|
|
2094
|
+
var u;
|
|
2095
|
+
return `${c.config.apiBaseUrl}${me.getVault[c.config.app]}`.replace(/{controlPlaneId}/gi, ((u = c.config) == null ? void 0 : u.controlPlaneId) || "").replace(/{id}/gi, c.vaultId);
|
|
2065
2096
|
});
|
|
2066
|
-
return
|
|
2067
|
-
var
|
|
2097
|
+
return ke(async () => {
|
|
2098
|
+
var u;
|
|
2068
2099
|
try {
|
|
2069
|
-
const { data:
|
|
2070
|
-
|
|
2071
|
-
} catch (
|
|
2072
|
-
|
|
2100
|
+
const { data: O } = await C.get(p.value);
|
|
2101
|
+
b.value = (u = O == null ? void 0 : O.config) == null ? void 0 : u.config_store_id;
|
|
2102
|
+
} catch (O) {
|
|
2103
|
+
n("error", O);
|
|
2073
2104
|
}
|
|
2074
|
-
}), (
|
|
2075
|
-
|
|
2076
|
-
"config-store-id":
|
|
2077
|
-
onError:
|
|
2078
|
-
onLoading:
|
|
2079
|
-
onUpdate:
|
|
2080
|
-
}), null, 16, ["config-store-id"])) :
|
|
2105
|
+
}), (u, O) => (A(), q("div", Gt, [
|
|
2106
|
+
b.value ? (A(), oe(zt, Pe({ key: 0 }, c, {
|
|
2107
|
+
"config-store-id": b.value,
|
|
2108
|
+
onError: o,
|
|
2109
|
+
onLoading: x,
|
|
2110
|
+
onUpdate: f
|
|
2111
|
+
}), null, 16, ["config-store-id"])) : ae("", !0)
|
|
2081
2112
|
]));
|
|
2082
2113
|
}
|
|
2083
|
-
}),
|
|
2114
|
+
}), bl = /* @__PURE__ */ ce(Zt, [["__scopeId", "data-v-02e6d2f3"]]), Jt = {
|
|
2115
|
+
class: "vault-secret-picker-provider"
|
|
2116
|
+
}, Qt = /* @__PURE__ */ ie({
|
|
2117
|
+
__name: "VaultSecretPickerProvider",
|
|
2118
|
+
props: {
|
|
2119
|
+
value: {},
|
|
2120
|
+
update: {
|
|
2121
|
+
type: Function
|
|
2122
|
+
}
|
|
2123
|
+
},
|
|
2124
|
+
emits: ["open"],
|
|
2125
|
+
setup(l, {
|
|
2126
|
+
emit: I
|
|
2127
|
+
}) {
|
|
2128
|
+
const c = l, n = I, {
|
|
2129
|
+
i18n: {
|
|
2130
|
+
t: f
|
|
2131
|
+
},
|
|
2132
|
+
i18nT: o
|
|
2133
|
+
} = ge.useI18n();
|
|
2134
|
+
return (x, C) => (A(), q("div", Jt, [d(e(o), {
|
|
2135
|
+
keypath: "vault_secret_picker.provider.complete_action",
|
|
2136
|
+
scope: "global"
|
|
2137
|
+
}, {
|
|
2138
|
+
cta: y(() => [R("span", {
|
|
2139
|
+
class: "vault-secret-picker-provider-action",
|
|
2140
|
+
onClick: C[0] || (C[0] = () => n("open", c.value, c.update))
|
|
2141
|
+
}, P(e(f)("vault_secret_picker.provider.cta")), 1)]),
|
|
2142
|
+
_: 1
|
|
2143
|
+
})]));
|
|
2144
|
+
}
|
|
2145
|
+
}), yl = /* @__PURE__ */ ce(Qt, [["__scopeId", "data-v-200e7f4d"]]), Yt = (l) => {
|
|
2146
|
+
let I = l.trim();
|
|
2147
|
+
if (!I.startsWith("{") || !I.endsWith("}"))
|
|
2148
|
+
throw new Error("Invalid secret reference: must be enclosed in curly braces");
|
|
2149
|
+
if (I = I.substring(1, I.length - 1).trim(), !I.startsWith("vault://"))
|
|
2150
|
+
throw new Error("Invalid secret reference: must start with vault://");
|
|
2151
|
+
const c = new URL(`http://${I.substring(8)}`);
|
|
2152
|
+
if (!c)
|
|
2153
|
+
throw new Error("Invalid secret reference: must have a vault prefix");
|
|
2154
|
+
const n = c.host, [, f, ...o] = c.pathname.split("/");
|
|
2155
|
+
if (!n)
|
|
2156
|
+
throw new Error("Invalid secret reference: must have a vault prefix");
|
|
2157
|
+
return {
|
|
2158
|
+
vaultPrefix: n,
|
|
2159
|
+
secretId: f || void 0,
|
|
2160
|
+
// Non-empty string or undefined
|
|
2161
|
+
optionalSecretKey: o == null ? void 0 : o.join("/")
|
|
2162
|
+
// Non-empty string or undefined
|
|
2163
|
+
};
|
|
2164
|
+
}, Xt = (l) => {
|
|
2165
|
+
if (!l.vaultPrefix)
|
|
2166
|
+
throw new Error("Invalid secret reference: must have a vault prefix");
|
|
2167
|
+
let I = `vault://${l.vaultPrefix}`;
|
|
2168
|
+
return l.secretId && (I = `${I}/${l.secretId}`), l.optionalSecretKey && (I = `${I}/${l.optionalSecretKey}`), `{${I}}`;
|
|
2169
|
+
}, el = {
|
|
2170
|
+
key: 1,
|
|
2171
|
+
class: "inputs-wrapper"
|
|
2172
|
+
}, tl = { "data-testid": "no-search-results" }, ll = { class: "k-select-selected-item-label" }, ol = { class: "vault-secret-picker-vault-dropdown-item" }, al = { class: "select-item-label" }, rl = { class: "select-item-description" }, il = { class: "select-item-description" }, nl = { "data-testid": "no-search-results" }, sl = /* @__PURE__ */ ie({
|
|
2173
|
+
__name: "VaultSecretPicker",
|
|
2174
|
+
props: {
|
|
2175
|
+
config: {
|
|
2176
|
+
type: Object,
|
|
2177
|
+
required: !0,
|
|
2178
|
+
validator: (l) => !(!l || !["konnect", "kongManager"].includes(l == null ? void 0 : l.app) || l.app === "konnect" && !l.controlPlaneId || l.app === "kongManager" && typeof l.workspace != "string")
|
|
2179
|
+
},
|
|
2180
|
+
setup: {
|
|
2181
|
+
type: null,
|
|
2182
|
+
required: !1,
|
|
2183
|
+
default: !1
|
|
2184
|
+
}
|
|
2185
|
+
},
|
|
2186
|
+
emits: ["proceed", "cancel"],
|
|
2187
|
+
setup(l, { emit: I }) {
|
|
2188
|
+
var B;
|
|
2189
|
+
const { i18n: { t: c } } = ge.useI18n(), n = l, f = I, { axiosInstance: o } = ve({
|
|
2190
|
+
// 404 errors are allowed in this components
|
|
2191
|
+
validateStatus: (_) => _ === 404 || _ >= 200 && _ < 300,
|
|
2192
|
+
// Spread the passed-in config later to allow overriding
|
|
2193
|
+
...(B = n.config) == null ? void 0 : B.axiosRequestConfig
|
|
2194
|
+
}), x = U(!1), C = U(""), b = U(""), p = U(""), h = U(), u = E(() => {
|
|
2195
|
+
var _, v;
|
|
2196
|
+
return n.config.app === "konnect" ? me.list[n.config.app].replace(/{id}/gi, ((v = (_ = h.value) == null ? void 0 : _.config) == null ? void 0 : v.config_store_id) ?? "") : "<not_applicable>";
|
|
2197
|
+
}), O = E(() => {
|
|
2198
|
+
if (z && G)
|
|
2199
|
+
return c("vault_secret_picker.fetch_error.vaults_and_secrets");
|
|
2200
|
+
if (z)
|
|
2201
|
+
return c("vault_secret_picker.fetch_error.vaults");
|
|
2202
|
+
if (G)
|
|
2203
|
+
return c("vault_secret_picker.fetch_error.secrets");
|
|
2204
|
+
}), {
|
|
2205
|
+
debouncedQueryChange: D,
|
|
2206
|
+
loading: re,
|
|
2207
|
+
error: z,
|
|
2208
|
+
loadItems: a,
|
|
2209
|
+
results: Y
|
|
2210
|
+
} = Te(n.config, se.list[n.config.app].getAll, void 0, {
|
|
2211
|
+
fetchedItemsKey: "data",
|
|
2212
|
+
searchKeys: ["prefix"]
|
|
2213
|
+
}), {
|
|
2214
|
+
debouncedQueryChange: ee,
|
|
2215
|
+
loading: W,
|
|
2216
|
+
error: G,
|
|
2217
|
+
loadItems: X,
|
|
2218
|
+
results: g
|
|
2219
|
+
} = Te(n.config, u, void 0, {
|
|
2220
|
+
fetchedItemsKey: "data",
|
|
2221
|
+
searchKeys: ["key"],
|
|
2222
|
+
exactMatchKey: "key"
|
|
2223
|
+
}), H = E(() => {
|
|
2224
|
+
var T;
|
|
2225
|
+
let _ = !1;
|
|
2226
|
+
const v = ((T = Y.value) == null ? void 0 : T.map((m) => (m.prefix === C.value && (_ = !0), { label: m.prefix, value: m.prefix, vault: m }))) ?? [];
|
|
2227
|
+
return !_ && h.value && v.push({
|
|
2228
|
+
label: h.value.prefix,
|
|
2229
|
+
value: h.value.prefix,
|
|
2230
|
+
vault: h.value
|
|
2231
|
+
}), v;
|
|
2232
|
+
}), M = E(() => {
|
|
2233
|
+
var T;
|
|
2234
|
+
let _ = !1;
|
|
2235
|
+
const v = ((T = g.value) == null ? void 0 : T.map((m) => (m.key === b.value && (_ = !0), { label: m.key, value: m.key }))) ?? [];
|
|
2236
|
+
return !_ && b.value && v.push({ label: b.value, value: b.value }), v;
|
|
2237
|
+
}), j = E(() => {
|
|
2238
|
+
var _;
|
|
2239
|
+
return ((_ = h == null ? void 0 : h.value) == null ? void 0 : _.name) === "konnect";
|
|
2240
|
+
}), te = E(() => !!h.value && !!b.value), Z = (_) => _.label ? `${_.label} - (${_.vault.name} - ${_.vault.id})` : _.value, ne = (_) => {
|
|
2241
|
+
var T, m;
|
|
2242
|
+
let v = `${n.config.apiBaseUrl}${se.form[n.config.app].edit}`;
|
|
2243
|
+
return n.config.app === "konnect" ? v = v.replace(/{controlPlaneId}/gi, ((T = n.config) == null ? void 0 : T.controlPlaneId) || "") : n.config.app === "kongManager" && (v = v.replace(/\/{workspace}/gi, (m = n.config) != null && m.workspace ? `/${n.config.workspace}` : "")), v.replace(/{id}/gi, _);
|
|
2244
|
+
}, $ = (_, v) => {
|
|
2245
|
+
var T;
|
|
2246
|
+
return n.config.app !== "konnect" ? "<not_applicable>" : `${n.config.apiBaseUrl}${me.form[n.config.app].edit}`.replace(/{controlPlaneId}/gi, ((T = n.config) == null ? void 0 : T.controlPlaneId) || "").replace(/{id}/gi, v).replace(/{secretId}/gi, _);
|
|
2247
|
+
}, J = () => {
|
|
2248
|
+
f("proceed", Xt({
|
|
2249
|
+
vaultPrefix: C.value,
|
|
2250
|
+
secretId: b.value || void 0,
|
|
2251
|
+
// Either a non-empty string or undefined
|
|
2252
|
+
optionalSecretKey: p.value || void 0
|
|
2253
|
+
// Either a non-empty string or undefined
|
|
2254
|
+
}));
|
|
2255
|
+
};
|
|
2256
|
+
return he(() => n.setup, async (_) => {
|
|
2257
|
+
if (_ !== !1) {
|
|
2258
|
+
if (x.value = !0, C.value = "", h.value = void 0, b.value = "", p.value = "", typeof _ == "string" && _.trim().length > 0)
|
|
2259
|
+
try {
|
|
2260
|
+
let v, T = "", m = "", w = "";
|
|
2261
|
+
const V = Yt(_), { data: k } = await o.get(ne(V.vaultPrefix));
|
|
2262
|
+
if (k != null && k.name)
|
|
2263
|
+
if (v = k, T = V.vaultPrefix, v.name === "konnect") {
|
|
2264
|
+
if (V.secretId) {
|
|
2265
|
+
const { data: le } = await o.get($(V.secretId, k.config.config_store_id));
|
|
2266
|
+
le.key === V.secretId && (m = V.secretId, w = V.optionalSecretKey ?? "");
|
|
2267
|
+
}
|
|
2268
|
+
} else
|
|
2269
|
+
m = V.secretId ?? "", w = V.optionalSecretKey ?? "";
|
|
2270
|
+
await Ze(() => {
|
|
2271
|
+
C.value = T, h.value = v, b.value = m, p.value = w;
|
|
2272
|
+
});
|
|
2273
|
+
} catch (v) {
|
|
2274
|
+
console.debug(v);
|
|
2275
|
+
}
|
|
2276
|
+
x.value = !1, await a();
|
|
2277
|
+
}
|
|
2278
|
+
}, { immediate: !0 }), he(C, async (_, v) => {
|
|
2279
|
+
var T;
|
|
2280
|
+
x.value || _ === v || (h.value = (T = H.value.find((m) => m.value === _)) == null ? void 0 : T.vault, b.value = "", p.value = "");
|
|
2281
|
+
}), he(u, async () => {
|
|
2282
|
+
j.value && await X();
|
|
2283
|
+
}, { immediate: !0 }), (_, v) => {
|
|
2284
|
+
const T = N("KEmptyState"), m = N("KSelect"), w = N("KInput"), V = N("KModal");
|
|
2285
|
+
return A(), oe(V, {
|
|
2286
|
+
"action-button-disabled": !te.value,
|
|
2287
|
+
"action-button-text": e(c)("vault_secret_picker.actions.use_key"),
|
|
2288
|
+
class: "vault-secret-picker",
|
|
2289
|
+
"data-testid": "vault-secret-picker-modal",
|
|
2290
|
+
title: e(c)("vault_secret_picker.title"),
|
|
2291
|
+
visible: n.setup !== !1,
|
|
2292
|
+
onCancel: v[4] || (v[4] = () => f("cancel")),
|
|
2293
|
+
onProceed: J
|
|
2294
|
+
}, {
|
|
2295
|
+
default: y(() => [
|
|
2296
|
+
e(z) || e(G) ? (A(), oe(T, {
|
|
2297
|
+
key: 0,
|
|
2298
|
+
"data-testid": "vault-secret-picker-fetch-error",
|
|
2299
|
+
"icon-variant": "error",
|
|
2300
|
+
message: O.value
|
|
2301
|
+
}, null, 8, ["message"])) : (A(), q("div", el, [
|
|
2302
|
+
d(m, {
|
|
2303
|
+
modelValue: C.value,
|
|
2304
|
+
"onUpdate:modelValue": v[0] || (v[0] = (k) => C.value = k),
|
|
2305
|
+
clearable: "",
|
|
2306
|
+
"data-testid": "vault-secret-picker-vault-select",
|
|
2307
|
+
disabled: x.value,
|
|
2308
|
+
"enable-filtering": "",
|
|
2309
|
+
"filter-function": () => !0,
|
|
2310
|
+
items: H.value,
|
|
2311
|
+
"kpop-attributes": { "data-testid": "vault-secret-picker-vault-popover" },
|
|
2312
|
+
label: e(c)("vault_secret_picker.vault.label"),
|
|
2313
|
+
loading: e(re),
|
|
2314
|
+
placeholder: e(c)("vault_secret_picker.vault.placeholder"),
|
|
2315
|
+
required: "",
|
|
2316
|
+
"reuse-item-template": "",
|
|
2317
|
+
width: "100%",
|
|
2318
|
+
onQueryChange: e(D)
|
|
2319
|
+
}, {
|
|
2320
|
+
loading: y(() => [
|
|
2321
|
+
R("div", null, P(e(c)("actions.loading")), 1)
|
|
2322
|
+
]),
|
|
2323
|
+
empty: y(() => [
|
|
2324
|
+
R("div", tl, P(e(c)("vault_secret_picker.no_results")), 1)
|
|
2325
|
+
]),
|
|
2326
|
+
"selected-item-template": y(({ item: k }) => [
|
|
2327
|
+
R("span", ll, P(Z(k)), 1)
|
|
2328
|
+
]),
|
|
2329
|
+
"item-template": y(({ item: k }) => [
|
|
2330
|
+
R("div", ol, [
|
|
2331
|
+
R("span", al, P(k.label), 1),
|
|
2332
|
+
R("span", rl, P(k.vault.name), 1),
|
|
2333
|
+
R("span", il, P(k.vault.id), 1)
|
|
2334
|
+
])
|
|
2335
|
+
]),
|
|
2336
|
+
_: 1
|
|
2337
|
+
}, 8, ["modelValue", "disabled", "items", "label", "loading", "placeholder", "onQueryChange"]),
|
|
2338
|
+
j.value ? (A(), oe(m, {
|
|
2339
|
+
key: 0,
|
|
2340
|
+
modelValue: b.value,
|
|
2341
|
+
"onUpdate:modelValue": v[1] || (v[1] = (k) => b.value = k),
|
|
2342
|
+
clearable: "",
|
|
2343
|
+
"data-testid": "vault-secret-picker-secret-id-select",
|
|
2344
|
+
disabled: x.value || !h.value,
|
|
2345
|
+
"enable-filtering": "",
|
|
2346
|
+
"filter-function": () => !0,
|
|
2347
|
+
items: M.value,
|
|
2348
|
+
"kpop-attributes": { "data-testid": "vault-secret-picker-secret-id-popover" },
|
|
2349
|
+
label: e(c)("vault_secret_picker.secret_id.label"),
|
|
2350
|
+
loading: e(W),
|
|
2351
|
+
placeholder: e(c)("vault_secret_picker.secret_id.select_placeholder"),
|
|
2352
|
+
required: "",
|
|
2353
|
+
"reuse-item-template": "",
|
|
2354
|
+
width: "100%",
|
|
2355
|
+
onQueryChange: e(ee)
|
|
2356
|
+
}, {
|
|
2357
|
+
loading: y(() => [
|
|
2358
|
+
R("div", null, P(e(c)("actions.loading")), 1)
|
|
2359
|
+
]),
|
|
2360
|
+
empty: y(() => [
|
|
2361
|
+
R("div", nl, P(e(c)("vault_secret_picker.no_results")), 1)
|
|
2362
|
+
]),
|
|
2363
|
+
_: 1
|
|
2364
|
+
}, 8, ["modelValue", "disabled", "items", "label", "loading", "placeholder", "onQueryChange"])) : (A(), oe(w, {
|
|
2365
|
+
key: 1,
|
|
2366
|
+
modelValue: b.value,
|
|
2367
|
+
"onUpdate:modelValue": v[2] || (v[2] = (k) => b.value = k),
|
|
2368
|
+
modelModifiers: { trim: !0 },
|
|
2369
|
+
autocomplete: "off",
|
|
2370
|
+
"data-testid": "vault-secret-picker-secret-id-input",
|
|
2371
|
+
disabled: x.value || !h.value,
|
|
2372
|
+
label: e(c)("vault_secret_picker.secret_id.label"),
|
|
2373
|
+
placeholder: e(c)("vault_secret_picker.secret_id.input_placeholder"),
|
|
2374
|
+
required: "",
|
|
2375
|
+
type: "text"
|
|
2376
|
+
}, null, 8, ["modelValue", "disabled", "label", "placeholder"])),
|
|
2377
|
+
d(w, {
|
|
2378
|
+
modelValue: p.value,
|
|
2379
|
+
"onUpdate:modelValue": v[3] || (v[3] = (k) => p.value = k),
|
|
2380
|
+
modelModifiers: { trim: !0 },
|
|
2381
|
+
autocomplete: "off",
|
|
2382
|
+
"data-testid": "vault-secret-picker-secret-key-input",
|
|
2383
|
+
disabled: x.value || !h.value,
|
|
2384
|
+
help: e(c)("vault_secret_picker.optional_secret_key.help"),
|
|
2385
|
+
label: e(c)("vault_secret_picker.optional_secret_key.label"),
|
|
2386
|
+
placeholder: e(c)("vault_secret_picker.optional_secret_key.placeholder"),
|
|
2387
|
+
type: "text"
|
|
2388
|
+
}, null, 8, ["modelValue", "disabled", "help", "label", "placeholder"])
|
|
2389
|
+
]))
|
|
2390
|
+
]),
|
|
2391
|
+
_: 1
|
|
2392
|
+
}, 8, ["action-button-disabled", "action-button-text", "title", "visible"]);
|
|
2393
|
+
};
|
|
2394
|
+
}
|
|
2395
|
+
}), hl = /* @__PURE__ */ ce(sl, [["__scopeId", "data-v-df8552cc"]]);
|
|
2084
2396
|
export {
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2397
|
+
bl as SecretForm,
|
|
2398
|
+
_l as SecretList,
|
|
2399
|
+
F as VaultAuthMethods,
|
|
2400
|
+
gl as VaultConfigCard,
|
|
2401
|
+
vl as VaultForm,
|
|
2402
|
+
ml as VaultList,
|
|
2091
2403
|
t as VaultProviders,
|
|
2092
|
-
|
|
2093
|
-
|
|
2404
|
+
hl as VaultSecretPicker,
|
|
2405
|
+
yl as VaultSecretPickerProvider,
|
|
2406
|
+
me as secretsEndpoints,
|
|
2407
|
+
se as vaultsEndpoints
|
|
2094
2408
|
};
|