@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.
- package/dist/components/AEntityDelete.d.ts +11 -10
- package/dist/components/AEntityDelete.d.ts.map +1 -1
- package/dist/components/client/AClient.d.ts +4 -4
- package/dist/components/client/AClient.d.ts.map +1 -1
- package/dist/components/client/AClientForm.d.ts +7 -7
- package/dist/components/client/AClientForm.d.ts.map +1 -1
- package/dist/components/client/AClientRedirectUris.d.ts +6 -6
- package/dist/components/client/AClientRedirectUris.d.ts.map +1 -1
- package/dist/components/client/AClientRedirectUrisItem.d.ts +6 -6
- package/dist/components/client/AClientRedirectUrisItem.d.ts.map +1 -1
- package/dist/components/client/AClients.d.ts +6 -6
- package/dist/components/client/AClients.d.ts.map +1 -1
- package/dist/components/client-scope/AClientScope.d.ts +4 -4
- package/dist/components/client-scope/AClientScope.d.ts.map +1 -1
- package/dist/components/client-scope/AClientScopeAssignment.d.ts +5 -5
- package/dist/components/client-scope/AClientScopeAssignment.d.ts.map +1 -1
- package/dist/components/client-scope/AClientScopeAssignments.d.ts +4 -4
- package/dist/components/client-scope/AClientScopeAssignments.d.ts.map +1 -1
- package/dist/components/client-scope/AClientScopes.d.ts +6 -6
- package/dist/components/client-scope/AClientScopes.d.ts.map +1 -1
- package/dist/components/identity-provider/AIdentityProvider.d.ts +4 -4
- package/dist/components/identity-provider/AIdentityProvider.d.ts.map +1 -1
- package/dist/components/identity-provider/AIdentityProviderBasicFields.d.ts +5 -5
- package/dist/components/identity-provider/AIdentityProviderBasicFields.d.ts.map +1 -1
- package/dist/components/identity-provider/AIdentityProviderForm.d.ts +5 -5
- package/dist/components/identity-provider/AIdentityProviderForm.d.ts.map +1 -1
- package/dist/components/identity-provider/AIdentityProviderIcon.d.ts +4 -4
- package/dist/components/identity-provider/AIdentityProviderIcon.d.ts.map +1 -1
- package/dist/components/identity-provider/AIdentityProviderLdapConnectionFields.d.ts +6 -6
- package/dist/components/identity-provider/AIdentityProviderLdapConnectionFields.d.ts.map +1 -1
- package/dist/components/identity-provider/AIdentityProviderLdapCredentialsFields.d.ts +6 -6
- package/dist/components/identity-provider/AIdentityProviderLdapCredentialsFields.d.ts.map +1 -1
- package/dist/components/identity-provider/AIdentityProviderLdapForm.d.ts +6 -6
- package/dist/components/identity-provider/AIdentityProviderLdapForm.d.ts.map +1 -1
- package/dist/components/identity-provider/AIdentityProviderLdapGroupFields.d.ts +6 -6
- package/dist/components/identity-provider/AIdentityProviderLdapGroupFields.d.ts.map +1 -1
- package/dist/components/identity-provider/AIdentityProviderLdapUserFields.d.ts +6 -6
- package/dist/components/identity-provider/AIdentityProviderLdapUserFields.d.ts.map +1 -1
- package/dist/components/identity-provider/AIdentityProviderOAuth2ClientFields.d.ts +5 -5
- package/dist/components/identity-provider/AIdentityProviderOAuth2ClientFields.d.ts.map +1 -1
- package/dist/components/identity-provider/AIdentityProviderOAuth2Discovery.d.ts +2 -2
- package/dist/components/identity-provider/AIdentityProviderOAuth2Discovery.d.ts.map +1 -1
- package/dist/components/identity-provider/AIdentityProviderOAuth2EndpointFields.d.ts +5 -5
- package/dist/components/identity-provider/AIdentityProviderOAuth2EndpointFields.d.ts.map +1 -1
- package/dist/components/identity-provider/AIdentityProviderOAuth2Form.d.ts +39 -12
- package/dist/components/identity-provider/AIdentityProviderOAuth2Form.d.ts.map +1 -1
- package/dist/components/identity-provider/AIdentityProviderPicker.d.ts +4 -4
- package/dist/components/identity-provider/AIdentityProviderPicker.d.ts.map +1 -1
- package/dist/components/identity-provider/AIdentityProviderPreset.d.ts +4 -4
- package/dist/components/identity-provider/AIdentityProviderPreset.d.ts.map +1 -1
- package/dist/components/identity-provider/AIdentityProviderProtocol.d.ts +4 -4
- package/dist/components/identity-provider/AIdentityProviderProtocol.d.ts.map +1 -1
- package/dist/components/identity-provider/AIdentityProviders.d.ts +6 -6
- package/dist/components/identity-provider/AIdentityProviders.d.ts.map +1 -1
- package/dist/components/identity-provider-role/AIdentityProviderRoleAssignment.d.ts +5 -5
- package/dist/components/identity-provider-role/AIdentityProviderRoleAssignment.d.ts.map +1 -1
- package/dist/components/identity-provider-role/AIdentityProviderRoleAssignments.d.ts +4 -4
- package/dist/components/identity-provider-role/AIdentityProviderRoleAssignments.d.ts.map +1 -1
- package/dist/components/permission/APermission.d.ts +4 -4
- package/dist/components/permission/APermission.d.ts.map +1 -1
- package/dist/components/permission/APermissionForm.d.ts +5 -5
- package/dist/components/permission/APermissionForm.d.ts.map +1 -1
- package/dist/components/permission/APermissions.d.ts +6 -6
- package/dist/components/permission/APermissions.d.ts.map +1 -1
- package/dist/components/permission-robot/APermissionRobotAssignments.d.ts +4 -4
- package/dist/components/permission-robot/APermissionRobotAssignments.d.ts.map +1 -1
- package/dist/components/permission-role/APermissionRoleAssignments.d.ts +4 -4
- package/dist/components/permission-role/APermissionRoleAssignments.d.ts.map +1 -1
- package/dist/components/permission-user/APermissionUserAssignments.d.ts +4 -4
- package/dist/components/permission-user/APermissionUserAssignments.d.ts.map +1 -1
- package/dist/components/realm/ARealm.d.ts +4 -4
- package/dist/components/realm/ARealm.d.ts.map +1 -1
- package/dist/components/realm/ARealmForm.d.ts +6 -6
- package/dist/components/realm/ARealmForm.d.ts.map +1 -1
- package/dist/components/realm/ARealms.d.ts +6 -6
- package/dist/components/realm/ARealms.d.ts.map +1 -1
- package/dist/components/robot/ARobot.d.ts +4 -4
- package/dist/components/robot/ARobot.d.ts.map +1 -1
- package/dist/components/robot/ARobotForm.d.ts +7 -7
- package/dist/components/robot/ARobotForm.d.ts.map +1 -1
- package/dist/components/robot/ARobots.d.ts +6 -6
- package/dist/components/robot/ARobots.d.ts.map +1 -1
- package/dist/components/robot-permission/ARobotPermissionAssignment.d.ts +5 -5
- package/dist/components/robot-permission/ARobotPermissionAssignment.d.ts.map +1 -1
- package/dist/components/robot-permission/ARobotPermissionAssignments.d.ts +4 -4
- package/dist/components/robot-permission/ARobotPermissionAssignments.d.ts.map +1 -1
- package/dist/components/robot-role/ARobotRoleAssignment.d.ts +5 -5
- package/dist/components/robot-role/ARobotRoleAssignment.d.ts.map +1 -1
- package/dist/components/robot-role/ARobotRoleAssignments.d.ts +4 -4
- package/dist/components/robot-role/ARobotRoleAssignments.d.ts.map +1 -1
- package/dist/components/role/ARole.d.ts +4 -4
- package/dist/components/role/ARole.d.ts.map +1 -1
- package/dist/components/role/ARoleForm.d.ts +6 -6
- package/dist/components/role/ARoleForm.d.ts.map +1 -1
- package/dist/components/role/ARoles.d.ts +6 -6
- package/dist/components/role/ARoles.d.ts.map +1 -1
- package/dist/components/role-permission/ARolePermissionAssignment.d.ts +5 -5
- package/dist/components/role-permission/ARolePermissionAssignment.d.ts.map +1 -1
- package/dist/components/role-permission/ARolePermissionAssignments.d.ts +4 -4
- package/dist/components/role-permission/ARolePermissionAssignments.d.ts.map +1 -1
- package/dist/components/role-robot/ARoleRobotAssignments.d.ts +4 -4
- package/dist/components/role-robot/ARoleRobotAssignments.d.ts.map +1 -1
- package/dist/components/role-user/ARoleUserAssignments.d.ts +4 -4
- package/dist/components/role-user/ARoleUserAssignments.d.ts.map +1 -1
- package/dist/components/scope/AScope.d.ts +4 -4
- package/dist/components/scope/AScope.d.ts.map +1 -1
- package/dist/components/scope/AScopeForm.d.ts +6 -6
- package/dist/components/scope/AScopeForm.d.ts.map +1 -1
- package/dist/components/scope/AScopes.d.ts +6 -6
- package/dist/components/scope/AScopes.d.ts.map +1 -1
- package/dist/components/scope-client/AScopeClientAssignments.d.ts +4 -4
- package/dist/components/scope-client/AScopeClientAssignments.d.ts.map +1 -1
- package/dist/components/user/AUser.d.ts +4 -4
- package/dist/components/user/AUser.d.ts.map +1 -1
- package/dist/components/user/AUserForm.d.ts +6 -6
- package/dist/components/user/AUserForm.d.ts.map +1 -1
- package/dist/components/user/AUserPasswordForm.d.ts +5 -5
- package/dist/components/user/AUserPasswordForm.d.ts.map +1 -1
- package/dist/components/user/AUsers.d.ts +6 -6
- package/dist/components/user/AUsers.d.ts.map +1 -1
- package/dist/components/user-permission/AUserPermissionAssignment.d.ts +5 -5
- package/dist/components/user-permission/AUserPermissionAssignment.d.ts.map +1 -1
- package/dist/components/user-permission/AUserPermissionAssignments.d.ts +4 -4
- package/dist/components/user-permission/AUserPermissionAssignments.d.ts.map +1 -1
- package/dist/components/user-role/AUserRoleAssignment.d.ts +5 -5
- package/dist/components/user-role/AUserRoleAssignment.d.ts.map +1 -1
- package/dist/components/user-role/AUserRoleAssignments.d.ts +4 -4
- package/dist/components/user-role/AUserRoleAssignments.d.ts.map +1 -1
- package/dist/components/utility/LanguageSwitcherDropdown.d.ts +5 -5
- package/dist/components/utility/LanguageSwitcherDropdown.d.ts.map +1 -1
- package/dist/components/utility/pagination/APagination.d.ts +4 -4
- package/dist/components/utility/pagination/APagination.d.ts.map +1 -1
- package/dist/components/utility/search/ASearch.d.ts +5 -5
- package/dist/components/utility/search/ASearch.d.ts.map +1 -1
- package/dist/components/utility/title/ATitle.d.ts +5 -5
- package/dist/components/utility/title/ATitle.d.ts.map +1 -1
- package/dist/composables/use-ability-check.d.ts.map +1 -1
- package/dist/core/entity-manager/utils.d.ts.map +1 -1
- package/dist/core/list/utils/component.d.ts.map +1 -1
- package/dist/core/store/create.d.ts +134 -39
- package/dist/core/store/create.d.ts.map +1 -1
- package/dist/core/store/install.d.ts.map +1 -1
- package/dist/index.cjs +391 -111
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +401 -121
- package/dist/index.mjs.map +1 -1
- package/dist/security/index.d.ts +2 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/policy/index.d.ts +3 -0
- package/dist/security/policy/index.d.ts.map +1 -0
- package/dist/security/policy/module.d.ts +5 -0
- package/dist/security/policy/module.d.ts.map +1 -0
- package/dist/security/policy/variants/evaluator.d.ts +11 -0
- package/dist/security/policy/variants/evaluator.d.ts.map +1 -0
- package/dist/security/policy/variants/index.d.ts +2 -0
- package/dist/security/policy/variants/index.d.ts.map +1 -0
- package/package.json +21 -20
package/dist/index.cjs
CHANGED
|
@@ -65,6 +65,35 @@ function injectHTTPClient(app) {
|
|
|
65
65
|
* view the LICENSE file that was distributed with this source code.
|
|
66
66
|
*/ const STORE_ID = 'authup';
|
|
67
67
|
|
|
68
|
+
class PermissionBindingPolicyEvaluator {
|
|
69
|
+
async can(ctx) {
|
|
70
|
+
return ctx.spec.type === kit.BuiltInPolicyType.PERMISSION_BINDING;
|
|
71
|
+
}
|
|
72
|
+
async validateSpecification(ctx) {
|
|
73
|
+
return this.validator.run(ctx.spec);
|
|
74
|
+
}
|
|
75
|
+
async validateData(ctx) {
|
|
76
|
+
if (!smob.isObject(ctx.data.identity) && !smob.isObject(ctx.data.permission)) {
|
|
77
|
+
throw kit.PolicyError.evaluatorContextInvalid();
|
|
78
|
+
}
|
|
79
|
+
return ctx.data;
|
|
80
|
+
}
|
|
81
|
+
async evaluate(ctx) {
|
|
82
|
+
// todo: this must be changed when the permission-checker not only checks owned permissions.
|
|
83
|
+
return kit.maybeInvertPolicyOutcome(true, ctx.spec.invert);
|
|
84
|
+
}
|
|
85
|
+
constructor(){
|
|
86
|
+
this.validator = new kit.PermissionBindingPolicyValidator();
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
class PolicyEngine extends kit.PolicyEngine {
|
|
91
|
+
constructor(){
|
|
92
|
+
super();
|
|
93
|
+
this.registerEvaluator(kit.BuiltInPolicyType.PERMISSION_BINDING, new PermissionBindingPolicyEvaluator());
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
68
97
|
function createStore(context = {}) {
|
|
69
98
|
const client = new coreHttpKit.Client({
|
|
70
99
|
baseURL: context.baseURL
|
|
@@ -145,7 +174,11 @@ function createStore(context = {}) {
|
|
|
145
174
|
const setRealmManagement = (entity)=>{
|
|
146
175
|
realmManagement.value = entity;
|
|
147
176
|
};
|
|
148
|
-
const
|
|
177
|
+
const permissionRepository = new kit.PermissionMemoryProvider();
|
|
178
|
+
const permissionChecker = new kit.PermissionChecker({
|
|
179
|
+
provider: permissionRepository,
|
|
180
|
+
policyEngine: new PolicyEngine()
|
|
181
|
+
});
|
|
149
182
|
const tokenInfo = vue.ref(undefined);
|
|
150
183
|
const tokenResolved = vue.ref(false);
|
|
151
184
|
const setTokenInfo = (entity)=>{
|
|
@@ -154,7 +187,7 @@ function createStore(context = {}) {
|
|
|
154
187
|
if (!entity) {
|
|
155
188
|
setRealm(undefined);
|
|
156
189
|
setRealmManagement(undefined);
|
|
157
|
-
|
|
190
|
+
permissionRepository.setMany([]);
|
|
158
191
|
return;
|
|
159
192
|
}
|
|
160
193
|
if (entity.exp) {
|
|
@@ -171,7 +204,7 @@ function createStore(context = {}) {
|
|
|
171
204
|
}
|
|
172
205
|
}
|
|
173
206
|
if (entity.permissions) {
|
|
174
|
-
|
|
207
|
+
permissionRepository.setMany(entity.permissions);
|
|
175
208
|
}
|
|
176
209
|
};
|
|
177
210
|
// --------------------------------------------------------------------
|
|
@@ -234,7 +267,7 @@ function createStore(context = {}) {
|
|
|
234
267
|
return {
|
|
235
268
|
initialized,
|
|
236
269
|
setInitialized,
|
|
237
|
-
|
|
270
|
+
permissionChecker,
|
|
238
271
|
login,
|
|
239
272
|
logout,
|
|
240
273
|
loggedIn,
|
|
@@ -271,6 +304,7 @@ function tryOnScopeDispose(fn) {
|
|
|
271
304
|
return false;
|
|
272
305
|
}
|
|
273
306
|
typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
|
|
307
|
+
const noop = ()=>{};
|
|
274
308
|
|
|
275
309
|
function useCookies(dependencies, { doNotParse = false, autoUpdateDependencies = false } = {}, cookies = new Cookie()) {
|
|
276
310
|
const watchingDependencies = autoUpdateDependencies ? [
|
|
@@ -357,17 +391,18 @@ function installStore(app, options = {}) {
|
|
|
357
391
|
baseURL: options.baseURL
|
|
358
392
|
}));
|
|
359
393
|
const store = storeCreator(options.pinia);
|
|
360
|
-
const cookies = useCookies();
|
|
361
394
|
let cookieGet;
|
|
362
395
|
if (options.cookieGet) {
|
|
363
396
|
cookieGet = options.cookieGet;
|
|
364
397
|
} else {
|
|
398
|
+
const cookies = useCookies();
|
|
365
399
|
cookieGet = cookies.get;
|
|
366
400
|
}
|
|
367
401
|
let cookieSet;
|
|
368
402
|
if (options.cookieSet) {
|
|
369
403
|
cookieSet = options.cookieSet;
|
|
370
404
|
} else {
|
|
405
|
+
const cookies = useCookies();
|
|
371
406
|
cookieSet = cookies.set;
|
|
372
407
|
}
|
|
373
408
|
let cookieUnset;
|
|
@@ -378,6 +413,7 @@ function installStore(app, options = {}) {
|
|
|
378
413
|
options.cookieSet(key, null);
|
|
379
414
|
};
|
|
380
415
|
} else {
|
|
416
|
+
const cookies = useCookies();
|
|
381
417
|
cookieUnset = cookies.remove;
|
|
382
418
|
}
|
|
383
419
|
const initStore = ()=>{
|
|
@@ -1018,17 +1054,17 @@ function createList(context) {
|
|
|
1018
1054
|
busy: busy.value,
|
|
1019
1055
|
data: data.value,
|
|
1020
1056
|
meta: meta.value,
|
|
1021
|
-
onCreated (value)
|
|
1057
|
+
onCreated: (value)=>{
|
|
1022
1058
|
if (context.setup.emit) {
|
|
1023
1059
|
context.setup.emit('created', value);
|
|
1024
1060
|
}
|
|
1025
1061
|
},
|
|
1026
|
-
onDeleted (value)
|
|
1062
|
+
onDeleted: (value)=>{
|
|
1027
1063
|
if (context.setup.emit) {
|
|
1028
1064
|
context.setup.emit('deleted', value);
|
|
1029
1065
|
}
|
|
1030
1066
|
},
|
|
1031
|
-
onUpdated (value)
|
|
1067
|
+
onUpdated: (value)=>{
|
|
1032
1068
|
if (context.setup.emit) {
|
|
1033
1069
|
context.setup.emit('updated', value);
|
|
1034
1070
|
}
|
|
@@ -1559,38 +1595,115 @@ exports.TranslatorTranslationDefaultKey = void 0;
|
|
|
1559
1595
|
TranslatorTranslationDefaultKey["USERS"] = "users";
|
|
1560
1596
|
})(exports.TranslatorTranslationDefaultKey || (exports.TranslatorTranslationDefaultKey = {}));
|
|
1561
1597
|
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1598
|
+
/*
|
|
1599
|
+
* Copyright (c) 2024-2024.
|
|
1600
|
+
* Author Peter Placzek (tada5hi)
|
|
1601
|
+
* For the full copyright and license information,
|
|
1602
|
+
* view the LICENSE file that was distributed with this source code.
|
|
1603
|
+
*/ const BRACKET_NUMBER_REGEX = RegExp("(?<!\\\\)\\[(\\d+)]$");
|
|
1604
|
+
/**
|
|
1605
|
+
* Convert string to property path array.
|
|
1606
|
+
*
|
|
1607
|
+
* @see https://github.com/lodash/lodash/blob/main/src/.internal/stringToPath.ts
|
|
1608
|
+
* @see https://github.com/chaijs/pathval
|
|
1609
|
+
*
|
|
1610
|
+
* @param segment
|
|
1611
|
+
*/ function pathToArray(segment) {
|
|
1612
|
+
const str = segment.replace(/([^\\])\[/g, '$1.[');
|
|
1613
|
+
const parts = str.match(/(\\\.|[^.]+?)+/g);
|
|
1614
|
+
if (!parts) {
|
|
1615
|
+
return [];
|
|
1616
|
+
}
|
|
1617
|
+
const result = [];
|
|
1618
|
+
for(let i = 0; i < parts.length; i++){
|
|
1619
|
+
if (parts[i] === 'constructor' || parts[i] === '__proto__' || parts[i] === 'prototype') {
|
|
1620
|
+
continue;
|
|
1621
|
+
}
|
|
1622
|
+
const regex = BRACKET_NUMBER_REGEX.exec(parts[i]);
|
|
1623
|
+
if (regex) {
|
|
1624
|
+
result.push(regex[1]);
|
|
1625
|
+
} else {
|
|
1626
|
+
result.push(parts[i].replace(/\\([.[\]])/g, '$1'));
|
|
1572
1627
|
}
|
|
1573
|
-
setObjectPathProperty(record[prefix], parts.join('.'), value);
|
|
1574
1628
|
}
|
|
1629
|
+
return result;
|
|
1630
|
+
}
|
|
1631
|
+
/*
|
|
1632
|
+
* Copyright (c) 2024.
|
|
1633
|
+
* Author Peter Placzek (tada5hi)
|
|
1634
|
+
* For the full copyright and license information,
|
|
1635
|
+
* view the LICENSE file that was distributed with this source code.
|
|
1636
|
+
*/ var Character;
|
|
1637
|
+
(function(Character) {
|
|
1638
|
+
Character["WILDCARD"] = "*";
|
|
1639
|
+
Character["GLOBSTAR"] = "**";
|
|
1640
|
+
})(Character || (Character = {}));
|
|
1641
|
+
/*
|
|
1642
|
+
* Copyright (c) 2024.
|
|
1643
|
+
* Author Peter Placzek (tada5hi)
|
|
1644
|
+
* For the full copyright and license information,
|
|
1645
|
+
* view the LICENSE file that was distributed with this source code.
|
|
1646
|
+
*/ function isObject(input) {
|
|
1647
|
+
return !!input && typeof input === 'object' && !Array.isArray(input);
|
|
1575
1648
|
}
|
|
1576
|
-
function
|
|
1577
|
-
const
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1649
|
+
function getPathValue(data, path) {
|
|
1650
|
+
const parts = Array.isArray(path) ? path : pathToArray(path);
|
|
1651
|
+
let res;
|
|
1652
|
+
let temp = data;
|
|
1653
|
+
let index = 0;
|
|
1654
|
+
while(index < parts.length){
|
|
1655
|
+
if (temp === null || typeof temp === 'undefined') {
|
|
1656
|
+
break;
|
|
1657
|
+
}
|
|
1658
|
+
if (parts[index] in Object(temp)) {
|
|
1659
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
1660
|
+
// @ts-expect-error
|
|
1661
|
+
temp = temp[parts[index]];
|
|
1662
|
+
} else {
|
|
1663
|
+
break;
|
|
1664
|
+
}
|
|
1665
|
+
if (index === parts.length - 1) {
|
|
1666
|
+
res = temp;
|
|
1667
|
+
}
|
|
1668
|
+
index++;
|
|
1581
1669
|
}
|
|
1582
|
-
|
|
1583
|
-
|
|
1670
|
+
return res;
|
|
1671
|
+
}
|
|
1672
|
+
const NUMBER_REGEX = /^\d+$/;
|
|
1673
|
+
function setPathValue(data, path, value) {
|
|
1674
|
+
const parts = Array.isArray(path) ? path : pathToArray(path);
|
|
1675
|
+
let temp = data;
|
|
1676
|
+
let index = 0;
|
|
1677
|
+
while(index < parts.length){
|
|
1678
|
+
/* istanbul ignore next */ if (!Array.isArray(temp) && !isObject(temp)) {
|
|
1679
|
+
break;
|
|
1680
|
+
}
|
|
1681
|
+
const key = parts[index];
|
|
1682
|
+
// [foo, '0']
|
|
1683
|
+
if (typeof temp[key] === 'undefined') {
|
|
1684
|
+
const match = NUMBER_REGEX.test(key);
|
|
1685
|
+
if (match) {
|
|
1686
|
+
temp[key] = [];
|
|
1687
|
+
} else {
|
|
1688
|
+
temp[key] = {};
|
|
1689
|
+
}
|
|
1690
|
+
}
|
|
1691
|
+
if (index === parts.length - 1) {
|
|
1692
|
+
temp[key] = value;
|
|
1693
|
+
break;
|
|
1694
|
+
}
|
|
1695
|
+
index++;
|
|
1696
|
+
temp = temp[key];
|
|
1584
1697
|
}
|
|
1585
|
-
|
|
1586
|
-
return getObjectPathProperty(data[currentKey], nextKey);
|
|
1698
|
+
return data;
|
|
1587
1699
|
}
|
|
1700
|
+
|
|
1588
1701
|
class MemoryStore {
|
|
1589
1702
|
async get(context) {
|
|
1590
1703
|
if (!this.data[context.locale] || !this.data[context.locale][context.group]) {
|
|
1591
1704
|
return undefined;
|
|
1592
1705
|
}
|
|
1593
|
-
const output =
|
|
1706
|
+
const output = getPathValue(this.data[context.locale][context.group], context.key);
|
|
1594
1707
|
if (typeof output === 'string') {
|
|
1595
1708
|
return output;
|
|
1596
1709
|
}
|
|
@@ -1598,7 +1711,7 @@ class MemoryStore {
|
|
|
1598
1711
|
}
|
|
1599
1712
|
async set(context) {
|
|
1600
1713
|
this.initLines(context.group, context.locale);
|
|
1601
|
-
|
|
1714
|
+
setPathValue(this.data[context.locale][context.group], context.key, context.value);
|
|
1602
1715
|
}
|
|
1603
1716
|
initLines(group, locale) {
|
|
1604
1717
|
if (typeof this.data[locale] === 'undefined') {
|
|
@@ -1616,9 +1729,6 @@ class MemoryStore {
|
|
|
1616
1729
|
}
|
|
1617
1730
|
}
|
|
1618
1731
|
|
|
1619
|
-
typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
|
|
1620
|
-
const noop = ()=>{};
|
|
1621
|
-
|
|
1622
1732
|
function computedAsync(evaluationCallback, initialState, optionsOrRef) {
|
|
1623
1733
|
let options;
|
|
1624
1734
|
if (vue.isRef(optionsOrRef)) {
|
|
@@ -2001,13 +2111,46 @@ function useUpdatedAt(input) {
|
|
|
2001
2111
|
}
|
|
2002
2112
|
|
|
2003
2113
|
function useAbilityCheck(name) {
|
|
2004
|
-
const
|
|
2114
|
+
const store = useStore();
|
|
2115
|
+
const refs = storeToRefs(store);
|
|
2005
2116
|
const data = vue.ref(false);
|
|
2006
|
-
|
|
2117
|
+
let computePromise;
|
|
2118
|
+
const compute = async ()=>{
|
|
2119
|
+
if (computePromise) {
|
|
2120
|
+
return computePromise;
|
|
2121
|
+
}
|
|
2122
|
+
let identity;
|
|
2123
|
+
if (refs.userId.value) {
|
|
2124
|
+
identity = {
|
|
2125
|
+
type: 'user',
|
|
2126
|
+
id: refs.userId.value
|
|
2127
|
+
};
|
|
2128
|
+
}
|
|
2129
|
+
let outcome;
|
|
2130
|
+
try {
|
|
2131
|
+
computePromise = store.permissionChecker.preCheck({
|
|
2132
|
+
name,
|
|
2133
|
+
data: {
|
|
2134
|
+
identity
|
|
2135
|
+
}
|
|
2136
|
+
}).then(()=>true).catch(()=>false);
|
|
2137
|
+
outcome = await computePromise;
|
|
2138
|
+
} catch (e) {
|
|
2139
|
+
outcome = false;
|
|
2140
|
+
} finally{
|
|
2141
|
+
computePromise = undefined;
|
|
2142
|
+
}
|
|
2143
|
+
return outcome;
|
|
2144
|
+
};
|
|
2145
|
+
Promise.resolve().then(()=>compute()).then((outcome)=>{
|
|
2146
|
+
data.value = outcome;
|
|
2147
|
+
});
|
|
2007
2148
|
let removeListener;
|
|
2008
2149
|
vue.onMounted(()=>{
|
|
2009
|
-
removeListener =
|
|
2010
|
-
|
|
2150
|
+
removeListener = vue.watch(refs.loggedIn, ()=>{
|
|
2151
|
+
Promise.resolve().then(()=>compute()).then((outcome)=>{
|
|
2152
|
+
data.value = outcome;
|
|
2153
|
+
});
|
|
2011
2154
|
});
|
|
2012
2155
|
});
|
|
2013
2156
|
vue.onUnmounted(()=>{
|
|
@@ -2059,6 +2202,7 @@ const ARealmForm = vue.defineComponent({
|
|
|
2059
2202
|
const busy = vue.ref(false);
|
|
2060
2203
|
const form = vue.reactive({
|
|
2061
2204
|
name: '',
|
|
2205
|
+
display_name: '',
|
|
2062
2206
|
description: ''
|
|
2063
2207
|
});
|
|
2064
2208
|
const $v = useVuelidate({
|
|
@@ -2067,6 +2211,10 @@ const ARealmForm = vue.defineComponent({
|
|
|
2067
2211
|
minLength: validators.minLength(3),
|
|
2068
2212
|
maxLength: validators.maxLength(128)
|
|
2069
2213
|
},
|
|
2214
|
+
display_name: {
|
|
2215
|
+
minLength: validators.minLength(3),
|
|
2216
|
+
maxLength: validators.maxLength(256)
|
|
2217
|
+
},
|
|
2070
2218
|
description: {
|
|
2071
2219
|
minLength: validators.minLength(5),
|
|
2072
2220
|
maxLength: validators.maxLength(4096)
|
|
@@ -2111,12 +2259,16 @@ const ARealmForm = vue.defineComponent({
|
|
|
2111
2259
|
{
|
|
2112
2260
|
key: exports.TranslatorTranslationDefaultKey.NAME
|
|
2113
2261
|
},
|
|
2262
|
+
{
|
|
2263
|
+
key: exports.TranslatorTranslationDefaultKey.DISPLAY_NAME
|
|
2264
|
+
},
|
|
2114
2265
|
{
|
|
2115
2266
|
key: exports.TranslatorTranslationDefaultKey.DESCRIPTION
|
|
2116
2267
|
}
|
|
2117
2268
|
]);
|
|
2118
2269
|
const render = ()=>{
|
|
2119
|
-
const
|
|
2270
|
+
const children = [];
|
|
2271
|
+
children.push(formControls.buildFormGroup({
|
|
2120
2272
|
validationMessages: translationsValidation.name.value,
|
|
2121
2273
|
validationSeverity: getVuelidateSeverity($v.value.name),
|
|
2122
2274
|
label: true,
|
|
@@ -2130,10 +2282,9 @@ const ARealmForm = vue.defineComponent({
|
|
|
2130
2282
|
disabled: manager.data.value && manager.data.value.name === coreKit.REALM_MASTER_NAME
|
|
2131
2283
|
}
|
|
2132
2284
|
})
|
|
2133
|
-
});
|
|
2134
|
-
let idHint = [];
|
|
2285
|
+
}));
|
|
2135
2286
|
if (!manager.data.value || !manager.data.value.id) {
|
|
2136
|
-
|
|
2287
|
+
children.push([
|
|
2137
2288
|
vue.h('div', {
|
|
2138
2289
|
class: 'mb-3'
|
|
2139
2290
|
}, [
|
|
@@ -2157,9 +2308,21 @@ const ARealmForm = vue.defineComponent({
|
|
|
2157
2308
|
translationsDefault[exports.TranslatorTranslationDefaultKey.GENERATE].value
|
|
2158
2309
|
])
|
|
2159
2310
|
])
|
|
2160
|
-
];
|
|
2311
|
+
]);
|
|
2161
2312
|
}
|
|
2162
|
-
|
|
2313
|
+
children.push(formControls.buildFormGroup({
|
|
2314
|
+
validationMessages: translationsValidation.display_name.value,
|
|
2315
|
+
validationSeverity: getVuelidateSeverity($v.value.display_name),
|
|
2316
|
+
label: true,
|
|
2317
|
+
labelContent: translationsDefault[exports.TranslatorTranslationDefaultKey.DISPLAY_NAME].value,
|
|
2318
|
+
content: formControls.buildFormInput({
|
|
2319
|
+
value: $v.value.display_name.$model,
|
|
2320
|
+
onChange (input) {
|
|
2321
|
+
$v.value.display_name.$model = input;
|
|
2322
|
+
}
|
|
2323
|
+
})
|
|
2324
|
+
}));
|
|
2325
|
+
children.push(formControls.buildFormGroup({
|
|
2163
2326
|
validationMessages: translationsValidation.description.value,
|
|
2164
2327
|
validationSeverity: getVuelidateSeverity($v.value.description),
|
|
2165
2328
|
label: true,
|
|
@@ -2173,26 +2336,19 @@ const ARealmForm = vue.defineComponent({
|
|
|
2173
2336
|
rows: 4
|
|
2174
2337
|
}
|
|
2175
2338
|
})
|
|
2176
|
-
});
|
|
2177
|
-
|
|
2339
|
+
}));
|
|
2340
|
+
children.push(buildFormSubmitWithTranslations({
|
|
2178
2341
|
submit,
|
|
2179
2342
|
busy: busy.value,
|
|
2180
2343
|
isEditing: isEditing.value,
|
|
2181
2344
|
invalid: $v.value.$invalid
|
|
2182
|
-
}, translationsSubmit);
|
|
2345
|
+
}, translationsSubmit));
|
|
2183
2346
|
return vue.h('form', {
|
|
2184
2347
|
onSubmit ($event) {
|
|
2185
2348
|
$event.preventDefault();
|
|
2186
2349
|
return submit.apply(null);
|
|
2187
2350
|
}
|
|
2188
|
-
},
|
|
2189
|
-
id,
|
|
2190
|
-
idHint,
|
|
2191
|
-
vue.h('hr'),
|
|
2192
|
-
description,
|
|
2193
|
-
vue.h('hr'),
|
|
2194
|
-
submitButton
|
|
2195
|
-
]);
|
|
2351
|
+
}, children);
|
|
2196
2352
|
};
|
|
2197
2353
|
return ()=>render();
|
|
2198
2354
|
}
|
|
@@ -2321,11 +2477,11 @@ const AClientRedirectUris = vue.defineComponent({
|
|
|
2321
2477
|
disabled: items.value.length <= 1,
|
|
2322
2478
|
class: 'mb-2',
|
|
2323
2479
|
uri: item,
|
|
2324
|
-
onUpdated (input)
|
|
2480
|
+
onUpdated: (input)=>{
|
|
2325
2481
|
items.value[index] = input;
|
|
2326
2482
|
handleChange();
|
|
2327
2483
|
},
|
|
2328
|
-
onDeleted ()
|
|
2484
|
+
onDeleted: ()=>{
|
|
2329
2485
|
items.value.splice(index, 1);
|
|
2330
2486
|
handleChange();
|
|
2331
2487
|
}
|
|
@@ -2373,6 +2529,7 @@ const AClientForm = vue.defineComponent({
|
|
|
2373
2529
|
const busy = vue.ref(false);
|
|
2374
2530
|
const form = vue.reactive({
|
|
2375
2531
|
name: '',
|
|
2532
|
+
display_name: '',
|
|
2376
2533
|
description: '',
|
|
2377
2534
|
realm_id: '',
|
|
2378
2535
|
redirect_uri: '',
|
|
@@ -2388,6 +2545,10 @@ const AClientForm = vue.defineComponent({
|
|
|
2388
2545
|
minLength: validators.minLength(3),
|
|
2389
2546
|
maxLength: validators.maxLength(256)
|
|
2390
2547
|
},
|
|
2548
|
+
display_name: {
|
|
2549
|
+
minLength: validators.minLength(3),
|
|
2550
|
+
maxLength: validators.maxLength(256)
|
|
2551
|
+
},
|
|
2391
2552
|
description: {
|
|
2392
2553
|
minLength: validators.minLength(3),
|
|
2393
2554
|
maxLength: validators.maxLength(256)
|
|
@@ -2465,6 +2626,9 @@ const AClientForm = vue.defineComponent({
|
|
|
2465
2626
|
{
|
|
2466
2627
|
key: exports.TranslatorTranslationDefaultKey.NAME
|
|
2467
2628
|
},
|
|
2629
|
+
{
|
|
2630
|
+
key: exports.TranslatorTranslationDefaultKey.DISPLAY_NAME
|
|
2631
|
+
},
|
|
2468
2632
|
{
|
|
2469
2633
|
key: exports.TranslatorTranslationDefaultKey.DESCRIPTION
|
|
2470
2634
|
},
|
|
@@ -2497,37 +2661,53 @@ const AClientForm = vue.defineComponent({
|
|
|
2497
2661
|
}),
|
|
2498
2662
|
vue.h('small', translationsClient[exports.TranslatorTranslationClientKey.NAME_HINT].value)
|
|
2499
2663
|
];
|
|
2664
|
+
const displayName = formControls.buildFormGroup({
|
|
2665
|
+
validationMessages: translationsValidation.display_name.value,
|
|
2666
|
+
validationSeverity: getVuelidateSeverity($v.value.display_name),
|
|
2667
|
+
label: true,
|
|
2668
|
+
labelContent: translationsDefault[exports.TranslatorTranslationDefaultKey.DISPLAY_NAME].value,
|
|
2669
|
+
content: formControls.buildFormInput({
|
|
2670
|
+
value: $v.value.display_name.$model,
|
|
2671
|
+
onChange (input) {
|
|
2672
|
+
$v.value.display_name.$model = input;
|
|
2673
|
+
}
|
|
2674
|
+
})
|
|
2675
|
+
});
|
|
2500
2676
|
const description = [
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2677
|
+
vue.h('div', [
|
|
2678
|
+
formControls.buildFormGroup({
|
|
2679
|
+
validationMessages: translationsValidation.description.value,
|
|
2680
|
+
validationSeverity: getVuelidateSeverity($v.value.description),
|
|
2681
|
+
label: true,
|
|
2682
|
+
labelContent: translationsDefault[exports.TranslatorTranslationDefaultKey.DESCRIPTION].value,
|
|
2683
|
+
content: formControls.buildFormTextarea({
|
|
2684
|
+
value: $v.value.description.$model,
|
|
2685
|
+
onChange (input) {
|
|
2686
|
+
$v.value.description.$model = input;
|
|
2687
|
+
},
|
|
2688
|
+
props: {
|
|
2689
|
+
rows: 7
|
|
2690
|
+
}
|
|
2691
|
+
})
|
|
2692
|
+
}),
|
|
2693
|
+
vue.h('small', translationsClient[exports.TranslatorTranslationClientKey.DESCRIPTION_HINT].value)
|
|
2694
|
+
])
|
|
2517
2695
|
];
|
|
2518
2696
|
const redirectUri = [
|
|
2519
|
-
vue.h('
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2697
|
+
vue.h('div', [
|
|
2698
|
+
vue.h('label', {
|
|
2699
|
+
class: 'form-label'
|
|
2700
|
+
}, [
|
|
2701
|
+
translationsDefault[exports.TranslatorTranslationDefaultKey.REDIRECT_URIS].value
|
|
2702
|
+
]),
|
|
2703
|
+
vue.h(AClientRedirectUris, {
|
|
2704
|
+
uri: form.redirect_uri,
|
|
2705
|
+
onUpdated: (value)=>{
|
|
2706
|
+
form.redirect_uri = value;
|
|
2707
|
+
}
|
|
2708
|
+
}),
|
|
2709
|
+
vue.h('small', translationsClient[exports.TranslatorTranslationClientKey.REDIRECT_URI_HINT].value)
|
|
2710
|
+
])
|
|
2531
2711
|
];
|
|
2532
2712
|
const isConfidential = formControls.buildFormGroup({
|
|
2533
2713
|
validationMessages: translationsValidation.is_confidential.value,
|
|
@@ -2553,7 +2733,8 @@ const AClientForm = vue.defineComponent({
|
|
|
2553
2733
|
disabled: true
|
|
2554
2734
|
}
|
|
2555
2735
|
})
|
|
2556
|
-
})
|
|
2736
|
+
}),
|
|
2737
|
+
vue.h('hr')
|
|
2557
2738
|
];
|
|
2558
2739
|
}
|
|
2559
2740
|
const secret = [
|
|
@@ -2620,9 +2801,10 @@ const AClientForm = vue.defineComponent({
|
|
|
2620
2801
|
class: 'col'
|
|
2621
2802
|
}, [
|
|
2622
2803
|
id,
|
|
2623
|
-
vue.h('hr'),
|
|
2624
2804
|
name,
|
|
2625
2805
|
vue.h('hr'),
|
|
2806
|
+
displayName,
|
|
2807
|
+
vue.h('hr'),
|
|
2626
2808
|
secret,
|
|
2627
2809
|
realm
|
|
2628
2810
|
]);
|
|
@@ -2630,11 +2812,11 @@ const AClientForm = vue.defineComponent({
|
|
|
2630
2812
|
vue.h('div', {
|
|
2631
2813
|
class: 'col'
|
|
2632
2814
|
}, [
|
|
2633
|
-
|
|
2815
|
+
isConfidential,
|
|
2634
2816
|
vue.h('hr'),
|
|
2635
2817
|
redirectUri,
|
|
2636
2818
|
vue.h('hr'),
|
|
2637
|
-
|
|
2819
|
+
description,
|
|
2638
2820
|
submitForm
|
|
2639
2821
|
])
|
|
2640
2822
|
];
|
|
@@ -2767,6 +2949,7 @@ const AScopeForm = vue.defineComponent({
|
|
|
2767
2949
|
const busy = vue.ref(false);
|
|
2768
2950
|
const form = vue.reactive({
|
|
2769
2951
|
name: '',
|
|
2952
|
+
display_name: '',
|
|
2770
2953
|
description: '',
|
|
2771
2954
|
realm_id: ''
|
|
2772
2955
|
});
|
|
@@ -2777,6 +2960,10 @@ const AScopeForm = vue.defineComponent({
|
|
|
2777
2960
|
minLength: validators.minLength(3),
|
|
2778
2961
|
maxLength: validators.maxLength(256)
|
|
2779
2962
|
},
|
|
2963
|
+
display_name: {
|
|
2964
|
+
minLength: validators.minLength(3),
|
|
2965
|
+
maxLength: validators.maxLength(256)
|
|
2966
|
+
},
|
|
2780
2967
|
description: {
|
|
2781
2968
|
minLength: validators.minLength(3),
|
|
2782
2969
|
maxLength: validators.maxLength(4096)
|
|
@@ -2829,6 +3016,9 @@ const AScopeForm = vue.defineComponent({
|
|
|
2829
3016
|
{
|
|
2830
3017
|
key: exports.TranslatorTranslationDefaultKey.NAME
|
|
2831
3018
|
},
|
|
3019
|
+
{
|
|
3020
|
+
key: exports.TranslatorTranslationDefaultKey.DISPLAY_NAME
|
|
3021
|
+
},
|
|
2832
3022
|
{
|
|
2833
3023
|
key: exports.TranslatorTranslationDefaultKey.DESCRIPTION
|
|
2834
3024
|
},
|
|
@@ -2853,6 +3043,18 @@ const AScopeForm = vue.defineComponent({
|
|
|
2853
3043
|
}
|
|
2854
3044
|
})
|
|
2855
3045
|
}),
|
|
3046
|
+
formControls.buildFormGroup({
|
|
3047
|
+
validationMessages: translationsValidation.display_name.value,
|
|
3048
|
+
validationSeverity: getVuelidateSeverity($v.value.display_name),
|
|
3049
|
+
label: true,
|
|
3050
|
+
labelContent: translationsDefault[exports.TranslatorTranslationDefaultKey.DISPLAY_NAME].value,
|
|
3051
|
+
content: formControls.buildFormInput({
|
|
3052
|
+
value: $v.value.display_name.$model,
|
|
3053
|
+
onChange (input) {
|
|
3054
|
+
$v.value.display_name.$model = input;
|
|
3055
|
+
}
|
|
3056
|
+
})
|
|
3057
|
+
}),
|
|
2856
3058
|
formControls.buildFormGroup({
|
|
2857
3059
|
validationMessages: translationsValidation.description.value,
|
|
2858
3060
|
validationSeverity: getVuelidateSeverity($v.value.description),
|
|
@@ -3022,6 +3224,7 @@ const AIdentityProviderBasicFields = vue.defineComponent({
|
|
|
3022
3224
|
setup (props, setup) {
|
|
3023
3225
|
const form = vue.reactive({
|
|
3024
3226
|
name: '',
|
|
3227
|
+
display_name: '',
|
|
3025
3228
|
slug: '',
|
|
3026
3229
|
enabled: true
|
|
3027
3230
|
});
|
|
@@ -3031,6 +3234,10 @@ const AIdentityProviderBasicFields = vue.defineComponent({
|
|
|
3031
3234
|
minLength: validators.minLength(5),
|
|
3032
3235
|
maxLength: validators.maxLength(128)
|
|
3033
3236
|
},
|
|
3237
|
+
display_name: {
|
|
3238
|
+
minLength: validators.minLength(3),
|
|
3239
|
+
maxLength: validators.maxLength(256)
|
|
3240
|
+
},
|
|
3034
3241
|
slug: {
|
|
3035
3242
|
required: validators.required,
|
|
3036
3243
|
[exports.VuelidateCustomRuleKey.ALPHA_NUM_HYPHEN_UNDERSCORE]: VuelidateCustomRule[exports.VuelidateCustomRuleKey.ALPHA_NUM_HYPHEN_UNDERSCORE],
|
|
@@ -3058,7 +3265,7 @@ const AIdentityProviderBasicFields = vue.defineComponent({
|
|
|
3058
3265
|
valid: !$v.value.$invalid
|
|
3059
3266
|
});
|
|
3060
3267
|
};
|
|
3061
|
-
function assign(data) {
|
|
3268
|
+
function assign(data = {}) {
|
|
3062
3269
|
extendObjectProperties(form, data);
|
|
3063
3270
|
if (isSlugEmpty.value) {
|
|
3064
3271
|
generateId();
|
|
@@ -3070,13 +3277,24 @@ const AIdentityProviderBasicFields = vue.defineComponent({
|
|
|
3070
3277
|
const updatedAt = useUpdatedAt(props.entity);
|
|
3071
3278
|
onChange(updatedAt, ()=>assign(props.entity));
|
|
3072
3279
|
assign(props.entity);
|
|
3073
|
-
const
|
|
3280
|
+
const translationsDefault = useTranslationsForGroup(exports.TranslatorTranslationGroup.DEFAULT, [
|
|
3281
|
+
{
|
|
3282
|
+
key: exports.TranslatorTranslationDefaultKey.DISPLAY_NAME
|
|
3283
|
+
},
|
|
3284
|
+
{
|
|
3285
|
+
key: exports.TranslatorTranslationDefaultKey.NAME
|
|
3286
|
+
},
|
|
3287
|
+
{
|
|
3288
|
+
key: exports.TranslatorTranslationDefaultKey.DESCRIPTION
|
|
3289
|
+
}
|
|
3290
|
+
]);
|
|
3291
|
+
const translationsValidation = useTranslationsForNestedValidation($v.value);
|
|
3074
3292
|
return ()=>{
|
|
3075
3293
|
const name = formControls.buildFormGroup({
|
|
3076
|
-
validationMessages:
|
|
3294
|
+
validationMessages: translationsValidation.name.value,
|
|
3077
3295
|
validationSeverity: getVuelidateSeverity($v.value.name),
|
|
3078
3296
|
label: true,
|
|
3079
|
-
labelContent:
|
|
3297
|
+
labelContent: translationsDefault[exports.TranslatorTranslationDefaultKey.NAME].value,
|
|
3080
3298
|
content: formControls.buildFormInput({
|
|
3081
3299
|
value: $v.value.name.$model,
|
|
3082
3300
|
onChange (input) {
|
|
@@ -3084,8 +3302,20 @@ const AIdentityProviderBasicFields = vue.defineComponent({
|
|
|
3084
3302
|
}
|
|
3085
3303
|
})
|
|
3086
3304
|
});
|
|
3305
|
+
const displayName = formControls.buildFormGroup({
|
|
3306
|
+
validationMessages: translationsValidation.display_name.value,
|
|
3307
|
+
validationSeverity: getVuelidateSeverity($v.value.display_name),
|
|
3308
|
+
label: true,
|
|
3309
|
+
labelContent: translationsDefault[exports.TranslatorTranslationDefaultKey.DISPLAY_NAME].value,
|
|
3310
|
+
content: formControls.buildFormInput({
|
|
3311
|
+
value: $v.value.display_name.$model,
|
|
3312
|
+
onChange (input) {
|
|
3313
|
+
$v.value.display_name.$model = input;
|
|
3314
|
+
}
|
|
3315
|
+
})
|
|
3316
|
+
});
|
|
3087
3317
|
const slug = formControls.buildFormGroup({
|
|
3088
|
-
validationMessages:
|
|
3318
|
+
validationMessages: translationsValidation.slug.value,
|
|
3089
3319
|
validationSeverity: getVuelidateSeverity($v.value.slug),
|
|
3090
3320
|
label: true,
|
|
3091
3321
|
labelContent: 'Slug',
|
|
@@ -3126,6 +3356,7 @@ const AIdentityProviderBasicFields = vue.defineComponent({
|
|
|
3126
3356
|
});
|
|
3127
3357
|
return [
|
|
3128
3358
|
name,
|
|
3359
|
+
displayName,
|
|
3129
3360
|
slug,
|
|
3130
3361
|
slugGenerator,
|
|
3131
3362
|
enabled
|
|
@@ -4498,11 +4729,11 @@ const AIdentityProviderForm = vue.defineComponent({
|
|
|
4498
4729
|
protocol: protocol.value,
|
|
4499
4730
|
preset: preset.value,
|
|
4500
4731
|
apiUrl: props.apiUrl,
|
|
4501
|
-
onCreated (el)
|
|
4732
|
+
onCreated: (el)=>{
|
|
4502
4733
|
entity.value = el;
|
|
4503
4734
|
setup.emit('created', el);
|
|
4504
4735
|
},
|
|
4505
|
-
onUpdated (el)
|
|
4736
|
+
onUpdated: (el)=>{
|
|
4506
4737
|
entity.value = el;
|
|
4507
4738
|
setup.emit('updated', el);
|
|
4508
4739
|
}
|
|
@@ -4513,11 +4744,11 @@ const AIdentityProviderForm = vue.defineComponent({
|
|
|
4513
4744
|
return render(vue.h(AIdentityProviderLdapForm, {
|
|
4514
4745
|
entity: entity.value,
|
|
4515
4746
|
realmId: props.realmId,
|
|
4516
|
-
onCreated (el)
|
|
4747
|
+
onCreated: (el)=>{
|
|
4517
4748
|
entity.value = el;
|
|
4518
4749
|
setup.emit('created', el);
|
|
4519
4750
|
},
|
|
4520
|
-
onUpdated (el)
|
|
4751
|
+
onUpdated: (el)=>{
|
|
4521
4752
|
entity.value = el;
|
|
4522
4753
|
setup.emit('updated', el);
|
|
4523
4754
|
}
|
|
@@ -4828,6 +5059,7 @@ const ARoleForm = vue.defineComponent({
|
|
|
4828
5059
|
const busy = vue.ref(false);
|
|
4829
5060
|
const form = vue.reactive({
|
|
4830
5061
|
name: '',
|
|
5062
|
+
display_name: '',
|
|
4831
5063
|
description: '',
|
|
4832
5064
|
realm_id: ''
|
|
4833
5065
|
});
|
|
@@ -4837,6 +5069,10 @@ const ARoleForm = vue.defineComponent({
|
|
|
4837
5069
|
minLength: validators.minLength(3),
|
|
4838
5070
|
maxLength: validators.maxLength(30)
|
|
4839
5071
|
},
|
|
5072
|
+
display_name: {
|
|
5073
|
+
minLength: validators.minLength(3),
|
|
5074
|
+
maxLength: validators.maxLength(256)
|
|
5075
|
+
},
|
|
4840
5076
|
description: {
|
|
4841
5077
|
minLength: validators.minLength(5),
|
|
4842
5078
|
maxLength: validators.maxLength(4096)
|
|
@@ -4880,6 +5116,9 @@ const ARoleForm = vue.defineComponent({
|
|
|
4880
5116
|
{
|
|
4881
5117
|
key: exports.TranslatorTranslationDefaultKey.NAME
|
|
4882
5118
|
},
|
|
5119
|
+
{
|
|
5120
|
+
key: exports.TranslatorTranslationDefaultKey.DISPLAY_NAME
|
|
5121
|
+
},
|
|
4883
5122
|
{
|
|
4884
5123
|
key: exports.TranslatorTranslationDefaultKey.DESCRIPTION
|
|
4885
5124
|
}
|
|
@@ -4898,6 +5137,18 @@ const ARoleForm = vue.defineComponent({
|
|
|
4898
5137
|
}
|
|
4899
5138
|
})
|
|
4900
5139
|
}));
|
|
5140
|
+
children.push(formControls.buildFormGroup({
|
|
5141
|
+
validationMessages: translationsValidation.display_name.value,
|
|
5142
|
+
validationSeverity: getVuelidateSeverity($v.value.display_name),
|
|
5143
|
+
label: true,
|
|
5144
|
+
labelContent: translationsDefault[exports.TranslatorTranslationDefaultKey.DISPLAY_NAME].value,
|
|
5145
|
+
content: formControls.buildFormInput({
|
|
5146
|
+
value: $v.value.display_name.$model,
|
|
5147
|
+
onChange (input) {
|
|
5148
|
+
$v.value.display_name.$model = input;
|
|
5149
|
+
}
|
|
5150
|
+
})
|
|
5151
|
+
}));
|
|
4901
5152
|
children.push(formControls.buildFormGroup({
|
|
4902
5153
|
validationMessages: translationsValidation.description.value,
|
|
4903
5154
|
validationSeverity: getVuelidateSeverity($v.value.description),
|
|
@@ -5032,6 +5283,7 @@ const APermissionForm = vue.defineComponent({
|
|
|
5032
5283
|
const busy = vue.ref(false);
|
|
5033
5284
|
const form = vue.reactive({
|
|
5034
5285
|
name: '',
|
|
5286
|
+
display_name: '',
|
|
5035
5287
|
description: '',
|
|
5036
5288
|
realm_id: ''
|
|
5037
5289
|
});
|
|
@@ -5041,6 +5293,10 @@ const APermissionForm = vue.defineComponent({
|
|
|
5041
5293
|
minLength: validators.minLength(3),
|
|
5042
5294
|
maxLength: validators.maxLength(128)
|
|
5043
5295
|
},
|
|
5296
|
+
display_name: {
|
|
5297
|
+
minLength: validators.minLength(3),
|
|
5298
|
+
maxLength: validators.maxLength(256)
|
|
5299
|
+
},
|
|
5044
5300
|
description: {
|
|
5045
5301
|
minLength: validators.minLength(5),
|
|
5046
5302
|
maxLength: validators.maxLength(4096)
|
|
@@ -5084,6 +5340,9 @@ const APermissionForm = vue.defineComponent({
|
|
|
5084
5340
|
{
|
|
5085
5341
|
key: exports.TranslatorTranslationDefaultKey.NAME
|
|
5086
5342
|
},
|
|
5343
|
+
{
|
|
5344
|
+
key: exports.TranslatorTranslationDefaultKey.DISPLAY_NAME
|
|
5345
|
+
},
|
|
5087
5346
|
{
|
|
5088
5347
|
key: exports.TranslatorTranslationDefaultKey.DESCRIPTION
|
|
5089
5348
|
}
|
|
@@ -5105,6 +5364,18 @@ const APermissionForm = vue.defineComponent({
|
|
|
5105
5364
|
}
|
|
5106
5365
|
})
|
|
5107
5366
|
}));
|
|
5367
|
+
children.push(formControls.buildFormGroup({
|
|
5368
|
+
validationMessages: translationsValidation.display_name.value,
|
|
5369
|
+
validationSeverity: getVuelidateSeverity($v.value.display_name),
|
|
5370
|
+
label: true,
|
|
5371
|
+
labelContent: translationsDefault[exports.TranslatorTranslationDefaultKey.DISPLAY_NAME].value,
|
|
5372
|
+
content: formControls.buildFormInput({
|
|
5373
|
+
value: $v.value.display_name.$model,
|
|
5374
|
+
onChange (input) {
|
|
5375
|
+
$v.value.display_name.$model = input;
|
|
5376
|
+
}
|
|
5377
|
+
})
|
|
5378
|
+
}));
|
|
5108
5379
|
children.push(formControls.buildFormGroup({
|
|
5109
5380
|
validationMessages: translationsValidation.description.value,
|
|
5110
5381
|
validationSeverity: getVuelidateSeverity($v.value.description),
|
|
@@ -5244,6 +5515,7 @@ const ARobotForm = vue.defineComponent({
|
|
|
5244
5515
|
const busy = vue.ref(false);
|
|
5245
5516
|
const form = vue.reactive({
|
|
5246
5517
|
name: '',
|
|
5518
|
+
display_name: '',
|
|
5247
5519
|
realm_id: '',
|
|
5248
5520
|
secret: ''
|
|
5249
5521
|
});
|
|
@@ -5253,6 +5525,10 @@ const ARobotForm = vue.defineComponent({
|
|
|
5253
5525
|
minLength: validators.minLength(3),
|
|
5254
5526
|
maxLength: validators.maxLength(128)
|
|
5255
5527
|
},
|
|
5528
|
+
display_name: {
|
|
5529
|
+
minLength: validators.minLength(3),
|
|
5530
|
+
maxLength: validators.maxLength(256)
|
|
5531
|
+
},
|
|
5256
5532
|
realm_id: {
|
|
5257
5533
|
required: validators.required
|
|
5258
5534
|
},
|
|
@@ -5272,7 +5548,7 @@ const ARobotForm = vue.defineComponent({
|
|
|
5272
5548
|
const isRealmLocked = vue.computed(()=>!!props.realmId);
|
|
5273
5549
|
const isSecretHashed = vue.computed(()=>manager.data.value && manager.data.value.secret === form.secret && form.secret.startsWith('$'));
|
|
5274
5550
|
const generateSecret = ()=>{
|
|
5275
|
-
form.secret = kit.createNanoID(
|
|
5551
|
+
form.secret = kit.createNanoID(64);
|
|
5276
5552
|
};
|
|
5277
5553
|
function initForm() {
|
|
5278
5554
|
if (props.name) {
|
|
@@ -5314,6 +5590,9 @@ const ARobotForm = vue.defineComponent({
|
|
|
5314
5590
|
{
|
|
5315
5591
|
key: exports.TranslatorTranslationDefaultKey.NAME
|
|
5316
5592
|
},
|
|
5593
|
+
{
|
|
5594
|
+
key: exports.TranslatorTranslationDefaultKey.DISPLAY_NAME
|
|
5595
|
+
},
|
|
5317
5596
|
{
|
|
5318
5597
|
key: exports.TranslatorTranslationDefaultKey.DESCRIPTION
|
|
5319
5598
|
},
|
|
@@ -5337,6 +5616,18 @@ const ARobotForm = vue.defineComponent({
|
|
|
5337
5616
|
}
|
|
5338
5617
|
})
|
|
5339
5618
|
});
|
|
5619
|
+
const displayName = formControls.buildFormGroup({
|
|
5620
|
+
validationMessages: translationsValidation.display_name.value,
|
|
5621
|
+
validationSeverity: getVuelidateSeverity($v.value.display_name),
|
|
5622
|
+
label: true,
|
|
5623
|
+
labelContent: translationsDefault[exports.TranslatorTranslationDefaultKey.DISPLAY_NAME].value,
|
|
5624
|
+
content: formControls.buildFormInput({
|
|
5625
|
+
value: $v.value.display_name.$model,
|
|
5626
|
+
onChange (input) {
|
|
5627
|
+
$v.value.display_name.$model = input;
|
|
5628
|
+
}
|
|
5629
|
+
})
|
|
5630
|
+
});
|
|
5340
5631
|
let id = [];
|
|
5341
5632
|
if (manager.data.value) {
|
|
5342
5633
|
id = [
|
|
@@ -5401,6 +5692,7 @@ const ARobotForm = vue.defineComponent({
|
|
|
5401
5692
|
}, [
|
|
5402
5693
|
id,
|
|
5403
5694
|
name,
|
|
5695
|
+
displayName,
|
|
5404
5696
|
secret,
|
|
5405
5697
|
secretInfo,
|
|
5406
5698
|
vue.h('hr'),
|
|
@@ -5660,7 +5952,6 @@ const AUserForm = vue.defineComponent({
|
|
|
5660
5952
|
emits: defineEntityManagerEvents(),
|
|
5661
5953
|
async setup (props, ctx) {
|
|
5662
5954
|
const busy = vue.ref(false);
|
|
5663
|
-
const displayNameChanged = vue.ref(false);
|
|
5664
5955
|
const form = vue.reactive({
|
|
5665
5956
|
active: true,
|
|
5666
5957
|
name: '',
|
|
@@ -5678,9 +5969,8 @@ const AUserForm = vue.defineComponent({
|
|
|
5678
5969
|
},
|
|
5679
5970
|
name_locked: {},
|
|
5680
5971
|
display_name: {
|
|
5681
|
-
required: validators.required,
|
|
5682
5972
|
minLength: validators.minLength(3),
|
|
5683
|
-
maxLength: validators.maxLength(
|
|
5973
|
+
maxLength: validators.maxLength(256)
|
|
5684
5974
|
},
|
|
5685
5975
|
email: {
|
|
5686
5976
|
minLength: validators.minLength(5),
|
|
@@ -5721,14 +6011,6 @@ const AUserForm = vue.defineComponent({
|
|
|
5721
6011
|
}
|
|
5722
6012
|
await manager.createOrUpdate(form);
|
|
5723
6013
|
};
|
|
5724
|
-
const updateDisplayName = (value)=>{
|
|
5725
|
-
if (!displayNameChanged.value) {
|
|
5726
|
-
form.display_name = value;
|
|
5727
|
-
}
|
|
5728
|
-
};
|
|
5729
|
-
const handleDisplayNameChanged = (value)=>{
|
|
5730
|
-
displayNameChanged.value = value.length !== 0;
|
|
5731
|
-
};
|
|
5732
6014
|
const translationsValidation = useTranslationsForNestedValidation($v.value);
|
|
5733
6015
|
const translationsSubmit = createFormSubmitTranslations();
|
|
5734
6016
|
const translationsDefault = useTranslationsForGroup(exports.TranslatorTranslationGroup.DEFAULT, [
|
|
@@ -5767,7 +6049,6 @@ const AUserForm = vue.defineComponent({
|
|
|
5767
6049
|
value: $v.value.name.$model,
|
|
5768
6050
|
onChange (input) {
|
|
5769
6051
|
$v.value.name.$model = input;
|
|
5770
|
-
updateDisplayName.call(null, input);
|
|
5771
6052
|
},
|
|
5772
6053
|
props: {
|
|
5773
6054
|
disabled: form.name_locked
|
|
@@ -5783,7 +6064,6 @@ const AUserForm = vue.defineComponent({
|
|
|
5783
6064
|
value: $v.value.display_name.$model,
|
|
5784
6065
|
onChange (input) {
|
|
5785
6066
|
$v.value.display_name.$model = input;
|
|
5786
|
-
handleDisplayNameChanged.call(null, input);
|
|
5787
6067
|
}
|
|
5788
6068
|
})
|
|
5789
6069
|
});
|