@kong-ui-public/entities-keys 3.13.40 → 3.14.0
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 +472 -620
- package/dist/entities-keys.umd.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +5 -5
package/dist/entities-keys.es.js
CHANGED
|
@@ -1,191 +1,66 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useRouter as
|
|
3
|
-
import { BookIcon as
|
|
4
|
-
import { createI18n as
|
|
5
|
-
import { useAxios as
|
|
6
|
-
const Ze = {
|
|
7
|
-
|
|
8
|
-
list: {
|
|
9
|
-
toolbar_actions: {
|
|
10
|
-
new_key: "New key"
|
|
11
|
-
},
|
|
12
|
-
table_headers: {
|
|
13
|
-
name: "Name",
|
|
14
|
-
key_id: "Key ID",
|
|
15
|
-
id: "ID",
|
|
16
|
-
tags: "Tags"
|
|
17
|
-
},
|
|
18
|
-
empty_state: {
|
|
19
|
-
title: "Configure a new key",
|
|
20
|
-
description: "A key object holds a representation of asymmetric keys in various formats."
|
|
21
|
-
},
|
|
22
|
-
empty_state_v2: {
|
|
23
|
-
title: "Configure your first key",
|
|
24
|
-
group: "Keys created in gateways within this group will automatically appear here.",
|
|
25
|
-
description: "Keys hold a representation of asymmetric keys that gateways and plugins can use for secure operations.",
|
|
26
|
-
create_cta: "New key",
|
|
27
|
-
learn_more: "Learn more"
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
actions: {
|
|
31
|
-
create: "New key",
|
|
32
|
-
copy_id: "Copy ID",
|
|
33
|
-
copy_json: "Copy JSON",
|
|
34
|
-
edit: "Edit",
|
|
35
|
-
delete: "Delete",
|
|
36
|
-
clear: "Clear",
|
|
37
|
-
view: "View details",
|
|
38
|
-
loading: "Loading..."
|
|
39
|
-
},
|
|
40
|
-
search: {
|
|
41
|
-
placeholder: "Filter by exact name or ID",
|
|
42
|
-
no_results: "No results found"
|
|
43
|
-
},
|
|
44
|
-
delete: {
|
|
45
|
-
title: "Delete a key",
|
|
46
|
-
description: "This action cannot be reversed so make sure to check the key usage before deleting."
|
|
47
|
-
},
|
|
48
|
-
errors: {
|
|
49
|
-
general: "Keys could not be retrieved",
|
|
50
|
-
delete: "The key could not be deleted at this time.",
|
|
51
|
-
copy: "Failed to copy to clipboard",
|
|
52
|
-
key_sets: {
|
|
53
|
-
fetch: "Could not fetch available key sets",
|
|
54
|
-
invalid: "Please select a valid key set ID"
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
copy: {
|
|
58
|
-
success: "Copied {val} to clipboard",
|
|
59
|
-
success_brief: "Successfully copied to clipboard"
|
|
60
|
-
},
|
|
61
|
-
form: {
|
|
62
|
-
sections: {
|
|
63
|
-
general: {
|
|
64
|
-
title: "General information",
|
|
65
|
-
description: "General information will help identify and manage this key."
|
|
66
|
-
},
|
|
67
|
-
keys: {
|
|
68
|
-
title: "Asymmetric keys",
|
|
69
|
-
description: "Choose the preferred format for this asymmetric key. Currently only support PEM and JWK format."
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
fields: {
|
|
73
|
-
id: {
|
|
74
|
-
label: "Key ID",
|
|
75
|
-
placeholder: "Enter a key ID",
|
|
76
|
-
tooltip: "An identifier for a key",
|
|
77
|
-
help: "If using JWK, need to match with the jwk.kid field"
|
|
78
|
-
},
|
|
79
|
-
x5t: {
|
|
80
|
-
label: "X.509 Certificate thumbprint (x5t)",
|
|
81
|
-
placeholder: "Enter the certificate thumbprint that identifies the key to be used to validate JWT signature",
|
|
82
|
-
tooltip: "x5t is a base64url-encoded SHA-1 thumbprint of the DER encoding of X.509 certificate",
|
|
83
|
-
help: "If using x5t, need to match with the jwk.x5t field"
|
|
84
|
-
},
|
|
85
|
-
name: {
|
|
86
|
-
label: "Name",
|
|
87
|
-
placeholder: "Enter a unique name for this key",
|
|
88
|
-
tooltip: "The name to associate with the given key"
|
|
89
|
-
},
|
|
90
|
-
tags: {
|
|
91
|
-
label: "Tags",
|
|
92
|
-
placeholder: "Enter a list of tags separated by comma",
|
|
93
|
-
help: "e.g. tag1, tag2, tag3",
|
|
94
|
-
tooltip: "An optional set of strings for grouping and filtering, separated by commas."
|
|
95
|
-
},
|
|
96
|
-
key_set: {
|
|
97
|
-
label: "Key set",
|
|
98
|
-
placeholder: "Select a key set to add into",
|
|
99
|
-
footer: "Search by exact ID to find key sets not included in the list"
|
|
100
|
-
},
|
|
101
|
-
key_format: {
|
|
102
|
-
label: "Key format",
|
|
103
|
-
options: {
|
|
104
|
-
jwk: "JWK",
|
|
105
|
-
pem: "PEM"
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
jwk: {
|
|
109
|
-
label: "JWK",
|
|
110
|
-
placeholder: "Enter a JWK",
|
|
111
|
-
tooltip: "A JSON Web key represented as a string"
|
|
112
|
-
},
|
|
113
|
-
kid: {
|
|
114
|
-
label: "Key ID",
|
|
115
|
-
tooltip: "A unique identifier for a key."
|
|
116
|
-
},
|
|
117
|
-
set: {
|
|
118
|
-
label: "Key set",
|
|
119
|
-
tooltip: "The id (an UUID) of the key-set with which to associate the key."
|
|
120
|
-
},
|
|
121
|
-
private_key: {
|
|
122
|
-
label: "Private key",
|
|
123
|
-
placeholder: "Enter a private key"
|
|
124
|
-
},
|
|
125
|
-
public_key: {
|
|
126
|
-
label: "Public key",
|
|
127
|
-
placeholder: "Enter a public key"
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}, et = {
|
|
132
|
-
keys: Ze
|
|
1
|
+
import { defineComponent as pe, computed as m, ref as b, watch as Y, onBeforeMount as xe, resolveComponent as j, openBlock as g, createElementBlock as q, createVNode as c, unref as t, createSlots as ke, withCtx as y, createTextVNode as U, toDisplayString as _, createElementVNode as $, createBlock as C, Teleport as Me, createCommentVNode as P, reactive as be, Fragment as _e, renderList as Se } from "vue";
|
|
2
|
+
import { useRouter as $e } from "vue-router";
|
|
3
|
+
import { BookIcon as we, AddIcon as Ie, KeyIcon as De } from "@kong/icons";
|
|
4
|
+
import { createI18n as Fe, i18nTComponent as Te } from "@kong-ui-public/i18n";
|
|
5
|
+
import { useAxios as me, useTableState as Be, useFetcher as Ae, useDeleteUrlBuilder as Ue, FetcherStatus as Pe, EntityBaseTable as qe, PermissionsWrapper as le, TableTags as Oe, EntityFilter as Ne, EntityDeleteModal as Je, EntityTypes as We, useErrors as Le, EntityBaseFormType as X, useDebouncedFilter as He, EntityBaseForm as Qe, SupportedEntityType as je, EntityFormSection as Ce, useStringHelpers as Ge, ConfigurationSchemaType as fe, ConfigurationSchemaSection as ue, EntityBaseConfigCard as ze, InternalLinkItem as Xe, ConfigCardItem as Ke } from "@kong-ui-public/entities-shared";
|
|
6
|
+
const Ye = { 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." }, empty_state_v2: { title: "Configure your first key", group: "Keys created in gateways within this group will automatically appear here.", description: "Keys hold a representation of asymmetric keys that gateways and plugins can use for secure operations.", create_cta: "New key", learn_more: "Learn more" } }, 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" }, x5t: { label: "X.509 Certificate thumbprint (x5t)", placeholder: "Enter the certificate thumbprint that identifies the key to be used to validate JWT signature", tooltip: "x5t is a base64url-encoded SHA-1 thumbprint of the DER encoding of X.509 certificate", help: "If using x5t, need to match with the jwk.x5t 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" } } } }, Ze = {
|
|
7
|
+
keys: Ye
|
|
133
8
|
};
|
|
134
|
-
function
|
|
135
|
-
const
|
|
9
|
+
function et() {
|
|
10
|
+
const l = Fe("en-us", Ze);
|
|
136
11
|
return {
|
|
137
|
-
i18n:
|
|
138
|
-
i18nT:
|
|
12
|
+
i18n: l,
|
|
13
|
+
i18nT: Te(l)
|
|
139
14
|
// Translation component <i18n-t>
|
|
140
15
|
};
|
|
141
16
|
}
|
|
142
|
-
const
|
|
143
|
-
useI18n:
|
|
144
|
-
},
|
|
17
|
+
const ge = {
|
|
18
|
+
useI18n: et
|
|
19
|
+
}, D = "/v2/control-planes/{controlPlaneId}/core-entities/{workspace}", F = "/{workspace}", T = {
|
|
145
20
|
list: {
|
|
146
21
|
konnect: {
|
|
147
|
-
all: `${
|
|
148
|
-
forKeySet: `${
|
|
22
|
+
all: `${D}/keys`,
|
|
23
|
+
forKeySet: `${D}/key-sets/{keySetId}/keys`
|
|
149
24
|
},
|
|
150
25
|
kongManager: {
|
|
151
|
-
all: `${
|
|
152
|
-
forKeySet: `${
|
|
26
|
+
all: `${F}/keys`,
|
|
27
|
+
forKeySet: `${F}/key-sets/{keySetId}/keys`
|
|
153
28
|
}
|
|
154
29
|
},
|
|
155
30
|
form: {
|
|
156
31
|
konnect: {
|
|
157
32
|
create: {
|
|
158
|
-
all: `${
|
|
159
|
-
forKeySet: `${
|
|
33
|
+
all: `${D}/keys`,
|
|
34
|
+
forKeySet: `${D}/key-sets/{keySetId}/keys`
|
|
160
35
|
},
|
|
161
36
|
edit: {
|
|
162
|
-
all: `${
|
|
163
|
-
forKeySet: `${
|
|
37
|
+
all: `${D}/keys/{id}`,
|
|
38
|
+
forKeySet: `${D}/key-sets/{keySetId}/keys/{id}`
|
|
164
39
|
},
|
|
165
|
-
keySets: `${
|
|
166
|
-
getKeySet: `${
|
|
40
|
+
keySets: `${D}/key-sets`,
|
|
41
|
+
getKeySet: `${D}/key-sets/{keySetId}`
|
|
167
42
|
},
|
|
168
43
|
kongManager: {
|
|
169
44
|
create: {
|
|
170
|
-
all: `${
|
|
171
|
-
forKeySet: `${
|
|
45
|
+
all: `${F}/keys`,
|
|
46
|
+
forKeySet: `${F}/key-sets/{keySetId}/keys`
|
|
172
47
|
},
|
|
173
48
|
edit: {
|
|
174
|
-
all: `${
|
|
175
|
-
forKeySet: `${
|
|
49
|
+
all: `${F}/keys/{id}`,
|
|
50
|
+
forKeySet: `${F}/key-sets/{keySetId}/keys/{id}`
|
|
176
51
|
},
|
|
177
|
-
keySets: `${
|
|
178
|
-
getKeySet: `${
|
|
52
|
+
keySets: `${F}/key-sets`,
|
|
53
|
+
getKeySet: `${F}/key-sets/{keySetId}`
|
|
179
54
|
}
|
|
180
55
|
}
|
|
181
|
-
},
|
|
56
|
+
}, tt = { class: "kong-ui-entities-keys-list" }, at = { class: "button-row" }, lt = /* @__PURE__ */ pe({
|
|
182
57
|
__name: "KeyList",
|
|
183
58
|
props: {
|
|
184
59
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
185
60
|
config: {
|
|
186
61
|
type: Object,
|
|
187
62
|
required: !0,
|
|
188
|
-
validator: (
|
|
63
|
+
validator: (l) => !(!l || !["konnect", "kongManager"].includes(l?.app) || !l.createRoute || !l.getViewRoute || !l.getEditRoute || l.app === "kongManager" && !l.isExactMatch && !l.filterSchema)
|
|
189
64
|
},
|
|
190
65
|
// used to override the default identifier for the cache entry
|
|
191
66
|
cacheIdentifier: {
|
|
@@ -223,176 +98,171 @@ const he = {
|
|
|
223
98
|
}
|
|
224
99
|
},
|
|
225
100
|
emits: ["error", "click:learn-more", "copy:success", "copy:error", "delete:success"],
|
|
226
|
-
setup(
|
|
227
|
-
|
|
228
|
-
const _ = q, t = o, { i18n: { t: c } } = he.useI18n(), d = Ee(), { axiosInstance: x } = ve((I = t.config) == null ? void 0 : I.axiosRequestConfig), { hasRecords: O, handleStateChange: z } = Ae(() => R.value), K = h(() => O.value && t.config.app === "konnect"), e = h(() => !!t.config.keySetId), $ = h(() => t.config.app !== "kongManager" || !!t.config.disableSorting), T = {
|
|
101
|
+
setup(l, { emit: B }) {
|
|
102
|
+
const v = B, a = l, { i18n: { t: d } } = ge.useI18n(), n = $e(), { axiosInstance: S } = me(a.config?.axiosRequestConfig), { hasRecords: A, handleStateChange: H } = Be(() => K.value), w = m(() => A.value && a.config.app === "konnect"), e = m(() => !!a.config.keySetId), I = m(() => a.config.app !== "kongManager" || !!a.config.disableSorting), E = {
|
|
229
103
|
// the Name column is non-hidable
|
|
230
|
-
name: { label:
|
|
231
|
-
kid: { label:
|
|
232
|
-
tags: { label:
|
|
233
|
-
id: { label:
|
|
234
|
-
},
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
if (s)
|
|
104
|
+
name: { label: d("keys.list.table_headers.name"), searchable: !0, sortable: !0, hidable: !1 },
|
|
105
|
+
kid: { label: d("keys.list.table_headers.key_id"), sortable: !0 },
|
|
106
|
+
tags: { label: d("keys.list.table_headers.tags") },
|
|
107
|
+
id: { label: d("keys.list.table_headers.id"), sortable: !0 }
|
|
108
|
+
}, V = E, O = m(() => {
|
|
109
|
+
let o = `${a.config.apiBaseUrl}${T.list[a.config.app][a.config.keySetId ? "forKeySet" : "all"]}`;
|
|
110
|
+
return a.config.app === "konnect" && (o = o.replace(/{controlPlaneId}/gi, a.config?.controlPlaneId || "")), o.replace(/\/{workspace}/gi, a.config?.workspace ? `/${a.config.workspace}` : "").replace(/{keySetId}/gi, a.config?.keySetId || "");
|
|
111
|
+
}), K = b(""), Q = m(() => {
|
|
112
|
+
const o = a.config.app === "konnect" || a.config.isExactMatch;
|
|
113
|
+
if (o)
|
|
241
114
|
return {
|
|
242
|
-
isExactMatch:
|
|
243
|
-
placeholder:
|
|
115
|
+
isExactMatch: o,
|
|
116
|
+
placeholder: d("keys.search.placeholder")
|
|
244
117
|
};
|
|
245
|
-
const i = { name:
|
|
118
|
+
const i = { name: E.name };
|
|
246
119
|
return {
|
|
247
|
-
isExactMatch:
|
|
120
|
+
isExactMatch: o,
|
|
248
121
|
fields: i,
|
|
249
|
-
schema:
|
|
122
|
+
schema: a.config.filterSchema
|
|
250
123
|
};
|
|
251
124
|
}), {
|
|
252
|
-
fetcher:
|
|
253
|
-
fetcherState:
|
|
254
|
-
fetcherCacheKey:
|
|
255
|
-
} =
|
|
256
|
-
|
|
257
|
-
},
|
|
258
|
-
|
|
259
|
-
},
|
|
260
|
-
const
|
|
261
|
-
if (!await i(
|
|
262
|
-
|
|
125
|
+
fetcher: u,
|
|
126
|
+
fetcherState: p,
|
|
127
|
+
fetcherCacheKey: h
|
|
128
|
+
} = Ae(m(() => ({ ...a.config, cacheIdentifier: a.cacheIdentifier })), O), f = () => {
|
|
129
|
+
K.value = "";
|
|
130
|
+
}, Z = () => {
|
|
131
|
+
h.value++;
|
|
132
|
+
}, N = b(null), ie = async (o, i) => {
|
|
133
|
+
const M = o.id;
|
|
134
|
+
if (!await i(M)) {
|
|
135
|
+
ne(o, "id");
|
|
263
136
|
return;
|
|
264
137
|
}
|
|
265
|
-
|
|
266
|
-
},
|
|
267
|
-
const
|
|
268
|
-
if (!await i(
|
|
269
|
-
|
|
270
|
-
entity:
|
|
271
|
-
message:
|
|
138
|
+
se(o, "id");
|
|
139
|
+
}, oe = async (o, i) => {
|
|
140
|
+
const M = JSON.stringify(o);
|
|
141
|
+
if (!await i(M)) {
|
|
142
|
+
v("copy:error", {
|
|
143
|
+
entity: o,
|
|
144
|
+
message: d("keys.errors.copy")
|
|
272
145
|
});
|
|
273
146
|
return;
|
|
274
147
|
}
|
|
275
|
-
|
|
276
|
-
entity:
|
|
277
|
-
message:
|
|
148
|
+
v("copy:success", {
|
|
149
|
+
entity: o,
|
|
150
|
+
message: d("keys.copy.success_brief")
|
|
278
151
|
});
|
|
279
|
-
},
|
|
280
|
-
|
|
281
|
-
entity:
|
|
152
|
+
}, se = (o, i) => {
|
|
153
|
+
v("copy:success", {
|
|
154
|
+
entity: o,
|
|
282
155
|
field: i,
|
|
283
|
-
message:
|
|
156
|
+
message: d("keys.copy.success", { val: o[i] })
|
|
284
157
|
});
|
|
285
|
-
},
|
|
286
|
-
|
|
287
|
-
entity:
|
|
158
|
+
}, ne = (o, i) => {
|
|
159
|
+
v("copy:error", {
|
|
160
|
+
entity: o,
|
|
288
161
|
field: i,
|
|
289
|
-
message:
|
|
162
|
+
message: d("keys.errors.copy")
|
|
290
163
|
});
|
|
291
|
-
},
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
if ((s = M.value) != null && s.id) {
|
|
307
|
-
G.value = !0;
|
|
164
|
+
}, re = async (o) => {
|
|
165
|
+
await a.canRetrieve?.(o) && n.push(a.config.getViewRoute(o.id));
|
|
166
|
+
}, de = (o) => ({
|
|
167
|
+
label: d("keys.actions.view"),
|
|
168
|
+
to: a.config.getViewRoute(o)
|
|
169
|
+
}), ce = (o) => ({
|
|
170
|
+
label: d("keys.actions.edit"),
|
|
171
|
+
to: a.config.getEditRoute(o)
|
|
172
|
+
}), x = b(void 0), J = b(!1), W = b(!1), ee = b(""), G = Ue(a.config, O.value), te = (o) => {
|
|
173
|
+
x.value = o, J.value = !0;
|
|
174
|
+
}, ye = () => {
|
|
175
|
+
J.value = !1;
|
|
176
|
+
}, s = async () => {
|
|
177
|
+
if (x.value?.id) {
|
|
178
|
+
W.value = !0;
|
|
308
179
|
try {
|
|
309
|
-
await
|
|
310
|
-
} catch (
|
|
311
|
-
|
|
180
|
+
await S.delete(G(x.value.id)), W.value = !1, J.value = !1, h.value++, v("delete:success", x.value);
|
|
181
|
+
} catch (o) {
|
|
182
|
+
ee.value = o.response?.data?.message || o.message || d("keys.errors.delete"), v("error", o);
|
|
312
183
|
} finally {
|
|
313
|
-
|
|
184
|
+
W.value = !1;
|
|
314
185
|
}
|
|
315
186
|
}
|
|
316
|
-
},
|
|
317
|
-
|
|
187
|
+
}, r = () => {
|
|
188
|
+
n.push(a.config.createRoute);
|
|
318
189
|
};
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
}, (E = (n = (i = s.error) == null ? void 0 : i.response) == null ? void 0 : n.data) != null && E.message && (S.value.message = s.error.response.data.message), _("error", s.error);
|
|
190
|
+
Y(p, (o) => {
|
|
191
|
+
if (o.status === Pe.Error) {
|
|
192
|
+
N.value = {
|
|
193
|
+
title: d("keys.errors.general")
|
|
194
|
+
}, o.error?.response?.data?.message && (N.value.message = o.error.response.data.message), v("error", o.error);
|
|
325
195
|
return;
|
|
326
196
|
}
|
|
327
|
-
|
|
197
|
+
N.value = null;
|
|
328
198
|
});
|
|
329
|
-
const
|
|
330
|
-
ctaPath:
|
|
199
|
+
const R = b({
|
|
200
|
+
ctaPath: a.config.createRoute,
|
|
331
201
|
ctaText: void 0,
|
|
332
|
-
message: `${
|
|
333
|
-
title:
|
|
334
|
-
}),
|
|
335
|
-
return
|
|
336
|
-
|
|
337
|
-
}), (
|
|
338
|
-
const
|
|
339
|
-
return
|
|
340
|
-
|
|
341
|
-
"cache-identifier":
|
|
342
|
-
"disable-sorting":
|
|
343
|
-
"empty-state-options":
|
|
202
|
+
message: `${d("keys.list.empty_state.description")}${a.config.additionMessageForEmptyState ? ` ${a.config.additionMessageForEmptyState}` : ""}`,
|
|
203
|
+
title: d("keys.title")
|
|
204
|
+
}), L = b(!1);
|
|
205
|
+
return xe(async () => {
|
|
206
|
+
L.value = await a.canCreate(), L.value && (R.value.title = d("keys.list.empty_state.title"), R.value.ctaText = d("keys.actions.create"));
|
|
207
|
+
}), (o, i) => {
|
|
208
|
+
const M = j("KButton"), Ve = j("KEmptyState"), ve = j("KCopy"), z = j("KDropdownItem"), he = j("KClipboardProvider");
|
|
209
|
+
return g(), q("div", tt, [
|
|
210
|
+
c(t(qe), {
|
|
211
|
+
"cache-identifier": l.cacheIdentifier,
|
|
212
|
+
"disable-sorting": I.value,
|
|
213
|
+
"empty-state-options": R.value,
|
|
344
214
|
"enable-entity-actions": "",
|
|
345
|
-
"error-message":
|
|
346
|
-
fetcher:
|
|
347
|
-
"fetcher-cache-key":
|
|
215
|
+
"error-message": N.value,
|
|
216
|
+
fetcher: t(u),
|
|
217
|
+
"fetcher-cache-key": t(h),
|
|
348
218
|
"pagination-type": "offset",
|
|
349
219
|
"preferences-storage-key": "kong-ui-entities-keys-list",
|
|
350
|
-
query:
|
|
351
|
-
"table-headers":
|
|
352
|
-
onClearSearchInput:
|
|
353
|
-
"onClick:row": i[3] || (i[3] = (
|
|
354
|
-
onSort:
|
|
355
|
-
onState:
|
|
356
|
-
},
|
|
357
|
-
"toolbar-filter":
|
|
358
|
-
|
|
359
|
-
modelValue:
|
|
360
|
-
"onUpdate:modelValue": i[0] || (i[0] = (
|
|
361
|
-
config:
|
|
220
|
+
query: K.value,
|
|
221
|
+
"table-headers": t(V),
|
|
222
|
+
onClearSearchInput: f,
|
|
223
|
+
"onClick:row": i[3] || (i[3] = (k) => re(k)),
|
|
224
|
+
onSort: Z,
|
|
225
|
+
onState: t(H)
|
|
226
|
+
}, ke({
|
|
227
|
+
"toolbar-filter": y(() => [
|
|
228
|
+
c(t(Ne), {
|
|
229
|
+
modelValue: K.value,
|
|
230
|
+
"onUpdate:modelValue": i[0] || (i[0] = (k) => K.value = k),
|
|
231
|
+
config: Q.value
|
|
362
232
|
}, null, 8, ["modelValue", "config"])
|
|
363
233
|
]),
|
|
364
|
-
"toolbar-button":
|
|
365
|
-
(
|
|
366
|
-
disabled: !
|
|
234
|
+
"toolbar-button": y(() => [
|
|
235
|
+
(g(), C(Me, {
|
|
236
|
+
disabled: !l.useActionOutside,
|
|
367
237
|
to: "#kong-ui-app-page-header-action-button"
|
|
368
238
|
}, [
|
|
369
|
-
|
|
370
|
-
!e.value &&
|
|
239
|
+
$("div", at, [
|
|
240
|
+
!e.value && w.value ? (g(), C(M, {
|
|
371
241
|
key: 0,
|
|
372
242
|
appearance: "secondary",
|
|
373
243
|
class: "open-learning-hub",
|
|
374
244
|
"data-testid": "keys-learn-more-button",
|
|
375
245
|
icon: "",
|
|
376
|
-
onClick: i[1] || (i[1] = (
|
|
246
|
+
onClick: i[1] || (i[1] = (k) => o.$emit("click:learn-more"))
|
|
377
247
|
}, {
|
|
378
|
-
default:
|
|
379
|
-
|
|
248
|
+
default: y(() => [
|
|
249
|
+
c(t(we), { decorative: "" })
|
|
380
250
|
]),
|
|
381
251
|
_: 1
|
|
382
|
-
})) :
|
|
383
|
-
|
|
384
|
-
"auth-function": () =>
|
|
252
|
+
})) : P("", !0),
|
|
253
|
+
c(t(le), {
|
|
254
|
+
"auth-function": () => l.canCreate()
|
|
385
255
|
}, {
|
|
386
|
-
default:
|
|
387
|
-
|
|
256
|
+
default: y(() => [
|
|
257
|
+
c(M, {
|
|
388
258
|
appearance: "primary",
|
|
389
259
|
"data-testid": "toolbar-add-key",
|
|
390
|
-
size:
|
|
391
|
-
to:
|
|
260
|
+
size: l.useActionOutside ? "medium" : "large",
|
|
261
|
+
to: l.config.createRoute
|
|
392
262
|
}, {
|
|
393
|
-
default:
|
|
394
|
-
|
|
395
|
-
|
|
263
|
+
default: y(() => [
|
|
264
|
+
c(t(Ie)),
|
|
265
|
+
U(" " + _(t(d)("keys.list.toolbar_actions.new_key")), 1)
|
|
396
266
|
]),
|
|
397
267
|
_: 1
|
|
398
268
|
}, 8, ["size", "to"])
|
|
@@ -402,85 +272,85 @@ const he = {
|
|
|
402
272
|
])
|
|
403
273
|
], 8, ["disabled"]))
|
|
404
274
|
]),
|
|
405
|
-
name:
|
|
406
|
-
|
|
275
|
+
name: y(({ rowValue: k }) => [
|
|
276
|
+
$("b", null, _(k ?? "-"), 1)
|
|
407
277
|
]),
|
|
408
|
-
kid:
|
|
409
|
-
|
|
278
|
+
kid: y(({ rowValue: k }) => [
|
|
279
|
+
c(ve, { text: k }, null, 8, ["text"])
|
|
410
280
|
]),
|
|
411
|
-
tags:
|
|
412
|
-
|
|
281
|
+
tags: y(({ rowValue: k }) => [
|
|
282
|
+
c(t(Oe), { tags: k }, null, 8, ["tags"])
|
|
413
283
|
]),
|
|
414
|
-
id:
|
|
415
|
-
|
|
416
|
-
text:
|
|
284
|
+
id: y(({ rowValue: k }) => [
|
|
285
|
+
c(ve, {
|
|
286
|
+
text: k,
|
|
417
287
|
truncate: ""
|
|
418
288
|
}, null, 8, ["text"])
|
|
419
289
|
]),
|
|
420
|
-
actions:
|
|
421
|
-
|
|
422
|
-
default:
|
|
423
|
-
|
|
290
|
+
actions: y(({ row: k }) => [
|
|
291
|
+
c(he, null, {
|
|
292
|
+
default: y(({ copyToClipboard: ae }) => [
|
|
293
|
+
c(z, {
|
|
424
294
|
"data-testid": "action-entity-copy-id",
|
|
425
|
-
onClick: (
|
|
295
|
+
onClick: (Re) => ie(k, ae)
|
|
426
296
|
}, {
|
|
427
|
-
default:
|
|
428
|
-
|
|
297
|
+
default: y(() => [
|
|
298
|
+
U(_(t(d)("keys.actions.copy_id")), 1)
|
|
429
299
|
]),
|
|
430
300
|
_: 1
|
|
431
301
|
}, 8, ["onClick"])
|
|
432
302
|
]),
|
|
433
303
|
_: 2
|
|
434
304
|
}, 1024),
|
|
435
|
-
|
|
436
|
-
default:
|
|
437
|
-
|
|
305
|
+
c(he, null, {
|
|
306
|
+
default: y(({ copyToClipboard: ae }) => [
|
|
307
|
+
c(z, {
|
|
438
308
|
"data-testid": "action-entity-copy-json",
|
|
439
|
-
onClick: (
|
|
309
|
+
onClick: (Re) => oe(k, ae)
|
|
440
310
|
}, {
|
|
441
|
-
default:
|
|
442
|
-
|
|
311
|
+
default: y(() => [
|
|
312
|
+
U(_(t(d)("keys.actions.copy_json")), 1)
|
|
443
313
|
]),
|
|
444
314
|
_: 1
|
|
445
315
|
}, 8, ["onClick"])
|
|
446
316
|
]),
|
|
447
317
|
_: 2
|
|
448
318
|
}, 1024),
|
|
449
|
-
|
|
450
|
-
"auth-function": () =>
|
|
319
|
+
c(t(le), {
|
|
320
|
+
"auth-function": () => l.canRetrieve(k)
|
|
451
321
|
}, {
|
|
452
|
-
default:
|
|
453
|
-
|
|
322
|
+
default: y(() => [
|
|
323
|
+
c(z, {
|
|
454
324
|
"data-testid": "action-entity-view",
|
|
455
325
|
"has-divider": "",
|
|
456
|
-
item:
|
|
326
|
+
item: de(k.id)
|
|
457
327
|
}, null, 8, ["item"])
|
|
458
328
|
]),
|
|
459
329
|
_: 2
|
|
460
330
|
}, 1032, ["auth-function"]),
|
|
461
|
-
|
|
462
|
-
"auth-function": () =>
|
|
331
|
+
c(t(le), {
|
|
332
|
+
"auth-function": () => l.canEdit(k)
|
|
463
333
|
}, {
|
|
464
|
-
default:
|
|
465
|
-
|
|
334
|
+
default: y(() => [
|
|
335
|
+
c(z, {
|
|
466
336
|
"data-testid": "action-entity-edit",
|
|
467
|
-
item:
|
|
337
|
+
item: ce(k.id)
|
|
468
338
|
}, null, 8, ["item"])
|
|
469
339
|
]),
|
|
470
340
|
_: 2
|
|
471
341
|
}, 1032, ["auth-function"]),
|
|
472
|
-
|
|
473
|
-
"auth-function": () =>
|
|
342
|
+
c(t(le), {
|
|
343
|
+
"auth-function": () => l.canDelete(k)
|
|
474
344
|
}, {
|
|
475
|
-
default:
|
|
476
|
-
|
|
345
|
+
default: y(() => [
|
|
346
|
+
c(z, {
|
|
477
347
|
danger: "",
|
|
478
348
|
"data-testid": "action-entity-delete",
|
|
479
349
|
"has-divider": "",
|
|
480
|
-
onClick: (
|
|
350
|
+
onClick: (ae) => te(k)
|
|
481
351
|
}, {
|
|
482
|
-
default:
|
|
483
|
-
|
|
352
|
+
default: y(() => [
|
|
353
|
+
U(_(t(d)("keys.actions.delete")), 1)
|
|
484
354
|
]),
|
|
485
355
|
_: 1
|
|
486
356
|
}, 8, ["onClick"])
|
|
@@ -490,90 +360,87 @@ const he = {
|
|
|
490
360
|
]),
|
|
491
361
|
_: 2
|
|
492
362
|
}, [
|
|
493
|
-
!
|
|
363
|
+
!K.value && l.config.app === "konnect" ? {
|
|
494
364
|
name: "empty-state",
|
|
495
|
-
fn:
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
u(l(xe), { decorative: "" }),
|
|
515
|
-
N(" " + C(l(c)("keys.list.empty_state_v2.create_cta")), 1)
|
|
516
|
-
]),
|
|
517
|
-
_: 1
|
|
518
|
-
})) : J("", !0),
|
|
519
|
-
u(n, {
|
|
520
|
-
appearance: "secondary",
|
|
521
|
-
"data-testid": "entity-learn-more-button",
|
|
522
|
-
onClick: i[2] || (i[2] = (ee) => s.$emit("click:learn-more"))
|
|
523
|
-
}, {
|
|
524
|
-
default: f(() => [
|
|
525
|
-
u(l(Ce), { decorative: "" }),
|
|
526
|
-
N(" " + C(l(c)("keys.list.empty_state_v2.learn_more")), 1)
|
|
527
|
-
]),
|
|
528
|
-
_: 1
|
|
529
|
-
})
|
|
530
|
-
]),
|
|
531
|
-
_: 2
|
|
532
|
-
}, [
|
|
533
|
-
(p = o.config) != null && p.isControlPlaneGroup ? {
|
|
534
|
-
name: "default",
|
|
535
|
-
fn: f(() => [
|
|
536
|
-
N(C(l(c)("keys.list.empty_state_v2.group")), 1)
|
|
365
|
+
fn: y(() => [
|
|
366
|
+
c(Ve, {
|
|
367
|
+
"data-testid": l.config.keySetId ? "nested-keys-entity-empty-state" : "keys-entity-empty-state",
|
|
368
|
+
"icon-background": "",
|
|
369
|
+
message: t(d)("keys.list.empty_state_v2.description"),
|
|
370
|
+
title: t(d)("keys.list.empty_state_v2.title")
|
|
371
|
+
}, ke({
|
|
372
|
+
icon: y(() => [
|
|
373
|
+
c(t(De), { decorative: "" })
|
|
374
|
+
]),
|
|
375
|
+
action: y(() => [
|
|
376
|
+
L.value ? (g(), C(M, {
|
|
377
|
+
key: 0,
|
|
378
|
+
"data-testid": "entity-create-button",
|
|
379
|
+
onClick: r
|
|
380
|
+
}, {
|
|
381
|
+
default: y(() => [
|
|
382
|
+
c(t(Ie), { decorative: "" }),
|
|
383
|
+
U(" " + _(t(d)("keys.list.empty_state_v2.create_cta")), 1)
|
|
537
384
|
]),
|
|
538
|
-
|
|
539
|
-
} :
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
385
|
+
_: 1
|
|
386
|
+
})) : P("", !0),
|
|
387
|
+
c(M, {
|
|
388
|
+
appearance: "secondary",
|
|
389
|
+
"data-testid": "entity-learn-more-button",
|
|
390
|
+
onClick: i[2] || (i[2] = (k) => o.$emit("click:learn-more"))
|
|
391
|
+
}, {
|
|
392
|
+
default: y(() => [
|
|
393
|
+
c(t(we), { decorative: "" }),
|
|
394
|
+
U(" " + _(t(d)("keys.list.empty_state_v2.learn_more")), 1)
|
|
395
|
+
]),
|
|
396
|
+
_: 1
|
|
397
|
+
})
|
|
398
|
+
]),
|
|
399
|
+
_: 2
|
|
400
|
+
}, [
|
|
401
|
+
l.config?.isControlPlaneGroup ? {
|
|
402
|
+
name: "default",
|
|
403
|
+
fn: y(() => [
|
|
404
|
+
U(_(t(d)("keys.list.empty_state_v2.group")), 1)
|
|
405
|
+
]),
|
|
406
|
+
key: "0"
|
|
407
|
+
} : void 0
|
|
408
|
+
]), 1032, ["data-testid", "message", "title"])
|
|
409
|
+
]),
|
|
543
410
|
key: "0"
|
|
544
411
|
} : void 0
|
|
545
412
|
]), 1032, ["cache-identifier", "disable-sorting", "empty-state-options", "error-message", "fetcher", "fetcher-cache-key", "query", "table-headers", "onState"]),
|
|
546
|
-
|
|
547
|
-
"action-pending":
|
|
548
|
-
description:
|
|
549
|
-
"entity-name":
|
|
550
|
-
"entity-type":
|
|
551
|
-
error:
|
|
552
|
-
title:
|
|
553
|
-
visible:
|
|
554
|
-
onCancel:
|
|
555
|
-
onProceed:
|
|
413
|
+
c(t(Je), {
|
|
414
|
+
"action-pending": W.value,
|
|
415
|
+
description: t(d)("keys.delete.description"),
|
|
416
|
+
"entity-name": x.value && (x.value.name || x.value.id),
|
|
417
|
+
"entity-type": t(We).Key,
|
|
418
|
+
error: ee.value,
|
|
419
|
+
title: t(d)("keys.delete.title"),
|
|
420
|
+
visible: J.value,
|
|
421
|
+
onCancel: ye,
|
|
422
|
+
onProceed: s
|
|
556
423
|
}, null, 8, ["action-pending", "description", "entity-name", "entity-type", "error", "title", "visible"])
|
|
557
424
|
]);
|
|
558
425
|
};
|
|
559
426
|
}
|
|
560
|
-
}),
|
|
561
|
-
const
|
|
562
|
-
for (const [
|
|
563
|
-
|
|
564
|
-
return
|
|
565
|
-
},
|
|
427
|
+
}), Ee = (l, B) => {
|
|
428
|
+
const v = l.__vccOpts || l;
|
|
429
|
+
for (const [a, d] of B)
|
|
430
|
+
v[a] = d;
|
|
431
|
+
return v;
|
|
432
|
+
}, ht = /* @__PURE__ */ Ee(lt, [["__scopeId", "data-v-8e1e850e"]]), it = { class: "kong-ui-entities-keys-form" }, ot = { "data-testid": "no-search-results" }, st = { class: "select-item-container" }, nt = { class: "select-item-label" }, rt = { class: "select-item-description" }, dt = {
|
|
566
433
|
key: 1,
|
|
567
434
|
class: "invalid-key-set-message",
|
|
568
435
|
"data-testid": "invalid-key-set-message"
|
|
569
|
-
},
|
|
436
|
+
}, ct = { "data-testid": "key-format-container" }, yt = /* @__PURE__ */ pe({
|
|
570
437
|
__name: "KeyForm",
|
|
571
438
|
props: {
|
|
572
439
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
573
440
|
config: {
|
|
574
441
|
type: Object,
|
|
575
442
|
required: !0,
|
|
576
|
-
validator: (
|
|
443
|
+
validator: (l) => !(!l || !["konnect", "kongManager"].includes(l?.app) || l.app === "konnect" && !l.controlPlaneId || l.app === "kongManager" && typeof l.workspace != "string" || !l.cancelRoute)
|
|
577
444
|
},
|
|
578
445
|
/** If a valid Key ID is provided, it will put the form in Edit mode instead of Create */
|
|
579
446
|
keyId: {
|
|
@@ -601,9 +468,8 @@ const he = {
|
|
|
601
468
|
}
|
|
602
469
|
},
|
|
603
470
|
emits: ["update", "error", "loading"],
|
|
604
|
-
setup(
|
|
605
|
-
|
|
606
|
-
const _ = q, t = o, c = Ee(), { i18n: { t: d } } = he.useI18n(), { getMessageFromError: x } = He(), { axiosInstance: O } = ve((se = t.config) == null ? void 0 : se.axiosRequestConfig), z = h(() => t.keySetId ? P.form[t.config.app].edit.forKeySet.replace(/{keySetId}/gi, t.keySetId) : P.form[t.config.app].edit.all), K = h(() => t.keyId ? te.Edit : te.Create), e = Se({
|
|
471
|
+
setup(l, { emit: B }) {
|
|
472
|
+
const v = B, a = l, d = $e(), { i18n: { t: n } } = ge.useI18n(), { getMessageFromError: S } = Le(), { axiosInstance: A } = me(a.config?.axiosRequestConfig), H = m(() => a.keySetId ? T.form[a.config.app].edit.forKeySet.replace(/{keySetId}/gi, a.keySetId) : T.form[a.config.app].edit.all), w = m(() => a.keyId ? X.Edit : X.Create), e = be({
|
|
607
473
|
fields: {
|
|
608
474
|
/**
|
|
609
475
|
* Generates a unique key name using the current timestamp.
|
|
@@ -611,7 +477,7 @@ const he = {
|
|
|
611
477
|
*
|
|
612
478
|
* Example output: "new-key-20250307123045789"
|
|
613
479
|
*/
|
|
614
|
-
name:
|
|
480
|
+
name: w.value === X.Create ? `new-key-${(/* @__PURE__ */ new Date()).toISOString().replace(/\D/g, "").slice(0, 17)}` : "",
|
|
615
481
|
tags: "",
|
|
616
482
|
key_id: "",
|
|
617
483
|
key_format: "jwk",
|
|
@@ -619,11 +485,11 @@ const he = {
|
|
|
619
485
|
jwk: "",
|
|
620
486
|
private_key: "",
|
|
621
487
|
public_key: "",
|
|
622
|
-
...
|
|
488
|
+
...a.showx5t ? { x5t: "" } : {}
|
|
623
489
|
},
|
|
624
490
|
isReadonly: !1,
|
|
625
491
|
errorMessage: ""
|
|
626
|
-
}),
|
|
492
|
+
}), I = be({
|
|
627
493
|
name: "",
|
|
628
494
|
tags: "",
|
|
629
495
|
key_id: "",
|
|
@@ -632,229 +498,223 @@ const he = {
|
|
|
632
498
|
jwk: "",
|
|
633
499
|
private_key: "",
|
|
634
500
|
public_key: ""
|
|
635
|
-
}),
|
|
501
|
+
}), E = [
|
|
636
502
|
{
|
|
637
|
-
label:
|
|
503
|
+
label: n("keys.form.fields.key_format.options.jwk"),
|
|
638
504
|
value: "jwk"
|
|
639
505
|
},
|
|
640
506
|
{
|
|
641
|
-
label:
|
|
507
|
+
label: n("keys.form.fields.key_format.options.pem"),
|
|
642
508
|
value: "pem"
|
|
643
509
|
}
|
|
644
|
-
],
|
|
645
|
-
|
|
646
|
-
|
|
510
|
+
], V = m(() => e.isReadonly || w.value === X.Create && !!a.fixedKeySetId), O = m(() => !V.value);
|
|
511
|
+
Y(() => a.fixedKeySetId, (s) => {
|
|
512
|
+
w.value === X.Create && (e.fields.key_set = s ?? "");
|
|
647
513
|
}, { immediate: !0 });
|
|
648
|
-
const
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
set: e.fields.key_set ? { id: e.fields.key_set } : null,
|
|
665
|
-
jwk: e.fields.key_format === "jwk" ? e.fields.jwk : null,
|
|
666
|
-
pem: e.fields.key_format === "pem" ? { private_key: e.fields.private_key, public_key: e.fields.public_key } : null
|
|
667
|
-
};
|
|
668
|
-
}), j = async () => {
|
|
669
|
-
var a, r, v, I, s;
|
|
514
|
+
const K = m(() => JSON.stringify(e.fields) !== JSON.stringify(I) && !!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)), Q = (s) => {
|
|
515
|
+
e.fields.key_id = s?.kid || "", e.fields.name = s?.name || "", e.fields.tags = s?.tags?.join(", ") || "", e.fields.key_set = s?.set?.id || "", e.fields.key_format = s?.pem ? "pem" : "jwk", e.fields.jwk = s?.jwk || "", e.fields.private_key = s?.pem?.private_key || "", e.fields.public_key = s?.pem?.public_key || "", a.showx5t && (e.fields.x5t = s?.x5t || ""), Object.assign(I, e.fields);
|
|
516
|
+
}, u = () => {
|
|
517
|
+
d.push(a.config.cancelRoute);
|
|
518
|
+
}, p = m(() => {
|
|
519
|
+
let s = `${a.config.apiBaseUrl}${T.form[a.config.app][w.value][a.keySetId ? "forKeySet" : "all"]}`;
|
|
520
|
+
return a.config.app === "konnect" && (s = s.replace(/{controlPlaneId}/gi, a.config?.controlPlaneId || "")), s.replace(/\/{workspace}/gi, a.config?.workspace ? `/${a.config.workspace}` : "").replace(/{id}/gi, a.keyId ?? "").replace(/{keySetId}/gi, a.keySetId || "");
|
|
521
|
+
}), h = m(() => ({
|
|
522
|
+
kid: e.fields.key_id,
|
|
523
|
+
...a.showx5t ? { x5t: e.fields.x5t || null } : {},
|
|
524
|
+
name: e.fields.name || null,
|
|
525
|
+
tags: e.fields.tags?.split(",")?.map((s) => String(s || "").trim())?.filter((s) => s !== "") || [],
|
|
526
|
+
set: e.fields.key_set ? { id: e.fields.key_set } : null,
|
|
527
|
+
jwk: e.fields.key_format === "jwk" ? e.fields.jwk : null,
|
|
528
|
+
pem: e.fields.key_format === "pem" ? { private_key: e.fields.private_key, public_key: e.fields.public_key } : null
|
|
529
|
+
})), f = async () => {
|
|
670
530
|
try {
|
|
671
531
|
e.isReadonly = !0;
|
|
672
|
-
let
|
|
673
|
-
if (
|
|
674
|
-
const { data:
|
|
675
|
-
e.fields.key_id =
|
|
532
|
+
let s;
|
|
533
|
+
if (w.value === "create" ? s = await A.post(p.value, h.value) : w.value === "edit" && (s = a.config?.app === "konnect" ? await A.put(p.value, h.value) : await A.patch(p.value, h.value)), s) {
|
|
534
|
+
const { data: r } = s;
|
|
535
|
+
e.fields.key_id = r?.kid || "", e.fields.name = r?.name || "", e.fields.tags = r?.tags?.join(", ") || "", e.fields.key_set = r?.set?.id || "", e.fields.key_format = r?.pem ? "pem" : "jwk", e.fields.jwk = r?.jwk || "", e.fields.private_key = r?.pem?.private_key || "", e.fields.public_key = r?.pem?.public_key || "", a.showx5t && (e.fields.x5t = r?.x5t || ""), Object.assign(I, e.fields), v("update", s?.data);
|
|
676
536
|
}
|
|
677
|
-
} catch (
|
|
678
|
-
e.errorMessage =
|
|
537
|
+
} catch (s) {
|
|
538
|
+
e.errorMessage = S(s), v("error", s);
|
|
679
539
|
} finally {
|
|
680
540
|
e.isReadonly = !1;
|
|
681
541
|
}
|
|
682
542
|
}, {
|
|
683
|
-
debouncedQueryChange:
|
|
684
|
-
loading:
|
|
685
|
-
allRecords:
|
|
686
|
-
error:
|
|
687
|
-
validationError:
|
|
688
|
-
loadItems:
|
|
689
|
-
results:
|
|
690
|
-
} =
|
|
543
|
+
debouncedQueryChange: Z,
|
|
544
|
+
loading: N,
|
|
545
|
+
allRecords: ie,
|
|
546
|
+
error: oe,
|
|
547
|
+
validationError: se,
|
|
548
|
+
loadItems: ne,
|
|
549
|
+
results: re
|
|
550
|
+
} = He(a.config, T.form[a.config.app].keySets, void 0, {
|
|
691
551
|
fetchedItemsKey: "data",
|
|
692
552
|
searchKeys: ["id", "name"]
|
|
693
|
-
}),
|
|
694
|
-
(!
|
|
695
|
-
},
|
|
696
|
-
if (
|
|
697
|
-
return
|
|
698
|
-
}),
|
|
553
|
+
}), de = (s) => {
|
|
554
|
+
(!s || s !== e.fields.key_set && s !== I.key_set) && Z(s);
|
|
555
|
+
}, ce = m(() => oe.value ? n("keys.errors.key_sets.fetch") : ""), x = m(() => se.value ? n("keys.errors.key_sets.invalid") : ""), J = b(0), W = m(() => ie.value === void 0), ee = m(() => {
|
|
556
|
+
if (W.value)
|
|
557
|
+
return a.config.app === "konnect" ? n("keys.form.fields.key_set.footer") : void 0;
|
|
558
|
+
}), G = b(/* @__PURE__ */ new Set()), te = m(() => Array.from(G.value).map((r) => ({
|
|
699
559
|
name: r.name || "",
|
|
700
560
|
// can't use name for label or it tries to search => 404
|
|
701
561
|
label: "",
|
|
702
562
|
// leave it blank so no flicker when used with selected-item-template
|
|
703
563
|
value: r.id,
|
|
704
564
|
selected: e.fields.key_set === r.id
|
|
705
|
-
}))),
|
|
706
|
-
|
|
565
|
+
}))), ye = (s) => {
|
|
566
|
+
G.value.clear();
|
|
707
567
|
let r;
|
|
708
|
-
for (r of
|
|
709
|
-
|
|
568
|
+
for (r of s)
|
|
569
|
+
G.value.add(r);
|
|
710
570
|
};
|
|
711
|
-
return
|
|
712
|
-
|
|
713
|
-
}, { immediate: !0, deep: !0 }),
|
|
714
|
-
|
|
715
|
-
}, { immediate: !0, deep: !0 }),
|
|
716
|
-
await
|
|
717
|
-
}), (
|
|
718
|
-
const
|
|
719
|
-
return
|
|
720
|
-
|
|
721
|
-
"can-submit":
|
|
722
|
-
config:
|
|
723
|
-
"edit-id":
|
|
724
|
-
"entity-type":
|
|
725
|
-
"error-message": e.errorMessage ||
|
|
726
|
-
"fetch-url":
|
|
727
|
-
"form-fields":
|
|
571
|
+
return Y(re, (s) => {
|
|
572
|
+
ye(s);
|
|
573
|
+
}, { immediate: !0, deep: !0 }), Y(te, () => {
|
|
574
|
+
J.value++;
|
|
575
|
+
}, { immediate: !0, deep: !0 }), xe(async () => {
|
|
576
|
+
await ne();
|
|
577
|
+
}), (s, r) => {
|
|
578
|
+
const R = j("KInput"), L = j("KSelect"), o = j("KTextArea");
|
|
579
|
+
return g(), q("div", it, [
|
|
580
|
+
c(t(Qe), {
|
|
581
|
+
"can-submit": K.value,
|
|
582
|
+
config: l.config,
|
|
583
|
+
"edit-id": l.keyId,
|
|
584
|
+
"entity-type": t(je).Key,
|
|
585
|
+
"error-message": e.errorMessage || ce.value,
|
|
586
|
+
"fetch-url": H.value,
|
|
587
|
+
"form-fields": h.value,
|
|
728
588
|
"is-readonly": e.isReadonly,
|
|
729
|
-
onCancel:
|
|
730
|
-
"onFetch:error": r[9] || (r[9] = (i) =>
|
|
731
|
-
"onFetch:success":
|
|
732
|
-
onLoading: r[10] || (r[10] = (i) =>
|
|
733
|
-
onSubmit:
|
|
589
|
+
onCancel: u,
|
|
590
|
+
"onFetch:error": r[9] || (r[9] = (i) => s.$emit("error", i)),
|
|
591
|
+
"onFetch:success": Q,
|
|
592
|
+
onLoading: r[10] || (r[10] = (i) => s.$emit("loading", i)),
|
|
593
|
+
onSubmit: f
|
|
734
594
|
}, {
|
|
735
|
-
default:
|
|
736
|
-
|
|
737
|
-
description:
|
|
738
|
-
title:
|
|
595
|
+
default: y(() => [
|
|
596
|
+
c(t(Ce), {
|
|
597
|
+
description: t(n)("keys.form.sections.general.description"),
|
|
598
|
+
title: t(n)("keys.form.sections.general.title")
|
|
739
599
|
}, {
|
|
740
|
-
default:
|
|
741
|
-
|
|
600
|
+
default: y(() => [
|
|
601
|
+
c(R, {
|
|
742
602
|
modelValue: e.fields.key_id,
|
|
743
603
|
"onUpdate:modelValue": r[0] || (r[0] = (i) => e.fields.key_id = i),
|
|
744
604
|
modelModifiers: { trim: !0 },
|
|
745
605
|
autocomplete: "off",
|
|
746
606
|
"data-testid": "key-form-id",
|
|
747
|
-
help:
|
|
748
|
-
label:
|
|
607
|
+
help: t(n)("keys.form.fields.id.help"),
|
|
608
|
+
label: t(n)("keys.form.fields.id.label"),
|
|
749
609
|
"label-attributes": {
|
|
750
|
-
info:
|
|
610
|
+
info: t(n)("keys.form.fields.id.tooltip"),
|
|
751
611
|
tooltipAttributes: { maxWidth: "400" }
|
|
752
612
|
},
|
|
753
|
-
placeholder:
|
|
613
|
+
placeholder: t(n)("keys.form.fields.id.placeholder"),
|
|
754
614
|
readonly: e.isReadonly,
|
|
755
615
|
required: "",
|
|
756
616
|
type: "text"
|
|
757
617
|
}, null, 8, ["modelValue", "help", "label", "label-attributes", "placeholder", "readonly"]),
|
|
758
|
-
|
|
618
|
+
l.showx5t ? (g(), C(R, {
|
|
759
619
|
key: 0,
|
|
760
620
|
modelValue: e.fields.x5t,
|
|
761
621
|
"onUpdate:modelValue": r[1] || (r[1] = (i) => e.fields.x5t = i),
|
|
762
622
|
modelModifiers: { trim: !0 },
|
|
763
623
|
autocomplete: "off",
|
|
764
624
|
"data-testid": "key-form-x5t",
|
|
765
|
-
help:
|
|
766
|
-
label:
|
|
625
|
+
help: t(n)("keys.form.fields.x5t.help"),
|
|
626
|
+
label: t(n)("keys.form.fields.x5t.label"),
|
|
767
627
|
"label-attributes": {
|
|
768
|
-
info:
|
|
628
|
+
info: t(n)("keys.form.fields.x5t.tooltip"),
|
|
769
629
|
tooltipAttributes: { maxWidth: "400" }
|
|
770
630
|
},
|
|
771
|
-
placeholder:
|
|
631
|
+
placeholder: t(n)("keys.form.fields.x5t.placeholder"),
|
|
772
632
|
readonly: e.isReadonly,
|
|
773
633
|
type: "text"
|
|
774
|
-
}, null, 8, ["modelValue", "help", "label", "label-attributes", "placeholder", "readonly"])) :
|
|
775
|
-
|
|
634
|
+
}, null, 8, ["modelValue", "help", "label", "label-attributes", "placeholder", "readonly"])) : P("", !0),
|
|
635
|
+
c(R, {
|
|
776
636
|
modelValue: e.fields.name,
|
|
777
637
|
"onUpdate:modelValue": r[2] || (r[2] = (i) => e.fields.name = i),
|
|
778
638
|
modelModifiers: { trim: !0 },
|
|
779
639
|
autocomplete: "off",
|
|
780
640
|
"data-testid": "key-form-name",
|
|
781
|
-
label:
|
|
782
|
-
placeholder:
|
|
641
|
+
label: t(n)("keys.form.fields.name.label"),
|
|
642
|
+
placeholder: t(n)("keys.form.fields.name.placeholder"),
|
|
783
643
|
readonly: e.isReadonly,
|
|
784
644
|
type: "text"
|
|
785
645
|
}, null, 8, ["modelValue", "label", "placeholder", "readonly"]),
|
|
786
|
-
|
|
646
|
+
c(L, {
|
|
787
647
|
modelValue: e.fields.key_set,
|
|
788
648
|
"onUpdate:modelValue": r[3] || (r[3] = (i) => e.fields.key_set = i),
|
|
789
|
-
clearable:
|
|
649
|
+
clearable: O.value,
|
|
790
650
|
"data-testid": "key-form-key-set",
|
|
791
|
-
"dropdown-footer-text":
|
|
651
|
+
"dropdown-footer-text": ee.value,
|
|
792
652
|
"enable-filtering": "",
|
|
793
653
|
"filter-function": () => !0,
|
|
794
|
-
items:
|
|
795
|
-
label:
|
|
796
|
-
loading:
|
|
797
|
-
placeholder:
|
|
798
|
-
readonly:
|
|
654
|
+
items: te.value,
|
|
655
|
+
label: t(n)("keys.form.fields.key_set.label"),
|
|
656
|
+
loading: t(N),
|
|
657
|
+
placeholder: t(n)("keys.form.fields.key_set.placeholder"),
|
|
658
|
+
readonly: V.value,
|
|
799
659
|
width: "100%",
|
|
800
|
-
onQueryChange:
|
|
660
|
+
onQueryChange: de
|
|
801
661
|
}, {
|
|
802
|
-
loading:
|
|
803
|
-
|
|
662
|
+
loading: y(() => [
|
|
663
|
+
$("div", null, _(t(n)("keys.actions.loading")), 1)
|
|
804
664
|
]),
|
|
805
|
-
empty:
|
|
806
|
-
|
|
665
|
+
empty: y(() => [
|
|
666
|
+
$("div", ot, _(t(n)("keys.search.no_results")), 1)
|
|
807
667
|
]),
|
|
808
|
-
"selected-item-template":
|
|
809
|
-
|
|
668
|
+
"selected-item-template": y(({ item: i }) => [
|
|
669
|
+
$("div", null, _(i.name), 1)
|
|
810
670
|
]),
|
|
811
|
-
"item-template":
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
671
|
+
"item-template": y(({ item: i }) => [
|
|
672
|
+
$("div", st, [
|
|
673
|
+
$("div", nt, _(i.name), 1),
|
|
674
|
+
$("div", rt, _(i.value), 1)
|
|
815
675
|
])
|
|
816
676
|
]),
|
|
817
677
|
_: 1
|
|
818
678
|
}, 8, ["modelValue", "clearable", "dropdown-footer-text", "items", "label", "loading", "placeholder", "readonly"]),
|
|
819
|
-
|
|
820
|
-
|
|
679
|
+
x.value ? (g(), q("p", dt, _(x.value), 1)) : P("", !0),
|
|
680
|
+
c(R, {
|
|
821
681
|
modelValue: e.fields.tags,
|
|
822
682
|
"onUpdate:modelValue": r[4] || (r[4] = (i) => e.fields.tags = i),
|
|
823
683
|
modelModifiers: { trim: !0 },
|
|
824
684
|
autocomplete: "off",
|
|
825
685
|
"data-testid": "key-form-tags",
|
|
826
|
-
help:
|
|
827
|
-
label:
|
|
686
|
+
help: t(n)("keys.form.fields.tags.help"),
|
|
687
|
+
label: t(n)("keys.form.fields.tags.label"),
|
|
828
688
|
"label-attributes": {
|
|
829
|
-
info:
|
|
689
|
+
info: t(n)("keys.form.fields.tags.tooltip"),
|
|
830
690
|
tooltipAttributes: { maxWidth: "400" }
|
|
831
691
|
},
|
|
832
|
-
placeholder:
|
|
692
|
+
placeholder: t(n)("keys.form.fields.tags.placeholder"),
|
|
833
693
|
readonly: e.isReadonly,
|
|
834
694
|
type: "text"
|
|
835
695
|
}, null, 8, ["modelValue", "help", "label", "label-attributes", "placeholder", "readonly"])
|
|
836
696
|
]),
|
|
837
697
|
_: 1
|
|
838
698
|
}, 8, ["description", "title"]),
|
|
839
|
-
|
|
840
|
-
description:
|
|
699
|
+
c(t(Ce), {
|
|
700
|
+
description: t(n)("keys.form.sections.keys.description"),
|
|
841
701
|
"has-divider": "",
|
|
842
|
-
title:
|
|
702
|
+
title: t(n)("keys.form.sections.keys.title")
|
|
843
703
|
}, {
|
|
844
|
-
default:
|
|
845
|
-
|
|
846
|
-
|
|
704
|
+
default: y(() => [
|
|
705
|
+
$("div", ct, [
|
|
706
|
+
c(L, {
|
|
847
707
|
modelValue: e.fields.key_format,
|
|
848
708
|
"onUpdate:modelValue": r[5] || (r[5] = (i) => e.fields.key_format = i),
|
|
849
709
|
"data-testid": "key-form-key-format",
|
|
850
|
-
items:
|
|
851
|
-
label:
|
|
710
|
+
items: E,
|
|
711
|
+
label: t(n)("keys.form.fields.key_format.label"),
|
|
852
712
|
readonly: e.isReadonly,
|
|
853
713
|
required: "",
|
|
854
714
|
width: "100%"
|
|
855
715
|
}, null, 8, ["modelValue", "label", "readonly"])
|
|
856
716
|
]),
|
|
857
|
-
e.fields.key_format === "jwk" ? (
|
|
717
|
+
e.fields.key_format === "jwk" ? (g(), C(o, {
|
|
858
718
|
key: 0,
|
|
859
719
|
modelValue: e.fields.jwk,
|
|
860
720
|
"onUpdate:modelValue": r[6] || (r[6] = (i) => e.fields.jwk = i),
|
|
@@ -862,16 +722,16 @@ const he = {
|
|
|
862
722
|
"character-limit": !1,
|
|
863
723
|
class: "key-form-textarea",
|
|
864
724
|
"data-testid": "key-form-jwk",
|
|
865
|
-
label:
|
|
725
|
+
label: t(n)("keys.form.fields.jwk.label"),
|
|
866
726
|
"label-attributes": {
|
|
867
|
-
info:
|
|
727
|
+
info: t(n)("keys.form.fields.jwk.tooltip"),
|
|
868
728
|
tooltipAttributes: { maxWidth: "400" }
|
|
869
729
|
},
|
|
870
|
-
placeholder:
|
|
730
|
+
placeholder: t(n)("keys.form.fields.jwk.placeholder"),
|
|
871
731
|
readonly: e.isReadonly,
|
|
872
732
|
required: ""
|
|
873
|
-
}, null, 8, ["modelValue", "label", "label-attributes", "placeholder", "readonly"])) :
|
|
874
|
-
e.fields.key_format === "pem" ? (
|
|
733
|
+
}, null, 8, ["modelValue", "label", "label-attributes", "placeholder", "readonly"])) : P("", !0),
|
|
734
|
+
e.fields.key_format === "pem" ? (g(), C(o, {
|
|
875
735
|
key: 1,
|
|
876
736
|
modelValue: e.fields.private_key,
|
|
877
737
|
"onUpdate:modelValue": r[7] || (r[7] = (i) => e.fields.private_key = i),
|
|
@@ -879,12 +739,12 @@ const he = {
|
|
|
879
739
|
"character-limit": !1,
|
|
880
740
|
class: "key-form-textarea",
|
|
881
741
|
"data-testid": "key-form-private-key",
|
|
882
|
-
label:
|
|
883
|
-
placeholder:
|
|
742
|
+
label: t(n)("keys.form.fields.private_key.label"),
|
|
743
|
+
placeholder: t(n)("keys.form.fields.private_key.placeholder"),
|
|
884
744
|
readonly: e.isReadonly,
|
|
885
745
|
required: ""
|
|
886
|
-
}, null, 8, ["modelValue", "label", "placeholder", "readonly"])) :
|
|
887
|
-
e.fields.key_format === "pem" ? (
|
|
746
|
+
}, null, 8, ["modelValue", "label", "placeholder", "readonly"])) : P("", !0),
|
|
747
|
+
e.fields.key_format === "pem" ? (g(), C(o, {
|
|
888
748
|
key: 2,
|
|
889
749
|
modelValue: e.fields.public_key,
|
|
890
750
|
"onUpdate:modelValue": r[8] || (r[8] = (i) => e.fields.public_key = i),
|
|
@@ -892,11 +752,11 @@ const he = {
|
|
|
892
752
|
"character-limit": !1,
|
|
893
753
|
class: "key-form-textarea",
|
|
894
754
|
"data-testid": "key-form-public-key",
|
|
895
|
-
label:
|
|
896
|
-
placeholder:
|
|
755
|
+
label: t(n)("keys.form.fields.public_key.label"),
|
|
756
|
+
placeholder: t(n)("keys.form.fields.public_key.placeholder"),
|
|
897
757
|
readonly: e.isReadonly,
|
|
898
758
|
required: ""
|
|
899
|
-
}, null, 8, ["modelValue", "label", "placeholder", "readonly"])) :
|
|
759
|
+
}, null, 8, ["modelValue", "label", "placeholder", "readonly"])) : P("", !0)
|
|
900
760
|
]),
|
|
901
761
|
_: 1
|
|
902
762
|
}, 8, ["description", "title"])
|
|
@@ -906,14 +766,14 @@ const he = {
|
|
|
906
766
|
]);
|
|
907
767
|
};
|
|
908
768
|
}
|
|
909
|
-
}),
|
|
769
|
+
}), bt = /* @__PURE__ */ Ee(yt, [["__scopeId", "data-v-e35f7792"]]), ft = { class: "kong-ui-entities-keys-entity-config-card" }, ut = { key: 2 }, _t = /* @__PURE__ */ pe({
|
|
910
770
|
__name: "KeyConfigCard",
|
|
911
771
|
props: {
|
|
912
772
|
/** The base konnect or kongManger config. Pass additional config props in the shared entity component as needed. */
|
|
913
773
|
config: {
|
|
914
774
|
type: Object,
|
|
915
775
|
required: !0,
|
|
916
|
-
validator: (
|
|
776
|
+
validator: (l) => !(!l || !["konnect", "kongManager"].includes(l?.app) || l.app === "konnect" && !l.controlPlaneId || l.app === "kongManager" && typeof l.workspace != "string" || !l.entityId)
|
|
917
777
|
},
|
|
918
778
|
/**
|
|
919
779
|
* External link for documentation that determines visibility of Documentation button
|
|
@@ -939,143 +799,135 @@ const he = {
|
|
|
939
799
|
}
|
|
940
800
|
},
|
|
941
801
|
emits: ["loading", "fetch:error", "fetch:success", "navigation-click"],
|
|
942
|
-
setup(
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
var y;
|
|
946
|
-
return (y = P.form[t.config.app]) == null ? void 0 : y.getKeySet;
|
|
947
|
-
}), K = w(), e = w({}), $ = w(t.keySetId || ""), T = w(""), B = w(!1), L = async (y) => {
|
|
948
|
-
var m;
|
|
949
|
-
K.value = y, $.value = (m = y == null ? void 0 : y.set) == null ? void 0 : m.id, _("fetch:success", y), R(y);
|
|
802
|
+
setup(l, { emit: B }) {
|
|
803
|
+
const v = B, a = l, { axiosInstance: d } = me(a.config?.axiosRequestConfig), { convertKeyToTitle: n } = Ge(), { i18n: { t: S } } = ge.useI18n(), A = m(() => a.keySetId ? `${T.form[a.config.app].edit.forKeySet}`.replace(/{keySetId}/gi, a.keySetId) : T.form[a.config.app].edit.all), H = m(() => T.form[a.config.app]?.getKeySet), w = b(), e = b({}), I = b(a.keySetId || ""), E = b(""), V = b(!1), O = async (u) => {
|
|
804
|
+
w.value = u, I.value = u?.set?.id, v("fetch:success", u), K(u);
|
|
950
805
|
};
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
if (!$.value)
|
|
806
|
+
Y(I, async () => {
|
|
807
|
+
if (!I.value)
|
|
954
808
|
return;
|
|
955
|
-
let
|
|
956
|
-
|
|
809
|
+
let u = `${a.config.apiBaseUrl}${H.value}`;
|
|
810
|
+
a.config.app === "konnect" && (u = u.replace(/{controlPlaneId}/gi, a.config?.controlPlaneId || "")), u = u.replace(/\/{workspace}/gi, a.config?.workspace ? `/${a.config.workspace}` : "").replace(/{keySetId}/gi, I.value || "");
|
|
957
811
|
try {
|
|
958
|
-
|
|
959
|
-
const { data:
|
|
960
|
-
validateStatus: (
|
|
812
|
+
V.value = !0;
|
|
813
|
+
const { data: p } = await d.get(u, {
|
|
814
|
+
validateStatus: (h) => h === 404 || h >= 200 && h < 300
|
|
961
815
|
// in case KeySet is deleted
|
|
962
816
|
});
|
|
963
|
-
|
|
964
|
-
} catch (
|
|
965
|
-
|
|
817
|
+
E.value = p?.name || p?.id;
|
|
818
|
+
} catch (p) {
|
|
819
|
+
v("fetch:error", p);
|
|
966
820
|
} finally {
|
|
967
|
-
|
|
821
|
+
V.value = !1;
|
|
968
822
|
}
|
|
969
823
|
}, { immediate: !0 });
|
|
970
|
-
const
|
|
971
|
-
var m, j;
|
|
824
|
+
const K = (u) => {
|
|
972
825
|
try {
|
|
973
|
-
if (
|
|
974
|
-
const
|
|
975
|
-
Object.keys(
|
|
826
|
+
if (u.jwk) {
|
|
827
|
+
const p = JSON.parse(u.jwk);
|
|
828
|
+
Object.keys(p).forEach((h) => {
|
|
976
829
|
e.value = {
|
|
977
830
|
...e.value,
|
|
978
|
-
[`jwk.${
|
|
831
|
+
[`jwk.${h}`]: p[h]
|
|
979
832
|
};
|
|
980
833
|
});
|
|
981
834
|
} else
|
|
982
835
|
e.value = {
|
|
983
|
-
"pem.public_key":
|
|
984
|
-
"pem.private_key":
|
|
836
|
+
"pem.public_key": u?.pem?.public_key,
|
|
837
|
+
"pem.private_key": u?.pem?.private_key
|
|
985
838
|
};
|
|
986
|
-
} catch (
|
|
987
|
-
|
|
839
|
+
} catch (p) {
|
|
840
|
+
v("fetch:error", p);
|
|
988
841
|
}
|
|
989
842
|
return e;
|
|
990
|
-
},
|
|
843
|
+
}, Q = b({
|
|
991
844
|
id: {},
|
|
992
845
|
name: {
|
|
993
|
-
tooltip:
|
|
846
|
+
tooltip: S("keys.form.fields.name.tooltip")
|
|
994
847
|
},
|
|
995
848
|
last_updated: {},
|
|
996
849
|
created: {},
|
|
997
850
|
set: {
|
|
998
|
-
label:
|
|
999
|
-
section:
|
|
1000
|
-
tooltip:
|
|
851
|
+
label: S("keys.form.fields.set.label"),
|
|
852
|
+
section: ue.Basic,
|
|
853
|
+
tooltip: S("keys.form.fields.set.tooltip"),
|
|
1001
854
|
order: 5
|
|
1002
855
|
},
|
|
1003
856
|
kid: {
|
|
1004
|
-
label:
|
|
1005
|
-
section:
|
|
1006
|
-
tooltip:
|
|
857
|
+
label: S("keys.form.fields.kid.label"),
|
|
858
|
+
section: ue.Basic,
|
|
859
|
+
tooltip: S("keys.form.fields.kid.tooltip")
|
|
1007
860
|
},
|
|
1008
861
|
tags: {
|
|
1009
|
-
tooltip:
|
|
862
|
+
tooltip: S("keys.form.fields.tags.tooltip")
|
|
1010
863
|
},
|
|
1011
864
|
// advanced fields
|
|
1012
865
|
jwk: {
|
|
1013
|
-
label:
|
|
1014
|
-
type:
|
|
866
|
+
label: S("keys.form.fields.jwk.label"),
|
|
867
|
+
type: fe.Json
|
|
1015
868
|
},
|
|
1016
869
|
pem: {
|
|
1017
|
-
section:
|
|
1018
|
-
label:
|
|
1019
|
-
type:
|
|
870
|
+
section: ue.Advanced,
|
|
871
|
+
label: S("keys.form.fields.key_format.options.pem"),
|
|
872
|
+
type: fe.Json
|
|
1020
873
|
}
|
|
1021
874
|
});
|
|
1022
|
-
return (
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
config:
|
|
1028
|
-
"config-
|
|
1029
|
-
"
|
|
1030
|
-
"
|
|
1031
|
-
"
|
|
1032
|
-
"
|
|
1033
|
-
"onFetch:
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
B.value ? (b(), V(j, {
|
|
875
|
+
return (u, p) => {
|
|
876
|
+
const h = j("KSkeleton");
|
|
877
|
+
return g(), q("div", ft, [
|
|
878
|
+
c(t(ze), {
|
|
879
|
+
config: l.config,
|
|
880
|
+
"config-card-doc": l.configCardDoc,
|
|
881
|
+
"config-schema": Q.value,
|
|
882
|
+
"entity-type": t(je).Key,
|
|
883
|
+
"fetch-url": A.value,
|
|
884
|
+
"hide-title": l.hideTitle,
|
|
885
|
+
"onFetch:error": p[0] || (p[0] = (f) => u.$emit("fetch:error", f)),
|
|
886
|
+
"onFetch:success": O,
|
|
887
|
+
onLoading: p[1] || (p[1] = (f) => u.$emit("loading", f))
|
|
888
|
+
}, ke({
|
|
889
|
+
set: y(({ row: f }) => [
|
|
890
|
+
V.value ? (g(), C(h, {
|
|
1039
891
|
key: 0,
|
|
1040
892
|
"data-testid": "key-set-name-loader",
|
|
1041
893
|
type: "spinner"
|
|
1042
|
-
})) :
|
|
894
|
+
})) : f.value && f.value.id === I.value && E.value ? (g(), C(t(Xe), {
|
|
1043
895
|
key: 1,
|
|
1044
896
|
item: {
|
|
1045
|
-
key:
|
|
1046
|
-
value:
|
|
1047
|
-
type:
|
|
897
|
+
key: f.value.id,
|
|
898
|
+
value: E.value,
|
|
899
|
+
type: t(fe).LinkInternal
|
|
1048
900
|
},
|
|
1049
|
-
onClick: (
|
|
1050
|
-
}, null, 8, ["item", "onClick"])) : (
|
|
901
|
+
onClick: (Z) => u.$emit("navigation-click", f.value.id, "key-sets")
|
|
902
|
+
}, null, 8, ["item", "onClick"])) : (g(), q("div", ut, _("–")))
|
|
1051
903
|
]),
|
|
1052
904
|
_: 2
|
|
1053
905
|
}, [
|
|
1054
|
-
|
|
906
|
+
w.value?.jwk ? {
|
|
1055
907
|
name: "jwk",
|
|
1056
|
-
fn:
|
|
1057
|
-
(
|
|
1058
|
-
key:
|
|
1059
|
-
"data-testid": `${
|
|
908
|
+
fn: y(() => [
|
|
909
|
+
(g(!0), q(_e, null, Se(Object.keys(e.value), (f) => (g(), C(t(Ke), {
|
|
910
|
+
key: f,
|
|
911
|
+
"data-testid": `${f}`,
|
|
1060
912
|
item: {
|
|
1061
|
-
key:
|
|
1062
|
-
label:
|
|
1063
|
-
value: e.value[
|
|
913
|
+
key: f,
|
|
914
|
+
label: t(n)(f),
|
|
915
|
+
value: e.value[f]
|
|
1064
916
|
}
|
|
1065
917
|
}, null, 8, ["data-testid", "item"]))), 128))
|
|
1066
918
|
]),
|
|
1067
919
|
key: "0"
|
|
1068
920
|
} : void 0,
|
|
1069
|
-
|
|
921
|
+
w.value?.pem ? {
|
|
1070
922
|
name: "pem",
|
|
1071
|
-
fn:
|
|
1072
|
-
(
|
|
1073
|
-
key:
|
|
1074
|
-
"data-testid": `${
|
|
923
|
+
fn: y(() => [
|
|
924
|
+
(g(!0), q(_e, null, Se(Object.keys(e.value), (f) => (g(), C(t(Ke), {
|
|
925
|
+
key: f,
|
|
926
|
+
"data-testid": `${f}`,
|
|
1075
927
|
item: {
|
|
1076
|
-
key:
|
|
1077
|
-
label:
|
|
1078
|
-
value: e.value[
|
|
928
|
+
key: f,
|
|
929
|
+
label: t(n)(f),
|
|
930
|
+
value: e.value[f]
|
|
1079
931
|
}
|
|
1080
932
|
}, null, 8, ["data-testid", "item"]))), 128))
|
|
1081
933
|
]),
|
|
@@ -1087,7 +939,7 @@ const he = {
|
|
|
1087
939
|
}
|
|
1088
940
|
});
|
|
1089
941
|
export {
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
942
|
+
_t as KeyConfigCard,
|
|
943
|
+
bt as KeyForm,
|
|
944
|
+
ht as KeyList
|
|
1093
945
|
};
|