@kong-ui-public/entities-keys 3.5.58 → 3.5.59
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-keys.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as fe,
|
|
1
|
+
import { defineComponent as fe, computed as _, ref as C, watch as Y, onBeforeMount as he, resolveComponent as T, openBlock as w, createElementBlock as J, createVNode as u, unref as i, withCtx as k, createBlock as A, Teleport as we, createTextVNode as le, toDisplayString as $, createElementVNode as R, reactive as pe, createCommentVNode as ie, createSlots as Ce, Fragment as me, renderList as ge } from "vue";
|
|
2
2
|
import { useRouter as _e } from "vue-router";
|
|
3
3
|
import { AddIcon as Ke } from "@kong/icons";
|
|
4
4
|
import { createI18n as je, i18nTComponent as $e } from "@kong-ui-public/i18n";
|
|
@@ -128,41 +128,41 @@ function We() {
|
|
|
128
128
|
}
|
|
129
129
|
const ke = {
|
|
130
130
|
useI18n: We
|
|
131
|
-
},
|
|
131
|
+
}, D = "/v2/control-planes/{controlPlaneId}/core-entities", F = "/{workspace}", B = {
|
|
132
132
|
list: {
|
|
133
133
|
konnect: {
|
|
134
|
-
all: `${
|
|
135
|
-
forKeySet: `${
|
|
134
|
+
all: `${D}/keys`,
|
|
135
|
+
forKeySet: `${D}/key-sets/{keySetId}/keys`
|
|
136
136
|
},
|
|
137
137
|
kongManager: {
|
|
138
|
-
all: `${
|
|
139
|
-
forKeySet: `${
|
|
138
|
+
all: `${F}/keys`,
|
|
139
|
+
forKeySet: `${F}/key-sets/{keySetId}/keys`
|
|
140
140
|
}
|
|
141
141
|
},
|
|
142
142
|
form: {
|
|
143
143
|
konnect: {
|
|
144
144
|
create: {
|
|
145
|
-
all: `${
|
|
146
|
-
forKeySet: `${
|
|
145
|
+
all: `${D}/keys`,
|
|
146
|
+
forKeySet: `${D}/key-sets/{keySetId}/keys`
|
|
147
147
|
},
|
|
148
148
|
edit: {
|
|
149
|
-
all: `${
|
|
150
|
-
forKeySet: `${
|
|
149
|
+
all: `${D}/keys/{id}`,
|
|
150
|
+
forKeySet: `${D}/key-sets/{keySetId}/keys/{id}`
|
|
151
151
|
},
|
|
152
|
-
keySets: `${
|
|
153
|
-
getKeySet: `${
|
|
152
|
+
keySets: `${D}/key-sets`,
|
|
153
|
+
getKeySet: `${D}/key-sets/{keySetId}`
|
|
154
154
|
},
|
|
155
155
|
kongManager: {
|
|
156
156
|
create: {
|
|
157
|
-
all: `${
|
|
158
|
-
forKeySet: `${
|
|
157
|
+
all: `${F}/keys`,
|
|
158
|
+
forKeySet: `${F}/key-sets/{keySetId}/keys`
|
|
159
159
|
},
|
|
160
160
|
edit: {
|
|
161
|
-
all: `${
|
|
162
|
-
forKeySet: `${
|
|
161
|
+
all: `${F}/keys/{id}`,
|
|
162
|
+
forKeySet: `${F}/key-sets/{keySetId}/keys/{id}`
|
|
163
163
|
},
|
|
164
|
-
keySets: `${
|
|
165
|
-
getKeySet: `${
|
|
164
|
+
keySets: `${F}/key-sets`,
|
|
165
|
+
getKeySet: `${F}/key-sets/{keySetId}`
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
}, Le = { class: "kong-ui-entities-keys-list" }, Qe = /* @__PURE__ */ fe({
|
|
@@ -210,36 +210,40 @@ const ke = {
|
|
|
210
210
|
}
|
|
211
211
|
},
|
|
212
212
|
emits: ["error", "copy:success", "copy:error", "delete:success"],
|
|
213
|
-
setup(o, { emit:
|
|
213
|
+
setup(o, { emit: U }) {
|
|
214
214
|
var X;
|
|
215
|
-
const h =
|
|
215
|
+
const h = U, l = o, { i18n: { t: y } } = ke.useI18n(), d = _e(), { axiosInstance: j } = ue((X = l.config) == null ? void 0 : X.axiosRequestConfig), q = _(() => l.config.app !== "kongManager" || !!l.config.disableSorting), W = {
|
|
216
216
|
// the Name column is non-hidable
|
|
217
217
|
name: { label: y("keys.list.table_headers.name"), searchable: !0, sortable: !0, hidable: !1 },
|
|
218
218
|
kid: { label: y("keys.list.table_headers.key_id"), sortable: !0 },
|
|
219
219
|
tags: { label: y("keys.list.table_headers.tags") },
|
|
220
220
|
id: { label: y("keys.list.table_headers.id"), sortable: !0 }
|
|
221
|
-
},
|
|
221
|
+
}, E = W, e = _(() => {
|
|
222
222
|
var f, t, s, g;
|
|
223
|
-
let a = `${l.config.apiBaseUrl}${
|
|
223
|
+
let a = `${l.config.apiBaseUrl}${B.list[l.config.app][l.config.keySetId ? "forKeySet" : "all"]}`;
|
|
224
224
|
return l.config.app === "konnect" ? a = a.replace(/{controlPlaneId}/gi, ((f = l.config) == null ? void 0 : f.controlPlaneId) || "").replace(/{keySetId}/gi, ((t = l.config) == null ? void 0 : t.keySetId) || "") : l.config.app === "kongManager" && (a = a.replace(/\/{workspace}/gi, (s = l.config) != null && s.workspace ? `/${l.config.workspace}` : "").replace(/{keySetId}/gi, ((g = l.config) == null ? void 0 : g.keySetId) || "")), a;
|
|
225
|
-
}),
|
|
225
|
+
}), S = C(""), P = _(() => {
|
|
226
226
|
const a = l.config.app === "konnect" || l.config.isExactMatch;
|
|
227
227
|
if (a)
|
|
228
228
|
return {
|
|
229
229
|
isExactMatch: a,
|
|
230
230
|
placeholder: y("keys.search.placeholder")
|
|
231
231
|
};
|
|
232
|
-
const f = { name:
|
|
232
|
+
const f = { name: W.name };
|
|
233
233
|
return {
|
|
234
234
|
isExactMatch: a,
|
|
235
235
|
fields: f,
|
|
236
236
|
schema: l.config.filterSchema
|
|
237
237
|
};
|
|
238
|
-
}), {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
},
|
|
238
|
+
}), {
|
|
239
|
+
fetcher: V,
|
|
240
|
+
fetcherState: G,
|
|
241
|
+
fetcherCacheKey: O
|
|
242
|
+
} = Ee({ ...l.config, cacheIdentifier: l.cacheIdentifier }, e.value), H = () => {
|
|
243
|
+
S.value = "";
|
|
244
|
+
}, L = () => {
|
|
245
|
+
O.value++;
|
|
246
|
+
}, n = C(null), v = (a, f) => {
|
|
243
247
|
const t = a.id;
|
|
244
248
|
if (!f(t)) {
|
|
245
249
|
K(a, "id");
|
|
@@ -280,69 +284,69 @@ const ke = {
|
|
|
280
284
|
}), ae = (a) => ({
|
|
281
285
|
label: y("keys.actions.edit"),
|
|
282
286
|
to: l.config.getEditRoute(a)
|
|
283
|
-
}),
|
|
284
|
-
|
|
285
|
-
},
|
|
286
|
-
|
|
287
|
+
}), M = C(void 0), Q = C(!1), z = C(!1), ee = C(""), te = xe(l.config, e.value), re = (a) => {
|
|
288
|
+
M.value = a, Q.value = !0;
|
|
289
|
+
}, ne = () => {
|
|
290
|
+
Q.value = !1;
|
|
287
291
|
}, de = async () => {
|
|
288
292
|
var a, f, t;
|
|
289
|
-
if ((a =
|
|
290
|
-
|
|
293
|
+
if ((a = M.value) != null && a.id) {
|
|
294
|
+
z.value = !0;
|
|
291
295
|
try {
|
|
292
|
-
await j.delete(te(
|
|
296
|
+
await j.delete(te(M.value.id)), z.value = !1, Q.value = !1, O.value++, h("delete:success", M.value);
|
|
293
297
|
} catch (s) {
|
|
294
298
|
ee.value = ((t = (f = s.response) == null ? void 0 : f.data) == null ? void 0 : t.message) || s.message || y("keys.errors.delete"), h("error", s);
|
|
295
299
|
} finally {
|
|
296
|
-
|
|
300
|
+
z.value = !1;
|
|
297
301
|
}
|
|
298
302
|
}
|
|
299
303
|
};
|
|
300
304
|
Y(G, (a) => {
|
|
301
305
|
var f, t, s;
|
|
302
306
|
if (a.status === Me.Error) {
|
|
303
|
-
|
|
307
|
+
n.value = {
|
|
304
308
|
title: y("keys.errors.general")
|
|
305
|
-
}, (s = (t = (f = a.error) == null ? void 0 : f.response) == null ? void 0 : t.data) != null && s.message && (
|
|
309
|
+
}, (s = (t = (f = a.error) == null ? void 0 : f.response) == null ? void 0 : t.data) != null && s.message && (n.value.message = a.error.response.data.message), h("error", a.error);
|
|
306
310
|
return;
|
|
307
311
|
}
|
|
308
|
-
|
|
312
|
+
n.value = null;
|
|
309
313
|
});
|
|
310
|
-
const
|
|
314
|
+
const N = C({
|
|
311
315
|
ctaPath: l.config.createRoute,
|
|
312
316
|
ctaText: void 0,
|
|
313
317
|
message: `${y("keys.list.empty_state.description")}${l.config.additionMessageForEmptyState ? ` ${l.config.additionMessageForEmptyState}` : ""}`,
|
|
314
318
|
title: y("keys.title")
|
|
315
319
|
});
|
|
316
320
|
return he(async () => {
|
|
317
|
-
await l.canCreate() && (
|
|
321
|
+
await l.canCreate() && (N.value.title = y("keys.list.empty_state.title"), N.value.ctaText = y("keys.actions.create"));
|
|
318
322
|
}), (a, f) => {
|
|
319
|
-
const t =
|
|
320
|
-
return w(),
|
|
323
|
+
const t = T("KButton"), s = T("KCopy"), g = T("KDropdownItem"), I = T("KClipboardProvider");
|
|
324
|
+
return w(), J("div", Le, [
|
|
321
325
|
u(i(Ve), {
|
|
322
326
|
"cache-identifier": o.cacheIdentifier,
|
|
323
|
-
"disable-sorting":
|
|
324
|
-
"empty-state-options":
|
|
327
|
+
"disable-sorting": q.value,
|
|
328
|
+
"empty-state-options": N.value,
|
|
325
329
|
"enable-entity-actions": "",
|
|
326
|
-
"error-message":
|
|
327
|
-
fetcher: i(
|
|
328
|
-
"fetcher-cache-key":
|
|
330
|
+
"error-message": n.value,
|
|
331
|
+
fetcher: i(V),
|
|
332
|
+
"fetcher-cache-key": i(O),
|
|
329
333
|
"pagination-type": "offset",
|
|
330
334
|
"preferences-storage-key": "kong-ui-entities-keys-list",
|
|
331
|
-
query:
|
|
332
|
-
"table-headers": i(
|
|
335
|
+
query: S.value,
|
|
336
|
+
"table-headers": i(E),
|
|
333
337
|
onClearSearchInput: H,
|
|
334
338
|
"onClick:row": f[1] || (f[1] = (c) => m(c)),
|
|
335
|
-
onSort:
|
|
339
|
+
onSort: L
|
|
336
340
|
}, {
|
|
337
341
|
"toolbar-filter": k(() => [
|
|
338
342
|
u(i(De), {
|
|
339
|
-
modelValue:
|
|
340
|
-
"onUpdate:modelValue": f[0] || (f[0] = (c) =>
|
|
341
|
-
config:
|
|
343
|
+
modelValue: S.value,
|
|
344
|
+
"onUpdate:modelValue": f[0] || (f[0] = (c) => S.value = c),
|
|
345
|
+
config: P.value
|
|
342
346
|
}, null, 8, ["modelValue", "config"])
|
|
343
347
|
]),
|
|
344
348
|
"toolbar-button": k(() => [
|
|
345
|
-
(w(),
|
|
349
|
+
(w(), A(we, {
|
|
346
350
|
disabled: !o.useActionOutside,
|
|
347
351
|
to: "#kong-ui-app-page-header-action-button"
|
|
348
352
|
}, [
|
|
@@ -358,7 +362,7 @@ const ke = {
|
|
|
358
362
|
}, {
|
|
359
363
|
default: k(() => [
|
|
360
364
|
u(i(Ke)),
|
|
361
|
-
le(" " +
|
|
365
|
+
le(" " + $(i(y)("keys.list.toolbar_actions.new_key")), 1)
|
|
362
366
|
]),
|
|
363
367
|
_: 1
|
|
364
368
|
}, 8, ["size", "to"])
|
|
@@ -368,7 +372,7 @@ const ke = {
|
|
|
368
372
|
], 8, ["disabled"]))
|
|
369
373
|
]),
|
|
370
374
|
name: k(({ rowValue: c }) => [
|
|
371
|
-
|
|
375
|
+
R("b", null, $(c ?? "-"), 1)
|
|
372
376
|
]),
|
|
373
377
|
kid: k(({ rowValue: c }) => [
|
|
374
378
|
u(s, { text: c }, null, 8, ["text"])
|
|
@@ -384,13 +388,13 @@ const ke = {
|
|
|
384
388
|
]),
|
|
385
389
|
actions: k(({ row: c }) => [
|
|
386
390
|
u(I, null, {
|
|
387
|
-
default: k(({ copyToClipboard:
|
|
391
|
+
default: k(({ copyToClipboard: r }) => [
|
|
388
392
|
u(g, {
|
|
389
393
|
"data-testid": "action-entity-copy-id",
|
|
390
|
-
onClick: (p) => v(c,
|
|
394
|
+
onClick: (p) => v(c, r)
|
|
391
395
|
}, {
|
|
392
396
|
default: k(() => [
|
|
393
|
-
le(
|
|
397
|
+
le($(i(y)("keys.actions.copy_id")), 1)
|
|
394
398
|
]),
|
|
395
399
|
_: 2
|
|
396
400
|
}, 1032, ["onClick"])
|
|
@@ -398,13 +402,13 @@ const ke = {
|
|
|
398
402
|
_: 2
|
|
399
403
|
}, 1024),
|
|
400
404
|
u(I, null, {
|
|
401
|
-
default: k(({ copyToClipboard:
|
|
405
|
+
default: k(({ copyToClipboard: r }) => [
|
|
402
406
|
u(g, {
|
|
403
407
|
"data-testid": "action-entity-copy-json",
|
|
404
|
-
onClick: (p) => x(c,
|
|
408
|
+
onClick: (p) => x(c, r)
|
|
405
409
|
}, {
|
|
406
410
|
default: k(() => [
|
|
407
|
-
le(
|
|
411
|
+
le($(i(y)("keys.actions.copy_json")), 1)
|
|
408
412
|
]),
|
|
409
413
|
_: 2
|
|
410
414
|
}, 1032, ["onClick"])
|
|
@@ -442,10 +446,10 @@ const ke = {
|
|
|
442
446
|
danger: "",
|
|
443
447
|
"data-testid": "action-entity-delete",
|
|
444
448
|
"has-divider": "",
|
|
445
|
-
onClick: (
|
|
449
|
+
onClick: (r) => re(c)
|
|
446
450
|
}, {
|
|
447
451
|
default: k(() => [
|
|
448
|
-
le(
|
|
452
|
+
le($(i(y)("keys.actions.delete")), 1)
|
|
449
453
|
]),
|
|
450
454
|
_: 2
|
|
451
455
|
}, 1032, ["onClick"])
|
|
@@ -456,26 +460,26 @@ const ke = {
|
|
|
456
460
|
_: 1
|
|
457
461
|
}, 8, ["cache-identifier", "disable-sorting", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "query", "table-headers"]),
|
|
458
462
|
u(i(Re), {
|
|
459
|
-
"action-pending":
|
|
463
|
+
"action-pending": z.value,
|
|
460
464
|
description: i(y)("keys.delete.description"),
|
|
461
|
-
"entity-name":
|
|
465
|
+
"entity-name": M.value && (M.value.name || M.value.id),
|
|
462
466
|
"entity-type": i(Te).Key,
|
|
463
467
|
error: ee.value,
|
|
464
468
|
"need-confirm": !1,
|
|
465
469
|
title: i(y)("keys.delete.title"),
|
|
466
|
-
visible:
|
|
467
|
-
onCancel:
|
|
470
|
+
visible: Q.value,
|
|
471
|
+
onCancel: ne,
|
|
468
472
|
onProceed: de
|
|
469
473
|
}, null, 8, ["action-pending", "description", "entity-name", "entity-type", "error", "title", "visible"])
|
|
470
474
|
]);
|
|
471
475
|
};
|
|
472
476
|
}
|
|
473
|
-
}), Ie = (o,
|
|
477
|
+
}), Ie = (o, U) => {
|
|
474
478
|
const h = o.__vccOpts || o;
|
|
475
|
-
for (const [l, y] of
|
|
479
|
+
for (const [l, y] of U)
|
|
476
480
|
h[l] = y;
|
|
477
481
|
return h;
|
|
478
|
-
}, dt = /* @__PURE__ */ Ie(Qe, [["__scopeId", "data-v-
|
|
482
|
+
}, dt = /* @__PURE__ */ Ie(Qe, [["__scopeId", "data-v-78f37f9c"]]), ze = { class: "kong-ui-entities-keys-form" }, Ge = { "data-testid": "no-search-results" }, He = { class: "select-item-container" }, Xe = { class: "select-item-label" }, Ye = { class: "select-item-description" }, Ze = {
|
|
479
483
|
key: 0,
|
|
480
484
|
class: "invalid-key-set-message",
|
|
481
485
|
"data-testid": "invalid-key-set-message"
|
|
@@ -508,9 +512,9 @@ const ke = {
|
|
|
508
512
|
}
|
|
509
513
|
},
|
|
510
514
|
emits: ["update", "error", "loading"],
|
|
511
|
-
setup(o, { emit:
|
|
515
|
+
setup(o, { emit: U }) {
|
|
512
516
|
var f;
|
|
513
|
-
const h =
|
|
517
|
+
const h = U, l = o, y = _e(), { i18n: { t: d } } = ke.useI18n(), { getMessageFromError: j } = Ae(), { axiosInstance: q } = ue((f = l.config) == null ? void 0 : f.axiosRequestConfig), W = _(() => l.keySetId ? B.form[l.config.app].edit.forKeySet.replace(/{keySetId}/gi, l.keySetId) : B.form[l.config.app].edit.all), E = _(() => l.keyId ? se.Edit : se.Create), e = pe({
|
|
514
518
|
fields: {
|
|
515
519
|
name: "",
|
|
516
520
|
tags: "",
|
|
@@ -523,7 +527,7 @@ const ke = {
|
|
|
523
527
|
},
|
|
524
528
|
isReadonly: !1,
|
|
525
529
|
errorMessage: ""
|
|
526
|
-
}),
|
|
530
|
+
}), S = pe({
|
|
527
531
|
name: "",
|
|
528
532
|
tags: "",
|
|
529
533
|
key_id: "",
|
|
@@ -532,7 +536,7 @@ const ke = {
|
|
|
532
536
|
jwk: "",
|
|
533
537
|
private_key: "",
|
|
534
538
|
public_key: ""
|
|
535
|
-
}),
|
|
539
|
+
}), P = [
|
|
536
540
|
{
|
|
537
541
|
label: d("keys.form.fields.key_format.options.jwk"),
|
|
538
542
|
value: "jwk"
|
|
@@ -541,18 +545,18 @@ const ke = {
|
|
|
541
545
|
label: d("keys.form.fields.key_format.options.pem"),
|
|
542
546
|
value: "pem"
|
|
543
547
|
}
|
|
544
|
-
],
|
|
548
|
+
], V = _(() => e.isReadonly || E.value === se.Create && !!l.fixedKeySetId), G = _(() => !V.value);
|
|
545
549
|
Y(() => l.fixedKeySetId, (t) => {
|
|
546
|
-
|
|
550
|
+
E.value === se.Create && (e.fields.key_set = t);
|
|
547
551
|
}, { immediate: !0 });
|
|
548
|
-
const
|
|
552
|
+
const O = _(() => JSON.stringify(e.fields) !== JSON.stringify(S) && !!e.fields.key_id && !!e.fields.key_format && (e.fields.key_format === "jwk" && !!e.fields.jwk || e.fields.key_format === "pem" && !!e.fields.private_key && !!e.fields.public_key)), H = (t) => {
|
|
549
553
|
var s, g, I, c;
|
|
550
|
-
e.fields.key_id = (t == null ? void 0 : t.kid) || "", e.fields.name = (t == null ? void 0 : t.name) || "", e.fields.tags = ((s = t == null ? void 0 : t.tags) == null ? void 0 : s.join(", ")) || "", e.fields.key_set = ((g = t == null ? void 0 : t.set) == null ? void 0 : g.id) || "", e.fields.key_format = t != null && t.pem ? "pem" : "jwk", e.fields.jwk = (t == null ? void 0 : t.jwk) || "", e.fields.private_key = ((I = t == null ? void 0 : t.pem) == null ? void 0 : I.private_key) || "", e.fields.public_key = ((c = t == null ? void 0 : t.pem) == null ? void 0 : c.public_key) || "", Object.assign(
|
|
551
|
-
},
|
|
554
|
+
e.fields.key_id = (t == null ? void 0 : t.kid) || "", e.fields.name = (t == null ? void 0 : t.name) || "", e.fields.tags = ((s = t == null ? void 0 : t.tags) == null ? void 0 : s.join(", ")) || "", e.fields.key_set = ((g = t == null ? void 0 : t.set) == null ? void 0 : g.id) || "", e.fields.key_format = t != null && t.pem ? "pem" : "jwk", e.fields.jwk = (t == null ? void 0 : t.jwk) || "", e.fields.private_key = ((I = t == null ? void 0 : t.pem) == null ? void 0 : I.private_key) || "", e.fields.public_key = ((c = t == null ? void 0 : t.pem) == null ? void 0 : c.public_key) || "", Object.assign(S, e.fields);
|
|
555
|
+
}, L = () => {
|
|
552
556
|
y.push(l.config.cancelRoute);
|
|
553
|
-
},
|
|
557
|
+
}, n = _(() => {
|
|
554
558
|
var s, g;
|
|
555
|
-
let t = `${l.config.apiBaseUrl}${
|
|
559
|
+
let t = `${l.config.apiBaseUrl}${B.form[l.config.app][E.value][l.keySetId ? "forKeySet" : "all"]}`;
|
|
556
560
|
return l.config.app === "konnect" ? t = t.replace(/{controlPlaneId}/gi, ((s = l.config) == null ? void 0 : s.controlPlaneId) || "") : l.config.app === "kongManager" && (t = t.replace(/\/{workspace}/gi, (g = l.config) != null && g.workspace ? `/${l.config.workspace}` : "")), t = t.replace(/{id}/gi, l.keyId).replace(/{keySetId}/gi, l.keySetId || ""), t;
|
|
557
561
|
}), v = _(() => {
|
|
558
562
|
var t, s, g;
|
|
@@ -568,13 +572,13 @@ const ke = {
|
|
|
568
572
|
var t, s, g, I, c;
|
|
569
573
|
try {
|
|
570
574
|
e.isReadonly = !0;
|
|
571
|
-
let
|
|
572
|
-
if (
|
|
573
|
-
const { data: p } =
|
|
574
|
-
e.fields.key_id = (p == null ? void 0 : p.kid) || "", e.fields.name = (p == null ? void 0 : p.name) || "", e.fields.tags = ((s = p == null ? void 0 : p.tags) == null ? void 0 : s.join(", ")) || "", e.fields.key_set = ((g = p == null ? void 0 : p.set) == null ? void 0 : g.id) || "", e.fields.key_format = p != null && p.pem ? "pem" : "jwk", e.fields.jwk = (p == null ? void 0 : p.jwk) || "", e.fields.private_key = ((I = p == null ? void 0 : p.pem) == null ? void 0 : I.private_key) || "", e.fields.public_key = ((c = p == null ? void 0 : p.pem) == null ? void 0 : c.public_key) || "", Object.assign(
|
|
575
|
+
let r;
|
|
576
|
+
if (E.value === "create" ? r = await q.post(n.value, v.value) : E.value === "edit" && (r = ((t = l.config) == null ? void 0 : t.app) === "konnect" ? await q.put(n.value, v.value) : await q.patch(n.value, v.value)), r) {
|
|
577
|
+
const { data: p } = r;
|
|
578
|
+
e.fields.key_id = (p == null ? void 0 : p.kid) || "", e.fields.name = (p == null ? void 0 : p.name) || "", e.fields.tags = ((s = p == null ? void 0 : p.tags) == null ? void 0 : s.join(", ")) || "", e.fields.key_set = ((g = p == null ? void 0 : p.set) == null ? void 0 : g.id) || "", e.fields.key_format = p != null && p.pem ? "pem" : "jwk", e.fields.jwk = (p == null ? void 0 : p.jwk) || "", e.fields.private_key = ((I = p == null ? void 0 : p.pem) == null ? void 0 : I.private_key) || "", e.fields.public_key = ((c = p == null ? void 0 : p.pem) == null ? void 0 : c.public_key) || "", Object.assign(S, e.fields), h("update", r == null ? void 0 : r.data);
|
|
575
579
|
}
|
|
576
|
-
} catch (
|
|
577
|
-
e.errorMessage = j(
|
|
580
|
+
} catch (r) {
|
|
581
|
+
e.errorMessage = j(r), h("error", r);
|
|
578
582
|
} finally {
|
|
579
583
|
e.isReadonly = !1;
|
|
580
584
|
}
|
|
@@ -584,17 +588,17 @@ const ke = {
|
|
|
584
588
|
allRecords: m,
|
|
585
589
|
error: Z,
|
|
586
590
|
validationError: ae,
|
|
587
|
-
loadItems:
|
|
588
|
-
results:
|
|
589
|
-
} = Be(l.config,
|
|
591
|
+
loadItems: M,
|
|
592
|
+
results: Q
|
|
593
|
+
} = Be(l.config, B.form[l.config.app].keySets, void 0, {
|
|
590
594
|
fetchedItemsKey: "data",
|
|
591
595
|
searchKeys: ["id", "name"]
|
|
592
|
-
}),
|
|
593
|
-
(!t || t !== e.fields.key_set && t !==
|
|
594
|
-
}, ee = _(() => Z.value ? d("keys.errors.key_sets.fetch") : ""), te = _(() => ae.value ? d("keys.errors.key_sets.invalid") : ""),
|
|
595
|
-
if (
|
|
596
|
+
}), z = (t) => {
|
|
597
|
+
(!t || t !== e.fields.key_set && t !== S.key_set) && b(t);
|
|
598
|
+
}, ee = _(() => Z.value ? d("keys.errors.key_sets.fetch") : ""), te = _(() => ae.value ? d("keys.errors.key_sets.invalid") : ""), re = C(0), ne = _(() => m.value === void 0), de = _(() => {
|
|
599
|
+
if (ne.value)
|
|
596
600
|
return l.config.app === "konnect" ? d("keys.form.fields.key_set.footer") : void 0;
|
|
597
|
-
}),
|
|
601
|
+
}), N = C(/* @__PURE__ */ new Set()), X = _(() => Array.from(N.value).map((s) => ({
|
|
598
602
|
name: s.name || "",
|
|
599
603
|
// can't use name for label or it tries to search => 404
|
|
600
604
|
label: "",
|
|
@@ -602,33 +606,33 @@ const ke = {
|
|
|
602
606
|
value: s.id,
|
|
603
607
|
selected: e.fields.key_set === s.id
|
|
604
608
|
}))), a = (t) => {
|
|
605
|
-
|
|
609
|
+
N.value.clear();
|
|
606
610
|
let s;
|
|
607
611
|
for (s of t)
|
|
608
|
-
|
|
612
|
+
N.value.add(s);
|
|
609
613
|
};
|
|
610
|
-
return Y(
|
|
614
|
+
return Y(Q, (t) => {
|
|
611
615
|
a(t);
|
|
612
616
|
}, { immediate: !0, deep: !0 }), Y(X, () => {
|
|
613
|
-
|
|
617
|
+
re.value++;
|
|
614
618
|
}, { immediate: !0, deep: !0 }), he(async () => {
|
|
615
|
-
await
|
|
619
|
+
await M();
|
|
616
620
|
}), (t, s) => {
|
|
617
|
-
const g =
|
|
618
|
-
return w(),
|
|
621
|
+
const g = T("KInput"), I = T("KSelect"), c = T("KTextArea");
|
|
622
|
+
return w(), J("div", ze, [
|
|
619
623
|
u(i(Ue), {
|
|
620
|
-
"can-submit":
|
|
624
|
+
"can-submit": O.value,
|
|
621
625
|
config: o.config,
|
|
622
626
|
"edit-id": o.keyId,
|
|
623
627
|
"entity-type": i(Se).Key,
|
|
624
628
|
"error-message": e.errorMessage || ee.value,
|
|
625
|
-
"fetch-url":
|
|
629
|
+
"fetch-url": W.value,
|
|
626
630
|
"form-fields": v.value,
|
|
627
631
|
"is-readonly": e.isReadonly,
|
|
628
|
-
onCancel:
|
|
629
|
-
"onFetch:error": s[8] || (s[8] = (
|
|
632
|
+
onCancel: L,
|
|
633
|
+
"onFetch:error": s[8] || (s[8] = (r) => t.$emit("error", r)),
|
|
630
634
|
"onFetch:success": H,
|
|
631
|
-
onLoading: s[9] || (s[9] = (
|
|
635
|
+
onLoading: s[9] || (s[9] = (r) => t.$emit("loading", r)),
|
|
632
636
|
onSubmit: x
|
|
633
637
|
}, {
|
|
634
638
|
default: k(() => [
|
|
@@ -639,7 +643,7 @@ const ke = {
|
|
|
639
643
|
default: k(() => [
|
|
640
644
|
u(g, {
|
|
641
645
|
modelValue: e.fields.key_id,
|
|
642
|
-
"onUpdate:modelValue": s[0] || (s[0] = (
|
|
646
|
+
"onUpdate:modelValue": s[0] || (s[0] = (r) => e.fields.key_id = r),
|
|
643
647
|
modelModifiers: { trim: !0 },
|
|
644
648
|
autocomplete: "off",
|
|
645
649
|
"data-testid": "key-form-id",
|
|
@@ -656,7 +660,7 @@ const ke = {
|
|
|
656
660
|
}, null, 8, ["modelValue", "help", "label", "label-attributes", "placeholder", "readonly"]),
|
|
657
661
|
u(g, {
|
|
658
662
|
modelValue: e.fields.name,
|
|
659
|
-
"onUpdate:modelValue": s[1] || (s[1] = (
|
|
663
|
+
"onUpdate:modelValue": s[1] || (s[1] = (r) => e.fields.name = r),
|
|
660
664
|
modelModifiers: { trim: !0 },
|
|
661
665
|
autocomplete: "off",
|
|
662
666
|
"data-testid": "key-form-name",
|
|
@@ -667,8 +671,8 @@ const ke = {
|
|
|
667
671
|
}, null, 8, ["modelValue", "label", "placeholder", "readonly"]),
|
|
668
672
|
u(I, {
|
|
669
673
|
modelValue: e.fields.key_set,
|
|
670
|
-
"onUpdate:modelValue": s[2] || (s[2] = (
|
|
671
|
-
clearable:
|
|
674
|
+
"onUpdate:modelValue": s[2] || (s[2] = (r) => e.fields.key_set = r),
|
|
675
|
+
clearable: G.value,
|
|
672
676
|
"data-testid": "key-form-key-set",
|
|
673
677
|
"dropdown-footer-text": de.value,
|
|
674
678
|
"enable-filtering": "",
|
|
@@ -677,31 +681,31 @@ const ke = {
|
|
|
677
681
|
label: i(d)("keys.form.fields.key_set.label"),
|
|
678
682
|
loading: i(K),
|
|
679
683
|
placeholder: i(d)("keys.form.fields.key_set.placeholder"),
|
|
680
|
-
readonly:
|
|
684
|
+
readonly: V.value,
|
|
681
685
|
width: "100%",
|
|
682
|
-
onQueryChange:
|
|
686
|
+
onQueryChange: z
|
|
683
687
|
}, {
|
|
684
688
|
loading: k(() => [
|
|
685
|
-
|
|
689
|
+
R("div", null, $(i(d)("keys.actions.loading")), 1)
|
|
686
690
|
]),
|
|
687
691
|
empty: k(() => [
|
|
688
|
-
|
|
692
|
+
R("div", Ge, $(i(d)("keys.search.no_results")), 1)
|
|
689
693
|
]),
|
|
690
|
-
"selected-item-template": k(({ item:
|
|
691
|
-
|
|
694
|
+
"selected-item-template": k(({ item: r }) => [
|
|
695
|
+
R("div", null, $(r.name), 1)
|
|
692
696
|
]),
|
|
693
|
-
"item-template": k(({ item:
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
+
"item-template": k(({ item: r }) => [
|
|
698
|
+
R("div", He, [
|
|
699
|
+
R("div", Xe, $(r.name), 1),
|
|
700
|
+
R("div", Ye, $(r.value), 1)
|
|
697
701
|
])
|
|
698
702
|
]),
|
|
699
703
|
_: 1
|
|
700
704
|
}, 8, ["modelValue", "clearable", "dropdown-footer-text", "items", "label", "loading", "placeholder", "readonly"]),
|
|
701
|
-
te.value ? (w(),
|
|
705
|
+
te.value ? (w(), J("p", Ze, $(te.value), 1)) : ie("", !0),
|
|
702
706
|
u(g, {
|
|
703
707
|
modelValue: e.fields.tags,
|
|
704
|
-
"onUpdate:modelValue": s[3] || (s[3] = (
|
|
708
|
+
"onUpdate:modelValue": s[3] || (s[3] = (r) => e.fields.tags = r),
|
|
705
709
|
modelModifiers: { trim: !0 },
|
|
706
710
|
autocomplete: "off",
|
|
707
711
|
"data-testid": "key-form-tags",
|
|
@@ -724,22 +728,22 @@ const ke = {
|
|
|
724
728
|
title: i(d)("keys.form.sections.keys.title")
|
|
725
729
|
}, {
|
|
726
730
|
default: k(() => [
|
|
727
|
-
|
|
731
|
+
R("div", et, [
|
|
728
732
|
u(I, {
|
|
729
733
|
modelValue: e.fields.key_format,
|
|
730
|
-
"onUpdate:modelValue": s[4] || (s[4] = (
|
|
734
|
+
"onUpdate:modelValue": s[4] || (s[4] = (r) => e.fields.key_format = r),
|
|
731
735
|
"data-testid": "key-form-key-format",
|
|
732
|
-
items:
|
|
736
|
+
items: P,
|
|
733
737
|
label: i(d)("keys.form.fields.key_format.label"),
|
|
734
738
|
readonly: e.isReadonly,
|
|
735
739
|
required: "",
|
|
736
740
|
width: "100%"
|
|
737
741
|
}, null, 8, ["modelValue", "label", "readonly"])
|
|
738
742
|
]),
|
|
739
|
-
e.fields.key_format === "jwk" ? (w(),
|
|
743
|
+
e.fields.key_format === "jwk" ? (w(), A(c, {
|
|
740
744
|
key: 0,
|
|
741
745
|
modelValue: e.fields.jwk,
|
|
742
|
-
"onUpdate:modelValue": s[5] || (s[5] = (
|
|
746
|
+
"onUpdate:modelValue": s[5] || (s[5] = (r) => e.fields.jwk = r),
|
|
743
747
|
modelModifiers: { trim: !0 },
|
|
744
748
|
class: "key-form-textarea",
|
|
745
749
|
"data-testid": "key-form-jwk",
|
|
@@ -752,10 +756,10 @@ const ke = {
|
|
|
752
756
|
readonly: e.isReadonly,
|
|
753
757
|
required: ""
|
|
754
758
|
}, null, 8, ["modelValue", "label", "label-attributes", "placeholder", "readonly"])) : ie("", !0),
|
|
755
|
-
e.fields.key_format === "pem" ? (w(),
|
|
759
|
+
e.fields.key_format === "pem" ? (w(), A(c, {
|
|
756
760
|
key: 1,
|
|
757
761
|
modelValue: e.fields.private_key,
|
|
758
|
-
"onUpdate:modelValue": s[6] || (s[6] = (
|
|
762
|
+
"onUpdate:modelValue": s[6] || (s[6] = (r) => e.fields.private_key = r),
|
|
759
763
|
modelModifiers: { trim: !0 },
|
|
760
764
|
class: "key-form-textarea",
|
|
761
765
|
"data-testid": "key-form-private-key",
|
|
@@ -764,10 +768,10 @@ const ke = {
|
|
|
764
768
|
readonly: e.isReadonly,
|
|
765
769
|
required: ""
|
|
766
770
|
}, null, 8, ["modelValue", "label", "placeholder", "readonly"])) : ie("", !0),
|
|
767
|
-
e.fields.key_format === "pem" ? (w(),
|
|
771
|
+
e.fields.key_format === "pem" ? (w(), A(c, {
|
|
768
772
|
key: 2,
|
|
769
773
|
modelValue: e.fields.public_key,
|
|
770
|
-
"onUpdate:modelValue": s[7] || (s[7] = (
|
|
774
|
+
"onUpdate:modelValue": s[7] || (s[7] = (r) => e.fields.public_key = r),
|
|
771
775
|
modelModifiers: { trim: !0 },
|
|
772
776
|
class: "key-form-textarea",
|
|
773
777
|
"data-testid": "key-form-public-key",
|
|
@@ -818,39 +822,39 @@ const ke = {
|
|
|
818
822
|
}
|
|
819
823
|
},
|
|
820
824
|
emits: ["loading", "fetch:error", "fetch:success", "navigation-click"],
|
|
821
|
-
setup(o, { emit:
|
|
822
|
-
var
|
|
823
|
-
const h =
|
|
824
|
-
var
|
|
825
|
-
return (
|
|
826
|
-
}),
|
|
825
|
+
setup(o, { emit: U }) {
|
|
826
|
+
var L;
|
|
827
|
+
const h = U, l = o, { axiosInstance: y } = ue((L = l.config) == null ? void 0 : L.axiosRequestConfig), { convertKeyToTitle: d } = qe(), { i18n: { t: j } } = ke.useI18n(), q = _(() => l.keySetId ? `${B.form[l.config.app].edit.forKeySet}`.replace(/{keySetId}/gi, l.keySetId) : B.form[l.config.app].edit.all), W = _(() => {
|
|
828
|
+
var n;
|
|
829
|
+
return (n = B.form[l.config.app]) == null ? void 0 : n.getKeySet;
|
|
830
|
+
}), E = C(), e = C({}), S = C(l.keySetId || ""), P = C(""), V = C(!1), G = async (n) => {
|
|
827
831
|
var v;
|
|
828
|
-
|
|
832
|
+
E.value = n, S.value = (v = n == null ? void 0 : n.set) == null ? void 0 : v.id, h("fetch:success", n), O(n);
|
|
829
833
|
};
|
|
830
|
-
Y(
|
|
834
|
+
Y(S, async () => {
|
|
831
835
|
var v, x;
|
|
832
|
-
if (!
|
|
836
|
+
if (!S.value)
|
|
833
837
|
return;
|
|
834
|
-
let
|
|
835
|
-
l.config.app === "konnect" ?
|
|
838
|
+
let n = `${l.config.apiBaseUrl}${W.value}`;
|
|
839
|
+
l.config.app === "konnect" ? n = n.replace(/{controlPlaneId}/gi, ((v = l.config) == null ? void 0 : v.controlPlaneId) || "").replace(/{keySetId}/gi, S.value || "") : l.config.app === "kongManager" && (n = n.replace(/\/{workspace}/gi, (x = l.config) != null && x.workspace ? `/${l.config.workspace}` : "").replace(/{keySetId}/gi, S.value || ""));
|
|
836
840
|
try {
|
|
837
|
-
|
|
838
|
-
const { data: b } = await y.get(
|
|
841
|
+
V.value = !0;
|
|
842
|
+
const { data: b } = await y.get(n, {
|
|
839
843
|
validateStatus: (K) => K === 404 || K >= 200 && K < 300
|
|
840
844
|
// in case KeySet is deleted
|
|
841
845
|
});
|
|
842
|
-
|
|
846
|
+
P.value = (b == null ? void 0 : b.name) || (b == null ? void 0 : b.id);
|
|
843
847
|
} catch (b) {
|
|
844
848
|
h("fetch:error", b);
|
|
845
849
|
} finally {
|
|
846
|
-
|
|
850
|
+
V.value = !1;
|
|
847
851
|
}
|
|
848
852
|
}, { immediate: !0 });
|
|
849
|
-
const
|
|
853
|
+
const O = (n) => {
|
|
850
854
|
var v, x;
|
|
851
855
|
try {
|
|
852
|
-
if (
|
|
853
|
-
const b = JSON.parse(
|
|
856
|
+
if (n.jwk) {
|
|
857
|
+
const b = JSON.parse(n.jwk);
|
|
854
858
|
Object.keys(b).forEach((K) => {
|
|
855
859
|
e.value = {
|
|
856
860
|
...e.value,
|
|
@@ -859,14 +863,14 @@ const ke = {
|
|
|
859
863
|
});
|
|
860
864
|
} else
|
|
861
865
|
e.value = {
|
|
862
|
-
"pem.public_key": (v =
|
|
863
|
-
"pem.private_key": (x =
|
|
866
|
+
"pem.public_key": (v = n == null ? void 0 : n.pem) == null ? void 0 : v.public_key,
|
|
867
|
+
"pem.private_key": (x = n == null ? void 0 : n.pem) == null ? void 0 : x.private_key
|
|
864
868
|
};
|
|
865
869
|
} catch (b) {
|
|
866
870
|
h("fetch:error", b);
|
|
867
871
|
}
|
|
868
872
|
return e;
|
|
869
|
-
}, H =
|
|
873
|
+
}, H = C({
|
|
870
874
|
id: {},
|
|
871
875
|
name: {
|
|
872
876
|
tooltip: j("keys.form.fields.name.tooltip")
|
|
@@ -898,42 +902,42 @@ const ke = {
|
|
|
898
902
|
type: ye.Json
|
|
899
903
|
}
|
|
900
904
|
});
|
|
901
|
-
return (
|
|
905
|
+
return (n, v) => {
|
|
902
906
|
var b, K;
|
|
903
|
-
const x =
|
|
904
|
-
return w(),
|
|
907
|
+
const x = T("KSkeleton");
|
|
908
|
+
return w(), J("div", lt, [
|
|
905
909
|
u(i(Pe), {
|
|
906
910
|
config: o.config,
|
|
907
911
|
"config-card-doc": o.configCardDoc,
|
|
908
912
|
"config-schema": H.value,
|
|
909
913
|
"entity-type": i(Se).Key,
|
|
910
|
-
"fetch-url":
|
|
914
|
+
"fetch-url": q.value,
|
|
911
915
|
"hide-title": o.hideTitle,
|
|
912
|
-
"onFetch:error": v[0] || (v[0] = (m) =>
|
|
913
|
-
"onFetch:success":
|
|
914
|
-
onLoading: v[1] || (v[1] = (m) =>
|
|
916
|
+
"onFetch:error": v[0] || (v[0] = (m) => n.$emit("fetch:error", m)),
|
|
917
|
+
"onFetch:success": G,
|
|
918
|
+
onLoading: v[1] || (v[1] = (m) => n.$emit("loading", m))
|
|
915
919
|
}, Ce({
|
|
916
920
|
set: k(({ row: m }) => [
|
|
917
|
-
|
|
921
|
+
V.value ? (w(), A(x, {
|
|
918
922
|
key: 0,
|
|
919
923
|
"data-testid": "key-set-name-loader",
|
|
920
924
|
type: "spinner"
|
|
921
|
-
})) : m.value && m.value.id ===
|
|
925
|
+
})) : m.value && m.value.id === S.value && P.value ? (w(), A(i(Oe), {
|
|
922
926
|
key: 1,
|
|
923
927
|
item: {
|
|
924
928
|
key: m.value.id,
|
|
925
|
-
value:
|
|
929
|
+
value: P.value,
|
|
926
930
|
type: i(ye).LinkInternal
|
|
927
931
|
},
|
|
928
|
-
onClick: (Z) =>
|
|
929
|
-
}, null, 8, ["item", "onClick"])) : (w(),
|
|
932
|
+
onClick: (Z) => n.$emit("navigation-click", m.value.id, "key-sets")
|
|
933
|
+
}, null, 8, ["item", "onClick"])) : (w(), J("div", it, $("–")))
|
|
930
934
|
]),
|
|
931
935
|
_: 2
|
|
932
936
|
}, [
|
|
933
|
-
(b =
|
|
937
|
+
(b = E.value) != null && b.jwk ? {
|
|
934
938
|
name: "jwk",
|
|
935
939
|
fn: k(() => [
|
|
936
|
-
(w(!0),
|
|
940
|
+
(w(!0), J(me, null, ge(Object.keys(e.value), (m) => (w(), A(i(be), {
|
|
937
941
|
key: m,
|
|
938
942
|
"data-testid": `${m}`,
|
|
939
943
|
item: {
|
|
@@ -945,10 +949,10 @@ const ke = {
|
|
|
945
949
|
]),
|
|
946
950
|
key: "0"
|
|
947
951
|
} : void 0,
|
|
948
|
-
(K =
|
|
952
|
+
(K = E.value) != null && K.pem ? {
|
|
949
953
|
name: "pem",
|
|
950
954
|
fn: k(() => [
|
|
951
|
-
(w(!0),
|
|
955
|
+
(w(!0), J(me, null, ge(Object.keys(e.value), (m) => (w(), A(i(be), {
|
|
952
956
|
key: m,
|
|
953
957
|
"data-testid": `${m}`,
|
|
954
958
|
item: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(w,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vue-router"),require("@kong/icons"),require("@kong-ui-public/i18n"),require("@kong-ui-public/entities-shared")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong/icons","@kong-ui-public/i18n","@kong-ui-public/entities-shared"],e):(w=typeof globalThis<"u"?globalThis:w||self,e(w["kong-ui-public-entities-keys"]={},w.Vue,w.VueRouter,w.KongIcons,w["kong-ui-public-i18n"],w["kong-ui-public-entities-shared"]))})(this,function(w,e,Z,te,v,s){"use strict";const oe={keys:{title:"Keys",list:{toolbar_actions:{new_key:"New Key"},table_headers:{name:"Name",key_id:"Key ID",id:"ID",tags:"Tags"},empty_state:{title:"Configure a New Key",description:"A Key object holds a representation of asymmetric keys in various formats."}},actions:{create:"New Key",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",clear:"Clear",view:"View Details",loading:"Loading..."},search:{placeholder:"Filter by exact name or ID",no_results:"No results found"},delete:{title:"Delete a Key",description:"This action cannot be reversed so make sure to check the key usage before deleting."},errors:{general:"Keys could not be retrieved",delete:"The key could not be deleted at this time.",copy:"Failed to copy to clipboard",key_sets:{fetch:"Could not fetch available key sets",invalid:"Please select a valid key set ID"}},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},form:{sections:{general:{title:"General Information",description:"General information will help identify and manage this key."},keys:{title:"Asymmetric Keys",description:"Choose the preferred format for this asymmetric key. Currently only support PEM and JWK format."}},fields:{id:{label:"Key ID",placeholder:"Enter a key ID",tooltip:"An identifier for a key",help:"If using JWK, need to match with the jwk.kid field"},name:{label:"Name",placeholder:"Enter a unique name for this key",tooltip:"The name to associate with the given key"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."},key_set:{label:"Key Set",placeholder:"Select a key set to add into",footer:"Search by exact ID to find key sets not included in the list"},key_format:{label:"Key Format",options:{jwk:"JWK",pem:"PEM"}},jwk:{label:"JWK",placeholder:"Enter a JWK",tooltip:"A JSON Web key represented as a string"},kid:{label:"Key ID",tooltip:"A unique identifier for a key."},set:{label:"Key Set",tooltip:"The id (an UUID) of the key-set with which to associate the key."},private_key:{label:"Private Key",placeholder:"Enter a private key"},public_key:{label:"Public Key",placeholder:"Enter a public key"}}}}};function le(){const i=v.createI18n("en-us",oe);return{i18n:i,i18nT:v.i18nTComponent(i)}}const z={useI18n:le},B="/v2/control-planes/{controlPlaneId}/core-entities",j="/{workspace}",$={list:{konnect:{all:`${B}/keys`,forKeySet:`${B}/key-sets/{keySetId}/keys`},kongManager:{all:`${j}/keys`,forKeySet:`${j}/key-sets/{keySetId}/keys`}},form:{konnect:{create:{all:`${B}/keys`,forKeySet:`${B}/key-sets/{keySetId}/keys`},edit:{all:`${B}/keys/{id}`,forKeySet:`${B}/key-sets/{keySetId}/keys/{id}`},keySets:`${B}/key-sets`,getKeySet:`${B}/key-sets/{keySetId}`},kongManager:{create:{all:`${j}/keys`,forKeySet:`${j}/key-sets/{keySetId}/keys`},edit:{all:`${j}/keys/{id}`,forKeySet:`${j}/key-sets/{keySetId}/keys/{id}`},keySets:`${j}/key-sets`,getKeySet:`${j}/key-sets/{keySetId}`}}},ie={class:"kong-ui-entities-keys-list"},ae=e.defineComponent({__name:"KeyList",props:{config:{type:Object,required:!0,validator:i=>!(!i||!["konnect","kongManager"].includes(i==null?void 0:i.app)||!i.createRoute||!i.getViewRoute||!i.getEditRoute||i.app==="kongManager"&&!i.isExactMatch&&!i.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(i,{emit:T}){var J;const h=T,l=i,{i18n:{t:y}}=z.useI18n(),d=Z.useRouter(),{axiosInstance:I}=s.useAxios((J=l.config)==null?void 0:J.axiosRequestConfig),E=e.ref(1),A=e.computed(()=>l.config.app!=="kongManager"||!!l.config.disableSorting),V={name:{label:y("keys.list.table_headers.name"),searchable:!0,sortable:!0,hidable:!1},kid:{label:y("keys.list.table_headers.key_id"),sortable:!0},tags:{label:y("keys.list.table_headers.tags")},id:{label:y("keys.list.table_headers.id"),sortable:!0}},t=V,C=e.computed(()=>{var p,o,a,u;let n=`${l.config.apiBaseUrl}${$.list[l.config.app][l.config.keySetId?"forKeySet":"all"]}`;return l.config.app==="konnect"?n=n.replace(/{controlPlaneId}/gi,((p=l.config)==null?void 0:p.controlPlaneId)||"").replace(/{keySetId}/gi,((o=l.config)==null?void 0:o.keySetId)||""):l.config.app==="kongManager"&&(n=n.replace(/\/{workspace}/gi,(a=l.config)!=null&&a.workspace?`/${l.config.workspace}`:"").replace(/{keySetId}/gi,((u=l.config)==null?void 0:u.keySetId)||"")),n}),K=e.ref(""),D=e.computed(()=>{const n=l.config.app==="konnect"||l.config.isExactMatch;if(n)return{isExactMatch:n,placeholder:y("keys.search.placeholder")};const p={name:V.name};return{isExactMatch:n,fields:p,schema:l.config.filterSchema}}),{fetcher:P,fetcherState:U}=s.useFetcher(l.config,C.value),O=()=>{K.value=""},F=()=>{E.value++},c=e.ref(null),g=(n,p)=>{const o=n.id;if(!p(o)){S(n,"id");return}b(n,"id")},x=(n,p)=>{const o=JSON.stringify(n);if(!p(o)){h("copy:error",{entity:n,message:y("keys.errors.copy")});return}h("copy:success",{entity:n,message:y("keys.copy.success_brief")})},b=(n,p)=>{h("copy:success",{entity:n,field:p,message:y("keys.copy.success",{val:n[p]})})},S=(n,p)=>{h("copy:error",{entity:n,field:p,message:y("keys.errors.copy")})},m=async n=>{var o;await((o=l.canRetrieve)==null?void 0:o.call(l,n))&&d.push(l.config.getViewRoute(n.id))},W=n=>({label:y("keys.actions.view"),to:l.config.getViewRoute(n)}),G=n=>({label:y("keys.actions.edit"),to:l.config.getEditRoute(n)}),N=e.ref(void 0),R=e.ref(!1),q=e.ref(!1),L=e.ref(""),Q=s.useDeleteUrlBuilder(l.config,C.value),H=n=>{N.value=n,R.value=!0},X=()=>{R.value=!1},Y=async()=>{var n,p,o;if((n=N.value)!=null&&n.id){q.value=!0;try{await I.delete(Q(N.value.id)),q.value=!1,R.value=!1,E.value++,h("delete:success",N.value)}catch(a){L.value=((o=(p=a.response)==null?void 0:p.data)==null?void 0:o.message)||a.message||y("keys.errors.delete"),h("error",a)}finally{q.value=!1}}};e.watch(U,n=>{var p,o,a;if(n.status===s.FetcherStatus.Error){c.value={title:y("keys.errors.general")},(a=(o=(p=n.error)==null?void 0:p.response)==null?void 0:o.data)!=null&&a.message&&(c.value.message=n.error.response.data.message),h("error",n.error);return}c.value=null});const M=e.ref({ctaPath:l.config.createRoute,ctaText:void 0,message:`${y("keys.list.empty_state.description")}${l.config.additionMessageForEmptyState?` ${l.config.additionMessageForEmptyState}`:""}`,title:y("keys.title")});return e.onBeforeMount(async()=>{await l.canCreate()&&(M.value.title=y("keys.list.empty_state.title"),M.value.ctaText=y("keys.actions.create"))}),(n,p)=>{const o=e.resolveComponent("KButton"),a=e.resolveComponent("KCopy"),u=e.resolveComponent("KDropdownItem"),_=e.resolveComponent("KClipboardProvider");return e.openBlock(),e.createElementBlock("div",ie,[e.createVNode(e.unref(s.EntityBaseTable),{"cache-identifier":i.cacheIdentifier,"disable-sorting":A.value,"empty-state-options":M.value,"enable-entity-actions":"","error-message":c.value,fetcher:e.unref(P),"fetcher-cache-key":E.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-keys-list",query:K.value,"table-headers":e.unref(t),onClearSearchInput:O,"onClick:row":p[1]||(p[1]=f=>m(f)),onSort:F},{"toolbar-filter":e.withCtx(()=>[e.createVNode(e.unref(s.EntityFilter),{modelValue:K.value,"onUpdate:modelValue":p[0]||(p[0]=f=>K.value=f),config:D.value},null,8,["modelValue","config"])]),"toolbar-button":e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!i.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[e.createVNode(e.unref(s.PermissionsWrapper),{"auth-function":()=>i.canCreate()},{default:e.withCtx(()=>[e.createVNode(o,{appearance:"primary","data-testid":"toolbar-add-key",size:i.useActionOutside?"medium":"large",to:i.config.createRoute},{default:e.withCtx(()=>[e.createVNode(e.unref(te.AddIcon)),e.createTextVNode(" "+e.toDisplayString(e.unref(y)("keys.list.toolbar_actions.new_key")),1)]),_:1},8,["size","to"])]),_:1},8,["auth-function"])],8,["disabled"]))]),name:e.withCtx(({rowValue:f})=>[e.createElementVNode("b",null,e.toDisplayString(f??"-"),1)]),kid:e.withCtx(({rowValue:f})=>[e.createVNode(a,{text:f},null,8,["text"])]),tags:e.withCtx(({rowValue:f})=>[e.createVNode(e.unref(s.TableTags),{tags:f},null,8,["tags"])]),id:e.withCtx(({rowValue:f})=>[e.createVNode(a,{text:f,truncate:""},null,8,["text"])]),actions:e.withCtx(({row:f})=>[e.createVNode(_,null,{default:e.withCtx(({copyToClipboard:r})=>[e.createVNode(u,{"data-testid":"action-entity-copy-id",onClick:k=>g(f,r)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y)("keys.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(_,null,{default:e.withCtx(({copyToClipboard:r})=>[e.createVNode(u,{"data-testid":"action-entity-copy-json",onClick:k=>x(f,r)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y)("keys.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(e.unref(s.PermissionsWrapper),{"auth-function":()=>i.canRetrieve(f)},{default:e.withCtx(()=>[e.createVNode(u,{"data-testid":"action-entity-view","has-divider":"",item:W(f.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(s.PermissionsWrapper),{"auth-function":()=>i.canEdit(f)},{default:e.withCtx(()=>[e.createVNode(u,{"data-testid":"action-entity-edit",item:G(f.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(s.PermissionsWrapper),{"auth-function":()=>i.canDelete(f)},{default:e.withCtx(()=>[e.createVNode(u,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:r=>H(f)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y)("keys.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers"]),e.createVNode(e.unref(s.EntityDeleteModal),{"action-pending":q.value,description:e.unref(y)("keys.delete.description"),"entity-name":N.value&&(N.value.name||N.value.id),"entity-type":e.unref(s.EntityTypes).Key,error:L.value,"need-confirm":!1,title:e.unref(y)("keys.delete.title"),visible:R.value,onCancel:X,onProceed:Y},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"])])}}}),ee=(i,T)=>{const h=i.__vccOpts||i;for(const[l,y]of T)h[l]=y;return h},ne=ee(ae,[["__scopeId","data-v-71a855ae"]]),re={class:"kong-ui-entities-keys-form"},se={"data-testid":"no-search-results"},ce={class:"select-item-container"},de={class:"select-item-label"},fe={class:"select-item-description"},ye={key:0,class:"invalid-key-set-message","data-testid":"invalid-key-set-message"},pe={"data-testid":"key-format-container"},ke=ee(e.defineComponent({__name:"KeyForm",props:{config:{type:Object,required:!0,validator:i=>!(!i||!["konnect","kongManager"].includes(i==null?void 0:i.app)||i.app==="konnect"&&!i.controlPlaneId||i.app==="kongManager"&&typeof i.workspace!="string"||!i.cancelRoute)},keyId:{type:String,required:!1,default:""},keySetId:{type:String,required:!1,default:null},fixedKeySetId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(i,{emit:T}){var p;const h=T,l=i,y=Z.useRouter(),{i18n:{t:d}}=z.useI18n(),{getMessageFromError:I}=s.useErrors(),{axiosInstance:E}=s.useAxios((p=l.config)==null?void 0:p.axiosRequestConfig),A=e.computed(()=>l.keySetId?$.form[l.config.app].edit.forKeySet.replace(/{keySetId}/gi,l.keySetId):$.form[l.config.app].edit.all),V=e.computed(()=>l.keyId?s.EntityBaseFormType.Edit:s.EntityBaseFormType.Create),t=e.reactive({fields:{name:"",tags:"",key_id:"",key_format:"jwk",key_set:"",jwk:"",private_key:"",public_key:""},isReadonly:!1,errorMessage:""}),C=e.reactive({name:"",tags:"",key_id:"",key_format:"jwk",key_set:"",jwk:"",private_key:"",public_key:""}),K=[{label:d("keys.form.fields.key_format.options.jwk"),value:"jwk"},{label:d("keys.form.fields.key_format.options.pem"),value:"pem"}],D=e.computed(()=>t.isReadonly||V.value===s.EntityBaseFormType.Create&&!!l.fixedKeySetId),P=e.computed(()=>!D.value);e.watch(()=>l.fixedKeySetId,o=>{V.value===s.EntityBaseFormType.Create&&(t.fields.key_set=o)},{immediate:!0});const U=e.computed(()=>JSON.stringify(t.fields)!==JSON.stringify(C)&&!!t.fields.key_id&&!!t.fields.key_format&&(t.fields.key_format==="jwk"&&!!t.fields.jwk||t.fields.key_format==="pem"&&!!t.fields.private_key&&!!t.fields.public_key)),O=o=>{var a,u,_,f;t.fields.key_id=(o==null?void 0:o.kid)||"",t.fields.name=(o==null?void 0:o.name)||"",t.fields.tags=((a=o==null?void 0:o.tags)==null?void 0:a.join(", "))||"",t.fields.key_set=((u=o==null?void 0:o.set)==null?void 0:u.id)||"",t.fields.key_format=o!=null&&o.pem?"pem":"jwk",t.fields.jwk=(o==null?void 0:o.jwk)||"",t.fields.private_key=((_=o==null?void 0:o.pem)==null?void 0:_.private_key)||"",t.fields.public_key=((f=o==null?void 0:o.pem)==null?void 0:f.public_key)||"",Object.assign(C,t.fields)},F=()=>{y.push(l.config.cancelRoute)},c=e.computed(()=>{var a,u;let o=`${l.config.apiBaseUrl}${$.form[l.config.app][V.value][l.keySetId?"forKeySet":"all"]}`;return l.config.app==="konnect"?o=o.replace(/{controlPlaneId}/gi,((a=l.config)==null?void 0:a.controlPlaneId)||""):l.config.app==="kongManager"&&(o=o.replace(/\/{workspace}/gi,(u=l.config)!=null&&u.workspace?`/${l.config.workspace}`:"")),o=o.replace(/{id}/gi,l.keyId).replace(/{keySetId}/gi,l.keySetId||""),o}),g=e.computed(()=>{var o,a,u;return{kid:t.fields.key_id,name:t.fields.name||null,tags:((u=(a=(o=t.fields.tags)==null?void 0:o.split(","))==null?void 0:a.map(_=>String(_||"").trim()))==null?void 0:u.filter(_=>_!==""))||[],set:t.fields.key_set?{id:t.fields.key_set}:null,jwk:t.fields.key_format==="jwk"?t.fields.jwk:null,pem:t.fields.key_format==="pem"?{private_key:t.fields.private_key,public_key:t.fields.public_key}:null}}),x=async()=>{var o,a,u,_,f;try{t.isReadonly=!0;let r;if(V.value==="create"?r=await E.post(c.value,g.value):V.value==="edit"&&(r=((o=l.config)==null?void 0:o.app)==="konnect"?await E.put(c.value,g.value):await E.patch(c.value,g.value)),r){const{data:k}=r;t.fields.key_id=(k==null?void 0:k.kid)||"",t.fields.name=(k==null?void 0:k.name)||"",t.fields.tags=((a=k==null?void 0:k.tags)==null?void 0:a.join(", "))||"",t.fields.key_set=((u=k==null?void 0:k.set)==null?void 0:u.id)||"",t.fields.key_format=k!=null&&k.pem?"pem":"jwk",t.fields.jwk=(k==null?void 0:k.jwk)||"",t.fields.private_key=((_=k==null?void 0:k.pem)==null?void 0:_.private_key)||"",t.fields.public_key=((f=k==null?void 0:k.pem)==null?void 0:f.public_key)||"",Object.assign(C,t.fields),h("update",r==null?void 0:r.data)}}catch(r){t.errorMessage=I(r),h("error",r)}finally{t.isReadonly=!1}},{debouncedQueryChange:b,loading:S,allRecords:m,error:W,validationError:G,loadItems:N,results:R}=s.useDebouncedFilter(l.config,$.form[l.config.app].keySets,void 0,{fetchedItemsKey:"data",searchKeys:["id","name"]}),q=o=>{(!o||o!==t.fields.key_set&&o!==C.key_set)&&b(o)},L=e.computed(()=>W.value?d("keys.errors.key_sets.fetch"):""),Q=e.computed(()=>G.value?d("keys.errors.key_sets.invalid"):""),H=e.ref(0),X=e.computed(()=>m.value===void 0),Y=e.computed(()=>{if(X.value)return l.config.app==="konnect"?d("keys.form.fields.key_set.footer"):void 0}),M=e.ref(new Set),J=e.computed(()=>Array.from(M.value).map(a=>({name:a.name||"",label:"",value:a.id,selected:t.fields.key_set===a.id}))),n=o=>{M.value.clear();let a;for(a of o)M.value.add(a)};return e.watch(R,o=>{n(o)},{immediate:!0,deep:!0}),e.watch(J,()=>{H.value++},{immediate:!0,deep:!0}),e.onBeforeMount(async()=>{await N()}),(o,a)=>{const u=e.resolveComponent("KInput"),_=e.resolveComponent("KSelect"),f=e.resolveComponent("KTextArea");return e.openBlock(),e.createElementBlock("div",re,[e.createVNode(e.unref(s.EntityBaseForm),{"can-submit":U.value,config:i.config,"edit-id":i.keyId,"entity-type":e.unref(s.SupportedEntityType).Key,"error-message":t.errorMessage||L.value,"fetch-url":A.value,"form-fields":g.value,"is-readonly":t.isReadonly,onCancel:F,"onFetch:error":a[8]||(a[8]=r=>o.$emit("error",r)),"onFetch:success":O,onLoading:a[9]||(a[9]=r=>o.$emit("loading",r)),onSubmit:x},{default:e.withCtx(()=>[e.createVNode(e.unref(s.EntityFormSection),{description:e.unref(d)("keys.form.sections.general.description"),title:e.unref(d)("keys.form.sections.general.title")},{default:e.withCtx(()=>[e.createVNode(u,{modelValue:t.fields.key_id,"onUpdate:modelValue":a[0]||(a[0]=r=>t.fields.key_id=r),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"key-form-id",help:e.unref(d)("keys.form.fields.id.help"),label:e.unref(d)("keys.form.fields.id.label"),"label-attributes":{info:e.unref(d)("keys.form.fields.id.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(d)("keys.form.fields.id.placeholder"),readonly:t.isReadonly,required:"",type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"]),e.createVNode(u,{modelValue:t.fields.name,"onUpdate:modelValue":a[1]||(a[1]=r=>t.fields.name=r),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"key-form-name",label:e.unref(d)("keys.form.fields.name.label"),placeholder:e.unref(d)("keys.form.fields.name.placeholder"),readonly:t.isReadonly,type:"text"},null,8,["modelValue","label","placeholder","readonly"]),e.createVNode(_,{modelValue:t.fields.key_set,"onUpdate:modelValue":a[2]||(a[2]=r=>t.fields.key_set=r),clearable:P.value,"data-testid":"key-form-key-set","dropdown-footer-text":Y.value,"enable-filtering":"","filter-function":()=>!0,items:J.value,label:e.unref(d)("keys.form.fields.key_set.label"),loading:e.unref(S),placeholder:e.unref(d)("keys.form.fields.key_set.placeholder"),readonly:D.value,width:"100%",onQueryChange:q},{loading:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(e.unref(d)("keys.actions.loading")),1)]),empty:e.withCtx(()=>[e.createElementVNode("div",se,e.toDisplayString(e.unref(d)("keys.search.no_results")),1)]),"selected-item-template":e.withCtx(({item:r})=>[e.createElementVNode("div",null,e.toDisplayString(r.name),1)]),"item-template":e.withCtx(({item:r})=>[e.createElementVNode("div",ce,[e.createElementVNode("div",de,e.toDisplayString(r.name),1),e.createElementVNode("div",fe,e.toDisplayString(r.value),1)])]),_:1},8,["modelValue","clearable","dropdown-footer-text","items","label","loading","placeholder","readonly"]),Q.value?(e.openBlock(),e.createElementBlock("p",ye,e.toDisplayString(Q.value),1)):e.createCommentVNode("",!0),e.createVNode(u,{modelValue:t.fields.tags,"onUpdate:modelValue":a[3]||(a[3]=r=>t.fields.tags=r),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"key-form-tags",help:e.unref(d)("keys.form.fields.tags.help"),label:e.unref(d)("keys.form.fields.tags.label"),"label-attributes":{info:e.unref(d)("keys.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(d)("keys.form.fields.tags.placeholder"),readonly:t.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"]),e.createVNode(e.unref(s.EntityFormSection),{description:e.unref(d)("keys.form.sections.keys.description"),"has-divider":"",title:e.unref(d)("keys.form.sections.keys.title")},{default:e.withCtx(()=>[e.createElementVNode("div",pe,[e.createVNode(_,{modelValue:t.fields.key_format,"onUpdate:modelValue":a[4]||(a[4]=r=>t.fields.key_format=r),"data-testid":"key-form-key-format",items:K,label:e.unref(d)("keys.form.fields.key_format.label"),readonly:t.isReadonly,required:"",width:"100%"},null,8,["modelValue","label","readonly"])]),t.fields.key_format==="jwk"?(e.openBlock(),e.createBlock(f,{key:0,modelValue:t.fields.jwk,"onUpdate:modelValue":a[5]||(a[5]=r=>t.fields.jwk=r),modelModifiers:{trim:!0},class:"key-form-textarea","data-testid":"key-form-jwk",label:e.unref(d)("keys.form.fields.jwk.label"),"label-attributes":{info:e.unref(d)("keys.form.fields.jwk.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(d)("keys.form.fields.jwk.placeholder"),readonly:t.isReadonly,required:""},null,8,["modelValue","label","label-attributes","placeholder","readonly"])):e.createCommentVNode("",!0),t.fields.key_format==="pem"?(e.openBlock(),e.createBlock(f,{key:1,modelValue:t.fields.private_key,"onUpdate:modelValue":a[6]||(a[6]=r=>t.fields.private_key=r),modelModifiers:{trim:!0},class:"key-form-textarea","data-testid":"key-form-private-key",label:e.unref(d)("keys.form.fields.private_key.label"),placeholder:e.unref(d)("keys.form.fields.private_key.placeholder"),readonly:t.isReadonly,required:""},null,8,["modelValue","label","placeholder","readonly"])):e.createCommentVNode("",!0),t.fields.key_format==="pem"?(e.openBlock(),e.createBlock(f,{key:2,modelValue:t.fields.public_key,"onUpdate:modelValue":a[7]||(a[7]=r=>t.fields.public_key=r),modelModifiers:{trim:!0},class:"key-form-textarea","data-testid":"key-form-public-key",label:e.unref(d)("keys.form.fields.public_key.label"),placeholder:e.unref(d)("keys.form.fields.public_key.placeholder"),readonly:t.isReadonly,required:""},null,8,["modelValue","label","placeholder","readonly"])):e.createCommentVNode("",!0)]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-9d0b1ebc"]]),me={class:"kong-ui-entities-keys-entity-config-card"},ue={key:2},ge=e.defineComponent({__name:"KeyConfigCard",props:{config:{type:Object,required:!0,validator:i=>!(!i||!["konnect","kongManager"].includes(i==null?void 0:i.app)||i.app==="konnect"&&!i.controlPlaneId||i.app==="kongManager"&&typeof i.workspace!="string"||!i.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1},keySetId:{type:String,default:null}},emits:["loading","fetch:error","fetch:success","navigation-click"],setup(i,{emit:T}){var F;const h=T,l=i,{axiosInstance:y}=s.useAxios((F=l.config)==null?void 0:F.axiosRequestConfig),{convertKeyToTitle:d}=s.useStringHelpers(),{i18n:{t:I}}=z.useI18n(),E=e.computed(()=>l.keySetId?`${$.form[l.config.app].edit.forKeySet}`.replace(/{keySetId}/gi,l.keySetId):$.form[l.config.app].edit.all),A=e.computed(()=>{var c;return(c=$.form[l.config.app])==null?void 0:c.getKeySet}),V=e.ref(),t=e.ref({}),C=e.ref(l.keySetId||""),K=e.ref(""),D=e.ref(!1),P=async c=>{var g;V.value=c,C.value=(g=c==null?void 0:c.set)==null?void 0:g.id,h("fetch:success",c),U(c)};e.watch(C,async()=>{var g,x;if(!C.value)return;let c=`${l.config.apiBaseUrl}${A.value}`;l.config.app==="konnect"?c=c.replace(/{controlPlaneId}/gi,((g=l.config)==null?void 0:g.controlPlaneId)||"").replace(/{keySetId}/gi,C.value||""):l.config.app==="kongManager"&&(c=c.replace(/\/{workspace}/gi,(x=l.config)!=null&&x.workspace?`/${l.config.workspace}`:"").replace(/{keySetId}/gi,C.value||""));try{D.value=!0;const{data:b}=await y.get(c,{validateStatus:S=>S===404||S>=200&&S<300});K.value=(b==null?void 0:b.name)||(b==null?void 0:b.id)}catch(b){h("fetch:error",b)}finally{D.value=!1}},{immediate:!0});const U=c=>{var g,x;try{if(c.jwk){const b=JSON.parse(c.jwk);Object.keys(b).forEach(S=>{t.value={...t.value,[`jwk.${S}`]:b[S]}})}else t.value={"pem.public_key":(g=c==null?void 0:c.pem)==null?void 0:g.public_key,"pem.private_key":(x=c==null?void 0:c.pem)==null?void 0:x.private_key}}catch(b){h("fetch:error",b)}return t},O=e.ref({id:{},name:{tooltip:I("keys.form.fields.name.tooltip")},last_updated:{},created:{},set:{label:I("keys.form.fields.set.label"),section:s.ConfigurationSchemaSection.Basic,tooltip:I("keys.form.fields.set.tooltip"),order:5},kid:{label:I("keys.form.fields.kid.label"),section:s.ConfigurationSchemaSection.Basic,tooltip:I("keys.form.fields.kid.tooltip")},tags:{tooltip:I("keys.form.fields.tags.tooltip")},jwk:{label:I("keys.form.fields.jwk.label"),type:s.ConfigurationSchemaType.Json},pem:{section:s.ConfigurationSchemaSection.Advanced,label:I("keys.form.fields.key_format.options.pem"),type:s.ConfigurationSchemaType.Json}});return(c,g)=>{var b,S;const x=e.resolveComponent("KSkeleton");return e.openBlock(),e.createElementBlock("div",me,[e.createVNode(e.unref(s.EntityBaseConfigCard),{config:i.config,"config-card-doc":i.configCardDoc,"config-schema":O.value,"entity-type":e.unref(s.SupportedEntityType).Key,"fetch-url":E.value,"hide-title":i.hideTitle,"onFetch:error":g[0]||(g[0]=m=>c.$emit("fetch:error",m)),"onFetch:success":P,onLoading:g[1]||(g[1]=m=>c.$emit("loading",m))},e.createSlots({set:e.withCtx(({row:m})=>[D.value?(e.openBlock(),e.createBlock(x,{key:0,"data-testid":"key-set-name-loader",type:"spinner"})):m.value&&m.value.id===C.value&&K.value?(e.openBlock(),e.createBlock(e.unref(s.InternalLinkItem),{key:1,item:{key:m.value.id,value:K.value,type:e.unref(s.ConfigurationSchemaType).LinkInternal},onClick:W=>c.$emit("navigation-click",m.value.id,"key-sets")},null,8,["item","onClick"])):(e.openBlock(),e.createElementBlock("div",ue,e.toDisplayString("–")))]),_:2},[(b=V.value)!=null&&b.jwk?{name:"jwk",fn:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.keys(t.value),m=>(e.openBlock(),e.createBlock(e.unref(s.ConfigCardItem),{key:m,"data-testid":`${m}`,item:{key:m,label:e.unref(d)(m),value:t.value[m]}},null,8,["data-testid","item"]))),128))]),key:"0"}:void 0,(S=V.value)!=null&&S.pem?{name:"pem",fn:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.keys(t.value),m=>(e.openBlock(),e.createBlock(e.unref(s.ConfigCardItem),{key:m,"data-testid":`${m}`,item:{key:m,label:e.unref(d)(m),value:t.value[m]}},null,8,["data-testid","item"]))),128))]),key:"1"}:void 0]),1032,["config","config-card-doc","config-schema","entity-type","fetch-url","hide-title"])])}}});w.KeyConfigCard=ge,w.KeyForm=ke,w.KeyList=ne,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(w,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vue-router"),require("@kong/icons"),require("@kong-ui-public/i18n"),require("@kong-ui-public/entities-shared")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong/icons","@kong-ui-public/i18n","@kong-ui-public/entities-shared"],e):(w=typeof globalThis<"u"?globalThis:w||self,e(w["kong-ui-public-entities-keys"]={},w.Vue,w.VueRouter,w.KongIcons,w["kong-ui-public-i18n"],w["kong-ui-public-entities-shared"]))})(this,function(w,e,Z,te,v,s){"use strict";const oe={keys:{title:"Keys",list:{toolbar_actions:{new_key:"New Key"},table_headers:{name:"Name",key_id:"Key ID",id:"ID",tags:"Tags"},empty_state:{title:"Configure a New Key",description:"A Key object holds a representation of asymmetric keys in various formats."}},actions:{create:"New Key",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",clear:"Clear",view:"View Details",loading:"Loading..."},search:{placeholder:"Filter by exact name or ID",no_results:"No results found"},delete:{title:"Delete a Key",description:"This action cannot be reversed so make sure to check the key usage before deleting."},errors:{general:"Keys could not be retrieved",delete:"The key could not be deleted at this time.",copy:"Failed to copy to clipboard",key_sets:{fetch:"Could not fetch available key sets",invalid:"Please select a valid key set ID"}},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},form:{sections:{general:{title:"General Information",description:"General information will help identify and manage this key."},keys:{title:"Asymmetric Keys",description:"Choose the preferred format for this asymmetric key. Currently only support PEM and JWK format."}},fields:{id:{label:"Key ID",placeholder:"Enter a key ID",tooltip:"An identifier for a key",help:"If using JWK, need to match with the jwk.kid field"},name:{label:"Name",placeholder:"Enter a unique name for this key",tooltip:"The name to associate with the given key"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."},key_set:{label:"Key Set",placeholder:"Select a key set to add into",footer:"Search by exact ID to find key sets not included in the list"},key_format:{label:"Key Format",options:{jwk:"JWK",pem:"PEM"}},jwk:{label:"JWK",placeholder:"Enter a JWK",tooltip:"A JSON Web key represented as a string"},kid:{label:"Key ID",tooltip:"A unique identifier for a key."},set:{label:"Key Set",tooltip:"The id (an UUID) of the key-set with which to associate the key."},private_key:{label:"Private Key",placeholder:"Enter a private key"},public_key:{label:"Public Key",placeholder:"Enter a public key"}}}}};function le(){const i=v.createI18n("en-us",oe);return{i18n:i,i18nT:v.i18nTComponent(i)}}const z={useI18n:le},E="/v2/control-planes/{controlPlaneId}/core-entities",N="/{workspace}",B={list:{konnect:{all:`${E}/keys`,forKeySet:`${E}/key-sets/{keySetId}/keys`},kongManager:{all:`${N}/keys`,forKeySet:`${N}/key-sets/{keySetId}/keys`}},form:{konnect:{create:{all:`${E}/keys`,forKeySet:`${E}/key-sets/{keySetId}/keys`},edit:{all:`${E}/keys/{id}`,forKeySet:`${E}/key-sets/{keySetId}/keys/{id}`},keySets:`${E}/key-sets`,getKeySet:`${E}/key-sets/{keySetId}`},kongManager:{create:{all:`${N}/keys`,forKeySet:`${N}/key-sets/{keySetId}/keys`},edit:{all:`${N}/keys/{id}`,forKeySet:`${N}/key-sets/{keySetId}/keys/{id}`},keySets:`${N}/key-sets`,getKeySet:`${N}/key-sets/{keySetId}`}}},ie={class:"kong-ui-entities-keys-list"},ae=e.defineComponent({__name:"KeyList",props:{config:{type:Object,required:!0,validator:i=>!(!i||!["konnect","kongManager"].includes(i==null?void 0:i.app)||!i.createRoute||!i.getViewRoute||!i.getEditRoute||i.app==="kongManager"&&!i.isExactMatch&&!i.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(i,{emit:$}){var J;const h=$,l=i,{i18n:{t:y}}=z.useI18n(),d=Z.useRouter(),{axiosInstance:I}=s.useAxios((J=l.config)==null?void 0:J.axiosRequestConfig),D=e.computed(()=>l.config.app!=="kongManager"||!!l.config.disableSorting),R={name:{label:y("keys.list.table_headers.name"),searchable:!0,sortable:!0,hidable:!1},kid:{label:y("keys.list.table_headers.key_id"),sortable:!0},tags:{label:y("keys.list.table_headers.tags")},id:{label:y("keys.list.table_headers.id"),sortable:!0}},V=R,t=e.computed(()=>{var p,o,a,u;let n=`${l.config.apiBaseUrl}${B.list[l.config.app][l.config.keySetId?"forKeySet":"all"]}`;return l.config.app==="konnect"?n=n.replace(/{controlPlaneId}/gi,((p=l.config)==null?void 0:p.controlPlaneId)||"").replace(/{keySetId}/gi,((o=l.config)==null?void 0:o.keySetId)||""):l.config.app==="kongManager"&&(n=n.replace(/\/{workspace}/gi,(a=l.config)!=null&&a.workspace?`/${l.config.workspace}`:"").replace(/{keySetId}/gi,((u=l.config)==null?void 0:u.keySetId)||"")),n}),_=e.ref(""),T=e.computed(()=>{const n=l.config.app==="konnect"||l.config.isExactMatch;if(n)return{isExactMatch:n,placeholder:y("keys.search.placeholder")};const p={name:R.name};return{isExactMatch:n,fields:p,schema:l.config.filterSchema}}),{fetcher:j,fetcherState:U,fetcherCacheKey:M}=s.useFetcher({...l.config,cacheIdentifier:l.cacheIdentifier},t.value),O=()=>{_.value=""},q=()=>{M.value++},c=e.ref(null),g=(n,p)=>{const o=n.id;if(!p(o)){S(n,"id");return}b(n,"id")},x=(n,p)=>{const o=JSON.stringify(n);if(!p(o)){h("copy:error",{entity:n,message:y("keys.errors.copy")});return}h("copy:success",{entity:n,message:y("keys.copy.success_brief")})},b=(n,p)=>{h("copy:success",{entity:n,field:p,message:y("keys.copy.success",{val:n[p]})})},S=(n,p)=>{h("copy:error",{entity:n,field:p,message:y("keys.errors.copy")})},m=async n=>{var o;await((o=l.canRetrieve)==null?void 0:o.call(l,n))&&d.push(l.config.getViewRoute(n.id))},W=n=>({label:y("keys.actions.view"),to:l.config.getViewRoute(n)}),G=n=>({label:y("keys.actions.edit"),to:l.config.getEditRoute(n)}),K=e.ref(void 0),A=e.ref(!1),P=e.ref(!1),L=e.ref(""),Q=s.useDeleteUrlBuilder(l.config,t.value),H=n=>{K.value=n,A.value=!0},X=()=>{A.value=!1},Y=async()=>{var n,p,o;if((n=K.value)!=null&&n.id){P.value=!0;try{await I.delete(Q(K.value.id)),P.value=!1,A.value=!1,M.value++,h("delete:success",K.value)}catch(a){L.value=((o=(p=a.response)==null?void 0:p.data)==null?void 0:o.message)||a.message||y("keys.errors.delete"),h("error",a)}finally{P.value=!1}}};e.watch(U,n=>{var p,o,a;if(n.status===s.FetcherStatus.Error){c.value={title:y("keys.errors.general")},(a=(o=(p=n.error)==null?void 0:p.response)==null?void 0:o.data)!=null&&a.message&&(c.value.message=n.error.response.data.message),h("error",n.error);return}c.value=null});const F=e.ref({ctaPath:l.config.createRoute,ctaText:void 0,message:`${y("keys.list.empty_state.description")}${l.config.additionMessageForEmptyState?` ${l.config.additionMessageForEmptyState}`:""}`,title:y("keys.title")});return e.onBeforeMount(async()=>{await l.canCreate()&&(F.value.title=y("keys.list.empty_state.title"),F.value.ctaText=y("keys.actions.create"))}),(n,p)=>{const o=e.resolveComponent("KButton"),a=e.resolveComponent("KCopy"),u=e.resolveComponent("KDropdownItem"),C=e.resolveComponent("KClipboardProvider");return e.openBlock(),e.createElementBlock("div",ie,[e.createVNode(e.unref(s.EntityBaseTable),{"cache-identifier":i.cacheIdentifier,"disable-sorting":D.value,"empty-state-options":F.value,"enable-entity-actions":"","error-message":c.value,fetcher:e.unref(j),"fetcher-cache-key":e.unref(M),"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-keys-list",query:_.value,"table-headers":e.unref(V),onClearSearchInput:O,"onClick:row":p[1]||(p[1]=f=>m(f)),onSort:q},{"toolbar-filter":e.withCtx(()=>[e.createVNode(e.unref(s.EntityFilter),{modelValue:_.value,"onUpdate:modelValue":p[0]||(p[0]=f=>_.value=f),config:T.value},null,8,["modelValue","config"])]),"toolbar-button":e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!i.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[e.createVNode(e.unref(s.PermissionsWrapper),{"auth-function":()=>i.canCreate()},{default:e.withCtx(()=>[e.createVNode(o,{appearance:"primary","data-testid":"toolbar-add-key",size:i.useActionOutside?"medium":"large",to:i.config.createRoute},{default:e.withCtx(()=>[e.createVNode(e.unref(te.AddIcon)),e.createTextVNode(" "+e.toDisplayString(e.unref(y)("keys.list.toolbar_actions.new_key")),1)]),_:1},8,["size","to"])]),_:1},8,["auth-function"])],8,["disabled"]))]),name:e.withCtx(({rowValue:f})=>[e.createElementVNode("b",null,e.toDisplayString(f??"-"),1)]),kid:e.withCtx(({rowValue:f})=>[e.createVNode(a,{text:f},null,8,["text"])]),tags:e.withCtx(({rowValue:f})=>[e.createVNode(e.unref(s.TableTags),{tags:f},null,8,["tags"])]),id:e.withCtx(({rowValue:f})=>[e.createVNode(a,{text:f,truncate:""},null,8,["text"])]),actions:e.withCtx(({row:f})=>[e.createVNode(C,null,{default:e.withCtx(({copyToClipboard:r})=>[e.createVNode(u,{"data-testid":"action-entity-copy-id",onClick:k=>g(f,r)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y)("keys.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(C,null,{default:e.withCtx(({copyToClipboard:r})=>[e.createVNode(u,{"data-testid":"action-entity-copy-json",onClick:k=>x(f,r)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y)("keys.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(e.unref(s.PermissionsWrapper),{"auth-function":()=>i.canRetrieve(f)},{default:e.withCtx(()=>[e.createVNode(u,{"data-testid":"action-entity-view","has-divider":"",item:W(f.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(s.PermissionsWrapper),{"auth-function":()=>i.canEdit(f)},{default:e.withCtx(()=>[e.createVNode(u,{"data-testid":"action-entity-edit",item:G(f.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(s.PermissionsWrapper),{"auth-function":()=>i.canDelete(f)},{default:e.withCtx(()=>[e.createVNode(u,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:r=>H(f)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(y)("keys.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers"]),e.createVNode(e.unref(s.EntityDeleteModal),{"action-pending":P.value,description:e.unref(y)("keys.delete.description"),"entity-name":K.value&&(K.value.name||K.value.id),"entity-type":e.unref(s.EntityTypes).Key,error:L.value,"need-confirm":!1,title:e.unref(y)("keys.delete.title"),visible:A.value,onCancel:X,onProceed:Y},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"])])}}}),ee=(i,$)=>{const h=i.__vccOpts||i;for(const[l,y]of $)h[l]=y;return h},ne=ee(ae,[["__scopeId","data-v-78f37f9c"]]),re={class:"kong-ui-entities-keys-form"},se={"data-testid":"no-search-results"},ce={class:"select-item-container"},de={class:"select-item-label"},fe={class:"select-item-description"},ye={key:0,class:"invalid-key-set-message","data-testid":"invalid-key-set-message"},pe={"data-testid":"key-format-container"},ke=ee(e.defineComponent({__name:"KeyForm",props:{config:{type:Object,required:!0,validator:i=>!(!i||!["konnect","kongManager"].includes(i==null?void 0:i.app)||i.app==="konnect"&&!i.controlPlaneId||i.app==="kongManager"&&typeof i.workspace!="string"||!i.cancelRoute)},keyId:{type:String,required:!1,default:""},keySetId:{type:String,required:!1,default:null},fixedKeySetId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(i,{emit:$}){var p;const h=$,l=i,y=Z.useRouter(),{i18n:{t:d}}=z.useI18n(),{getMessageFromError:I}=s.useErrors(),{axiosInstance:D}=s.useAxios((p=l.config)==null?void 0:p.axiosRequestConfig),R=e.computed(()=>l.keySetId?B.form[l.config.app].edit.forKeySet.replace(/{keySetId}/gi,l.keySetId):B.form[l.config.app].edit.all),V=e.computed(()=>l.keyId?s.EntityBaseFormType.Edit:s.EntityBaseFormType.Create),t=e.reactive({fields:{name:"",tags:"",key_id:"",key_format:"jwk",key_set:"",jwk:"",private_key:"",public_key:""},isReadonly:!1,errorMessage:""}),_=e.reactive({name:"",tags:"",key_id:"",key_format:"jwk",key_set:"",jwk:"",private_key:"",public_key:""}),T=[{label:d("keys.form.fields.key_format.options.jwk"),value:"jwk"},{label:d("keys.form.fields.key_format.options.pem"),value:"pem"}],j=e.computed(()=>t.isReadonly||V.value===s.EntityBaseFormType.Create&&!!l.fixedKeySetId),U=e.computed(()=>!j.value);e.watch(()=>l.fixedKeySetId,o=>{V.value===s.EntityBaseFormType.Create&&(t.fields.key_set=o)},{immediate:!0});const M=e.computed(()=>JSON.stringify(t.fields)!==JSON.stringify(_)&&!!t.fields.key_id&&!!t.fields.key_format&&(t.fields.key_format==="jwk"&&!!t.fields.jwk||t.fields.key_format==="pem"&&!!t.fields.private_key&&!!t.fields.public_key)),O=o=>{var a,u,C,f;t.fields.key_id=(o==null?void 0:o.kid)||"",t.fields.name=(o==null?void 0:o.name)||"",t.fields.tags=((a=o==null?void 0:o.tags)==null?void 0:a.join(", "))||"",t.fields.key_set=((u=o==null?void 0:o.set)==null?void 0:u.id)||"",t.fields.key_format=o!=null&&o.pem?"pem":"jwk",t.fields.jwk=(o==null?void 0:o.jwk)||"",t.fields.private_key=((C=o==null?void 0:o.pem)==null?void 0:C.private_key)||"",t.fields.public_key=((f=o==null?void 0:o.pem)==null?void 0:f.public_key)||"",Object.assign(_,t.fields)},q=()=>{y.push(l.config.cancelRoute)},c=e.computed(()=>{var a,u;let o=`${l.config.apiBaseUrl}${B.form[l.config.app][V.value][l.keySetId?"forKeySet":"all"]}`;return l.config.app==="konnect"?o=o.replace(/{controlPlaneId}/gi,((a=l.config)==null?void 0:a.controlPlaneId)||""):l.config.app==="kongManager"&&(o=o.replace(/\/{workspace}/gi,(u=l.config)!=null&&u.workspace?`/${l.config.workspace}`:"")),o=o.replace(/{id}/gi,l.keyId).replace(/{keySetId}/gi,l.keySetId||""),o}),g=e.computed(()=>{var o,a,u;return{kid:t.fields.key_id,name:t.fields.name||null,tags:((u=(a=(o=t.fields.tags)==null?void 0:o.split(","))==null?void 0:a.map(C=>String(C||"").trim()))==null?void 0:u.filter(C=>C!==""))||[],set:t.fields.key_set?{id:t.fields.key_set}:null,jwk:t.fields.key_format==="jwk"?t.fields.jwk:null,pem:t.fields.key_format==="pem"?{private_key:t.fields.private_key,public_key:t.fields.public_key}:null}}),x=async()=>{var o,a,u,C,f;try{t.isReadonly=!0;let r;if(V.value==="create"?r=await D.post(c.value,g.value):V.value==="edit"&&(r=((o=l.config)==null?void 0:o.app)==="konnect"?await D.put(c.value,g.value):await D.patch(c.value,g.value)),r){const{data:k}=r;t.fields.key_id=(k==null?void 0:k.kid)||"",t.fields.name=(k==null?void 0:k.name)||"",t.fields.tags=((a=k==null?void 0:k.tags)==null?void 0:a.join(", "))||"",t.fields.key_set=((u=k==null?void 0:k.set)==null?void 0:u.id)||"",t.fields.key_format=k!=null&&k.pem?"pem":"jwk",t.fields.jwk=(k==null?void 0:k.jwk)||"",t.fields.private_key=((C=k==null?void 0:k.pem)==null?void 0:C.private_key)||"",t.fields.public_key=((f=k==null?void 0:k.pem)==null?void 0:f.public_key)||"",Object.assign(_,t.fields),h("update",r==null?void 0:r.data)}}catch(r){t.errorMessage=I(r),h("error",r)}finally{t.isReadonly=!1}},{debouncedQueryChange:b,loading:S,allRecords:m,error:W,validationError:G,loadItems:K,results:A}=s.useDebouncedFilter(l.config,B.form[l.config.app].keySets,void 0,{fetchedItemsKey:"data",searchKeys:["id","name"]}),P=o=>{(!o||o!==t.fields.key_set&&o!==_.key_set)&&b(o)},L=e.computed(()=>W.value?d("keys.errors.key_sets.fetch"):""),Q=e.computed(()=>G.value?d("keys.errors.key_sets.invalid"):""),H=e.ref(0),X=e.computed(()=>m.value===void 0),Y=e.computed(()=>{if(X.value)return l.config.app==="konnect"?d("keys.form.fields.key_set.footer"):void 0}),F=e.ref(new Set),J=e.computed(()=>Array.from(F.value).map(a=>({name:a.name||"",label:"",value:a.id,selected:t.fields.key_set===a.id}))),n=o=>{F.value.clear();let a;for(a of o)F.value.add(a)};return e.watch(A,o=>{n(o)},{immediate:!0,deep:!0}),e.watch(J,()=>{H.value++},{immediate:!0,deep:!0}),e.onBeforeMount(async()=>{await K()}),(o,a)=>{const u=e.resolveComponent("KInput"),C=e.resolveComponent("KSelect"),f=e.resolveComponent("KTextArea");return e.openBlock(),e.createElementBlock("div",re,[e.createVNode(e.unref(s.EntityBaseForm),{"can-submit":M.value,config:i.config,"edit-id":i.keyId,"entity-type":e.unref(s.SupportedEntityType).Key,"error-message":t.errorMessage||L.value,"fetch-url":R.value,"form-fields":g.value,"is-readonly":t.isReadonly,onCancel:q,"onFetch:error":a[8]||(a[8]=r=>o.$emit("error",r)),"onFetch:success":O,onLoading:a[9]||(a[9]=r=>o.$emit("loading",r)),onSubmit:x},{default:e.withCtx(()=>[e.createVNode(e.unref(s.EntityFormSection),{description:e.unref(d)("keys.form.sections.general.description"),title:e.unref(d)("keys.form.sections.general.title")},{default:e.withCtx(()=>[e.createVNode(u,{modelValue:t.fields.key_id,"onUpdate:modelValue":a[0]||(a[0]=r=>t.fields.key_id=r),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"key-form-id",help:e.unref(d)("keys.form.fields.id.help"),label:e.unref(d)("keys.form.fields.id.label"),"label-attributes":{info:e.unref(d)("keys.form.fields.id.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(d)("keys.form.fields.id.placeholder"),readonly:t.isReadonly,required:"",type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"]),e.createVNode(u,{modelValue:t.fields.name,"onUpdate:modelValue":a[1]||(a[1]=r=>t.fields.name=r),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"key-form-name",label:e.unref(d)("keys.form.fields.name.label"),placeholder:e.unref(d)("keys.form.fields.name.placeholder"),readonly:t.isReadonly,type:"text"},null,8,["modelValue","label","placeholder","readonly"]),e.createVNode(C,{modelValue:t.fields.key_set,"onUpdate:modelValue":a[2]||(a[2]=r=>t.fields.key_set=r),clearable:U.value,"data-testid":"key-form-key-set","dropdown-footer-text":Y.value,"enable-filtering":"","filter-function":()=>!0,items:J.value,label:e.unref(d)("keys.form.fields.key_set.label"),loading:e.unref(S),placeholder:e.unref(d)("keys.form.fields.key_set.placeholder"),readonly:j.value,width:"100%",onQueryChange:P},{loading:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(e.unref(d)("keys.actions.loading")),1)]),empty:e.withCtx(()=>[e.createElementVNode("div",se,e.toDisplayString(e.unref(d)("keys.search.no_results")),1)]),"selected-item-template":e.withCtx(({item:r})=>[e.createElementVNode("div",null,e.toDisplayString(r.name),1)]),"item-template":e.withCtx(({item:r})=>[e.createElementVNode("div",ce,[e.createElementVNode("div",de,e.toDisplayString(r.name),1),e.createElementVNode("div",fe,e.toDisplayString(r.value),1)])]),_:1},8,["modelValue","clearable","dropdown-footer-text","items","label","loading","placeholder","readonly"]),Q.value?(e.openBlock(),e.createElementBlock("p",ye,e.toDisplayString(Q.value),1)):e.createCommentVNode("",!0),e.createVNode(u,{modelValue:t.fields.tags,"onUpdate:modelValue":a[3]||(a[3]=r=>t.fields.tags=r),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"key-form-tags",help:e.unref(d)("keys.form.fields.tags.help"),label:e.unref(d)("keys.form.fields.tags.label"),"label-attributes":{info:e.unref(d)("keys.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(d)("keys.form.fields.tags.placeholder"),readonly:t.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"]),e.createVNode(e.unref(s.EntityFormSection),{description:e.unref(d)("keys.form.sections.keys.description"),"has-divider":"",title:e.unref(d)("keys.form.sections.keys.title")},{default:e.withCtx(()=>[e.createElementVNode("div",pe,[e.createVNode(C,{modelValue:t.fields.key_format,"onUpdate:modelValue":a[4]||(a[4]=r=>t.fields.key_format=r),"data-testid":"key-form-key-format",items:T,label:e.unref(d)("keys.form.fields.key_format.label"),readonly:t.isReadonly,required:"",width:"100%"},null,8,["modelValue","label","readonly"])]),t.fields.key_format==="jwk"?(e.openBlock(),e.createBlock(f,{key:0,modelValue:t.fields.jwk,"onUpdate:modelValue":a[5]||(a[5]=r=>t.fields.jwk=r),modelModifiers:{trim:!0},class:"key-form-textarea","data-testid":"key-form-jwk",label:e.unref(d)("keys.form.fields.jwk.label"),"label-attributes":{info:e.unref(d)("keys.form.fields.jwk.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:e.unref(d)("keys.form.fields.jwk.placeholder"),readonly:t.isReadonly,required:""},null,8,["modelValue","label","label-attributes","placeholder","readonly"])):e.createCommentVNode("",!0),t.fields.key_format==="pem"?(e.openBlock(),e.createBlock(f,{key:1,modelValue:t.fields.private_key,"onUpdate:modelValue":a[6]||(a[6]=r=>t.fields.private_key=r),modelModifiers:{trim:!0},class:"key-form-textarea","data-testid":"key-form-private-key",label:e.unref(d)("keys.form.fields.private_key.label"),placeholder:e.unref(d)("keys.form.fields.private_key.placeholder"),readonly:t.isReadonly,required:""},null,8,["modelValue","label","placeholder","readonly"])):e.createCommentVNode("",!0),t.fields.key_format==="pem"?(e.openBlock(),e.createBlock(f,{key:2,modelValue:t.fields.public_key,"onUpdate:modelValue":a[7]||(a[7]=r=>t.fields.public_key=r),modelModifiers:{trim:!0},class:"key-form-textarea","data-testid":"key-form-public-key",label:e.unref(d)("keys.form.fields.public_key.label"),placeholder:e.unref(d)("keys.form.fields.public_key.placeholder"),readonly:t.isReadonly,required:""},null,8,["modelValue","label","placeholder","readonly"])):e.createCommentVNode("",!0)]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-9d0b1ebc"]]),me={class:"kong-ui-entities-keys-entity-config-card"},ue={key:2},ge=e.defineComponent({__name:"KeyConfigCard",props:{config:{type:Object,required:!0,validator:i=>!(!i||!["konnect","kongManager"].includes(i==null?void 0:i.app)||i.app==="konnect"&&!i.controlPlaneId||i.app==="kongManager"&&typeof i.workspace!="string"||!i.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1},keySetId:{type:String,default:null}},emits:["loading","fetch:error","fetch:success","navigation-click"],setup(i,{emit:$}){var q;const h=$,l=i,{axiosInstance:y}=s.useAxios((q=l.config)==null?void 0:q.axiosRequestConfig),{convertKeyToTitle:d}=s.useStringHelpers(),{i18n:{t:I}}=z.useI18n(),D=e.computed(()=>l.keySetId?`${B.form[l.config.app].edit.forKeySet}`.replace(/{keySetId}/gi,l.keySetId):B.form[l.config.app].edit.all),R=e.computed(()=>{var c;return(c=B.form[l.config.app])==null?void 0:c.getKeySet}),V=e.ref(),t=e.ref({}),_=e.ref(l.keySetId||""),T=e.ref(""),j=e.ref(!1),U=async c=>{var g;V.value=c,_.value=(g=c==null?void 0:c.set)==null?void 0:g.id,h("fetch:success",c),M(c)};e.watch(_,async()=>{var g,x;if(!_.value)return;let c=`${l.config.apiBaseUrl}${R.value}`;l.config.app==="konnect"?c=c.replace(/{controlPlaneId}/gi,((g=l.config)==null?void 0:g.controlPlaneId)||"").replace(/{keySetId}/gi,_.value||""):l.config.app==="kongManager"&&(c=c.replace(/\/{workspace}/gi,(x=l.config)!=null&&x.workspace?`/${l.config.workspace}`:"").replace(/{keySetId}/gi,_.value||""));try{j.value=!0;const{data:b}=await y.get(c,{validateStatus:S=>S===404||S>=200&&S<300});T.value=(b==null?void 0:b.name)||(b==null?void 0:b.id)}catch(b){h("fetch:error",b)}finally{j.value=!1}},{immediate:!0});const M=c=>{var g,x;try{if(c.jwk){const b=JSON.parse(c.jwk);Object.keys(b).forEach(S=>{t.value={...t.value,[`jwk.${S}`]:b[S]}})}else t.value={"pem.public_key":(g=c==null?void 0:c.pem)==null?void 0:g.public_key,"pem.private_key":(x=c==null?void 0:c.pem)==null?void 0:x.private_key}}catch(b){h("fetch:error",b)}return t},O=e.ref({id:{},name:{tooltip:I("keys.form.fields.name.tooltip")},last_updated:{},created:{},set:{label:I("keys.form.fields.set.label"),section:s.ConfigurationSchemaSection.Basic,tooltip:I("keys.form.fields.set.tooltip"),order:5},kid:{label:I("keys.form.fields.kid.label"),section:s.ConfigurationSchemaSection.Basic,tooltip:I("keys.form.fields.kid.tooltip")},tags:{tooltip:I("keys.form.fields.tags.tooltip")},jwk:{label:I("keys.form.fields.jwk.label"),type:s.ConfigurationSchemaType.Json},pem:{section:s.ConfigurationSchemaSection.Advanced,label:I("keys.form.fields.key_format.options.pem"),type:s.ConfigurationSchemaType.Json}});return(c,g)=>{var b,S;const x=e.resolveComponent("KSkeleton");return e.openBlock(),e.createElementBlock("div",me,[e.createVNode(e.unref(s.EntityBaseConfigCard),{config:i.config,"config-card-doc":i.configCardDoc,"config-schema":O.value,"entity-type":e.unref(s.SupportedEntityType).Key,"fetch-url":D.value,"hide-title":i.hideTitle,"onFetch:error":g[0]||(g[0]=m=>c.$emit("fetch:error",m)),"onFetch:success":U,onLoading:g[1]||(g[1]=m=>c.$emit("loading",m))},e.createSlots({set:e.withCtx(({row:m})=>[j.value?(e.openBlock(),e.createBlock(x,{key:0,"data-testid":"key-set-name-loader",type:"spinner"})):m.value&&m.value.id===_.value&&T.value?(e.openBlock(),e.createBlock(e.unref(s.InternalLinkItem),{key:1,item:{key:m.value.id,value:T.value,type:e.unref(s.ConfigurationSchemaType).LinkInternal},onClick:W=>c.$emit("navigation-click",m.value.id,"key-sets")},null,8,["item","onClick"])):(e.openBlock(),e.createElementBlock("div",ue,e.toDisplayString("–")))]),_:2},[(b=V.value)!=null&&b.jwk?{name:"jwk",fn:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.keys(t.value),m=>(e.openBlock(),e.createBlock(e.unref(s.ConfigCardItem),{key:m,"data-testid":`${m}`,item:{key:m,label:e.unref(d)(m),value:t.value[m]}},null,8,["data-testid","item"]))),128))]),key:"0"}:void 0,(S=V.value)!=null&&S.pem?{name:"pem",fn:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Object.keys(t.value),m=>(e.openBlock(),e.createBlock(e.unref(s.ConfigCardItem),{key:m,"data-testid":`${m}`,item:{key:m,label:e.unref(d)(m),value:t.value[m]}},null,8,["data-testid","item"]))),128))]),key:"1"}:void 0]),1032,["config","config-card-doc","config-schema","entity-type","fetch-url","hide-title"])])}}});w.KeyConfigCard=ge,w.KeyForm=ke,w.KeyList=ne,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.config-card-fieldset[data-v-68ca83ec]{border:solid 1px #e0e4ea;border-radius:4px;margin-bottom:8px;margin-top:4px}.config-card-fieldset-title[data-v-68ca83ec]{font-size:14px;padding:0 8px;width:auto}fieldset.config-card-fieldset .config-card-details-row{width:unset}.config-card-json-item .config-card-details-row,fieldset.config-card-fieldset .config-card-details-row{margin:0 16px}.config-card-json-item .config-card-details-row:last-of-type,fieldset.config-card-fieldset .config-card-details-row:last-of-type{border-bottom:none}[data-v-c96811e5] .k-button.navigation-button{font-size:14px;font-weight:400}.config-card-details-row[data-v-761f7e64]{align-items:center;border-bottom:var(--3ccdd5d2);box-sizing:border-box;display:var(--4b1da305);padding:16px 16px 16px 0;width:100%}.config-card-details-row .config-card-details-label[data-v-761f7e64]{box-sizing:border-box;padding-right:16px;width:var(--cd20788a)}.config-card-details-row .config-card-details-label label[data-v-761f7e64]{color:#3a3f51;display:inline-flex;max-width:100%}.config-card-details-row .config-card-details-label label .label-content[data-v-761f7e64]{line-height:initial;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.config-card-details-row .config-card-details-label label .k-popover[data-v-761f7e64]{min-width:0}.config-card-details-row .config-card-details-value[data-v-761f7e64]{box-sizing:border-box;width:var(--cd1becd4)}.config-card-details-row .config-card-details-value .truncated[data-v-761f7e64]{display:inline-block;line-height:initial;max-width:20ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.config-card-details-row .config-card-details-value span.attrs-data-text[data-v-761f7e64]{overflow-wrap:anywhere}.config-card-details-row .config-card-details-value .copy-uuid-array[data-v-761f7e64] .k-copy:not(:last-of-type){margin-bottom:8px}.config-card-details-row .config-card-details-value .method-badge-array[data-v-761f7e64]{display:flex;flex-wrap:wrap;row-gap:10px}.config-card-details-row .config-badge[data-v-761f7e64]{margin-right:4px}.config-card-details-row[data-v-761f7e64] .k-label{margin-bottom:0}.config-card-details-row[data-v-761f7e64] .k-label .kong-icon-infoFilled{display:flex}.config-card-details-row[data-v-761f7e64] .config-card-details-row{width:auto}.json-content.k-code-block{border-top-left-radius:0;border-top-right-radius:0}.json-endpoint{align-items:baseline;background-color:#000933;border-bottom:1px solid rgba(255,255,255,.2);border-top-left-radius:8px;border-top-right-radius:8px;display:flex;padding:8px 0 8px 12px}.json-endpoint .k-code-block{flex:auto;z-index:2}.json-endpoint .k-code-block .code-block-content{padding-bottom:0;padding-top:0}.json-endpoint .k-code-block .code-block-secondary-actions{margin-top:0!important}.json-endpoint code{direction:rtl;max-width:var(--454fa8c4);overflow:hidden!important;text-align:left;text-overflow:ellipsis;white-space:nowrap}.config-card-prop-section-title[data-v-d15be7fe]{color:#000933;font-size:16px;font-weight:600;margin-bottom:16px;margin-top:48px}.kong-ui-entity-base-config-card .config-card-actions[data-v-7ef5c755]{align-items:center;display:flex}.kong-ui-entity-base-config-card .config-card-actions .config-format-select-label[data-v-7ef5c755]{margin-bottom:0;margin-right:8px}.kong-ui-entity-base-config-card .config-card-prop-section-title[data-v-7ef5c755]{color:#000933;font-size:16px;font-weight:600;margin-bottom:16px;margin-top:48px}.kong-ui-entity-base-config-card[data-v-7ef5c755] .config-card-details-row:last-of-type{border-bottom:none}.kong-ui-entity-base-config-card .book-icon[data-v-7ef5c755]{margin-left:8px;padding:0}.kong-ui-entity-base-form[data-v-6210a67a]{box-sizing:border-box;max-width:1536px;width:100%}.kong-ui-entity-base-form .form-actions[data-v-6210a67a]{align-items:center;display:flex;justify-content:flex-end;margin-top:24px}.kong-ui-entity-base-form .form-actions[data-v-6210a67a] .k-button:last-of-type,.kong-ui-entity-base-form .form-actions[data-v-6210a67a] .k-button:nth-last-of-type(2){margin-left:16px}.kong-ui-entity-base-form[data-v-6210a67a] .k-slideout-title{color:#000933!important;font-size:24px!important;font-weight:700!important;line-height:32px!important;margin-bottom:16px!important}.kong-ui-entity-base-form[data-v-6210a67a] .k-card.content-card{padding:0 16px!important}.kong-ui-entity-base-form[data-v-6210a67a] .tab-item>div.tab-link.has-panels{color:#6c7489!important;font-size:14px!important;font-weight:700!important;line-height:24px!important}.kong-ui-entity-base-form[data-v-6210a67a] .tab-item.active>div.tab-link.has-panels{color:#000933!important;font-weight:600!important}.content-wrapper[data-v-b252463e] .k-tooltip{word-break:break-all}.kong-ui-entity-base-table .toolbar-container[data-v-499e74da]{align-items:center;display:flex;width:100%}.kong-ui-entity-base-table .toolbar-button-container[data-v-499e74da]{margin-left:auto}.kong-ui-entity-base-table :deep(.k-table){table-layout:fixed}.kong-ui-entity-delete-modal .message[data-v-4361d622],.kong-ui-entity-delete-modal .description[data-v-4361d622]{line-height:24px;margin:0}.kong-ui-entity-delete-modal .message strong[data-v-4361d622]{font-weight:600}.kong-ui-entity-delete-modal .description[data-v-4361d622]{margin-top:32px}.kong-ui-entity-delete-error[data-v-4361d622]{margin-bottom:16px}.kong-ui-entity-filter-input[data-v-10fa27a5]{width:100%}.kong-ui-entity-filter-clear[data-v-10fa27a5]{cursor:pointer}.kong-ui-entity-filter[data-v-10fa27a5]{display:flex;position:relative}.kong-ui-entity-filter[data-v-10fa27a5] .menu-content{flex-direction:column}.kong-ui-entity-filter[data-v-10fa27a5] .k-menu-item-divider hr{margin:12px 0}.kong-ui-entity-filter-backdrop[data-v-10fa27a5]{bottom:0;left:0;position:fixed;right:0;top:0;z-index:1050}.kong-ui-entity-filter-menu[data-v-10fa27a5]{background-color:#fff;border:1px solid #afb7c5;border-radius:4px;box-shadow:0 4px 20px #e0e4ea;left:0;margin-top:16px;padding:8px 0 12px;position:absolute;top:100%;width:300px;z-index:1060}.kong-ui-entity-filter-menu-item[data-v-10fa27a5]{border-bottom:1px solid #e0e4ea;color:#6c7489;font-size:12px;font-weight:400;line-height:16px;list-style:none;margin:0 20px;padding:16px 0;position:relative;white-space:nowrap}.menu-item-title[data-v-10fa27a5]{align-items:center;cursor:pointer;display:flex;line-height:24px}.menu-item-title.expanded[data-v-10fa27a5]{color:#232633}.menu-item-expand-icon[data-v-10fa27a5]{margin-left:auto}.menu-item-expand-icon.expanded[data-v-10fa27a5]{transform:rotate(180deg)}.menu-item-indicator[data-v-10fa27a5]{background-color:#0044f4;border-radius:50%;height:4px;margin-left:4px;width:4px}.menu-item-body[data-v-10fa27a5]{align-items:center;display:flex;justify-content:space-between;margin-top:16px}.menu-item-body[data-v-10fa27a5] .input{padding-bottom:4px!important;padding-top:4px!important}.menu-item-body[data-v-10fa27a5] .k-input{width:100%}.menu-item-body[data-v-10fa27a5] .k-select-input .input{font-size:12px}.menu-item-body[data-v-10fa27a5] .k-select-input .input::placeholder{color:#00000073!important;font-size:12px}.menu-item-label[data-v-10fa27a5]{margin-bottom:0;margin-right:12px}.menu-item-buttons[data-v-10fa27a5]{display:flex;justify-content:space-between;margin:10px 0 6px}.filter-clear-button-container[data-v-10fa27a5]{padding:12px 20px 0}fieldset[data-v-b1f74200]{margin:0;min-width:0;padding:0}.kong-ui-entity-form-section[data-v-b1f74200]{border:0}.kong-ui-entity-form-section .form-section-wrapper[data-v-b1f74200]{column-gap:16px;display:flex;flex-direction:column;padding-bottom:64px;row-gap:12px;width:100%}@media (min-width: 1024px){.kong-ui-entity-form-section .form-section-wrapper[data-v-b1f74200]{flex-direction:row}}.kong-ui-entity-form-section .form-section-wrapper .form-section-info[data-v-b1f74200]{flex:1}@media (min-width: 1024px){.kong-ui-entity-form-section .form-section-wrapper .form-section-info[data-v-b1f74200]{max-width:350px}.kong-ui-entity-form-section .form-section-wrapper .form-section-info.sticky[data-v-b1f74200]{height:fit-content;margin-bottom:16px;position:sticky;top:16px}}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-title[data-v-b1f74200]{color:#000933;font-size:16px;font-weight:700;line-height:20px;margin-bottom:8px;margin-top:0}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description[data-v-b1f74200],.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description p[data-v-b1f74200],.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description[data-v-b1f74200] p{color:#000933;font-size:14px;font-weight:400;line-height:20px;margin:0}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-footer[data-v-b1f74200]{margin-top:32px}.kong-ui-entity-form-section .form-section-wrapper .form-section-content[data-v-b1f74200]{flex:1}.kong-ui-entity-form-section .form-section-wrapper .form-section-content[data-v-b1f74200]>*:not(:first-child){margin-top:24px}.kong-ui-entity-form-section.has-divider .form-section-wrapper[data-v-b1f74200]{border-bottom:1px solid #e0e4ea}.kong-ui-public-entity-link[data-v-60e3ef7c]{align-items:center;display:flex}.kong-ui-public-entity-link .deleted-entity[data-v-60e3ef7c]{font-style:italic}.kong-ui-public-entity-link .entity-link[data-v-60e3ef7c]{display:flex}.kong-ui-public-entity-link .entity-link[data-v-60e3ef7c] .external-link-icon{color:#0044f4;margin-left:4px;padding:2px}.kong-ui-public-entity-link .entity-link-label[data-v-60e3ef7c]{display:inline-block;font-weight:400;max-width:20ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kong-ui-public-entity-link .copy-uuid-tooltip[data-v-60e3ef7c]{align-items:center;cursor:pointer;display:flex}.kong-ui-public-entity-link .copy-uuid-tooltip .entity-link-copy-id[data-v-60e3ef7c]{margin-left:2px}.kong-ui-entities-keys-list[data-v-71a855ae]{width:100%}.kong-ui-entities-keys-list .kong-ui-entity-filter-input[data-v-71a855ae]{margin-right:12px}.kong-ui-entities-keys-form[data-v-9d0b1ebc],.kong-ui-entities-keys-form .key-form-textarea[data-v-9d0b1ebc]{width:100%}.kong-ui-entities-keys-form .invalid-key-set-message[data-v-9d0b1ebc]{color:#d60027;font-size:11px;font-weight:500;margin-top:3px!important}.kong-ui-entities-keys-form[data-v-9d0b1ebc] .k-select .custom-selected-item{left:0}.kong-ui-entities-keys-form .select-item-container .select-item-label[data-v-9d0b1ebc]{font-weight:600}.kong-ui-entities-keys-form .select-item-container .select-item-description[data-v-9d0b1ebc]{color:#6c7489;font-size:12px}
|
|
1
|
+
.config-card-fieldset[data-v-68ca83ec]{border:solid 1px #e0e4ea;border-radius:4px;margin-bottom:8px;margin-top:4px}.config-card-fieldset-title[data-v-68ca83ec]{font-size:14px;padding:0 8px;width:auto}fieldset.config-card-fieldset .config-card-details-row{width:unset}.config-card-json-item .config-card-details-row,fieldset.config-card-fieldset .config-card-details-row{margin:0 16px}.config-card-json-item .config-card-details-row:last-of-type,fieldset.config-card-fieldset .config-card-details-row:last-of-type{border-bottom:none}[data-v-c96811e5] .k-button.navigation-button{font-size:14px;font-weight:400}.config-card-details-row[data-v-761f7e64]{align-items:center;border-bottom:var(--3ccdd5d2);box-sizing:border-box;display:var(--4b1da305);padding:16px 16px 16px 0;width:100%}.config-card-details-row .config-card-details-label[data-v-761f7e64]{box-sizing:border-box;padding-right:16px;width:var(--cd20788a)}.config-card-details-row .config-card-details-label label[data-v-761f7e64]{color:#3a3f51;display:inline-flex;max-width:100%}.config-card-details-row .config-card-details-label label .label-content[data-v-761f7e64]{line-height:initial;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.config-card-details-row .config-card-details-label label .k-popover[data-v-761f7e64]{min-width:0}.config-card-details-row .config-card-details-value[data-v-761f7e64]{box-sizing:border-box;width:var(--cd1becd4)}.config-card-details-row .config-card-details-value .truncated[data-v-761f7e64]{display:inline-block;line-height:initial;max-width:20ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.config-card-details-row .config-card-details-value span.attrs-data-text[data-v-761f7e64]{overflow-wrap:anywhere}.config-card-details-row .config-card-details-value .copy-uuid-array[data-v-761f7e64] .k-copy:not(:last-of-type){margin-bottom:8px}.config-card-details-row .config-card-details-value .method-badge-array[data-v-761f7e64]{display:flex;flex-wrap:wrap;row-gap:10px}.config-card-details-row .config-badge[data-v-761f7e64]{margin-right:4px}.config-card-details-row[data-v-761f7e64] .k-label{margin-bottom:0}.config-card-details-row[data-v-761f7e64] .k-label .kong-icon-infoFilled{display:flex}.config-card-details-row[data-v-761f7e64] .config-card-details-row{width:auto}.json-content.k-code-block{border-top-left-radius:0;border-top-right-radius:0}.json-endpoint{align-items:baseline;background-color:#000933;border-bottom:1px solid rgba(255,255,255,.2);border-top-left-radius:8px;border-top-right-radius:8px;display:flex;padding:8px 0 8px 12px}.json-endpoint .k-code-block{flex:auto;z-index:2}.json-endpoint .k-code-block .code-block-content{padding-bottom:0;padding-top:0}.json-endpoint .k-code-block .code-block-secondary-actions{margin-top:0!important}.json-endpoint code{direction:rtl;max-width:var(--454fa8c4);overflow:hidden!important;text-align:left;text-overflow:ellipsis;white-space:nowrap}.config-card-prop-section-title[data-v-d15be7fe]{color:#000933;font-size:16px;font-weight:600;margin-bottom:16px;margin-top:48px}.kong-ui-entity-base-config-card .config-card-actions[data-v-7ef5c755]{align-items:center;display:flex}.kong-ui-entity-base-config-card .config-card-actions .config-format-select-label[data-v-7ef5c755]{margin-bottom:0;margin-right:8px}.kong-ui-entity-base-config-card .config-card-prop-section-title[data-v-7ef5c755]{color:#000933;font-size:16px;font-weight:600;margin-bottom:16px;margin-top:48px}.kong-ui-entity-base-config-card[data-v-7ef5c755] .config-card-details-row:last-of-type{border-bottom:none}.kong-ui-entity-base-config-card .book-icon[data-v-7ef5c755]{margin-left:8px;padding:0}.kong-ui-entity-base-form[data-v-6210a67a]{box-sizing:border-box;max-width:1536px;width:100%}.kong-ui-entity-base-form .form-actions[data-v-6210a67a]{align-items:center;display:flex;justify-content:flex-end;margin-top:24px}.kong-ui-entity-base-form .form-actions[data-v-6210a67a] .k-button:last-of-type,.kong-ui-entity-base-form .form-actions[data-v-6210a67a] .k-button:nth-last-of-type(2){margin-left:16px}.kong-ui-entity-base-form[data-v-6210a67a] .k-slideout-title{color:#000933!important;font-size:24px!important;font-weight:700!important;line-height:32px!important;margin-bottom:16px!important}.kong-ui-entity-base-form[data-v-6210a67a] .k-card.content-card{padding:0 16px!important}.kong-ui-entity-base-form[data-v-6210a67a] .tab-item>div.tab-link.has-panels{color:#6c7489!important;font-size:14px!important;font-weight:700!important;line-height:24px!important}.kong-ui-entity-base-form[data-v-6210a67a] .tab-item.active>div.tab-link.has-panels{color:#000933!important;font-weight:600!important}.content-wrapper[data-v-b252463e] .k-tooltip{word-break:break-all}.kong-ui-entity-base-table .toolbar-container[data-v-6f28b73b]{align-items:center;display:flex;width:100%}.kong-ui-entity-base-table .toolbar-button-container[data-v-6f28b73b]{margin-left:auto}.kong-ui-entity-base-table :deep(.k-table){table-layout:fixed}.kong-ui-entity-delete-modal .message[data-v-4361d622],.kong-ui-entity-delete-modal .description[data-v-4361d622]{line-height:24px;margin:0}.kong-ui-entity-delete-modal .message strong[data-v-4361d622]{font-weight:600}.kong-ui-entity-delete-modal .description[data-v-4361d622]{margin-top:32px}.kong-ui-entity-delete-error[data-v-4361d622]{margin-bottom:16px}.kong-ui-entity-filter-input[data-v-10fa27a5]{width:100%}.kong-ui-entity-filter-clear[data-v-10fa27a5]{cursor:pointer}.kong-ui-entity-filter[data-v-10fa27a5]{display:flex;position:relative}.kong-ui-entity-filter[data-v-10fa27a5] .menu-content{flex-direction:column}.kong-ui-entity-filter[data-v-10fa27a5] .k-menu-item-divider hr{margin:12px 0}.kong-ui-entity-filter-backdrop[data-v-10fa27a5]{bottom:0;left:0;position:fixed;right:0;top:0;z-index:1050}.kong-ui-entity-filter-menu[data-v-10fa27a5]{background-color:#fff;border:1px solid #afb7c5;border-radius:4px;box-shadow:0 4px 20px #e0e4ea;left:0;margin-top:16px;padding:8px 0 12px;position:absolute;top:100%;width:300px;z-index:1060}.kong-ui-entity-filter-menu-item[data-v-10fa27a5]{border-bottom:1px solid #e0e4ea;color:#6c7489;font-size:12px;font-weight:400;line-height:16px;list-style:none;margin:0 20px;padding:16px 0;position:relative;white-space:nowrap}.menu-item-title[data-v-10fa27a5]{align-items:center;cursor:pointer;display:flex;line-height:24px}.menu-item-title.expanded[data-v-10fa27a5]{color:#232633}.menu-item-expand-icon[data-v-10fa27a5]{margin-left:auto}.menu-item-expand-icon.expanded[data-v-10fa27a5]{transform:rotate(180deg)}.menu-item-indicator[data-v-10fa27a5]{background-color:#0044f4;border-radius:50%;height:4px;margin-left:4px;width:4px}.menu-item-body[data-v-10fa27a5]{align-items:center;display:flex;justify-content:space-between;margin-top:16px}.menu-item-body[data-v-10fa27a5] .input{padding-bottom:4px!important;padding-top:4px!important}.menu-item-body[data-v-10fa27a5] .k-input{width:100%}.menu-item-body[data-v-10fa27a5] .k-select-input .input{font-size:12px}.menu-item-body[data-v-10fa27a5] .k-select-input .input::placeholder{color:#00000073!important;font-size:12px}.menu-item-label[data-v-10fa27a5]{margin-bottom:0;margin-right:12px}.menu-item-buttons[data-v-10fa27a5]{display:flex;justify-content:space-between;margin:10px 0 6px}.filter-clear-button-container[data-v-10fa27a5]{padding:12px 20px 0}fieldset[data-v-b1f74200]{margin:0;min-width:0;padding:0}.kong-ui-entity-form-section[data-v-b1f74200]{border:0}.kong-ui-entity-form-section .form-section-wrapper[data-v-b1f74200]{column-gap:16px;display:flex;flex-direction:column;padding-bottom:64px;row-gap:12px;width:100%}@media (min-width: 1024px){.kong-ui-entity-form-section .form-section-wrapper[data-v-b1f74200]{flex-direction:row}}.kong-ui-entity-form-section .form-section-wrapper .form-section-info[data-v-b1f74200]{flex:1}@media (min-width: 1024px){.kong-ui-entity-form-section .form-section-wrapper .form-section-info[data-v-b1f74200]{max-width:350px}.kong-ui-entity-form-section .form-section-wrapper .form-section-info.sticky[data-v-b1f74200]{height:fit-content;margin-bottom:16px;position:sticky;top:16px}}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-title[data-v-b1f74200]{color:#000933;font-size:16px;font-weight:700;line-height:20px;margin-bottom:8px;margin-top:0}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description[data-v-b1f74200],.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description p[data-v-b1f74200],.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-description[data-v-b1f74200] p{color:#000933;font-size:14px;font-weight:400;line-height:20px;margin:0}.kong-ui-entity-form-section .form-section-wrapper .form-section-info .form-section-footer[data-v-b1f74200]{margin-top:32px}.kong-ui-entity-form-section .form-section-wrapper .form-section-content[data-v-b1f74200]{flex:1}.kong-ui-entity-form-section .form-section-wrapper .form-section-content[data-v-b1f74200]>*:not(:first-child){margin-top:24px}.kong-ui-entity-form-section.has-divider .form-section-wrapper[data-v-b1f74200]{border-bottom:1px solid #e0e4ea}.kong-ui-public-entity-link[data-v-60e3ef7c]{align-items:center;display:flex}.kong-ui-public-entity-link .deleted-entity[data-v-60e3ef7c]{font-style:italic}.kong-ui-public-entity-link .entity-link[data-v-60e3ef7c]{display:flex}.kong-ui-public-entity-link .entity-link[data-v-60e3ef7c] .external-link-icon{color:#0044f4;margin-left:4px;padding:2px}.kong-ui-public-entity-link .entity-link-label[data-v-60e3ef7c]{display:inline-block;font-weight:400;max-width:20ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kong-ui-public-entity-link .copy-uuid-tooltip[data-v-60e3ef7c]{align-items:center;cursor:pointer;display:flex}.kong-ui-public-entity-link .copy-uuid-tooltip .entity-link-copy-id[data-v-60e3ef7c]{margin-left:2px}.kong-ui-entities-keys-list[data-v-78f37f9c]{width:100%}.kong-ui-entities-keys-list .kong-ui-entity-filter-input[data-v-78f37f9c]{margin-right:12px}.kong-ui-entities-keys-form[data-v-9d0b1ebc],.kong-ui-entities-keys-form .key-form-textarea[data-v-9d0b1ebc]{width:100%}.kong-ui-entities-keys-form .invalid-key-set-message[data-v-9d0b1ebc]{color:#d60027;font-size:11px;font-weight:500;margin-top:3px!important}.kong-ui-entities-keys-form[data-v-9d0b1ebc] .k-select .custom-selected-item{left:0}.kong-ui-entities-keys-form .select-item-container .select-item-label[data-v-9d0b1ebc]{font-weight:600}.kong-ui-entities-keys-form .select-item-container .select-item-description[data-v-9d0b1ebc]{color:#6c7489;font-size:12px}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyList.vue.d.ts","sourceRoot":"","sources":["../../../src/components/KeyList.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"KeyList.vue.d.ts","sourceRoot":"","sources":["../../../src/components/KeyList.vue"],"names":[],"mappings":"AA0dA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AAEnC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAiBvC,OAAO,KAAK,EACV,wBAAwB,EACxB,oBAAoB,EACpB,SAAS,EACT,gBAAgB,EACjB,MAAM,UAAU,CAAA;AASjB,OAAO,gDAAgD,CAAA;;IAmyBrD,oHAAoH;;cAElG,QAAQ,CAAC,oBAAoB,GAAG,wBAAwB,CAAC;;4BAErD,oBAAoB,GAAG,wBAAwB,KAAG,OAAO;;;;;;IAY/E,yHAAyH;;cAErG,QAAQ,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;;;;IAI9D,2HAA2H;;cAEvG,QAAQ,CAAC,CAAC,GAAG,EAAE,SAAS,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;;;;IAI5E,yHAAyH;;cAErG,QAAQ,CAAC,CAAC,GAAG,EAAE,SAAS,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;;;;IAI5E,4IAA4I;;cAExH,QAAQ,CAAC,CAAC,GAAG,EAAE,SAAS,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;;;;IAI5E,iHAAiH;;;;;;;;;;;IAxCjH,oHAAoH;;cAElG,QAAQ,CAAC,oBAAoB,GAAG,wBAAwB,CAAC;;4BAErD,oBAAoB,GAAG,wBAAwB,KAAG,OAAO;;;;;;IAY/E,yHAAyH;;cAErG,QAAQ,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;;;;IAI9D,2HAA2H;;cAEvG,QAAQ,CAAC,CAAC,GAAG,EAAE,SAAS,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;;;;IAI5E,yHAAyH;;cAErG,QAAQ,CAAC,CAAC,GAAG,EAAE,SAAS,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;;;;IAI5E,4IAA4I;;cAExH,QAAQ,CAAC,CAAC,GAAG,EAAE,SAAS,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;;;;IAI5E,iHAAiH;;;;;;;;;;;;qBAtB9E,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;qBAM1B,SAAS,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;mBAMxC,SAAS,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;uBAMxC,SAAS,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;;;AAhD7E,wBA0DG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kong-ui-public/entities-keys",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.59",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/entities-keys.umd.js",
|
|
6
6
|
"module": "./dist/entities-keys.es.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"axios": "^1.7.7",
|
|
27
27
|
"vue": ">= 3.3.13 < 4",
|
|
28
28
|
"vue-router": "^4.4.5",
|
|
29
|
-
"@kong-ui-public/entities-shared": "^3.10.
|
|
29
|
+
"@kong-ui-public/entities-shared": "^3.10.17",
|
|
30
30
|
"@kong-ui-public/i18n": "^2.2.10"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"axios": "^1.7.7",
|
|
37
37
|
"vue": "^3.5.12",
|
|
38
38
|
"vue-router": "^4.4.5",
|
|
39
|
-
"@kong-ui-public/entities-shared": "^3.10.
|
|
39
|
+
"@kong-ui-public/entities-shared": "^3.10.17",
|
|
40
40
|
"@kong-ui-public/i18n": "^2.2.10"
|
|
41
41
|
},
|
|
42
42
|
"repository": {
|