@authup/client-web-kit 1.0.0-beta.18 → 1.0.0-beta.20

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.
Files changed (157) hide show
  1. package/dist/components/AEntityDelete.d.ts +11 -10
  2. package/dist/components/AEntityDelete.d.ts.map +1 -1
  3. package/dist/components/client/AClient.d.ts +4 -4
  4. package/dist/components/client/AClient.d.ts.map +1 -1
  5. package/dist/components/client/AClientForm.d.ts +7 -7
  6. package/dist/components/client/AClientForm.d.ts.map +1 -1
  7. package/dist/components/client/AClientRedirectUris.d.ts +6 -6
  8. package/dist/components/client/AClientRedirectUris.d.ts.map +1 -1
  9. package/dist/components/client/AClientRedirectUrisItem.d.ts +6 -6
  10. package/dist/components/client/AClientRedirectUrisItem.d.ts.map +1 -1
  11. package/dist/components/client/AClients.d.ts +6 -6
  12. package/dist/components/client/AClients.d.ts.map +1 -1
  13. package/dist/components/client-scope/AClientScope.d.ts +4 -4
  14. package/dist/components/client-scope/AClientScope.d.ts.map +1 -1
  15. package/dist/components/client-scope/AClientScopeAssignment.d.ts +5 -5
  16. package/dist/components/client-scope/AClientScopeAssignment.d.ts.map +1 -1
  17. package/dist/components/client-scope/AClientScopeAssignments.d.ts +4 -4
  18. package/dist/components/client-scope/AClientScopeAssignments.d.ts.map +1 -1
  19. package/dist/components/client-scope/AClientScopes.d.ts +6 -6
  20. package/dist/components/client-scope/AClientScopes.d.ts.map +1 -1
  21. package/dist/components/identity-provider/AIdentityProvider.d.ts +4 -4
  22. package/dist/components/identity-provider/AIdentityProvider.d.ts.map +1 -1
  23. package/dist/components/identity-provider/AIdentityProviderBasicFields.d.ts +5 -5
  24. package/dist/components/identity-provider/AIdentityProviderBasicFields.d.ts.map +1 -1
  25. package/dist/components/identity-provider/AIdentityProviderForm.d.ts +5 -5
  26. package/dist/components/identity-provider/AIdentityProviderForm.d.ts.map +1 -1
  27. package/dist/components/identity-provider/AIdentityProviderIcon.d.ts +4 -4
  28. package/dist/components/identity-provider/AIdentityProviderIcon.d.ts.map +1 -1
  29. package/dist/components/identity-provider/AIdentityProviderLdapConnectionFields.d.ts +6 -6
  30. package/dist/components/identity-provider/AIdentityProviderLdapConnectionFields.d.ts.map +1 -1
  31. package/dist/components/identity-provider/AIdentityProviderLdapCredentialsFields.d.ts +6 -6
  32. package/dist/components/identity-provider/AIdentityProviderLdapCredentialsFields.d.ts.map +1 -1
  33. package/dist/components/identity-provider/AIdentityProviderLdapForm.d.ts +6 -6
  34. package/dist/components/identity-provider/AIdentityProviderLdapForm.d.ts.map +1 -1
  35. package/dist/components/identity-provider/AIdentityProviderLdapGroupFields.d.ts +6 -6
  36. package/dist/components/identity-provider/AIdentityProviderLdapGroupFields.d.ts.map +1 -1
  37. package/dist/components/identity-provider/AIdentityProviderLdapUserFields.d.ts +6 -6
  38. package/dist/components/identity-provider/AIdentityProviderLdapUserFields.d.ts.map +1 -1
  39. package/dist/components/identity-provider/AIdentityProviderOAuth2ClientFields.d.ts +5 -5
  40. package/dist/components/identity-provider/AIdentityProviderOAuth2ClientFields.d.ts.map +1 -1
  41. package/dist/components/identity-provider/AIdentityProviderOAuth2Discovery.d.ts +2 -2
  42. package/dist/components/identity-provider/AIdentityProviderOAuth2Discovery.d.ts.map +1 -1
  43. package/dist/components/identity-provider/AIdentityProviderOAuth2EndpointFields.d.ts +5 -5
  44. package/dist/components/identity-provider/AIdentityProviderOAuth2EndpointFields.d.ts.map +1 -1
  45. package/dist/components/identity-provider/AIdentityProviderOAuth2Form.d.ts +39 -12
  46. package/dist/components/identity-provider/AIdentityProviderOAuth2Form.d.ts.map +1 -1
  47. package/dist/components/identity-provider/AIdentityProviderPicker.d.ts +4 -4
  48. package/dist/components/identity-provider/AIdentityProviderPicker.d.ts.map +1 -1
  49. package/dist/components/identity-provider/AIdentityProviderPreset.d.ts +4 -4
  50. package/dist/components/identity-provider/AIdentityProviderPreset.d.ts.map +1 -1
  51. package/dist/components/identity-provider/AIdentityProviderProtocol.d.ts +4 -4
  52. package/dist/components/identity-provider/AIdentityProviderProtocol.d.ts.map +1 -1
  53. package/dist/components/identity-provider/AIdentityProviders.d.ts +6 -6
  54. package/dist/components/identity-provider/AIdentityProviders.d.ts.map +1 -1
  55. package/dist/components/identity-provider-role/AIdentityProviderRoleAssignment.d.ts +5 -5
  56. package/dist/components/identity-provider-role/AIdentityProviderRoleAssignment.d.ts.map +1 -1
  57. package/dist/components/identity-provider-role/AIdentityProviderRoleAssignments.d.ts +4 -4
  58. package/dist/components/identity-provider-role/AIdentityProviderRoleAssignments.d.ts.map +1 -1
  59. package/dist/components/permission/APermission.d.ts +4 -4
  60. package/dist/components/permission/APermission.d.ts.map +1 -1
  61. package/dist/components/permission/APermissionForm.d.ts +5 -5
  62. package/dist/components/permission/APermissionForm.d.ts.map +1 -1
  63. package/dist/components/permission/APermissions.d.ts +6 -6
  64. package/dist/components/permission/APermissions.d.ts.map +1 -1
  65. package/dist/components/permission-robot/APermissionRobotAssignments.d.ts +4 -4
  66. package/dist/components/permission-robot/APermissionRobotAssignments.d.ts.map +1 -1
  67. package/dist/components/permission-role/APermissionRoleAssignments.d.ts +4 -4
  68. package/dist/components/permission-role/APermissionRoleAssignments.d.ts.map +1 -1
  69. package/dist/components/permission-user/APermissionUserAssignments.d.ts +4 -4
  70. package/dist/components/permission-user/APermissionUserAssignments.d.ts.map +1 -1
  71. package/dist/components/realm/ARealm.d.ts +4 -4
  72. package/dist/components/realm/ARealm.d.ts.map +1 -1
  73. package/dist/components/realm/ARealmForm.d.ts +6 -6
  74. package/dist/components/realm/ARealmForm.d.ts.map +1 -1
  75. package/dist/components/realm/ARealms.d.ts +6 -6
  76. package/dist/components/realm/ARealms.d.ts.map +1 -1
  77. package/dist/components/robot/ARobot.d.ts +4 -4
  78. package/dist/components/robot/ARobot.d.ts.map +1 -1
  79. package/dist/components/robot/ARobotForm.d.ts +7 -7
  80. package/dist/components/robot/ARobotForm.d.ts.map +1 -1
  81. package/dist/components/robot/ARobots.d.ts +6 -6
  82. package/dist/components/robot/ARobots.d.ts.map +1 -1
  83. package/dist/components/robot-permission/ARobotPermissionAssignment.d.ts +5 -5
  84. package/dist/components/robot-permission/ARobotPermissionAssignment.d.ts.map +1 -1
  85. package/dist/components/robot-permission/ARobotPermissionAssignments.d.ts +4 -4
  86. package/dist/components/robot-permission/ARobotPermissionAssignments.d.ts.map +1 -1
  87. package/dist/components/robot-role/ARobotRoleAssignment.d.ts +5 -5
  88. package/dist/components/robot-role/ARobotRoleAssignment.d.ts.map +1 -1
  89. package/dist/components/robot-role/ARobotRoleAssignments.d.ts +4 -4
  90. package/dist/components/robot-role/ARobotRoleAssignments.d.ts.map +1 -1
  91. package/dist/components/role/ARole.d.ts +4 -4
  92. package/dist/components/role/ARole.d.ts.map +1 -1
  93. package/dist/components/role/ARoleForm.d.ts +6 -6
  94. package/dist/components/role/ARoleForm.d.ts.map +1 -1
  95. package/dist/components/role/ARoles.d.ts +6 -6
  96. package/dist/components/role/ARoles.d.ts.map +1 -1
  97. package/dist/components/role-permission/ARolePermissionAssignment.d.ts +5 -5
  98. package/dist/components/role-permission/ARolePermissionAssignment.d.ts.map +1 -1
  99. package/dist/components/role-permission/ARolePermissionAssignments.d.ts +4 -4
  100. package/dist/components/role-permission/ARolePermissionAssignments.d.ts.map +1 -1
  101. package/dist/components/role-robot/ARoleRobotAssignments.d.ts +4 -4
  102. package/dist/components/role-robot/ARoleRobotAssignments.d.ts.map +1 -1
  103. package/dist/components/role-user/ARoleUserAssignments.d.ts +4 -4
  104. package/dist/components/role-user/ARoleUserAssignments.d.ts.map +1 -1
  105. package/dist/components/scope/AScope.d.ts +4 -4
  106. package/dist/components/scope/AScope.d.ts.map +1 -1
  107. package/dist/components/scope/AScopeForm.d.ts +6 -6
  108. package/dist/components/scope/AScopeForm.d.ts.map +1 -1
  109. package/dist/components/scope/AScopes.d.ts +6 -6
  110. package/dist/components/scope/AScopes.d.ts.map +1 -1
  111. package/dist/components/scope-client/AScopeClientAssignments.d.ts +4 -4
  112. package/dist/components/scope-client/AScopeClientAssignments.d.ts.map +1 -1
  113. package/dist/components/user/AUser.d.ts +4 -4
  114. package/dist/components/user/AUser.d.ts.map +1 -1
  115. package/dist/components/user/AUserForm.d.ts +6 -6
  116. package/dist/components/user/AUserForm.d.ts.map +1 -1
  117. package/dist/components/user/AUserPasswordForm.d.ts +5 -5
  118. package/dist/components/user/AUserPasswordForm.d.ts.map +1 -1
  119. package/dist/components/user/AUsers.d.ts +6 -6
  120. package/dist/components/user/AUsers.d.ts.map +1 -1
  121. package/dist/components/user-permission/AUserPermissionAssignment.d.ts +5 -5
  122. package/dist/components/user-permission/AUserPermissionAssignment.d.ts.map +1 -1
  123. package/dist/components/user-permission/AUserPermissionAssignments.d.ts +4 -4
  124. package/dist/components/user-permission/AUserPermissionAssignments.d.ts.map +1 -1
  125. package/dist/components/user-role/AUserRoleAssignment.d.ts +5 -5
  126. package/dist/components/user-role/AUserRoleAssignment.d.ts.map +1 -1
  127. package/dist/components/user-role/AUserRoleAssignments.d.ts +4 -4
  128. package/dist/components/user-role/AUserRoleAssignments.d.ts.map +1 -1
  129. package/dist/components/utility/LanguageSwitcherDropdown.d.ts +5 -5
  130. package/dist/components/utility/LanguageSwitcherDropdown.d.ts.map +1 -1
  131. package/dist/components/utility/pagination/APagination.d.ts +4 -4
  132. package/dist/components/utility/pagination/APagination.d.ts.map +1 -1
  133. package/dist/components/utility/search/ASearch.d.ts +5 -5
  134. package/dist/components/utility/search/ASearch.d.ts.map +1 -1
  135. package/dist/components/utility/title/ATitle.d.ts +5 -5
  136. package/dist/components/utility/title/ATitle.d.ts.map +1 -1
  137. package/dist/composables/use-ability-check.d.ts.map +1 -1
  138. package/dist/core/entity-manager/utils.d.ts.map +1 -1
  139. package/dist/core/list/utils/component.d.ts.map +1 -1
  140. package/dist/core/store/create.d.ts +134 -39
  141. package/dist/core/store/create.d.ts.map +1 -1
  142. package/dist/core/store/install.d.ts.map +1 -1
  143. package/dist/index.cjs +391 -111
  144. package/dist/index.cjs.map +1 -1
  145. package/dist/index.mjs +401 -121
  146. package/dist/index.mjs.map +1 -1
  147. package/dist/security/index.d.ts +2 -0
  148. package/dist/security/index.d.ts.map +1 -0
  149. package/dist/security/policy/index.d.ts +3 -0
  150. package/dist/security/policy/index.d.ts.map +1 -0
  151. package/dist/security/policy/module.d.ts +5 -0
  152. package/dist/security/policy/module.d.ts.map +1 -0
  153. package/dist/security/policy/variants/evaluator.d.ts +11 -0
  154. package/dist/security/policy/variants/evaluator.d.ts.map +1 -0
  155. package/dist/security/policy/variants/index.d.ts +2 -0
  156. package/dist/security/policy/variants/index.d.ts.map +1 -0
  157. package/package.json +21 -20
package/dist/index.mjs CHANGED
@@ -2,8 +2,8 @@ import { REALM_MASTER_NAME, DomainEventName, buildDomainChannelName, DomainType,
2
2
  import { hasInjectionContext, inject as inject$2, provide as provide$1, ref, computed, getCurrentScope, onScopeDispose, toRaw, isRef, isReactive, toRef, unref, h, onMounted, onUnmounted, watch, shallowRef, watchEffect, defineComponent, reactive, nextTick, getCurrentInstance, resolveDynamicComponent, mergeProps } from 'vue';
3
3
  import { Client, isClientTokenExpiredError, CookieName, ClientResponseErrorTokenHook } from '@authup/core-http-kit';
4
4
  import { defineStore, storeToRefs as storeToRefs$1 } from 'pinia';
5
- import { Abilities, buildEventFullName, EventNameSuffix, hasOwnProperty, createNanoID, isOAuth2OpenIDProviderMetadata, isObject as isObject$1 } from '@authup/kit';
6
- import { merge, isObject, createMerger } from 'smob';
5
+ import { BuiltInPolicyType, PolicyError, maybeInvertPolicyOutcome, PermissionBindingPolicyValidator, PolicyEngine as PolicyEngine$1, PermissionMemoryProvider, PermissionChecker, buildEventFullName, EventNameSuffix, hasOwnProperty, createNanoID, isOAuth2OpenIDProviderMetadata, isObject as isObject$2 } from '@authup/kit';
6
+ import { isObject as isObject$1, merge, createMerger } from 'smob';
7
7
  import { buildList, SlotName } from '@vuecs/list-controls';
8
8
  import { ClientManager } from '@authup/core-realtime-kit';
9
9
  import { SortDirection } from 'rapiq';
@@ -61,6 +61,35 @@ function injectHTTPClient(app) {
61
61
  * view the LICENSE file that was distributed with this source code.
62
62
  */ const STORE_ID = 'authup';
63
63
 
64
+ class PermissionBindingPolicyEvaluator {
65
+ async can(ctx) {
66
+ return ctx.spec.type === BuiltInPolicyType.PERMISSION_BINDING;
67
+ }
68
+ async validateSpecification(ctx) {
69
+ return this.validator.run(ctx.spec);
70
+ }
71
+ async validateData(ctx) {
72
+ if (!isObject$1(ctx.data.identity) && !isObject$1(ctx.data.permission)) {
73
+ throw PolicyError.evaluatorContextInvalid();
74
+ }
75
+ return ctx.data;
76
+ }
77
+ async evaluate(ctx) {
78
+ // todo: this must be changed when the permission-checker not only checks owned permissions.
79
+ return maybeInvertPolicyOutcome(true, ctx.spec.invert);
80
+ }
81
+ constructor(){
82
+ this.validator = new PermissionBindingPolicyValidator();
83
+ }
84
+ }
85
+
86
+ class PolicyEngine extends PolicyEngine$1 {
87
+ constructor(){
88
+ super();
89
+ this.registerEvaluator(BuiltInPolicyType.PERMISSION_BINDING, new PermissionBindingPolicyEvaluator());
90
+ }
91
+ }
92
+
64
93
  function createStore(context = {}) {
65
94
  const client = new Client({
66
95
  baseURL: context.baseURL
@@ -141,7 +170,11 @@ function createStore(context = {}) {
141
170
  const setRealmManagement = (entity)=>{
142
171
  realmManagement.value = entity;
143
172
  };
144
- const abilities = new Abilities();
173
+ const permissionRepository = new PermissionMemoryProvider();
174
+ const permissionChecker = new PermissionChecker({
175
+ provider: permissionRepository,
176
+ policyEngine: new PolicyEngine()
177
+ });
145
178
  const tokenInfo = ref(undefined);
146
179
  const tokenResolved = ref(false);
147
180
  const setTokenInfo = (entity)=>{
@@ -150,7 +183,7 @@ function createStore(context = {}) {
150
183
  if (!entity) {
151
184
  setRealm(undefined);
152
185
  setRealmManagement(undefined);
153
- abilities.set([]);
186
+ permissionRepository.setMany([]);
154
187
  return;
155
188
  }
156
189
  if (entity.exp) {
@@ -167,7 +200,7 @@ function createStore(context = {}) {
167
200
  }
168
201
  }
169
202
  if (entity.permissions) {
170
- abilities.set(entity.permissions);
203
+ permissionRepository.setMany(entity.permissions);
171
204
  }
172
205
  };
173
206
  // --------------------------------------------------------------------
@@ -230,7 +263,7 @@ function createStore(context = {}) {
230
263
  return {
231
264
  initialized,
232
265
  setInitialized,
233
- abilities,
266
+ permissionChecker,
234
267
  login,
235
268
  logout,
236
269
  loggedIn,
@@ -267,6 +300,7 @@ function tryOnScopeDispose(fn) {
267
300
  return false;
268
301
  }
269
302
  typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
303
+ const noop = ()=>{};
270
304
 
271
305
  function useCookies(dependencies, { doNotParse = false, autoUpdateDependencies = false } = {}, cookies = new Cookie()) {
272
306
  const watchingDependencies = autoUpdateDependencies ? [
@@ -353,17 +387,18 @@ function installStore(app, options = {}) {
353
387
  baseURL: options.baseURL
354
388
  }));
355
389
  const store = storeCreator(options.pinia);
356
- const cookies = useCookies();
357
390
  let cookieGet;
358
391
  if (options.cookieGet) {
359
392
  cookieGet = options.cookieGet;
360
393
  } else {
394
+ const cookies = useCookies();
361
395
  cookieGet = cookies.get;
362
396
  }
363
397
  let cookieSet;
364
398
  if (options.cookieSet) {
365
399
  cookieSet = options.cookieSet;
366
400
  } else {
401
+ const cookies = useCookies();
367
402
  cookieSet = cookies.set;
368
403
  }
369
404
  let cookieUnset;
@@ -374,6 +409,7 @@ function installStore(app, options = {}) {
374
409
  options.cookieSet(key, null);
375
410
  };
376
411
  } else {
412
+ const cookies = useCookies();
377
413
  cookieUnset = cookies.remove;
378
414
  }
379
415
  const initStore = ()=>{
@@ -659,7 +695,7 @@ function buildListCreatedHandler(items, cb) {
659
695
  return (item, options)=>{
660
696
  options = options || {};
661
697
  let index;
662
- if (isObject(item)) {
698
+ if (isObject$1(item)) {
663
699
  index = items.value.findIndex((el)=>el.id === item.id);
664
700
  } else {
665
701
  index = -1;
@@ -678,7 +714,7 @@ function buildListCreatedHandler(items, cb) {
678
714
  }
679
715
  function buildListUpdatedHandler(items, cb) {
680
716
  return (item)=>{
681
- if (!isObject(item)) {
717
+ if (!isObject$1(item)) {
682
718
  return;
683
719
  }
684
720
  const index = items.value.findIndex((el)=>el.id === item.id);
@@ -695,7 +731,7 @@ function buildListUpdatedHandler(items, cb) {
695
731
  }
696
732
  function buildListDeletedHandler(items, cb) {
697
733
  return (item)=>{
698
- if (!isObject(item)) {
734
+ if (!isObject$1(item)) {
699
735
  return undefined;
700
736
  }
701
737
  const index = items.value.findIndex((el)=>el.id === item.id);
@@ -880,7 +916,7 @@ function isQuerySortedDescByDate(input) {
880
916
  if (Array.isArray(input)) {
881
917
  return input.some((el)=>isQuerySortedDescByDate(el));
882
918
  }
883
- if (isObject(input)) {
919
+ if (isObject$1(input)) {
884
920
  return input.created_at === SortDirection.DESC || input.updated_at === SortDirection.DESC;
885
921
  }
886
922
  return typeof input === 'string' && (input === '-created_at' || input === '-updated_at');
@@ -1014,17 +1050,17 @@ function createList(context) {
1014
1050
  busy: busy.value,
1015
1051
  data: data.value,
1016
1052
  meta: meta.value,
1017
- onCreated (value) {
1053
+ onCreated: (value)=>{
1018
1054
  if (context.setup.emit) {
1019
1055
  context.setup.emit('created', value);
1020
1056
  }
1021
1057
  },
1022
- onDeleted (value) {
1058
+ onDeleted: (value)=>{
1023
1059
  if (context.setup.emit) {
1024
1060
  context.setup.emit('deleted', value);
1025
1061
  }
1026
1062
  },
1027
- onUpdated (value) {
1063
+ onUpdated: (value)=>{
1028
1064
  if (context.setup.emit) {
1029
1065
  context.setup.emit('updated', value);
1030
1066
  }
@@ -1050,7 +1086,7 @@ function createList(context) {
1050
1086
  if (typeof context.socket !== 'boolean' || typeof context.socket === 'undefined' || context.socket) {
1051
1087
  const socketContext = {
1052
1088
  type: context.type,
1053
- ...isObject(context.socket) ? context.socket : {}
1089
+ ...isObject$1(context.socket) ? context.socket : {}
1054
1090
  };
1055
1091
  socketContext.onCreated = (entity)=>{
1056
1092
  const isSorted = query && query.sort && isQuerySortedDescByDate(query.sort) && meta.value?.pagination?.offset === 0;
@@ -1315,7 +1351,7 @@ function createEntityManager(ctx) {
1315
1351
  let socketContext = {
1316
1352
  type: ctx.type
1317
1353
  };
1318
- if (isObject(ctx.socket)) {
1354
+ if (isObject$1(ctx.socket)) {
1319
1355
  socketContext = {
1320
1356
  ...socketContext,
1321
1357
  ...ctx.socket
@@ -1473,7 +1509,7 @@ function createEntityManager(ctx) {
1473
1509
  if (!ctx.setup || !ctx.setup.slots) {
1474
1510
  return undefined;
1475
1511
  }
1476
- if (isObject(error) && hasNormalizedSlot('error', ctx.setup.slots)) {
1512
+ if (isObject$1(error) && hasNormalizedSlot('error', ctx.setup.slots)) {
1477
1513
  return normalizeSlot('error', error, ctx.setup.slots);
1478
1514
  }
1479
1515
  return undefined;
@@ -1555,38 +1591,115 @@ var TranslatorTranslationDefaultKey;
1555
1591
  TranslatorTranslationDefaultKey["USERS"] = "users";
1556
1592
  })(TranslatorTranslationDefaultKey || (TranslatorTranslationDefaultKey = {}));
1557
1593
 
1558
- function setObjectPathProperty(record, key, value) {
1559
- const parts = key.split('.');
1560
- if (parts.length === 1) {
1561
- record[key] = value;
1562
- return;
1563
- }
1564
- const prefix = parts.shift();
1565
- if (prefix) {
1566
- if (!Object.prototype.hasOwnProperty.call(record, prefix) || !isObject(record[prefix])) {
1567
- record[prefix] = {};
1594
+ /*
1595
+ * Copyright (c) 2024-2024.
1596
+ * Author Peter Placzek (tada5hi)
1597
+ * For the full copyright and license information,
1598
+ * view the LICENSE file that was distributed with this source code.
1599
+ */ const BRACKET_NUMBER_REGEX = RegExp("(?<!\\\\)\\[(\\d+)]$");
1600
+ /**
1601
+ * Convert string to property path array.
1602
+ *
1603
+ * @see https://github.com/lodash/lodash/blob/main/src/.internal/stringToPath.ts
1604
+ * @see https://github.com/chaijs/pathval
1605
+ *
1606
+ * @param segment
1607
+ */ function pathToArray(segment) {
1608
+ const str = segment.replace(/([^\\])\[/g, '$1.[');
1609
+ const parts = str.match(/(\\\.|[^.]+?)+/g);
1610
+ if (!parts) {
1611
+ return [];
1612
+ }
1613
+ const result = [];
1614
+ for(let i = 0; i < parts.length; i++){
1615
+ if (parts[i] === 'constructor' || parts[i] === '__proto__' || parts[i] === 'prototype') {
1616
+ continue;
1617
+ }
1618
+ const regex = BRACKET_NUMBER_REGEX.exec(parts[i]);
1619
+ if (regex) {
1620
+ result.push(regex[1]);
1621
+ } else {
1622
+ result.push(parts[i].replace(/\\([.[\]])/g, '$1'));
1568
1623
  }
1569
- setObjectPathProperty(record[prefix], parts.join('.'), value);
1570
1624
  }
1625
+ return result;
1626
+ }
1627
+ /*
1628
+ * Copyright (c) 2024.
1629
+ * Author Peter Placzek (tada5hi)
1630
+ * For the full copyright and license information,
1631
+ * view the LICENSE file that was distributed with this source code.
1632
+ */ var Character;
1633
+ (function(Character) {
1634
+ Character["WILDCARD"] = "*";
1635
+ Character["GLOBSTAR"] = "**";
1636
+ })(Character || (Character = {}));
1637
+ /*
1638
+ * Copyright (c) 2024.
1639
+ * Author Peter Placzek (tada5hi)
1640
+ * For the full copyright and license information,
1641
+ * view the LICENSE file that was distributed with this source code.
1642
+ */ function isObject(input) {
1643
+ return !!input && typeof input === 'object' && !Array.isArray(input);
1571
1644
  }
1572
- function getObjectPathProperty(data, key) {
1573
- const dotIndex = key.indexOf('.');
1574
- const currentKey = dotIndex === -1 ? key : key.substring(0, dotIndex);
1575
- if (dotIndex === -1) {
1576
- return data[currentKey];
1645
+ function getPathValue(data, path) {
1646
+ const parts = Array.isArray(path) ? path : pathToArray(path);
1647
+ let res;
1648
+ let temp = data;
1649
+ let index = 0;
1650
+ while(index < parts.length){
1651
+ if (temp === null || typeof temp === 'undefined') {
1652
+ break;
1653
+ }
1654
+ if (parts[index] in Object(temp)) {
1655
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1656
+ // @ts-expect-error
1657
+ temp = temp[parts[index]];
1658
+ } else {
1659
+ break;
1660
+ }
1661
+ if (index === parts.length - 1) {
1662
+ res = temp;
1663
+ }
1664
+ index++;
1577
1665
  }
1578
- if (!isObject(data[currentKey])) {
1579
- return undefined;
1666
+ return res;
1667
+ }
1668
+ const NUMBER_REGEX = /^\d+$/;
1669
+ function setPathValue(data, path, value) {
1670
+ const parts = Array.isArray(path) ? path : pathToArray(path);
1671
+ let temp = data;
1672
+ let index = 0;
1673
+ while(index < parts.length){
1674
+ /* istanbul ignore next */ if (!Array.isArray(temp) && !isObject(temp)) {
1675
+ break;
1676
+ }
1677
+ const key = parts[index];
1678
+ // [foo, '0']
1679
+ if (typeof temp[key] === 'undefined') {
1680
+ const match = NUMBER_REGEX.test(key);
1681
+ if (match) {
1682
+ temp[key] = [];
1683
+ } else {
1684
+ temp[key] = {};
1685
+ }
1686
+ }
1687
+ if (index === parts.length - 1) {
1688
+ temp[key] = value;
1689
+ break;
1690
+ }
1691
+ index++;
1692
+ temp = temp[key];
1580
1693
  }
1581
- const nextKey = key.substring(currentKey.length + 1);
1582
- return getObjectPathProperty(data[currentKey], nextKey);
1694
+ return data;
1583
1695
  }
1696
+
1584
1697
  class MemoryStore {
1585
1698
  async get(context) {
1586
1699
  if (!this.data[context.locale] || !this.data[context.locale][context.group]) {
1587
1700
  return undefined;
1588
1701
  }
1589
- const output = getObjectPathProperty(this.data[context.locale][context.group], context.key);
1702
+ const output = getPathValue(this.data[context.locale][context.group], context.key);
1590
1703
  if (typeof output === 'string') {
1591
1704
  return output;
1592
1705
  }
@@ -1594,7 +1707,7 @@ class MemoryStore {
1594
1707
  }
1595
1708
  async set(context) {
1596
1709
  this.initLines(context.group, context.locale);
1597
- setObjectPathProperty(this.data[context.locale][context.group], context.key, context.value);
1710
+ setPathValue(this.data[context.locale][context.group], context.key, context.value);
1598
1711
  }
1599
1712
  initLines(group, locale) {
1600
1713
  if (typeof this.data[locale] === 'undefined') {
@@ -1612,9 +1725,6 @@ class MemoryStore {
1612
1725
  }
1613
1726
  }
1614
1727
 
1615
- typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
1616
- const noop = ()=>{};
1617
-
1618
1728
  function computedAsync(evaluationCallback, initialState, optionsOrRef) {
1619
1729
  let options;
1620
1730
  if (isRef(optionsOrRef)) {
@@ -1997,13 +2107,46 @@ function useUpdatedAt(input) {
1997
2107
  }
1998
2108
 
1999
2109
  function useAbilityCheck(name) {
2000
- const { abilities } = useStore();
2110
+ const store = useStore();
2111
+ const refs = storeToRefs(store);
2001
2112
  const data = ref(false);
2002
- data.value = abilities.has(name);
2113
+ let computePromise;
2114
+ const compute = async ()=>{
2115
+ if (computePromise) {
2116
+ return computePromise;
2117
+ }
2118
+ let identity;
2119
+ if (refs.userId.value) {
2120
+ identity = {
2121
+ type: 'user',
2122
+ id: refs.userId.value
2123
+ };
2124
+ }
2125
+ let outcome;
2126
+ try {
2127
+ computePromise = store.permissionChecker.preCheck({
2128
+ name,
2129
+ data: {
2130
+ identity
2131
+ }
2132
+ }).then(()=>true).catch(()=>false);
2133
+ outcome = await computePromise;
2134
+ } catch (e) {
2135
+ outcome = false;
2136
+ } finally{
2137
+ computePromise = undefined;
2138
+ }
2139
+ return outcome;
2140
+ };
2141
+ Promise.resolve().then(()=>compute()).then((outcome)=>{
2142
+ data.value = outcome;
2143
+ });
2003
2144
  let removeListener;
2004
2145
  onMounted(()=>{
2005
- removeListener = abilities.on('updated', ()=>{
2006
- data.value = abilities.has(name);
2146
+ removeListener = watch(refs.loggedIn, ()=>{
2147
+ Promise.resolve().then(()=>compute()).then((outcome)=>{
2148
+ data.value = outcome;
2149
+ });
2007
2150
  });
2008
2151
  });
2009
2152
  onUnmounted(()=>{
@@ -2055,6 +2198,7 @@ const ARealmForm = defineComponent({
2055
2198
  const busy = ref(false);
2056
2199
  const form = reactive({
2057
2200
  name: '',
2201
+ display_name: '',
2058
2202
  description: ''
2059
2203
  });
2060
2204
  const $v = useVuelidate({
@@ -2063,6 +2207,10 @@ const ARealmForm = defineComponent({
2063
2207
  minLength: minLength(3),
2064
2208
  maxLength: maxLength(128)
2065
2209
  },
2210
+ display_name: {
2211
+ minLength: minLength(3),
2212
+ maxLength: maxLength(256)
2213
+ },
2066
2214
  description: {
2067
2215
  minLength: minLength(5),
2068
2216
  maxLength: maxLength(4096)
@@ -2107,12 +2255,16 @@ const ARealmForm = defineComponent({
2107
2255
  {
2108
2256
  key: TranslatorTranslationDefaultKey.NAME
2109
2257
  },
2258
+ {
2259
+ key: TranslatorTranslationDefaultKey.DISPLAY_NAME
2260
+ },
2110
2261
  {
2111
2262
  key: TranslatorTranslationDefaultKey.DESCRIPTION
2112
2263
  }
2113
2264
  ]);
2114
2265
  const render = ()=>{
2115
- const id = buildFormGroup({
2266
+ const children = [];
2267
+ children.push(buildFormGroup({
2116
2268
  validationMessages: translationsValidation.name.value,
2117
2269
  validationSeverity: getVuelidateSeverity($v.value.name),
2118
2270
  label: true,
@@ -2126,10 +2278,9 @@ const ARealmForm = defineComponent({
2126
2278
  disabled: manager.data.value && manager.data.value.name === REALM_MASTER_NAME
2127
2279
  }
2128
2280
  })
2129
- });
2130
- let idHint = [];
2281
+ }));
2131
2282
  if (!manager.data.value || !manager.data.value.id) {
2132
- idHint = [
2283
+ children.push([
2133
2284
  h('div', {
2134
2285
  class: 'mb-3'
2135
2286
  }, [
@@ -2153,9 +2304,21 @@ const ARealmForm = defineComponent({
2153
2304
  translationsDefault[TranslatorTranslationDefaultKey.GENERATE].value
2154
2305
  ])
2155
2306
  ])
2156
- ];
2307
+ ]);
2157
2308
  }
2158
- const description = buildFormGroup({
2309
+ children.push(buildFormGroup({
2310
+ validationMessages: translationsValidation.display_name.value,
2311
+ validationSeverity: getVuelidateSeverity($v.value.display_name),
2312
+ label: true,
2313
+ labelContent: translationsDefault[TranslatorTranslationDefaultKey.DISPLAY_NAME].value,
2314
+ content: buildFormInput({
2315
+ value: $v.value.display_name.$model,
2316
+ onChange (input) {
2317
+ $v.value.display_name.$model = input;
2318
+ }
2319
+ })
2320
+ }));
2321
+ children.push(buildFormGroup({
2159
2322
  validationMessages: translationsValidation.description.value,
2160
2323
  validationSeverity: getVuelidateSeverity($v.value.description),
2161
2324
  label: true,
@@ -2169,26 +2332,19 @@ const ARealmForm = defineComponent({
2169
2332
  rows: 4
2170
2333
  }
2171
2334
  })
2172
- });
2173
- const submitButton = buildFormSubmitWithTranslations({
2335
+ }));
2336
+ children.push(buildFormSubmitWithTranslations({
2174
2337
  submit,
2175
2338
  busy: busy.value,
2176
2339
  isEditing: isEditing.value,
2177
2340
  invalid: $v.value.$invalid
2178
- }, translationsSubmit);
2341
+ }, translationsSubmit));
2179
2342
  return h('form', {
2180
2343
  onSubmit ($event) {
2181
2344
  $event.preventDefault();
2182
2345
  return submit.apply(null);
2183
2346
  }
2184
- }, [
2185
- id,
2186
- idHint,
2187
- h('hr'),
2188
- description,
2189
- h('hr'),
2190
- submitButton
2191
- ]);
2347
+ }, children);
2192
2348
  };
2193
2349
  return ()=>render();
2194
2350
  }
@@ -2317,11 +2473,11 @@ const AClientRedirectUris = defineComponent({
2317
2473
  disabled: items.value.length <= 1,
2318
2474
  class: 'mb-2',
2319
2475
  uri: item,
2320
- onUpdated (input) {
2476
+ onUpdated: (input)=>{
2321
2477
  items.value[index] = input;
2322
2478
  handleChange();
2323
2479
  },
2324
- onDeleted () {
2480
+ onDeleted: ()=>{
2325
2481
  items.value.splice(index, 1);
2326
2482
  handleChange();
2327
2483
  }
@@ -2369,6 +2525,7 @@ const AClientForm = defineComponent({
2369
2525
  const busy = ref(false);
2370
2526
  const form = reactive({
2371
2527
  name: '',
2528
+ display_name: '',
2372
2529
  description: '',
2373
2530
  realm_id: '',
2374
2531
  redirect_uri: '',
@@ -2384,6 +2541,10 @@ const AClientForm = defineComponent({
2384
2541
  minLength: minLength(3),
2385
2542
  maxLength: maxLength(256)
2386
2543
  },
2544
+ display_name: {
2545
+ minLength: minLength(3),
2546
+ maxLength: maxLength(256)
2547
+ },
2387
2548
  description: {
2388
2549
  minLength: minLength(3),
2389
2550
  maxLength: maxLength(256)
@@ -2461,6 +2622,9 @@ const AClientForm = defineComponent({
2461
2622
  {
2462
2623
  key: TranslatorTranslationDefaultKey.NAME
2463
2624
  },
2625
+ {
2626
+ key: TranslatorTranslationDefaultKey.DISPLAY_NAME
2627
+ },
2464
2628
  {
2465
2629
  key: TranslatorTranslationDefaultKey.DESCRIPTION
2466
2630
  },
@@ -2493,37 +2657,53 @@ const AClientForm = defineComponent({
2493
2657
  }),
2494
2658
  h('small', translationsClient[TranslatorTranslationClientKey.NAME_HINT].value)
2495
2659
  ];
2660
+ const displayName = buildFormGroup({
2661
+ validationMessages: translationsValidation.display_name.value,
2662
+ validationSeverity: getVuelidateSeverity($v.value.display_name),
2663
+ label: true,
2664
+ labelContent: translationsDefault[TranslatorTranslationDefaultKey.DISPLAY_NAME].value,
2665
+ content: buildFormInput({
2666
+ value: $v.value.display_name.$model,
2667
+ onChange (input) {
2668
+ $v.value.display_name.$model = input;
2669
+ }
2670
+ })
2671
+ });
2496
2672
  const description = [
2497
- buildFormGroup({
2498
- validationMessages: translationsValidation.description.value,
2499
- validationSeverity: getVuelidateSeverity($v.value.description),
2500
- label: true,
2501
- labelContent: translationsDefault[TranslatorTranslationDefaultKey.DESCRIPTION].value,
2502
- content: buildFormTextarea({
2503
- value: $v.value.description.$model,
2504
- onChange (input) {
2505
- $v.value.description.$model = input;
2506
- },
2507
- props: {
2508
- rows: 7
2509
- }
2510
- })
2511
- }),
2512
- h('small', translationsClient[TranslatorTranslationClientKey.DESCRIPTION_HINT].value)
2673
+ h('div', [
2674
+ buildFormGroup({
2675
+ validationMessages: translationsValidation.description.value,
2676
+ validationSeverity: getVuelidateSeverity($v.value.description),
2677
+ label: true,
2678
+ labelContent: translationsDefault[TranslatorTranslationDefaultKey.DESCRIPTION].value,
2679
+ content: buildFormTextarea({
2680
+ value: $v.value.description.$model,
2681
+ onChange (input) {
2682
+ $v.value.description.$model = input;
2683
+ },
2684
+ props: {
2685
+ rows: 7
2686
+ }
2687
+ })
2688
+ }),
2689
+ h('small', translationsClient[TranslatorTranslationClientKey.DESCRIPTION_HINT].value)
2690
+ ])
2513
2691
  ];
2514
2692
  const redirectUri = [
2515
- h('label', {
2516
- class: 'form-label'
2517
- }, [
2518
- translationsDefault[TranslatorTranslationDefaultKey.REDIRECT_URIS].value
2519
- ]),
2520
- h(AClientRedirectUris, {
2521
- uri: form.redirect_uri,
2522
- onUpdated (value) {
2523
- form.redirect_uri = value;
2524
- }
2525
- }),
2526
- h('small', translationsClient[TranslatorTranslationClientKey.REDIRECT_URI_HINT].value)
2693
+ h('div', [
2694
+ h('label', {
2695
+ class: 'form-label'
2696
+ }, [
2697
+ translationsDefault[TranslatorTranslationDefaultKey.REDIRECT_URIS].value
2698
+ ]),
2699
+ h(AClientRedirectUris, {
2700
+ uri: form.redirect_uri,
2701
+ onUpdated: (value)=>{
2702
+ form.redirect_uri = value;
2703
+ }
2704
+ }),
2705
+ h('small', translationsClient[TranslatorTranslationClientKey.REDIRECT_URI_HINT].value)
2706
+ ])
2527
2707
  ];
2528
2708
  const isConfidential = buildFormGroup({
2529
2709
  validationMessages: translationsValidation.is_confidential.value,
@@ -2549,7 +2729,8 @@ const AClientForm = defineComponent({
2549
2729
  disabled: true
2550
2730
  }
2551
2731
  })
2552
- })
2732
+ }),
2733
+ h('hr')
2553
2734
  ];
2554
2735
  }
2555
2736
  const secret = [
@@ -2616,9 +2797,10 @@ const AClientForm = defineComponent({
2616
2797
  class: 'col'
2617
2798
  }, [
2618
2799
  id,
2619
- h('hr'),
2620
2800
  name,
2621
2801
  h('hr'),
2802
+ displayName,
2803
+ h('hr'),
2622
2804
  secret,
2623
2805
  realm
2624
2806
  ]);
@@ -2626,11 +2808,11 @@ const AClientForm = defineComponent({
2626
2808
  h('div', {
2627
2809
  class: 'col'
2628
2810
  }, [
2629
- description,
2811
+ isConfidential,
2630
2812
  h('hr'),
2631
2813
  redirectUri,
2632
2814
  h('hr'),
2633
- isConfidential,
2815
+ description,
2634
2816
  submitForm
2635
2817
  ])
2636
2818
  ];
@@ -2763,6 +2945,7 @@ const AScopeForm = defineComponent({
2763
2945
  const busy = ref(false);
2764
2946
  const form = reactive({
2765
2947
  name: '',
2948
+ display_name: '',
2766
2949
  description: '',
2767
2950
  realm_id: ''
2768
2951
  });
@@ -2773,6 +2956,10 @@ const AScopeForm = defineComponent({
2773
2956
  minLength: minLength(3),
2774
2957
  maxLength: maxLength(256)
2775
2958
  },
2959
+ display_name: {
2960
+ minLength: minLength(3),
2961
+ maxLength: maxLength(256)
2962
+ },
2776
2963
  description: {
2777
2964
  minLength: minLength(3),
2778
2965
  maxLength: maxLength(4096)
@@ -2825,6 +3012,9 @@ const AScopeForm = defineComponent({
2825
3012
  {
2826
3013
  key: TranslatorTranslationDefaultKey.NAME
2827
3014
  },
3015
+ {
3016
+ key: TranslatorTranslationDefaultKey.DISPLAY_NAME
3017
+ },
2828
3018
  {
2829
3019
  key: TranslatorTranslationDefaultKey.DESCRIPTION
2830
3020
  },
@@ -2849,6 +3039,18 @@ const AScopeForm = defineComponent({
2849
3039
  }
2850
3040
  })
2851
3041
  }),
3042
+ buildFormGroup({
3043
+ validationMessages: translationsValidation.display_name.value,
3044
+ validationSeverity: getVuelidateSeverity($v.value.display_name),
3045
+ label: true,
3046
+ labelContent: translationsDefault[TranslatorTranslationDefaultKey.DISPLAY_NAME].value,
3047
+ content: buildFormInput({
3048
+ value: $v.value.display_name.$model,
3049
+ onChange (input) {
3050
+ $v.value.display_name.$model = input;
3051
+ }
3052
+ })
3053
+ }),
2852
3054
  buildFormGroup({
2853
3055
  validationMessages: translationsValidation.description.value,
2854
3056
  validationSeverity: getVuelidateSeverity($v.value.description),
@@ -3018,6 +3220,7 @@ const AIdentityProviderBasicFields = defineComponent({
3018
3220
  setup (props, setup) {
3019
3221
  const form = reactive({
3020
3222
  name: '',
3223
+ display_name: '',
3021
3224
  slug: '',
3022
3225
  enabled: true
3023
3226
  });
@@ -3027,6 +3230,10 @@ const AIdentityProviderBasicFields = defineComponent({
3027
3230
  minLength: minLength(5),
3028
3231
  maxLength: maxLength(128)
3029
3232
  },
3233
+ display_name: {
3234
+ minLength: minLength(3),
3235
+ maxLength: maxLength(256)
3236
+ },
3030
3237
  slug: {
3031
3238
  required,
3032
3239
  [VuelidateCustomRuleKey.ALPHA_NUM_HYPHEN_UNDERSCORE]: VuelidateCustomRule[VuelidateCustomRuleKey.ALPHA_NUM_HYPHEN_UNDERSCORE],
@@ -3054,7 +3261,7 @@ const AIdentityProviderBasicFields = defineComponent({
3054
3261
  valid: !$v.value.$invalid
3055
3262
  });
3056
3263
  };
3057
- function assign(data) {
3264
+ function assign(data = {}) {
3058
3265
  extendObjectProperties(form, data);
3059
3266
  if (isSlugEmpty.value) {
3060
3267
  generateId();
@@ -3066,13 +3273,24 @@ const AIdentityProviderBasicFields = defineComponent({
3066
3273
  const updatedAt = useUpdatedAt(props.entity);
3067
3274
  onChange(updatedAt, ()=>assign(props.entity));
3068
3275
  assign(props.entity);
3069
- const validationMessages = useTranslationsForNestedValidation($v.value);
3276
+ const translationsDefault = useTranslationsForGroup(TranslatorTranslationGroup.DEFAULT, [
3277
+ {
3278
+ key: TranslatorTranslationDefaultKey.DISPLAY_NAME
3279
+ },
3280
+ {
3281
+ key: TranslatorTranslationDefaultKey.NAME
3282
+ },
3283
+ {
3284
+ key: TranslatorTranslationDefaultKey.DESCRIPTION
3285
+ }
3286
+ ]);
3287
+ const translationsValidation = useTranslationsForNestedValidation($v.value);
3070
3288
  return ()=>{
3071
3289
  const name = buildFormGroup({
3072
- validationMessages: validationMessages.name.value,
3290
+ validationMessages: translationsValidation.name.value,
3073
3291
  validationSeverity: getVuelidateSeverity($v.value.name),
3074
3292
  label: true,
3075
- labelContent: 'Name',
3293
+ labelContent: translationsDefault[TranslatorTranslationDefaultKey.NAME].value,
3076
3294
  content: buildFormInput({
3077
3295
  value: $v.value.name.$model,
3078
3296
  onChange (input) {
@@ -3080,8 +3298,20 @@ const AIdentityProviderBasicFields = defineComponent({
3080
3298
  }
3081
3299
  })
3082
3300
  });
3301
+ const displayName = buildFormGroup({
3302
+ validationMessages: translationsValidation.display_name.value,
3303
+ validationSeverity: getVuelidateSeverity($v.value.display_name),
3304
+ label: true,
3305
+ labelContent: translationsDefault[TranslatorTranslationDefaultKey.DISPLAY_NAME].value,
3306
+ content: buildFormInput({
3307
+ value: $v.value.display_name.$model,
3308
+ onChange (input) {
3309
+ $v.value.display_name.$model = input;
3310
+ }
3311
+ })
3312
+ });
3083
3313
  const slug = buildFormGroup({
3084
- validationMessages: validationMessages.slug.value,
3314
+ validationMessages: translationsValidation.slug.value,
3085
3315
  validationSeverity: getVuelidateSeverity($v.value.slug),
3086
3316
  label: true,
3087
3317
  labelContent: 'Slug',
@@ -3122,6 +3352,7 @@ const AIdentityProviderBasicFields = defineComponent({
3122
3352
  });
3123
3353
  return [
3124
3354
  name,
3355
+ displayName,
3125
3356
  slug,
3126
3357
  slugGenerator,
3127
3358
  enabled
@@ -4494,11 +4725,11 @@ const AIdentityProviderForm = defineComponent({
4494
4725
  protocol: protocol.value,
4495
4726
  preset: preset.value,
4496
4727
  apiUrl: props.apiUrl,
4497
- onCreated (el) {
4728
+ onCreated: (el)=>{
4498
4729
  entity.value = el;
4499
4730
  setup.emit('created', el);
4500
4731
  },
4501
- onUpdated (el) {
4732
+ onUpdated: (el)=>{
4502
4733
  entity.value = el;
4503
4734
  setup.emit('updated', el);
4504
4735
  }
@@ -4509,11 +4740,11 @@ const AIdentityProviderForm = defineComponent({
4509
4740
  return render(h(AIdentityProviderLdapForm, {
4510
4741
  entity: entity.value,
4511
4742
  realmId: props.realmId,
4512
- onCreated (el) {
4743
+ onCreated: (el)=>{
4513
4744
  entity.value = el;
4514
4745
  setup.emit('created', el);
4515
4746
  },
4516
- onUpdated (el) {
4747
+ onUpdated: (el)=>{
4517
4748
  entity.value = el;
4518
4749
  setup.emit('updated', el);
4519
4750
  }
@@ -4824,6 +5055,7 @@ const ARoleForm = defineComponent({
4824
5055
  const busy = ref(false);
4825
5056
  const form = reactive({
4826
5057
  name: '',
5058
+ display_name: '',
4827
5059
  description: '',
4828
5060
  realm_id: ''
4829
5061
  });
@@ -4833,6 +5065,10 @@ const ARoleForm = defineComponent({
4833
5065
  minLength: minLength(3),
4834
5066
  maxLength: maxLength(30)
4835
5067
  },
5068
+ display_name: {
5069
+ minLength: minLength(3),
5070
+ maxLength: maxLength(256)
5071
+ },
4836
5072
  description: {
4837
5073
  minLength: minLength(5),
4838
5074
  maxLength: maxLength(4096)
@@ -4876,6 +5112,9 @@ const ARoleForm = defineComponent({
4876
5112
  {
4877
5113
  key: TranslatorTranslationDefaultKey.NAME
4878
5114
  },
5115
+ {
5116
+ key: TranslatorTranslationDefaultKey.DISPLAY_NAME
5117
+ },
4879
5118
  {
4880
5119
  key: TranslatorTranslationDefaultKey.DESCRIPTION
4881
5120
  }
@@ -4894,6 +5133,18 @@ const ARoleForm = defineComponent({
4894
5133
  }
4895
5134
  })
4896
5135
  }));
5136
+ children.push(buildFormGroup({
5137
+ validationMessages: translationsValidation.display_name.value,
5138
+ validationSeverity: getVuelidateSeverity($v.value.display_name),
5139
+ label: true,
5140
+ labelContent: translationsDefault[TranslatorTranslationDefaultKey.DISPLAY_NAME].value,
5141
+ content: buildFormInput({
5142
+ value: $v.value.display_name.$model,
5143
+ onChange (input) {
5144
+ $v.value.display_name.$model = input;
5145
+ }
5146
+ })
5147
+ }));
4897
5148
  children.push(buildFormGroup({
4898
5149
  validationMessages: translationsValidation.description.value,
4899
5150
  validationSeverity: getVuelidateSeverity($v.value.description),
@@ -5028,6 +5279,7 @@ const APermissionForm = defineComponent({
5028
5279
  const busy = ref(false);
5029
5280
  const form = reactive({
5030
5281
  name: '',
5282
+ display_name: '',
5031
5283
  description: '',
5032
5284
  realm_id: ''
5033
5285
  });
@@ -5037,6 +5289,10 @@ const APermissionForm = defineComponent({
5037
5289
  minLength: minLength(3),
5038
5290
  maxLength: maxLength(128)
5039
5291
  },
5292
+ display_name: {
5293
+ minLength: minLength(3),
5294
+ maxLength: maxLength(256)
5295
+ },
5040
5296
  description: {
5041
5297
  minLength: minLength(5),
5042
5298
  maxLength: maxLength(4096)
@@ -5080,6 +5336,9 @@ const APermissionForm = defineComponent({
5080
5336
  {
5081
5337
  key: TranslatorTranslationDefaultKey.NAME
5082
5338
  },
5339
+ {
5340
+ key: TranslatorTranslationDefaultKey.DISPLAY_NAME
5341
+ },
5083
5342
  {
5084
5343
  key: TranslatorTranslationDefaultKey.DESCRIPTION
5085
5344
  }
@@ -5101,6 +5360,18 @@ const APermissionForm = defineComponent({
5101
5360
  }
5102
5361
  })
5103
5362
  }));
5363
+ children.push(buildFormGroup({
5364
+ validationMessages: translationsValidation.display_name.value,
5365
+ validationSeverity: getVuelidateSeverity($v.value.display_name),
5366
+ label: true,
5367
+ labelContent: translationsDefault[TranslatorTranslationDefaultKey.DISPLAY_NAME].value,
5368
+ content: buildFormInput({
5369
+ value: $v.value.display_name.$model,
5370
+ onChange (input) {
5371
+ $v.value.display_name.$model = input;
5372
+ }
5373
+ })
5374
+ }));
5104
5375
  children.push(buildFormGroup({
5105
5376
  validationMessages: translationsValidation.description.value,
5106
5377
  validationSeverity: getVuelidateSeverity($v.value.description),
@@ -5240,6 +5511,7 @@ const ARobotForm = defineComponent({
5240
5511
  const busy = ref(false);
5241
5512
  const form = reactive({
5242
5513
  name: '',
5514
+ display_name: '',
5243
5515
  realm_id: '',
5244
5516
  secret: ''
5245
5517
  });
@@ -5249,6 +5521,10 @@ const ARobotForm = defineComponent({
5249
5521
  minLength: minLength(3),
5250
5522
  maxLength: maxLength(128)
5251
5523
  },
5524
+ display_name: {
5525
+ minLength: minLength(3),
5526
+ maxLength: maxLength(256)
5527
+ },
5252
5528
  realm_id: {
5253
5529
  required
5254
5530
  },
@@ -5268,7 +5544,7 @@ const ARobotForm = defineComponent({
5268
5544
  const isRealmLocked = computed(()=>!!props.realmId);
5269
5545
  const isSecretHashed = computed(()=>manager.data.value && manager.data.value.secret === form.secret && form.secret.startsWith('$'));
5270
5546
  const generateSecret = ()=>{
5271
- form.secret = createNanoID('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_!.', 64);
5547
+ form.secret = createNanoID(64);
5272
5548
  };
5273
5549
  function initForm() {
5274
5550
  if (props.name) {
@@ -5310,6 +5586,9 @@ const ARobotForm = defineComponent({
5310
5586
  {
5311
5587
  key: TranslatorTranslationDefaultKey.NAME
5312
5588
  },
5589
+ {
5590
+ key: TranslatorTranslationDefaultKey.DISPLAY_NAME
5591
+ },
5313
5592
  {
5314
5593
  key: TranslatorTranslationDefaultKey.DESCRIPTION
5315
5594
  },
@@ -5333,6 +5612,18 @@ const ARobotForm = defineComponent({
5333
5612
  }
5334
5613
  })
5335
5614
  });
5615
+ const displayName = buildFormGroup({
5616
+ validationMessages: translationsValidation.display_name.value,
5617
+ validationSeverity: getVuelidateSeverity($v.value.display_name),
5618
+ label: true,
5619
+ labelContent: translationsDefault[TranslatorTranslationDefaultKey.DISPLAY_NAME].value,
5620
+ content: buildFormInput({
5621
+ value: $v.value.display_name.$model,
5622
+ onChange (input) {
5623
+ $v.value.display_name.$model = input;
5624
+ }
5625
+ })
5626
+ });
5336
5627
  let id = [];
5337
5628
  if (manager.data.value) {
5338
5629
  id = [
@@ -5397,6 +5688,7 @@ const ARobotForm = defineComponent({
5397
5688
  }, [
5398
5689
  id,
5399
5690
  name,
5691
+ displayName,
5400
5692
  secret,
5401
5693
  secretInfo,
5402
5694
  h('hr'),
@@ -5656,7 +5948,6 @@ const AUserForm = defineComponent({
5656
5948
  emits: defineEntityManagerEvents(),
5657
5949
  async setup (props, ctx) {
5658
5950
  const busy = ref(false);
5659
- const displayNameChanged = ref(false);
5660
5951
  const form = reactive({
5661
5952
  active: true,
5662
5953
  name: '',
@@ -5674,9 +5965,8 @@ const AUserForm = defineComponent({
5674
5965
  },
5675
5966
  name_locked: {},
5676
5967
  display_name: {
5677
- required,
5678
5968
  minLength: minLength(3),
5679
- maxLength: maxLength(128)
5969
+ maxLength: maxLength(256)
5680
5970
  },
5681
5971
  email: {
5682
5972
  minLength: minLength(5),
@@ -5717,14 +6007,6 @@ const AUserForm = defineComponent({
5717
6007
  }
5718
6008
  await manager.createOrUpdate(form);
5719
6009
  };
5720
- const updateDisplayName = (value)=>{
5721
- if (!displayNameChanged.value) {
5722
- form.display_name = value;
5723
- }
5724
- };
5725
- const handleDisplayNameChanged = (value)=>{
5726
- displayNameChanged.value = value.length !== 0;
5727
- };
5728
6010
  const translationsValidation = useTranslationsForNestedValidation($v.value);
5729
6011
  const translationsSubmit = createFormSubmitTranslations();
5730
6012
  const translationsDefault = useTranslationsForGroup(TranslatorTranslationGroup.DEFAULT, [
@@ -5763,7 +6045,6 @@ const AUserForm = defineComponent({
5763
6045
  value: $v.value.name.$model,
5764
6046
  onChange (input) {
5765
6047
  $v.value.name.$model = input;
5766
- updateDisplayName.call(null, input);
5767
6048
  },
5768
6049
  props: {
5769
6050
  disabled: form.name_locked
@@ -5779,7 +6060,6 @@ const AUserForm = defineComponent({
5779
6060
  value: $v.value.display_name.$model,
5780
6061
  onChange (input) {
5781
6062
  $v.value.display_name.$model = input;
5782
- handleDisplayNameChanged.call(null, input);
5783
6063
  }
5784
6064
  })
5785
6065
  });
@@ -6597,7 +6877,7 @@ const AEntityDelete = defineComponent({
6597
6877
  const busy = ref(false);
6598
6878
  const submit = wrapFnWithBusyState(busy, async ()=>{
6599
6879
  const domainAPI = apiClient[props.entityType];
6600
- if (!isObject$1(domainAPI)) {
6880
+ if (!isObject$2(domainAPI)) {
6601
6881
  return;
6602
6882
  }
6603
6883
  if (typeof domainAPI.delete !== 'function') {