identityscope 0.28.3 → 0.28.4

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 (91) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +917 -917
  3. package/SECURITY.md +56 -56
  4. package/dist/node/cli.js +26 -26
  5. package/dist/node/monthly.js +17 -17
  6. package/package.json +2 -2
  7. package/reports/access-profile-members.yaml +29 -29
  8. package/reports/access-profile-membership-counts.yaml +17 -17
  9. package/reports/access-profiles-without-owner.yaml +16 -16
  10. package/reports/access-request-audit-trail.yaml +36 -36
  11. package/reports/accounts-by-source.yaml +19 -19
  12. package/reports/active-identities-without-manager.yaml +22 -22
  13. package/reports/aggregation-failures.yaml +29 -29
  14. package/reports/aggregation-history.yaml +27 -27
  15. package/reports/all-sources.yaml +16 -16
  16. package/reports/application-accounts.yaml +32 -32
  17. package/reports/application-entitlements.yaml +31 -31
  18. package/reports/campaign-progress.yaml +23 -23
  19. package/reports/certification-decisions.yaml +31 -31
  20. package/reports/direct-reports-per-manager.yaml +20 -20
  21. package/reports/disabled-accounts-of-active-people.yaml +33 -33
  22. package/reports/duplicate-emails.yaml +16 -16
  23. package/reports/entitlement-holders.yaml +35 -35
  24. package/reports/entitlements-held-by-inactive-identities.yaml +31 -31
  25. package/reports/entitlements-without-owner.yaml +28 -28
  26. package/reports/identities-by-lifecycle-state.yaml +15 -15
  27. package/reports/identities-missing-key-attributes.yaml +27 -27
  28. package/reports/identities-with-processing-errors.yaml +19 -19
  29. package/reports/identity-attribute-mappings.yaml +27 -27
  30. package/reports/machine-accounts.yaml +28 -28
  31. package/reports/managers-and-direct-reports.yaml +23 -23
  32. package/reports/most-access.yaml +18 -18
  33. package/reports/new-identities.yaml +24 -24
  34. package/reports/old-passwords.yaml +35 -35
  35. package/reports/pending-reviews-by-reviewer.yaml +20 -20
  36. package/reports/person-access.yaml +31 -31
  37. package/reports/privileged-access.yaml +29 -29
  38. package/reports/provisioning-error-causes.yaml +27 -27
  39. package/reports/provisioning-errors.yaml +32 -32
  40. package/reports/provisioning-failures.yaml +28 -28
  41. package/reports/recent-access-requests.yaml +22 -22
  42. package/reports/recent-activity.yaml +32 -32
  43. package/reports/recent-leavers.yaml +34 -34
  44. package/reports/role-members.yaml +29 -29
  45. package/reports/role-membership-counts.yaml +18 -18
  46. package/reports/roles-without-owner.yaml +17 -17
  47. package/reports/sources-needing-attention.yaml +23 -23
  48. package/reports/stuck-access-requests.yaml +29 -29
  49. package/reports/team-access.yaml +30 -30
  50. package/reports/terminated-users-with-active-accounts.yaml +46 -46
  51. package/reports/uncorrelated-accounts.yaml +38 -38
  52. package/ui/js/00-setup.js +6 -6
  53. package/ui/js/01-small-helpers.js +143 -143
  54. package/ui/js/02-connection.js +150 -150
  55. package/ui/js/03-health-check.js +17 -17
  56. package/ui/js/04-library.js +135 -135
  57. package/ui/js/05-pickers.js +163 -163
  58. package/ui/js/06-report-view.js +157 -157
  59. package/ui/js/07-fields.js +85 -85
  60. package/ui/js/08-designer.js +360 -360
  61. package/ui/js/09-yaml.js +22 -22
  62. package/ui/js/10-instant-check.js +171 -171
  63. package/ui/js/11-lookup.js +161 -161
  64. package/ui/js/12-tenant.js +115 -115
  65. package/ui/js/13-source-configuration-and-diagnostics.js +64 -64
  66. package/ui/js/14-certifications.js +68 -68
  67. package/ui/js/15-monthly-report.js +24 -24
  68. package/ui/js/16-ownership.js +39 -39
  69. package/ui/js/17-compare-tenants.js +102 -102
  70. package/ui/js/18-audit.js +181 -181
  71. package/ui/js/19-insights.js +108 -108
  72. package/ui/js/20-role-mining.js +35 -35
  73. package/ui/js/21-share-reports.js +45 -45
  74. package/ui/js/22-partner-overview-all-customer-tenants.js +228 -228
  75. package/ui/js/23-in-app-guidance.js +217 -217
  76. package/ui/js/24-role-tools.js +220 -220
  77. package/ui/js/25-schedules.js +264 -264
  78. package/ui/js/26-start.js +7 -7
  79. package/ui/js/27-warnings.js +224 -224
  80. package/ui/js/28-audit-readiness.js +99 -99
  81. package/ui/js/29-lifecycle.js +182 -182
  82. package/ui/js/30-labs.js +265 -265
  83. package/ui/js/31-build.js +203 -203
  84. package/ui/js/32-lab-examples.js +148 -148
  85. package/ui/js/33-finder.js +89 -89
  86. package/ui/js/34-governance.js +129 -129
  87. package/ui/js/35-watch.js +266 -266
  88. package/ui/js/36-model.js +247 -247
  89. package/ui/js/37-logs-and-watch.js +224 -224
  90. package/ui/shell.html +112 -112
  91. package/ui/style.css +350 -350
@@ -1,39 +1,39 @@
1
- // ---------- ownership (a Lookup tab) ----------
2
- state.ow = { filter: '', owner: null };
3
- function renderOwnership(w) {
4
- var O = state.ow;
5
- w.appendChild(el('div', { className: 'bar', style: 'margin-bottom:14px' }, el('span', { className: 'muted', style: 'flex:1', text: 'Who owns sources, roles, access profiles, entitlements, workflows and identity profiles, and what is owned by people who left. Reads every entitlement, so it takes a while on big tenants.' }),
6
- el('button', { className: 'btn primary', disabled: !!O.busy, onclick: function () { runJobInto(O, '/api/ownership/run', {}, renderLookup); } }, icon('play'), O.data ? 'Read again' : 'Read ownership')));
7
- if (O.busy) { w.appendChild(busyBox(O.busy)); return; }
8
- if (O.error) { w.appendChild(el('div', { className: 'error', text: O.error })); return; }
9
- var d = O.data;
10
- if (!d) return;
11
- d.notes.forEach(function (n) { w.appendChild(el('div', { className: 'note', text: n })); });
12
- var types = ['Source', 'Role', 'Access profile', 'Entitlement', 'Workflow', 'Identity profile'];
13
- w.appendChild(el('div', { className: 'bigstats' }, types.map(function (ty) {
14
- var total = d.totals[ty] || 0, un = d.unowned[ty] || 0;
15
- return el('div', { className: 'bigstat' + (un ? ' lose' : '') }, el('b', { text: fmtNum(un) }), el('span', { text: ty.toLowerCase() + 's without owner (of ' + fmtNum(total) + ')' }));
16
- })));
17
- var ownerWord = function (st) { return st === 'not found' ? 'no longer in ISC' : st; };
18
- var left = d.owners.filter(function (o) { return o.status !== 'active'; });
19
- w.appendChild(el('div', { className: 'banner ' + (d.orphaned.length ? 'bad' : 'ok') }, el('b', { text: d.orphaned.length ? fmtNum(d.orphaned.length) + ' objects are owned by ' + left.length + ' people who left or no longer exist' : 'Every owner is an active identity' }), el('span', { style: 'flex:1' }), downloads(O.job)));
20
- if (d.orphaned.length) w.appendChild(section('Owned by people who left (hand these over)', d.orphaned.length, simpleTable(['Type', 'Object', 'Source', 'Owner', 'Owner status'], d.orphaned.slice(0, 1000).map(function (x) { return [x.type, x.name, x.source, x.ownerName, el('span', { className: 'chg lose', text: ownerWord(x.ownerStatus) + (x.lifecycleState ? ' (' + x.lifecycleState + ')' : '') })]; }))));
21
- var f = el('input', { className: 'input', placeholder: 'Filter owners...', value: O.filter, style: 'max-width:280px' });
22
- var box = el('div');
23
- var draw = function () {
24
- var q = O.filter.toLowerCase();
25
- box.textContent = '';
26
- box.appendChild(simpleTable(['Owner', 'Status', 'Sources', 'Roles', 'Access profiles', 'Entitlements', 'Workflows', 'Identity profiles', 'Total'], d.owners.filter(function (o) { return !q || (o.name + ' ' + (o.email || '')).toLowerCase().indexOf(q) >= 0; }).slice(0, 500).map(function (o) {
27
- return [el('button', { className: 'btn link', style: 'padding:0', text: o.name, onclick: function () { O.owner = o.id; renderLookup(); } }), el('span', { className: 'chg ' + (o.status === 'active' ? 'gain' : 'lose'), text: ownerWord(o.status) }), o.counts['Source'] || 0, o.counts['Role'] || 0, o.counts['Access profile'] || 0, o.counts['Entitlement'] || 0, o.counts['Workflow'] || 0, o.counts['Identity profile'] || 0, o.total];
28
- })));
29
- };
30
- f.addEventListener('input', function () { O.filter = f.value; draw(); });
31
- w.appendChild(section('Owners', d.owners.length, el('div', {}, el('div', { style: 'margin-bottom:10px' }, f), box)));
32
- draw();
33
- if (O.owner) {
34
- var who = d.owners.filter(function (o) { return o.id === O.owner; })[0];
35
- var mine = d.objects.filter(function (x) { return x.ownerId === O.owner; });
36
- w.appendChild(section('Owned by ' + (who ? who.name : '?'), mine.length, simpleTable(['Type', 'Object', 'Source'], mine.slice(0, 2000).map(function (x) { return [x.type, x.name, x.source]; }))));
37
- }
38
- }
39
-
1
+ // ---------- ownership (a Lookup tab) ----------
2
+ state.ow = { filter: '', owner: null };
3
+ function renderOwnership(w) {
4
+ var O = state.ow;
5
+ w.appendChild(el('div', { className: 'bar', style: 'margin-bottom:14px' }, el('span', { className: 'muted', style: 'flex:1', text: 'Who owns sources, roles, access profiles, entitlements, workflows and identity profiles, and what is owned by people who left. Reads every entitlement, so it takes a while on big tenants.' }),
6
+ el('button', { className: 'btn primary', disabled: !!O.busy, onclick: function () { runJobInto(O, '/api/ownership/run', {}, renderLookup); } }, icon('play'), O.data ? 'Read again' : 'Read ownership')));
7
+ if (O.busy) { w.appendChild(busyBox(O.busy)); return; }
8
+ if (O.error) { w.appendChild(el('div', { className: 'error', text: O.error })); return; }
9
+ var d = O.data;
10
+ if (!d) return;
11
+ d.notes.forEach(function (n) { w.appendChild(el('div', { className: 'note', text: n })); });
12
+ var types = ['Source', 'Role', 'Access profile', 'Entitlement', 'Workflow', 'Identity profile'];
13
+ w.appendChild(el('div', { className: 'bigstats' }, types.map(function (ty) {
14
+ var total = d.totals[ty] || 0, un = d.unowned[ty] || 0;
15
+ return el('div', { className: 'bigstat' + (un ? ' lose' : '') }, el('b', { text: fmtNum(un) }), el('span', { text: ty.toLowerCase() + 's without owner (of ' + fmtNum(total) + ')' }));
16
+ })));
17
+ var ownerWord = function (st) { return st === 'not found' ? 'no longer in ISC' : st; };
18
+ var left = d.owners.filter(function (o) { return o.status !== 'active'; });
19
+ w.appendChild(el('div', { className: 'banner ' + (d.orphaned.length ? 'bad' : 'ok') }, el('b', { text: d.orphaned.length ? fmtNum(d.orphaned.length) + ' objects are owned by ' + left.length + ' people who left or no longer exist' : 'Every owner is an active identity' }), el('span', { style: 'flex:1' }), downloads(O.job)));
20
+ if (d.orphaned.length) w.appendChild(section('Owned by people who left (hand these over)', d.orphaned.length, simpleTable(['Type', 'Object', 'Source', 'Owner', 'Owner status'], d.orphaned.slice(0, 1000).map(function (x) { return [x.type, x.name, x.source, x.ownerName, el('span', { className: 'chg lose', text: ownerWord(x.ownerStatus) + (x.lifecycleState ? ' (' + x.lifecycleState + ')' : '') })]; }))));
21
+ var f = el('input', { className: 'input', placeholder: 'Filter owners...', value: O.filter, style: 'max-width:280px' });
22
+ var box = el('div');
23
+ var draw = function () {
24
+ var q = O.filter.toLowerCase();
25
+ box.textContent = '';
26
+ box.appendChild(simpleTable(['Owner', 'Status', 'Sources', 'Roles', 'Access profiles', 'Entitlements', 'Workflows', 'Identity profiles', 'Total'], d.owners.filter(function (o) { return !q || (o.name + ' ' + (o.email || '')).toLowerCase().indexOf(q) >= 0; }).slice(0, 500).map(function (o) {
27
+ return [el('button', { className: 'btn link', style: 'padding:0', text: o.name, onclick: function () { O.owner = o.id; renderLookup(); } }), el('span', { className: 'chg ' + (o.status === 'active' ? 'gain' : 'lose'), text: ownerWord(o.status) }), o.counts['Source'] || 0, o.counts['Role'] || 0, o.counts['Access profile'] || 0, o.counts['Entitlement'] || 0, o.counts['Workflow'] || 0, o.counts['Identity profile'] || 0, o.total];
28
+ })));
29
+ };
30
+ f.addEventListener('input', function () { O.filter = f.value; draw(); });
31
+ w.appendChild(section('Owners', d.owners.length, el('div', {}, el('div', { style: 'margin-bottom:10px' }, f), box)));
32
+ draw();
33
+ if (O.owner) {
34
+ var who = d.owners.filter(function (o) { return o.id === O.owner; })[0];
35
+ var mine = d.objects.filter(function (x) { return x.ownerId === O.owner; });
36
+ w.appendChild(section('Owned by ' + (who ? who.name : '?'), mine.length, simpleTable(['Type', 'Object', 'Source'], mine.slice(0, 2000).map(function (x) { return [x.type, x.name, x.source]; }))));
37
+ }
38
+ }
39
+
@@ -1,102 +1,102 @@
1
- // ---------- compare tenants (a Tenant tab) ----------
2
- state.cp = { kinds: null };
3
- function cmpKey(path) { return String(path).replace(/ \(.*$/, '').replace(/\[\d+\]/g, '[]'); }
4
- function cmpIgnore(P, kind, setting, on) {
5
- api('/api/compare/ignore', 'POST', { kind: kind, setting: setting, ignore: on }).then(function (r) {
6
- P.info.ignore = r.ignore;
7
- if (on && P.data) {
8
- // Apply now to what is on screen; the next Compare applies it to the results and the exports.
9
- P.data.kinds.forEach(function (k) {
10
- if (k.kind !== kind) return;
11
- var keep = [];
12
- k.different.forEach(function (x) { var left = x.differences.filter(function (y) { return cmpKey(y.path) !== setting; }); if (left.length) keep.push({ name: x.name, differences: left }); else k.same++; });
13
- k.different = keep;
14
- });
15
- }
16
- renderTenant();
17
- }, function (e) { toast(errorText(e)); });
18
- }
19
- function renderCompare2(w) {
20
- var P = state.cp;
21
- if (!P.info) {
22
- w.appendChild(el('div', { className: 'progress' }, el('span', { className: 'spinner' }), 'Loading...'));
23
- api('/api/compare').then(function (r) { P.info = r; if (!P.kinds) P.kinds = r.kinds.map(function (k) { return k.kind; }); renderTenant(); });
24
- return;
25
- }
26
- if (!P.info.other) {
27
- var base = el('input', { className: 'input', placeholder: 'production tenant, e.g. acme or https://acme.api.identitynow.com', autocomplete: 'off' });
28
- var cid = el('input', { className: 'input', autocomplete: 'off' });
29
- var sec = el('input', { className: 'input', type: 'password', autocomplete: 'off' });
30
- var msg = el('div');
31
- w.appendChild(el('section', { className: 'card' }, el('div', { className: 'card-h' }, el('h3', { text: 'Connect the other tenant' })),
32
- el('p', { className: 'muted', style: 'margin-top:0', text: 'Compares ' + (P.info.tenant || 'this tenant') + ' with another tenant (for example sandbox with production) by object name. Read-only on both. The other tenant’s token is kept in memory only, never saved.' }),
33
- el('div', { className: 'grid' }, el('label', { className: 'field' }, el('span', { className: 'lbl', text: 'Other tenant' }), base), el('label', { className: 'field' }, el('span', { className: 'lbl', text: 'Client ID (personal access token)' }), cid), el('label', { className: 'field' }, el('span', { className: 'lbl', text: 'Client secret' }), sec)),
34
- el('button', { className: 'btn primary', style: 'margin-top:14px', onclick: function () {
35
- msg.textContent = '';
36
- api('/api/compare/connect', 'POST', { baseUrl: base.value, clientId: cid.value, clientSecret: sec.value }).then(function (r) { sec.value = ''; P.info.other = r.tenant; renderTenant(); }).catch(function (e) { msg.appendChild(el('div', { className: 'error', text: errorText(e) })); });
37
- } }, 'Connect'), msg));
38
- return;
39
- }
40
- var boxes = el('div', { className: 'bar' }, P.info.kinds.map(function (k) {
41
- var c = el('input', { type: 'checkbox', checked: P.kinds.indexOf(k.kind) >= 0, 'aria-label': k.label });
42
- c.addEventListener('change', function () { P.kinds = P.kinds.filter(function (x) { return x !== k.kind; }); if (c.checked) P.kinds.push(k.kind); renderTenant(); });
43
- return el('label', { className: 'check' }, c, k.label);
44
- }));
45
- w.appendChild(el('section', { className: 'card' }, el('div', { className: 'card-h' }, el('h3', {}, 'Compare ', el('span', { className: 'pill blue', text: P.info.tenant }), ' with ', el('span', { className: 'pill blue', text: P.info.other })),
46
- el('button', { className: 'btn ghost sm', onclick: function () { api('/api/compare/disconnect', 'POST', {}).then(function () { P.info.other = null; P.data = null; renderTenant(); }); } }, 'Disconnect other tenant')),
47
- boxes,
48
- el('p', { className: 'muted small', text: '"Where rules are used" compares which sources, transforms, identity profiles, identity attributes and provisioning policies use each rule: a rule used in one tenant and not the other is a deployment gap. Connector rules are compared in full, code included.' }),
49
- (function () {
50
- var c = el('input', { type: 'checkbox', checked: !!P.cloudRuleCode, 'aria-describedby': 'cloud-rule-note' });
51
- c.addEventListener('change', function () { P.cloudRuleCode = c.checked; renderTenant(); });
52
- return el('div', { className: 'note', style: 'margin-top:10px' },
53
- el('label', { className: 'check', style: 'font-weight:600' }, c, 'Also compare cloud rule code'),
54
- el('div', { id: 'cloud-rule-note', className: 'small', style: 'margin-top:4px', text: 'ISC has no plain read for cloud rules. With this on, IdentityScope starts one SP-Config export job of rules in each tenant, waits for it and compares the code. The export reads configuration and changes nothing, but it is a job you will see in the tenant, and the API client needs SP-Config access (the sp:config:read or sp:config:manage scope). Off by default; not used by change history or the drift check.' }));
55
- })(),
56
- el('div', { className: 'bar', style: 'margin-top:12px' },
57
- el('button', { className: 'btn primary', disabled: !!P.busy || (!P.kinds.length && !P.cloudRuleCode), onclick: function () { runJobInto(P, '/api/compare/run', { kinds: P.kinds, cloudRuleCode: !!P.cloudRuleCode }, renderTenant); } }, icon('cols'), 'Compare'),
58
- el('button', { className: 'btn ghost sm', onclick: function () { P.kinds = P.info.kinds.map(function (k) { return k.kind; }); renderTenant(); } }, 'All'),
59
- el('button', { className: 'btn ghost sm', onclick: function () { P.kinds = []; renderTenant(); } }, 'None'))));
60
- if (P.busy) { w.appendChild(busyBox(P.busy)); return; }
61
- if (P.error) { w.appendChild(el('div', { className: 'error', text: P.error })); return; }
62
- var d = P.data;
63
- if (!d) return;
64
- w.appendChild(el('div', { className: 'bar', style: 'justify-content:flex-end;margin-bottom:10px' }, downloads(P.job)));
65
- w.appendChild(simpleTable(['Type', 'Only in ' + d.a, 'Only in ' + d.b, 'Different', 'Same'], d.kinds.map(function (k) {
66
- return [k.label, k.error ? el('span', { className: 'chg lose', text: k.error }) : k.onlyA.length, k.error ? null : k.onlyB.length, k.error ? null : (k.different.length ? el('span', { className: 'chg lose', text: String(k.different.length) }) : 0), k.error ? null : k.same];
67
- })));
68
- var ignored = (P.info && P.info.ignore) || [];
69
- if (ignored.length) {
70
- w.appendChild(el('div', { className: 'note', style: 'margin:12px 0' }, el('b', { text: 'Ignored settings: ' }),
71
- el('span', {}, ignored.map(function (key) {
72
- var parts = key.split('|'), label = (P.info.kinds.filter(function (k) { return k.kind === parts[0]; })[0] || { label: parts[0] }).label;
73
- return el('span', { className: 'chip', style: 'display:inline-flex;gap:6px;align-items:center;margin:2px 6px 2px 0' }, label + ': ', el('code', { text: parts.slice(1).join('|') }),
74
- el('button', { className: 'linkbtn small', 'aria-label': 'Stop ignoring ' + parts.slice(1).join('|'), onclick: function () { cmpIgnore(P, parts[0], parts.slice(1).join('|'), false); } }, 'undo'));
75
- })),
76
- el('div', { className: 'small muted', text: 'Undo takes effect at the next Compare.' })));
77
- }
78
- d.kinds.forEach(function (k) {
79
- if (k.error || (!k.onlyA.length && !k.onlyB.length && !k.different.length)) return;
80
- var body = el('div');
81
- if (k.onlyA.length) body.appendChild(el('p', {}, el('b', { text: 'Only in ' + d.a + ': ' }), k.onlyA.join(', ')));
82
- if (k.onlyB.length) body.appendChild(el('p', {}, el('b', { text: 'Only in ' + d.b + ': ' }), k.onlyB.join(', ')));
83
- if (k.different.length > 1) {
84
- // Which settings differ most often: usually tenant-specific values (cluster, owner) worth ignoring.
85
- var counts = {};
86
- k.different.forEach(function (x) { var seen = {}; x.differences.forEach(function (y) { var key = cmpKey(y.path); if (!seen[key]) { seen[key] = 1; counts[key] = (counts[key] || 0) + 1; } }); });
87
- var top = Object.keys(counts).sort(function (a, b) { return counts[b] - counts[a]; }).slice(0, 8);
88
- body.appendChild(el('div', { className: 'note', style: 'margin:8px 0' }, el('b', { text: 'Most common differences: ' }),
89
- el('div', {}, top.map(function (key) {
90
- return el('div', { style: 'display:flex;gap:10px;align-items:center;margin:3px 0' }, el('code', { text: key }), el('span', { className: 'muted small', text: counts[key] + ' of ' + k.different.length }),
91
- el('button', { className: 'btn ghost sm', 'aria-label': 'Ignore ' + key + ' for ' + k.label, onclick: function () { cmpIgnore(P, k.kind, key, true); } }, 'Ignore'));
92
- })),
93
- el('div', { className: 'small muted', text: 'Ignore a setting that is meant to differ between tenants (for example a cluster or an owner). It is remembered on this computer for future comparisons.' })));
94
- }
95
- k.different.forEach(function (x) {
96
- body.appendChild(el('details', { className: 'adv', style: 'margin:8px 0' }, el('summary', { text: x.name + ' (' + x.differences.length + ' difference' + (x.differences.length > 1 ? 's' : '') + ')' }),
97
- simpleTable(['Setting', d.a, d.b], x.differences.map(function (y) { return [y.path, y.a, y.b]; }))));
98
- });
99
- w.appendChild(section(k.label, null, body));
100
- });
101
- }
102
-
1
+ // ---------- compare tenants (a Tenant tab) ----------
2
+ state.cp = { kinds: null };
3
+ function cmpKey(path) { return String(path).replace(/ \(.*$/, '').replace(/\[\d+\]/g, '[]'); }
4
+ function cmpIgnore(P, kind, setting, on) {
5
+ api('/api/compare/ignore', 'POST', { kind: kind, setting: setting, ignore: on }).then(function (r) {
6
+ P.info.ignore = r.ignore;
7
+ if (on && P.data) {
8
+ // Apply now to what is on screen; the next Compare applies it to the results and the exports.
9
+ P.data.kinds.forEach(function (k) {
10
+ if (k.kind !== kind) return;
11
+ var keep = [];
12
+ k.different.forEach(function (x) { var left = x.differences.filter(function (y) { return cmpKey(y.path) !== setting; }); if (left.length) keep.push({ name: x.name, differences: left }); else k.same++; });
13
+ k.different = keep;
14
+ });
15
+ }
16
+ renderTenant();
17
+ }, function (e) { toast(errorText(e)); });
18
+ }
19
+ function renderCompare2(w) {
20
+ var P = state.cp;
21
+ if (!P.info) {
22
+ w.appendChild(el('div', { className: 'progress' }, el('span', { className: 'spinner' }), 'Loading...'));
23
+ api('/api/compare').then(function (r) { P.info = r; if (!P.kinds) P.kinds = r.kinds.map(function (k) { return k.kind; }); renderTenant(); });
24
+ return;
25
+ }
26
+ if (!P.info.other) {
27
+ var base = el('input', { className: 'input', placeholder: 'production tenant, e.g. acme or https://acme.api.identitynow.com', autocomplete: 'off' });
28
+ var cid = el('input', { className: 'input', autocomplete: 'off' });
29
+ var sec = el('input', { className: 'input', type: 'password', autocomplete: 'off' });
30
+ var msg = el('div');
31
+ w.appendChild(el('section', { className: 'card' }, el('div', { className: 'card-h' }, el('h3', { text: 'Connect the other tenant' })),
32
+ el('p', { className: 'muted', style: 'margin-top:0', text: 'Compares ' + (P.info.tenant || 'this tenant') + ' with another tenant (for example sandbox with production) by object name. Read-only on both. The other tenant’s token is kept in memory only, never saved.' }),
33
+ el('div', { className: 'grid' }, el('label', { className: 'field' }, el('span', { className: 'lbl', text: 'Other tenant' }), base), el('label', { className: 'field' }, el('span', { className: 'lbl', text: 'Client ID (personal access token)' }), cid), el('label', { className: 'field' }, el('span', { className: 'lbl', text: 'Client secret' }), sec)),
34
+ el('button', { className: 'btn primary', style: 'margin-top:14px', onclick: function () {
35
+ msg.textContent = '';
36
+ api('/api/compare/connect', 'POST', { baseUrl: base.value, clientId: cid.value, clientSecret: sec.value }).then(function (r) { sec.value = ''; P.info.other = r.tenant; renderTenant(); }).catch(function (e) { msg.appendChild(el('div', { className: 'error', text: errorText(e) })); });
37
+ } }, 'Connect'), msg));
38
+ return;
39
+ }
40
+ var boxes = el('div', { className: 'bar' }, P.info.kinds.map(function (k) {
41
+ var c = el('input', { type: 'checkbox', checked: P.kinds.indexOf(k.kind) >= 0, 'aria-label': k.label });
42
+ c.addEventListener('change', function () { P.kinds = P.kinds.filter(function (x) { return x !== k.kind; }); if (c.checked) P.kinds.push(k.kind); renderTenant(); });
43
+ return el('label', { className: 'check' }, c, k.label);
44
+ }));
45
+ w.appendChild(el('section', { className: 'card' }, el('div', { className: 'card-h' }, el('h3', {}, 'Compare ', el('span', { className: 'pill blue', text: P.info.tenant }), ' with ', el('span', { className: 'pill blue', text: P.info.other })),
46
+ el('button', { className: 'btn ghost sm', onclick: function () { api('/api/compare/disconnect', 'POST', {}).then(function () { P.info.other = null; P.data = null; renderTenant(); }); } }, 'Disconnect other tenant')),
47
+ boxes,
48
+ el('p', { className: 'muted small', text: '"Where rules are used" compares which sources, transforms, identity profiles, identity attributes and provisioning policies use each rule: a rule used in one tenant and not the other is a deployment gap. Connector rules are compared in full, code included.' }),
49
+ (function () {
50
+ var c = el('input', { type: 'checkbox', checked: !!P.cloudRuleCode, 'aria-describedby': 'cloud-rule-note' });
51
+ c.addEventListener('change', function () { P.cloudRuleCode = c.checked; renderTenant(); });
52
+ return el('div', { className: 'note', style: 'margin-top:10px' },
53
+ el('label', { className: 'check', style: 'font-weight:600' }, c, 'Also compare cloud rule code'),
54
+ el('div', { id: 'cloud-rule-note', className: 'small', style: 'margin-top:4px', text: 'ISC has no plain read for cloud rules. With this on, IdentityScope starts one SP-Config export job of rules in each tenant, waits for it and compares the code. The export reads configuration and changes nothing, but it is a job you will see in the tenant, and the API client needs SP-Config access (the sp:config:read or sp:config:manage scope). Off by default; not used by change history or the drift check.' }));
55
+ })(),
56
+ el('div', { className: 'bar', style: 'margin-top:12px' },
57
+ el('button', { className: 'btn primary', disabled: !!P.busy || (!P.kinds.length && !P.cloudRuleCode), onclick: function () { runJobInto(P, '/api/compare/run', { kinds: P.kinds, cloudRuleCode: !!P.cloudRuleCode }, renderTenant); } }, icon('cols'), 'Compare'),
58
+ el('button', { className: 'btn ghost sm', onclick: function () { P.kinds = P.info.kinds.map(function (k) { return k.kind; }); renderTenant(); } }, 'All'),
59
+ el('button', { className: 'btn ghost sm', onclick: function () { P.kinds = []; renderTenant(); } }, 'None'))));
60
+ if (P.busy) { w.appendChild(busyBox(P.busy)); return; }
61
+ if (P.error) { w.appendChild(el('div', { className: 'error', text: P.error })); return; }
62
+ var d = P.data;
63
+ if (!d) return;
64
+ w.appendChild(el('div', { className: 'bar', style: 'justify-content:flex-end;margin-bottom:10px' }, downloads(P.job)));
65
+ w.appendChild(simpleTable(['Type', 'Only in ' + d.a, 'Only in ' + d.b, 'Different', 'Same'], d.kinds.map(function (k) {
66
+ return [k.label, k.error ? el('span', { className: 'chg lose', text: k.error }) : k.onlyA.length, k.error ? null : k.onlyB.length, k.error ? null : (k.different.length ? el('span', { className: 'chg lose', text: String(k.different.length) }) : 0), k.error ? null : k.same];
67
+ })));
68
+ var ignored = (P.info && P.info.ignore) || [];
69
+ if (ignored.length) {
70
+ w.appendChild(el('div', { className: 'note', style: 'margin:12px 0' }, el('b', { text: 'Ignored settings: ' }),
71
+ el('span', {}, ignored.map(function (key) {
72
+ var parts = key.split('|'), label = (P.info.kinds.filter(function (k) { return k.kind === parts[0]; })[0] || { label: parts[0] }).label;
73
+ return el('span', { className: 'chip', style: 'display:inline-flex;gap:6px;align-items:center;margin:2px 6px 2px 0' }, label + ': ', el('code', { text: parts.slice(1).join('|') }),
74
+ el('button', { className: 'linkbtn small', 'aria-label': 'Stop ignoring ' + parts.slice(1).join('|'), onclick: function () { cmpIgnore(P, parts[0], parts.slice(1).join('|'), false); } }, 'undo'));
75
+ })),
76
+ el('div', { className: 'small muted', text: 'Undo takes effect at the next Compare.' })));
77
+ }
78
+ d.kinds.forEach(function (k) {
79
+ if (k.error || (!k.onlyA.length && !k.onlyB.length && !k.different.length)) return;
80
+ var body = el('div');
81
+ if (k.onlyA.length) body.appendChild(el('p', {}, el('b', { text: 'Only in ' + d.a + ': ' }), k.onlyA.join(', ')));
82
+ if (k.onlyB.length) body.appendChild(el('p', {}, el('b', { text: 'Only in ' + d.b + ': ' }), k.onlyB.join(', ')));
83
+ if (k.different.length > 1) {
84
+ // Which settings differ most often: usually tenant-specific values (cluster, owner) worth ignoring.
85
+ var counts = {};
86
+ k.different.forEach(function (x) { var seen = {}; x.differences.forEach(function (y) { var key = cmpKey(y.path); if (!seen[key]) { seen[key] = 1; counts[key] = (counts[key] || 0) + 1; } }); });
87
+ var top = Object.keys(counts).sort(function (a, b) { return counts[b] - counts[a]; }).slice(0, 8);
88
+ body.appendChild(el('div', { className: 'note', style: 'margin:8px 0' }, el('b', { text: 'Most common differences: ' }),
89
+ el('div', {}, top.map(function (key) {
90
+ return el('div', { style: 'display:flex;gap:10px;align-items:center;margin:3px 0' }, el('code', { text: key }), el('span', { className: 'muted small', text: counts[key] + ' of ' + k.different.length }),
91
+ el('button', { className: 'btn ghost sm', 'aria-label': 'Ignore ' + key + ' for ' + k.label, onclick: function () { cmpIgnore(P, k.kind, key, true); } }, 'Ignore'));
92
+ })),
93
+ el('div', { className: 'small muted', text: 'Ignore a setting that is meant to differ between tenants (for example a cluster or an owner). It is remembered on this computer for future comparisons.' })));
94
+ }
95
+ k.different.forEach(function (x) {
96
+ body.appendChild(el('details', { className: 'adv', style: 'margin:8px 0' }, el('summary', { text: x.name + ' (' + x.differences.length + ' difference' + (x.differences.length > 1 ? 's' : '') + ')' }),
97
+ simpleTable(['Setting', d.a, d.b], x.differences.map(function (y) { return [y.path, y.a, y.b]; }))));
98
+ });
99
+ w.appendChild(section(k.label, null, body));
100
+ });
101
+ }
102
+