identityscope 0.0.0-stage → 0.28.3
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/LICENSE +21 -0
- package/README.md +917 -3
- package/SECURITY.md +56 -0
- package/dist/core/audit-readiness.d.ts +158 -0
- package/dist/core/audit-readiness.js +357 -0
- package/dist/core/audit-readiness.js.map +1 -0
- package/dist/core/certs.d.ts +68 -0
- package/dist/core/certs.js +132 -0
- package/dist/core/certs.js.map +1 -0
- package/dist/core/checks.d.ts +133 -0
- package/dist/core/checks.js +512 -0
- package/dist/core/checks.js.map +1 -0
- package/dist/core/cloud-rules.d.ts +20 -0
- package/dist/core/cloud-rules.js +44 -0
- package/dist/core/cloud-rules.js.map +1 -0
- package/dist/core/compare.d.ts +45 -0
- package/dist/core/compare.js +372 -0
- package/dist/core/compare.js.map +1 -0
- package/dist/core/conditions.d.ts +10 -0
- package/dist/core/conditions.js +201 -0
- package/dist/core/conditions.js.map +1 -0
- package/dist/core/credentials.d.ts +71 -0
- package/dist/core/credentials.js +211 -0
- package/dist/core/credentials.js.map +1 -0
- package/dist/core/datasets.d.ts +53 -0
- package/dist/core/datasets.js +596 -0
- package/dist/core/datasets.js.map +1 -0
- package/dist/core/definition.d.ts +32 -0
- package/dist/core/definition.js +301 -0
- package/dist/core/definition.js.map +1 -0
- package/dist/core/discover.d.ts +32 -0
- package/dist/core/discover.js +105 -0
- package/dist/core/discover.js.map +1 -0
- package/dist/core/engine.d.ts +18 -0
- package/dist/core/engine.js +290 -0
- package/dist/core/engine.js.map +1 -0
- package/dist/core/fields.d.ts +16 -0
- package/dist/core/fields.js +132 -0
- package/dist/core/fields.js.map +1 -0
- package/dist/core/governance-trail.d.ts +211 -0
- package/dist/core/governance-trail.js +557 -0
- package/dist/core/governance-trail.js.map +1 -0
- package/dist/core/http-transport.d.ts +66 -0
- package/dist/core/http-transport.js +247 -0
- package/dist/core/http-transport.js.map +1 -0
- package/dist/core/index.d.ts +13 -0
- package/dist/core/index.js +16 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/insights.d.ts +176 -0
- package/dist/core/insights.js +417 -0
- package/dist/core/insights.js.map +1 -0
- package/dist/core/joiner-evidence.d.ts +98 -0
- package/dist/core/joiner-evidence.js +254 -0
- package/dist/core/joiner-evidence.js.map +1 -0
- package/dist/core/lab/credential-map.d.ts +50 -0
- package/dist/core/lab/credential-map.js +163 -0
- package/dist/core/lab/credential-map.js.map +1 -0
- package/dist/core/lab/javadate.d.ts +7 -0
- package/dist/core/lab/javadate.js +307 -0
- package/dist/core/lab/javadate.js.map +1 -0
- package/dist/core/lab/jsonpath.d.ts +11 -0
- package/dist/core/lab/jsonpath.js +273 -0
- package/dist/core/lab/jsonpath.js.map +1 -0
- package/dist/core/lab/policy-preview.d.ts +43 -0
- package/dist/core/lab/policy-preview.js +78 -0
- package/dist/core/lab/policy-preview.js.map +1 -0
- package/dist/core/lab/rfc5646.d.ts +2 -0
- package/dist/core/lab/rfc5646.js +421 -0
- package/dist/core/lab/rfc5646.js.map +1 -0
- package/dist/core/lab/transform-impact.d.ts +63 -0
- package/dist/core/lab/transform-impact.js +138 -0
- package/dist/core/lab/transform-impact.js.map +1 -0
- package/dist/core/lab/transform-people.d.ts +61 -0
- package/dist/core/lab/transform-people.js +132 -0
- package/dist/core/lab/transform-people.js.map +1 -0
- package/dist/core/lab/transforms.d.ts +79 -0
- package/dist/core/lab/transforms.js +738 -0
- package/dist/core/lab/transforms.js.map +1 -0
- package/dist/core/lab/velocity.d.ts +33 -0
- package/dist/core/lab/velocity.js +874 -0
- package/dist/core/lab/velocity.js.map +1 -0
- package/dist/core/lab/workflow-health.d.ts +80 -0
- package/dist/core/lab/workflow-health.js +234 -0
- package/dist/core/lab/workflow-health.js.map +1 -0
- package/dist/core/lab/workflows.d.ts +87 -0
- package/dist/core/lab/workflows.js +568 -0
- package/dist/core/lab/workflows.js.map +1 -0
- package/dist/core/lifecycle-gaps.d.ts +192 -0
- package/dist/core/lifecycle-gaps.js +389 -0
- package/dist/core/lifecycle-gaps.js.map +1 -0
- package/dist/core/logs.d.ts +145 -0
- package/dist/core/logs.js +342 -0
- package/dist/core/logs.js.map +1 -0
- package/dist/core/lookup.d.ts +129 -0
- package/dist/core/lookup.js +289 -0
- package/dist/core/lookup.js.map +1 -0
- package/dist/core/model-insights.d.ts +247 -0
- package/dist/core/model-insights.js +474 -0
- package/dist/core/model-insights.js.map +1 -0
- package/dist/core/narrow.d.ts +23 -0
- package/dist/core/narrow.js +137 -0
- package/dist/core/narrow.js.map +1 -0
- package/dist/core/nerm.d.ts +154 -0
- package/dist/core/nerm.js +397 -0
- package/dist/core/nerm.js.map +1 -0
- package/dist/core/operations-watch.d.ts +232 -0
- package/dist/core/operations-watch.js +491 -0
- package/dist/core/operations-watch.js.map +1 -0
- package/dist/core/output/csv.d.ts +6 -0
- package/dist/core/output/csv.js +22 -0
- package/dist/core/output/csv.js.map +1 -0
- package/dist/core/output/html.d.ts +11 -0
- package/dist/core/output/html.js +66 -0
- package/dist/core/output/html.js.map +1 -0
- package/dist/core/output/xlsx.d.ts +3 -0
- package/dist/core/output/xlsx.js +130 -0
- package/dist/core/output/xlsx.js.map +1 -0
- package/dist/core/output/zip.d.ts +16 -0
- package/dist/core/output/zip.js +106 -0
- package/dist/core/output/zip.js.map +1 -0
- package/dist/core/ownership.d.ts +39 -0
- package/dist/core/ownership.js +100 -0
- package/dist/core/ownership.js.map +1 -0
- package/dist/core/patterns.d.ts +11 -0
- package/dist/core/patterns.js +31 -0
- package/dist/core/patterns.js.map +1 -0
- package/dist/core/preview.d.ts +96 -0
- package/dist/core/preview.js +173 -0
- package/dist/core/preview.js.map +1 -0
- package/dist/core/roles.d.ts +125 -0
- package/dist/core/roles.js +420 -0
- package/dist/core/roles.js.map +1 -0
- package/dist/core/tenant.d.ts +67 -0
- package/dist/core/tenant.js +194 -0
- package/dist/core/tenant.js.map +1 -0
- package/dist/core/threat-signals.d.ts +112 -0
- package/dist/core/threat-signals.js +250 -0
- package/dist/core/threat-signals.js.map +1 -0
- package/dist/core/threat-watch.d.ts +144 -0
- package/dist/core/threat-watch.js +282 -0
- package/dist/core/threat-watch.js.map +1 -0
- package/dist/core/transport.d.ts +82 -0
- package/dist/core/transport.js +312 -0
- package/dist/core/transport.js.map +1 -0
- package/dist/core/types.d.ts +137 -0
- package/dist/core/types.js +10 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/warnings.d.ts +236 -0
- package/dist/core/warnings.js +504 -0
- package/dist/core/warnings.js.map +1 -0
- package/dist/demo/tenant.d.ts +1572 -0
- package/dist/demo/tenant.js +1023 -0
- package/dist/demo/tenant.js.map +1 -0
- package/dist/node/attribute-history.d.ts +22 -0
- package/dist/node/attribute-history.js +86 -0
- package/dist/node/attribute-history.js.map +1 -0
- package/dist/node/changes.d.ts +20 -0
- package/dist/node/changes.js +78 -0
- package/dist/node/changes.js.map +1 -0
- package/dist/node/cli.d.ts +2 -0
- package/dist/node/cli.js +291 -0
- package/dist/node/cli.js.map +1 -0
- package/dist/node/config.d.ts +72 -0
- package/dist/node/config.js +203 -0
- package/dist/node/config.js.map +1 -0
- package/dist/node/credentials.d.ts +13 -0
- package/dist/node/credentials.js +24 -0
- package/dist/node/credentials.js.map +1 -0
- package/dist/node/delivery.d.ts +10 -0
- package/dist/node/delivery.js +105 -0
- package/dist/node/delivery.js.map +1 -0
- package/dist/node/doctor.d.ts +2 -0
- package/dist/node/doctor.js +151 -0
- package/dist/node/doctor.js.map +1 -0
- package/dist/node/drift.d.ts +31 -0
- package/dist/node/drift.js +56 -0
- package/dist/node/drift.js.map +1 -0
- package/dist/node/evidence.d.ts +42 -0
- package/dist/node/evidence.js +129 -0
- package/dist/node/evidence.js.map +1 -0
- package/dist/node/exceptions.d.ts +30 -0
- package/dist/node/exceptions.js +83 -0
- package/dist/node/exceptions.js.map +1 -0
- package/dist/node/history.d.ts +35 -0
- package/dist/node/history.js +74 -0
- package/dist/node/history.js.map +1 -0
- package/dist/node/index.d.ts +7 -0
- package/dist/node/index.js +8 -0
- package/dist/node/index.js.map +1 -0
- package/dist/node/keep.d.ts +9 -0
- package/dist/node/keep.js +39 -0
- package/dist/node/keep.js.map +1 -0
- package/dist/node/loader.d.ts +7 -0
- package/dist/node/loader.js +35 -0
- package/dist/node/loader.js.map +1 -0
- package/dist/node/log-files.d.ts +16 -0
- package/dist/node/log-files.js +93 -0
- package/dist/node/log-files.js.map +1 -0
- package/dist/node/monthly.d.ts +41 -0
- package/dist/node/monthly.js +108 -0
- package/dist/node/monthly.js.map +1 -0
- package/dist/node/oauth-login.d.ts +45 -0
- package/dist/node/oauth-login.js +121 -0
- package/dist/node/oauth-login.js.map +1 -0
- package/dist/node/packs.d.ts +32 -0
- package/dist/node/packs.js +43 -0
- package/dist/node/packs.js.map +1 -0
- package/dist/node/privileged-seen.d.ts +11 -0
- package/dist/node/privileged-seen.js +41 -0
- package/dist/node/privileged-seen.js.map +1 -0
- package/dist/node/recipients.d.ts +17 -0
- package/dist/node/recipients.js +51 -0
- package/dist/node/recipients.js.map +1 -0
- package/dist/node/runner.d.ts +51 -0
- package/dist/node/runner.js +298 -0
- package/dist/node/runner.js.map +1 -0
- package/dist/node/runtime.d.ts +12 -0
- package/dist/node/runtime.js +13 -0
- package/dist/node/runtime.js.map +1 -0
- package/dist/node/schedules.d.ts +87 -0
- package/dist/node/schedules.js +141 -0
- package/dist/node/schedules.js.map +1 -0
- package/dist/node/secrets.d.ts +37 -0
- package/dist/node/secrets.js +219 -0
- package/dist/node/secrets.js.map +1 -0
- package/dist/node/support.d.ts +14 -0
- package/dist/node/support.js +133 -0
- package/dist/node/support.js.map +1 -0
- package/dist/node/tenants.d.ts +93 -0
- package/dist/node/tenants.js +255 -0
- package/dist/node/tenants.js.map +1 -0
- package/dist/node/ui-page.d.ts +1 -0
- package/dist/node/ui-page.js +3 -0
- package/dist/node/ui-page.js.map +1 -0
- package/dist/node/ui-server.d.ts +48 -0
- package/dist/node/ui-server.js +2665 -0
- package/dist/node/ui-server.js.map +1 -0
- package/dist/node/write.d.ts +9 -0
- package/dist/node/write.js +53 -0
- package/dist/node/write.js.map +1 -0
- package/dist/reports/builtin.generated.d.ts +1 -0
- package/dist/reports/builtin.generated.js +49 -0
- package/dist/reports/builtin.generated.js.map +1 -0
- package/dist/reports/library.d.ts +6 -0
- package/dist/reports/library.js +18 -0
- package/dist/reports/library.js.map +1 -0
- package/launcher/IdentityScope.cmd +11 -0
- package/package.json +69 -4
- package/reports/access-profile-members.yaml +29 -0
- package/reports/access-profile-membership-counts.yaml +17 -0
- package/reports/access-profiles-without-owner.yaml +16 -0
- package/reports/access-request-audit-trail.yaml +36 -0
- package/reports/accounts-by-source.yaml +19 -0
- package/reports/active-identities-without-manager.yaml +22 -0
- package/reports/aggregation-failures.yaml +29 -0
- package/reports/aggregation-history.yaml +27 -0
- package/reports/all-sources.yaml +16 -0
- package/reports/application-accounts.yaml +32 -0
- package/reports/application-entitlements.yaml +31 -0
- package/reports/campaign-progress.yaml +23 -0
- package/reports/certification-decisions.yaml +31 -0
- package/reports/direct-reports-per-manager.yaml +20 -0
- package/reports/disabled-accounts-of-active-people.yaml +33 -0
- package/reports/duplicate-emails.yaml +16 -0
- package/reports/entitlement-holders.yaml +35 -0
- package/reports/entitlements-held-by-inactive-identities.yaml +31 -0
- package/reports/entitlements-without-owner.yaml +28 -0
- package/reports/identities-by-lifecycle-state.yaml +15 -0
- package/reports/identities-missing-key-attributes.yaml +27 -0
- package/reports/identities-with-processing-errors.yaml +19 -0
- package/reports/identity-attribute-mappings.yaml +27 -0
- package/reports/machine-accounts.yaml +28 -0
- package/reports/managers-and-direct-reports.yaml +23 -0
- package/reports/most-access.yaml +18 -0
- package/reports/new-identities.yaml +24 -0
- package/reports/old-passwords.yaml +35 -0
- package/reports/pending-reviews-by-reviewer.yaml +20 -0
- package/reports/person-access.yaml +31 -0
- package/reports/privileged-access.yaml +29 -0
- package/reports/provisioning-error-causes.yaml +27 -0
- package/reports/provisioning-errors.yaml +32 -0
- package/reports/provisioning-failures.yaml +28 -0
- package/reports/recent-access-requests.yaml +22 -0
- package/reports/recent-activity.yaml +32 -0
- package/reports/recent-leavers.yaml +34 -0
- package/reports/role-members.yaml +29 -0
- package/reports/role-membership-counts.yaml +18 -0
- package/reports/roles-without-owner.yaml +17 -0
- package/reports/sources-needing-attention.yaml +23 -0
- package/reports/stuck-access-requests.yaml +29 -0
- package/reports/team-access.yaml +30 -0
- package/reports/terminated-users-with-active-accounts.yaml +46 -0
- package/reports/uncorrelated-accounts.yaml +38 -0
- package/ui/js/00-setup.js +6 -0
- package/ui/js/01-small-helpers.js +143 -0
- package/ui/js/02-connection.js +150 -0
- package/ui/js/03-health-check.js +17 -0
- package/ui/js/04-library.js +135 -0
- package/ui/js/05-pickers.js +163 -0
- package/ui/js/06-report-view.js +157 -0
- package/ui/js/07-fields.js +85 -0
- package/ui/js/08-designer.js +360 -0
- package/ui/js/09-yaml.js +22 -0
- package/ui/js/10-instant-check.js +171 -0
- package/ui/js/11-lookup.js +161 -0
- package/ui/js/12-tenant.js +115 -0
- package/ui/js/13-source-configuration-and-diagnostics.js +64 -0
- package/ui/js/14-certifications.js +68 -0
- package/ui/js/15-monthly-report.js +24 -0
- package/ui/js/16-ownership.js +39 -0
- package/ui/js/17-compare-tenants.js +102 -0
- package/ui/js/18-audit.js +181 -0
- package/ui/js/19-insights.js +108 -0
- package/ui/js/20-role-mining.js +35 -0
- package/ui/js/21-share-reports.js +45 -0
- package/ui/js/22-partner-overview-all-customer-tenants.js +228 -0
- package/ui/js/23-in-app-guidance.js +217 -0
- package/ui/js/24-role-tools.js +220 -0
- package/ui/js/25-schedules.js +264 -0
- package/ui/js/26-start.js +7 -0
- package/ui/js/27-warnings.js +224 -0
- package/ui/js/28-audit-readiness.js +99 -0
- package/ui/js/29-lifecycle.js +182 -0
- package/ui/js/30-labs.js +265 -0
- package/ui/js/31-build.js +203 -0
- package/ui/js/32-lab-examples.js +148 -0
- package/ui/js/33-finder.js +89 -0
- package/ui/js/34-governance.js +129 -0
- package/ui/js/35-watch.js +266 -0
- package/ui/js/36-model.js +247 -0
- package/ui/js/37-logs-and-watch.js +224 -0
- package/ui/shell.html +112 -0
- package/ui/style.css +350 -0
package/ui/js/30-labs.js
ADDED
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
// ---------- Transform lab, Workflow lab, Credential map (all read-only; evaluated on this computer) ----------
|
|
2
|
+
var LAB_SAMPLE_TRANSFORM = { type: 'static', attributes: { fn: { type: 'identityAttribute', attributes: { name: 'firstname' } }, ln: { type: 'identityAttribute', attributes: { name: 'lastname' } }, value: '$fn.substring(0,1).toLowerCase()$ln.toLowerCase()' } };
|
|
3
|
+
var LAB_SAMPLE_TRIGGER = { identity: { id: 'id-1', name: 'jane.doe' }, changes: [{ attribute: 'cloudLifecycleState', oldValue: 'active', newValue: 'inactive' }] };
|
|
4
|
+
function labState() {
|
|
5
|
+
if (!state.lab) state.lab = {
|
|
6
|
+
t: { json: JSON.stringify(LAB_SAMPLE_TRANSFORM, null, 2), name: '', implicit: '', identity: JSON.stringify(LAB_IDENTITY, null, 2), accounts: JSON.stringify([LAB_HR_ACCOUNT], null, 2), drafts: '', result: null, cases: [], people: {}, count: 200, query: '', attribute: '' },
|
|
7
|
+
w: { json: '', trigger: JSON.stringify(LAB_SAMPLE_TRIGGER, null, 2), mocks: '{}', pick: '', result: null, replay: {} },
|
|
8
|
+
c: {},
|
|
9
|
+
};
|
|
10
|
+
return state.lab;
|
|
11
|
+
}
|
|
12
|
+
function labCode(value, label, rows, oninput) {
|
|
13
|
+
var ta = el('textarea', { className: 'yaml', spellcheck: 'false', 'aria-label': label, style: 'min-height:' + (rows * 20 + 28) + 'px' });
|
|
14
|
+
ta.value = value;
|
|
15
|
+
ta.addEventListener('input', function () { oninput(ta.value); });
|
|
16
|
+
return ta;
|
|
17
|
+
}
|
|
18
|
+
function labParse(text, what) {
|
|
19
|
+
if (!String(text).trim()) return undefined;
|
|
20
|
+
try { return JSON.parse(text); } catch (e) { throw new Error(what + ' is not valid JSON: ' + e.message); }
|
|
21
|
+
}
|
|
22
|
+
function labValue(v) {
|
|
23
|
+
if (v === null || v === undefined) return el('span', { className: 'muted', text: 'null (no value)' });
|
|
24
|
+
return el('code', { text: typeof v === 'string' ? v : JSON.stringify(v) });
|
|
25
|
+
}
|
|
26
|
+
var LAB_STATUS = { ok: ['worked offline', 'gain'], error: ['fails (ISC would fail too)', 'lose'], 'isc-only': ['only ISC can work this out', 'keep-other'], random: ['different every run', 'keep-other'] };
|
|
27
|
+
function labStatus(s) { var x = LAB_STATUS[s] || [s, 'keep-other']; return pill(x[0], x[1]); }
|
|
28
|
+
function labLoadTenant(H, path, rerender) {
|
|
29
|
+
if (H.list || H.loading) return;
|
|
30
|
+
H.loading = true;
|
|
31
|
+
api(path).then(function (r) { H.list = r; }, function (e) { H.listError = errorText(e); }).then(function () { H.loading = false; rerender(); });
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Tenant > Transform lab
|
|
35
|
+
function renderTransformLab(w) {
|
|
36
|
+
var L = labState().t, rr = renderBuild;
|
|
37
|
+
labLoadTenant(L, '/api/lab/transforms', rr);
|
|
38
|
+
w.appendChild(el('div', { className: 'note', text: 'Runs the transform on this computer, nothing is saved to ISC. Pick one of your transforms or identity profile mappings, or paste a draft. Velocity, dates and lookups work the way SailPoint documents them; anything only ISC can know (custom rules, uniqueness) is marked.' }));
|
|
39
|
+
var pick = el('select', { className: 'input', style: 'max-width:420px', 'aria-label': 'Start from' }, el('option', { value: '', text: L.listError ? 'Could not read transforms' : L.list ? 'Start from one of yours...' : 'Reading your transforms...' }));
|
|
40
|
+
if (L.list) {
|
|
41
|
+
var g1 = el('optgroup', { label: 'Identity profile mappings' });
|
|
42
|
+
L.list.mappings.forEach(function (m, i) { g1.appendChild(el('option', { value: 'm' + i, text: m.profile + ': ' + m.attribute + ' (' + m.summary + ')' })); });
|
|
43
|
+
var g2 = el('optgroup', { label: 'Transforms' });
|
|
44
|
+
L.list.transforms.forEach(function (t, i) { g2.appendChild(el('option', { value: 't' + i, text: t.name + ' (' + t.type + ')' })); });
|
|
45
|
+
pick.appendChild(g1); pick.appendChild(g2);
|
|
46
|
+
}
|
|
47
|
+
pick.addEventListener('change', function () {
|
|
48
|
+
var v = pick.value; if (!v) return;
|
|
49
|
+
if (v[0] === 'm') { var m = L.list.mappings[Number(v.slice(1))]; L.json = JSON.stringify(m.transformDefinition, null, 2); L.name = m.profile + ' / ' + m.attribute; L.attribute = m.attribute; }
|
|
50
|
+
else { var t = L.list.transforms[Number(v.slice(1))]; L.json = JSON.stringify({ type: t.type, attributes: t.attributes || {} }, null, 2); L.name = t.name; L.attribute = ''; }
|
|
51
|
+
L.help = ''; L.result = null; L.people = {}; L.cases = (L.saved && L.saved[L.name]) || [];
|
|
52
|
+
rr();
|
|
53
|
+
});
|
|
54
|
+
if (!L.saved) api('/api/lab/tests').then(function (r) { L.saved = r; }, function () { L.saved = {}; });
|
|
55
|
+
var nameIn = el('input', { className: 'input', value: L.name, placeholder: 'Name (for saved test cases)', style: 'max-width:260px', 'aria-label': 'Transform name' });
|
|
56
|
+
nameIn.addEventListener('input', function () { L.name = nameIn.value; });
|
|
57
|
+
var exPick = el('select', { className: 'input', style: 'max-width:320px', 'aria-label': 'Examples' }, el('option', { value: '', text: 'Or start from an example...' }));
|
|
58
|
+
TRANSFORM_EXAMPLES.forEach(function (x, i) { exPick.appendChild(el('option', { value: String(i), text: x.title })); });
|
|
59
|
+
exPick.addEventListener('change', function () {
|
|
60
|
+
var x = TRANSFORM_EXAMPLES[Number(exPick.value)]; if (!x) return;
|
|
61
|
+
L.json = JSON.stringify(x.transform, null, 2); L.name = x.title; L.attribute = '';
|
|
62
|
+
L.implicit = x.implicit || ''; L.identity = JSON.stringify(x.identity || LAB_IDENTITY, null, 2);
|
|
63
|
+
L.accounts = JSON.stringify(x.accounts || [], null, 2); L.drafts = x.drafts ? JSON.stringify(x.drafts, null, 2) : '';
|
|
64
|
+
L.help = x.help; L.result = null; L.people = {}; L.cases = [];
|
|
65
|
+
rr();
|
|
66
|
+
});
|
|
67
|
+
w.appendChild(el('div', { className: 'bar', style: 'margin-bottom:10px' }, pick, exPick, nameIn));
|
|
68
|
+
if (L.help) w.appendChild(el('div', { className: 'note' }, el('b', { text: 'About this example: ' }), L.help));
|
|
69
|
+
|
|
70
|
+
var runBtn = el('button', { className: 'btn primary', onclick: function () { labRunTransform(L, rr); } }, icon('play'), 'Run');
|
|
71
|
+
var left = el('div', { style: 'flex:1.2;min-width:340px' }, el('div', { className: 'lbl', text: 'Transform (JSON)' }), labCode(L.json, 'Transform JSON', 16, function (v) { L.json = v; }));
|
|
72
|
+
var imp = el('input', { className: 'input', value: L.implicit, placeholder: 'e.g. 2024-03-01 or Sales', 'aria-label': 'Input value' });
|
|
73
|
+
imp.addEventListener('input', function () { L.implicit = imp.value; });
|
|
74
|
+
var right = el('div', { style: 'flex:1;min-width:300px' },
|
|
75
|
+
el('label', { className: 'field' }, el('span', { className: 'lbl', text: 'Input value (what the identity profile mapping passes in)' }), imp),
|
|
76
|
+
el('div', { className: 'lbl', text: 'Identity attributes (JSON)' }), labCode(L.identity, 'Identity attributes JSON', 4, function (v) { L.identity = v; }),
|
|
77
|
+
el('div', { className: 'lbl', style: 'margin-top:10px', text: 'Accounts (JSON list; used by accountAttribute)' }), labCode(L.accounts, 'Accounts JSON', 7, function (v) { L.accounts = v; }),
|
|
78
|
+
el('p', { className: 'muted small', style: 'margin:4px 0 0', text: 'Each account: "source" (the source name the transform asks for), "attributes" (the account\'s attributes); optional "nativeIdentity", "name" and "created", which accountFilter and the oldest-first rule use.' }),
|
|
79
|
+
el('div', { className: 'lbl', style: 'margin-top:10px', text: 'Other transforms (JSON list; used by reference)' }), labCode(L.drafts, 'Other transforms JSON', 4, function (v) { L.drafts = v; }),
|
|
80
|
+
el('p', { className: 'muted small', style: 'margin:4px 0 0', text: 'Drafts with a "name", "type" and "attributes". A reference looks here first, then in your tenant\'s saved transforms, so you can test a chain before saving any of it.' }),
|
|
81
|
+
el('div', { className: 'bar', style: 'margin-top:10px' }, runBtn));
|
|
82
|
+
w.appendChild(el('div', { style: 'display:flex;gap:16px;flex-wrap:wrap;margin-bottom:14px' }, left, right));
|
|
83
|
+
|
|
84
|
+
if (L.error) w.appendChild(el('div', { className: 'error', text: L.error }));
|
|
85
|
+
var R = L.result;
|
|
86
|
+
if (R) {
|
|
87
|
+
var r = R.result;
|
|
88
|
+
w.appendChild(section('Result', null, el('div', {},
|
|
89
|
+
el('div', { className: 'bar', style: 'margin-bottom:10px' }, el('b', { text: 'Value: ' }), labValue(r.value), labStatus(r.status)),
|
|
90
|
+
r.error ? el('div', { className: 'error', text: r.error }) : null,
|
|
91
|
+
r.assumptions.length ? el('div', { className: 'note' }, el('b', { text: 'Assumed where SailPoint does not document it: ' }), r.assumptions.join(' · ')) : null,
|
|
92
|
+
simpleTable(['Step', 'Transform', 'Input', 'Output', 'Note'], r.trace.map(function (s) {
|
|
93
|
+
return [el('span', { style: 'padding-left:' + (s.depth * 14) + 'px', text: s.type }), s.name || null, s.input === undefined ? null : labValue(s.input), s.error ? pill(s.error, 'lose') : labValue(s.output), s.note || null];
|
|
94
|
+
}), 'How the value was worked out'))));
|
|
95
|
+
}
|
|
96
|
+
renderLabCases(w, L, rr);
|
|
97
|
+
renderLabPeople(w, L, rr);
|
|
98
|
+
}
|
|
99
|
+
function labInput(L, implicit) {
|
|
100
|
+
var input = { implicit: implicit === undefined ? (L.implicit === '' ? undefined : L.implicit) : implicit };
|
|
101
|
+
var id = labParse(L.identity, 'Identity attributes'); if (id) input.identity = id;
|
|
102
|
+
var ac = labParse(L.accounts, 'Accounts'); if (ac) input.accounts = ac;
|
|
103
|
+
return input;
|
|
104
|
+
}
|
|
105
|
+
function labRunTransform(L, rr) {
|
|
106
|
+
L.error = null;
|
|
107
|
+
try {
|
|
108
|
+
var tr = labParse(L.json, 'The transform');
|
|
109
|
+
var cases = L.cases.map(function (c) { return { name: c.name, expected: c.expected, input: labInput(L, c.implicit) }; });
|
|
110
|
+
api('/api/lab/transform/run', 'POST', { transform: tr, input: labInput(L), cases: cases, transforms: labParse(L.drafts, 'Other transforms') }).then(function (r) {
|
|
111
|
+
L.result = r;
|
|
112
|
+
(r.cases || []).forEach(function (x, i) { if (L.cases[i]) L.cases[i].last = x; });
|
|
113
|
+
}, function (e) { L.error = errorText(e); }).then(rr);
|
|
114
|
+
} catch (e) { L.error = e.message; rr(); }
|
|
115
|
+
}
|
|
116
|
+
function renderLabCases(w, L, rr) {
|
|
117
|
+
var addBtn = el('button', { className: 'btn sm', onclick: function () {
|
|
118
|
+
var got = L.result && L.result.result.value;
|
|
119
|
+
L.cases.push({ name: 'Case ' + (L.cases.length + 1), implicit: L.implicit, expected: got === null || got === undefined ? '' : String(got) });
|
|
120
|
+
rr();
|
|
121
|
+
} }, icon('plus'), 'Add the current input as a case');
|
|
122
|
+
var saveBtn = el('button', { className: 'btn sm', disabled: !L.name, onclick: function () {
|
|
123
|
+
api('/api/lab/tests', 'POST', { transform: L.name, cases: L.cases.map(function (c) { return { name: c.name, implicit: c.implicit, expected: c.expected }; }) }).then(function (r) { L.saved = r; toast('Test cases saved on this computer'); }, function (e) { toast(errorText(e)); });
|
|
124
|
+
} }, icon('save'), 'Save cases');
|
|
125
|
+
var passed = L.cases.filter(function (c) { return c.last && c.last.pass; }).length, ran = L.cases.filter(function (c) { return c.last; }).length;
|
|
126
|
+
var body = el('div', {}, el('div', { className: 'bar', style: 'margin-bottom:10px' }, addBtn, saveBtn, el('span', { className: 'muted small', text: L.name ? 'Saved for "' + L.name + '" in your IdentityScope folder.' : 'Give the transform a name to save its cases.' }), el('span', { style: 'flex:1' }), ran ? pill(passed + ' of ' + ran + ' pass', passed === ran ? 'gain' : 'lose') : null));
|
|
127
|
+
if (L.cases.length) {
|
|
128
|
+
body.appendChild(simpleTable(['Case', 'Input value', 'Expected', 'Got', ''], L.cases.map(function (c, i) {
|
|
129
|
+
var n = el('input', { className: 'input', value: c.name, 'aria-label': 'Case name ' + (i + 1) }); n.addEventListener('input', function () { c.name = n.value; });
|
|
130
|
+
var v = el('input', { className: 'input', value: c.implicit || '', 'aria-label': 'Case input ' + (i + 1) }); v.addEventListener('input', function () { c.implicit = v.value; });
|
|
131
|
+
var x = el('input', { className: 'input', value: c.expected || '', 'aria-label': 'Expected value ' + (i + 1) }); x.addEventListener('input', function () { c.expected = x.value; });
|
|
132
|
+
return [n, v, x, c.last ? el('span', {}, pill(c.last.pass ? 'pass' : 'fail', c.last.pass ? 'gain' : 'lose'), ' ', el('code', { text: c.last.got })) : null,
|
|
133
|
+
el('button', { className: 'btn sm', 'aria-label': 'Remove case ' + (i + 1), onclick: function () { L.cases.splice(i, 1); rr(); } }, icon('trash'))];
|
|
134
|
+
}), 'Test cases'));
|
|
135
|
+
body.appendChild(el('p', { className: 'muted small', text: 'Cases use the identity attributes and accounts above with their own input value. Run checks every case.' }));
|
|
136
|
+
}
|
|
137
|
+
w.appendChild(section('Test cases', L.cases.length, body));
|
|
138
|
+
}
|
|
139
|
+
function renderLabPeople(w, L, rr) {
|
|
140
|
+
var H = L.people;
|
|
141
|
+
var count = numSelect(L, 'count', [[50, '50 people'], [200, '200 people'], [500, '500 people'], [2000, '2,000 people']], 'How many people');
|
|
142
|
+
var q = attrInput(L, 'query', 'Which people (search query, optional)', 'attributes.department:Sales');
|
|
143
|
+
var at = attrInput(L, 'attribute', 'Compare with identity attribute (optional)', 'email');
|
|
144
|
+
var go = el('button', { className: 'btn primary', disabled: !!H.busy, onclick: function () {
|
|
145
|
+
try { runJobInto(H, '/api/lab/transform/people', { transform: labParse(L.json, 'The transform'), transforms: labParse(L.drafts, 'Other transforms'), attribute: L.attribute || undefined, query: L.query || undefined, count: L.count }, rr); } catch (e) { toast(e.message); }
|
|
146
|
+
} }, icon('people'), 'Run on real people');
|
|
147
|
+
var body = el('div', {}, el('p', { className: 'muted', text: 'Reads real people and their accounts from ISC and works the value out for each, on this computer. With an attribute to compare, it shows where the offline result differs from what ISC holds now: use it before changing a mapping, or to check this engine against your tenant.' }),
|
|
148
|
+
el('div', { className: 'bar', style: 'margin-bottom:12px;align-items:flex-end' }, q, at, el('label', { className: 'field', style: 'margin:0' }, el('span', { className: 'lbl', text: 'How many' }), count), go));
|
|
149
|
+
if (H.busy) body.appendChild(busyBox(H.busy));
|
|
150
|
+
if (H.error) body.appendChild(el('div', { className: 'error', text: H.error }));
|
|
151
|
+
if (H.data) {
|
|
152
|
+
var d = H.data, S = d.summary;
|
|
153
|
+
(d.notes || []).forEach(function (n) { body.appendChild(el('div', { className: 'note', text: n })); });
|
|
154
|
+
body.appendChild(el('div', { className: 'bigstats' }, d.attribute ? stat(S.same, 'same as ISC') : null, d.attribute ? stat(S.different, 'different from ISC', 'lose') : null, stat(S.empty, 'no value'), stat(S.errors, 'errors', 'lose'), stat(S.iscOnly + S.random, 'only ISC can say'), stat(d.people, 'people')));
|
|
155
|
+
if (d.distinct.length) body.appendChild(el('p', { className: 'muted small', text: 'Most common results: ' + d.distinct.slice(0, 8).map(function (x) { return (x.value || '(empty)') + ' × ' + x.people; }).join(', ') }));
|
|
156
|
+
var show = d.attribute ? d.rows.slice().sort(function (a, b) { return (a.same === false ? 0 : 1) - (b.same === false ? 0 : 1); }) : d.rows;
|
|
157
|
+
body.appendChild(filteredTable(H, show, ['Person', d.attribute ? 'In ISC now' : 'Current', 'Offline result', 'Result'], function (r) {
|
|
158
|
+
return [r.person, r.current === undefined ? null : labValue(r.current), labValue(r.result), r.status !== 'ok' ? labStatus(r.status) : d.attribute ? pill(r.same ? 'same' : 'different', r.same ? 'gain' : 'lose') : null];
|
|
159
|
+
}, 'Transform results per person'));
|
|
160
|
+
}
|
|
161
|
+
w.appendChild(section('Try it on real people', null, body));
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// Tenant > Workflow lab
|
|
165
|
+
function renderWorkflowLab(w) {
|
|
166
|
+
var L = labState().w, rr = renderBuild;
|
|
167
|
+
labLoadTenant(L, '/api/lab/workflows', rr);
|
|
168
|
+
w.appendChild(el('div', { className: 'note', text: 'Walks a workflow step by step on this computer with a trigger you give it: which branch each condition takes, what each variable becomes and what each action would send. Nothing is called, so the workflow does not need to be disabled. Secrets are never shown.' }));
|
|
169
|
+
var pick = el('select', { className: 'input', style: 'max-width:420px', 'aria-label': 'Workflow' }, el('option', { value: '', text: L.listError ? 'Could not read workflows' : L.list ? 'Pick one of your workflows...' : 'Reading your workflows...' }));
|
|
170
|
+
(L.list || []).forEach(function (x) { pick.appendChild(el('option', { value: x.id, text: x.name + (x.enabled ? '' : ' (disabled)') })); });
|
|
171
|
+
pick.value = L.pick;
|
|
172
|
+
pick.addEventListener('change', function () {
|
|
173
|
+
L.pick = pick.value;
|
|
174
|
+
var x = (L.list || []).filter(function (y) { return y.id === L.pick; })[0];
|
|
175
|
+
if (x) L.json = JSON.stringify(x.definition || {}, null, 2);
|
|
176
|
+
L.help = '';
|
|
177
|
+
L.result = null; L.replay = {}; rr();
|
|
178
|
+
});
|
|
179
|
+
var exPick = el('select', { className: 'input', style: 'max-width:360px', 'aria-label': 'Workflow examples' }, el('option', { value: '', text: 'Or start from an example...' }));
|
|
180
|
+
WORKFLOW_EXAMPLES.forEach(function (x, i) { exPick.appendChild(el('option', { value: String(i), text: x.title })); });
|
|
181
|
+
exPick.addEventListener('change', function () {
|
|
182
|
+
var x = WORKFLOW_EXAMPLES[Number(exPick.value)]; if (!x) return;
|
|
183
|
+
L.pick = ''; L.json = JSON.stringify(x.definition, null, 2); L.trigger = JSON.stringify(TRIGGER_SAMPLES[x.trigger].input, null, 2);
|
|
184
|
+
L.mocks = JSON.stringify(x.mocks || {}, null, 2); L.help = x.help; L.result = null; L.replay = {};
|
|
185
|
+
rr();
|
|
186
|
+
});
|
|
187
|
+
var trPick = el('select', { className: 'input', style: 'max-width:280px', 'aria-label': 'Trigger input samples' }, el('option', { value: '', text: 'Trigger input sample...' }));
|
|
188
|
+
TRIGGER_SAMPLES.forEach(function (x, i) { trPick.appendChild(el('option', { value: String(i), text: x.title })); });
|
|
189
|
+
trPick.addEventListener('change', function () { var x = TRIGGER_SAMPLES[Number(trPick.value)]; if (!x) return; L.trigger = JSON.stringify(x.input, null, 2); L.result = null; rr(); });
|
|
190
|
+
w.appendChild(el('div', { className: 'bar', style: 'margin-bottom:10px' }, pick, exPick, trPick));
|
|
191
|
+
if (L.help) w.appendChild(el('div', { className: 'note' }, el('b', { text: 'About this example: ' }), L.help));
|
|
192
|
+
var runBtn = el('button', { className: 'btn primary', onclick: function () {
|
|
193
|
+
L.error = null;
|
|
194
|
+
try {
|
|
195
|
+
api('/api/lab/workflow/simulate', 'POST', { definition: labParse(L.json, 'The definition'), trigger: labParse(L.trigger, 'The trigger') || {}, mocks: labParse(L.mocks, 'Step outputs') || {} }).then(function (r) { L.result = r; }, function (e) { L.error = errorText(e); }).then(rr);
|
|
196
|
+
} catch (e) { L.error = e.message; rr(); }
|
|
197
|
+
} }, icon('play'), 'Simulate');
|
|
198
|
+
w.appendChild(el('div', { style: 'display:flex;gap:16px;flex-wrap:wrap;margin-bottom:14px' },
|
|
199
|
+
el('div', { style: 'flex:1.2;min-width:340px' }, el('div', { className: 'lbl', text: 'Definition (JSON: "start" and "steps")' }), labCode(L.json, 'Workflow definition JSON', 16, function (v) { L.json = v; })),
|
|
200
|
+
el('div', { style: 'flex:1;min-width:300px' }, el('div', { className: 'lbl', text: 'Trigger input (JSON)' }), labCode(L.trigger, 'Trigger JSON', 8, function (v) { L.trigger = v; }),
|
|
201
|
+
el('p', { className: 'muted small', style: 'margin:4px 0 0', text: 'What the trigger passes in; steps read it as $.trigger. Pick a sample above for the shape SailPoint documents per trigger, or replay a real run to use its actual input.' }),
|
|
202
|
+
el('div', { className: 'lbl', style: 'margin-top:10px', text: 'Step outputs to pretend (JSON: step name → output, optional)' }), labCode(L.mocks, 'Step outputs JSON', 4, function (v) { L.mocks = v; }),
|
|
203
|
+
el('p', { className: 'muted small', style: 'margin:4px 0 0', text: 'For steps that would read ISC or call a system, e.g. {"Get Identity": {"attributes": {"manager": {"email": "x@acme.com"}}}}. Later steps read it as $.getIdentity (the step name in camel case).' }),
|
|
204
|
+
el('div', { className: 'bar', style: 'margin-top:10px' }, runBtn))));
|
|
205
|
+
if (L.error) w.appendChild(el('div', { className: 'error', text: L.error }));
|
|
206
|
+
var R = L.result;
|
|
207
|
+
if (R) {
|
|
208
|
+
var tone = R.outcome === 'success' ? 'ok' : 'bad';
|
|
209
|
+
w.appendChild(el('div', { className: 'banner ' + tone }, el('b', { text: 'Ends in ' + R.outcome + (R.endStep ? ' at "' + R.endStep + '"' : '') }), el('span', { text: R.path.join(' → ') })));
|
|
210
|
+
R.warnings.forEach(function (x) { w.appendChild(el('div', { className: 'note', text: x })); });
|
|
211
|
+
if (R.failure) w.appendChild(el('div', { className: 'error', text: R.failure }));
|
|
212
|
+
w.appendChild(section('Steps', R.steps.length, simpleTable(['Step', 'Kind', 'What happens', 'Details', 'Next'], R.steps.map(function (s) {
|
|
213
|
+
var details = s.resolved !== undefined ? s.resolved : s.output;
|
|
214
|
+
return [el('span', { style: 'padding-left:' + (s.depth * 14) + 'px', text: s.step }), s.kind + (s.mocked ? ' (' + s.mocked + ' output)' : ''), el('span', {}, s.note || '', s.warning ? el('div', {}, pill(s.warning, 'lose')) : null), details === undefined ? null : el('code', { className: 'small', style: 'white-space:pre-wrap;word-break:break-word', text: JSON.stringify(details) }), s.next || null];
|
|
215
|
+
}), 'Simulated steps')));
|
|
216
|
+
}
|
|
217
|
+
renderReplay(w, L, rr);
|
|
218
|
+
}
|
|
219
|
+
function renderReplay(w, L, rr) {
|
|
220
|
+
var H = L.replay;
|
|
221
|
+
if (!L.replayCount) L.replayCount = 20;
|
|
222
|
+
var count = numSelect(L, 'replayCount', [[10, 'Last 10 runs'], [20, 'Last 20 runs'], [50, 'Last 50 runs'], [100, 'Last 100 runs']], 'How many runs');
|
|
223
|
+
var go = function (draft) {
|
|
224
|
+
return function () {
|
|
225
|
+
try { runJobInto(H, '/api/lab/workflow/replay', { workflowId: L.pick, count: L.replayCount, definition: draft ? labParse(L.json, 'The definition') : undefined }, rr); } catch (e) { toast(e.message); }
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
var body = el('div', {}, el('p', { className: 'muted', text: 'Reads the history of real runs (ISC keeps it for 90 days) and runs each one again here. "As it ran" checks the simulator against ISC. "With my edits" uses the definition above, so you can see which real runs would now take a different path before you publish.' }),
|
|
229
|
+
el('div', { className: 'bar', style: 'margin-bottom:12px' }, count,
|
|
230
|
+
el('button', { className: 'btn primary', disabled: !L.pick || !!H.busy, onclick: go(false) }, icon('lifecycle'), 'Replay as it ran'),
|
|
231
|
+
el('button', { className: 'btn', disabled: !L.pick || !!H.busy, onclick: go(true) }, icon('play'), 'Replay with my edits'),
|
|
232
|
+
L.pick ? null : el('span', { className: 'muted small', text: 'Pick one of your workflows first.' })));
|
|
233
|
+
if (H.busy) body.appendChild(busyBox(H.busy));
|
|
234
|
+
if (H.error) body.appendChild(el('div', { className: 'error', text: H.error }));
|
|
235
|
+
if (H.data) {
|
|
236
|
+
var d = H.data;
|
|
237
|
+
(d.notes || []).forEach(function (n) { body.appendChild(el('div', { className: 'note', text: n })); });
|
|
238
|
+
body.appendChild(el('div', { className: 'bigstats' }, stat(d.same, d.draft ? 'would take the same path' : 'same path as ISC'), stat(d.total - d.same, d.draft ? 'would take a different path' : 'different from ISC', 'lose'), stat(d.total, 'runs replayed')));
|
|
239
|
+
body.appendChild(filteredTable(H, d.results, ['Started', 'Status in ISC', 'Path in ISC', d.draft ? 'Path with your edits' : 'Simulated path', 'Result'], function (x) {
|
|
240
|
+
return [x.started ? x.started.slice(0, 16).replace('T', ' ') : null, x.status || null, x.realPath.join(' → '), x.simPath.join(' → '), x.same ? pill('same', 'gain') : pill(x.noTrigger ? 'no trigger recorded' : 'different at step ' + ((x.divergence && x.divergence.index + 1) || '?'), 'lose')];
|
|
241
|
+
}, 'Replayed runs'));
|
|
242
|
+
}
|
|
243
|
+
w.appendChild(section('Replay real runs', null, body));
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// Tenant > Credential map
|
|
247
|
+
function renderCredentialMap(w) {
|
|
248
|
+
var H = labState().c, rr = rerenderHost;
|
|
249
|
+
w.appendChild(el('div', { className: 'bar', style: 'margin-bottom:14px' }, el('span', { className: 'muted', style: 'flex:1;min-width:260px', text: 'Every place a client ID, user or endpoint is used in workflows and source connections: a checklist for rotating a secret or promoting to production. Secret values are never read or shown; only whether one is typed in.' }),
|
|
250
|
+
el('button', { className: 'btn primary', disabled: !!H.busy, onclick: function () { runJobInto(H, '/api/lab/credentials/run', {}, rr); } }, icon('search'), H.data ? 'Read again' : 'Map credentials')));
|
|
251
|
+
if (H.busy) { w.appendChild(busyBox(H.busy)); return; }
|
|
252
|
+
if (H.error) { w.appendChild(el('div', { className: 'error', text: H.error })); return; }
|
|
253
|
+
if (!H.data) return;
|
|
254
|
+
var d = H.data, T = d.totals;
|
|
255
|
+
(d.notes || []).forEach(function (n) { w.appendChild(el('div', { className: 'note', text: n })); });
|
|
256
|
+
w.appendChild(el('div', { className: 'bigstats' }, stat(T.inline, 'secrets typed into a step or source', 'lose'), stat(T.otherTenant, 'calls to another ISC tenant', T.otherTenant ? 'lose' : undefined), stat(T.thisTenantByName, 'call this tenant by its name (break when promoted)', T.thisTenantByName ? 'lose' : undefined), stat(T.parameterStorage, 'use Parameter Storage'), stat(T.workflowSteps, 'workflow steps with a connection'), stat(T.sources, 'sources with a connection')));
|
|
257
|
+
w.appendChild(section('By credential', d.groups.length, simpleTable(['Target', 'Client ID or user', 'Uses', 'Workflows', 'Sources', 'Secret typed in'], d.groups.map(function (g) {
|
|
258
|
+
return [g.target || '—', g.clientId || g.user || '—', g.uses, g.workflows, g.sources, g.inline ? pill(String(g.inline), 'lose') : 0];
|
|
259
|
+
}), 'Credentials grouped by target')));
|
|
260
|
+
w.appendChild(section('Every use', d.uses.length, filteredTable(H, d.uses, ['Where', 'Name', 'Step', 'Target', 'Client ID or user', 'Secret kept as', 'Notes'], function (u) {
|
|
261
|
+
return [u.where, el('span', {}, u.object, u.objectEnabled === false ? el('div', { className: 'muted small', text: 'disabled' }) : null), u.step || null, u.target || null, u.clientId || u.user || null,
|
|
262
|
+
u.parameterStorage ? pill('Parameter Storage', 'gain') : u.hasSecret ? pill('typed in', 'lose') : 'none', u.flags.length ? el('span', {}, u.flags.map(function (f) { return el('div', { className: 'small', text: f }); })) : null];
|
|
263
|
+
}, 'Credential uses')));
|
|
264
|
+
w.appendChild(el('p', { className: 'muted small', text: 'To rotate: change the secret in the application, then update each place listed here in ISC (or once, in Parameter Storage, for steps that use it). IdentityScope stays read-only and does not change them for you.' }));
|
|
265
|
+
}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
// ---------- Build & test: try changes before making them in ISC (read-only) ----------
|
|
2
|
+
state.bt = { tab: 'tlab', impact: {}, pick: '', policy: { usageType: 'CREATE', person: '' }, health: { days: 30 }, drift: {} };
|
|
3
|
+
// Build & test holds the tools for trying a change before making it. Where transforms and credentials
|
|
4
|
+
// are used and workflow health live on the Tenant page, drift on Audit > Change history, and the role
|
|
5
|
+
// change preview on Role tools: one home each.
|
|
6
|
+
var BUILD_TABS = [
|
|
7
|
+
['tlab', 'Transform lab', 'sliders'], ['policy', 'Account create preview', 'plus'], ['wlab', 'Workflow lab', 'play'],
|
|
8
|
+
];
|
|
9
|
+
/** Redraws whichever page the shared tools are on. */
|
|
10
|
+
function rerenderHost() {
|
|
11
|
+
if (state.page === 'tenant') renderTenant();
|
|
12
|
+
else if (state.page === 'certs') renderAudit();
|
|
13
|
+
else renderBuild();
|
|
14
|
+
}
|
|
15
|
+
function renderBuild() {
|
|
16
|
+
var B = state.bt;
|
|
17
|
+
var outer = $('build');
|
|
18
|
+
outer.textContent = '';
|
|
19
|
+
var w = el('div', { className: 'wrap', style: 'max-width:1240px' });
|
|
20
|
+
outer.appendChild(w);
|
|
21
|
+
w.appendChild(el('div', { className: 'rhead', style: 'margin-bottom:4px' }, el('span', { className: 'cat-ico', style: 'color:#6d28d9;background:#ede9fe' }, icon('code')),
|
|
22
|
+
el('div', {}, el('h2', { text: 'Build & test' }), el('p', { className: 'desc', text: 'Try changes before you make them in ISC. Everything here runs on this computer or only reads ISC: nothing is created, changed or started.' }))));
|
|
23
|
+
var tabs = el('div', { className: 'tabs' });
|
|
24
|
+
BUILD_TABS.forEach(function (t) {
|
|
25
|
+
tabs.appendChild(el('button', { className: 'tab' + (B.tab === t[0] ? ' active' : ''), onclick: function () { B.tab = t[0]; renderBuild(); } }, icon(t[2]), t[1]));
|
|
26
|
+
});
|
|
27
|
+
w.appendChild(tabs);
|
|
28
|
+
if (!BUILD_TABS.some(function (t) { return t[0] === B.tab; })) B.tab = 'tlab';
|
|
29
|
+
if (B.tab === 'policy') renderPolicyPreview(w);
|
|
30
|
+
else if (B.tab === 'wlab') renderWorkflowLab(w);
|
|
31
|
+
else renderTransformLab(w);
|
|
32
|
+
w.appendChild(el('p', { className: 'muted small', style: 'margin-top:18px', text: 'Also: where each transform is used (Tenant > Transforms), workflow runs and failures (Tenant > Workflows), where credentials are used (Tenant > Credential map), drift from an approved baseline (Audit > Change history), and who a role change would affect (Role tools > Preview a role change).' }));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Transform impact
|
|
36
|
+
function renderImpactMap(w) {
|
|
37
|
+
var B = state.bt, H = B.impact;
|
|
38
|
+
w.appendChild(el('div', { className: 'bar', style: 'margin-bottom:14px' },
|
|
39
|
+
el('span', { className: 'muted', style: 'flex:1;min-width:260px', text: 'Before you change a transform: every identity profile, other transform and provisioning policy that uses it, also through other transforms, and how many people that covers. Also lists transforms nothing uses.' }),
|
|
40
|
+
el('button', { className: 'btn primary', disabled: !!H.busy, onclick: function () { runJobInto(H, '/api/build/impact/run', {}, rerenderHost); } }, icon('search'), H.data ? 'Read again' : 'Find where transforms are used')));
|
|
41
|
+
if (H.busy) { w.appendChild(busyBox(H.busy)); return; }
|
|
42
|
+
if (H.error) { w.appendChild(el('div', { className: 'error', text: H.error })); return; }
|
|
43
|
+
if (!H.data) return;
|
|
44
|
+
var d = H.data;
|
|
45
|
+
(d.notes || []).forEach(function (n) { w.appendChild(el('div', { className: 'note', text: n })); });
|
|
46
|
+
w.appendChild(el('div', { className: 'bigstats' }, stat(d.transforms.length, 'transforms'), stat(d.unused.length, 'used by nothing', d.unused.length ? 'lose' : undefined), stat(d.profiles.length, 'identity profiles'), stat(d.policiesRead, 'provisioning policies read')));
|
|
47
|
+
var pick = el('select', { className: 'input', style: 'max-width:420px', 'aria-label': 'Transform' }, el('option', { value: '', text: 'Pick a transform to see where it is used...' }));
|
|
48
|
+
d.transforms.forEach(function (t) { pick.appendChild(el('option', { value: t.name, text: t.name + ' (' + t.uses.length + ' use' + (t.uses.length === 1 ? '' : 's') + ')' })); });
|
|
49
|
+
pick.value = B.pick;
|
|
50
|
+
pick.addEventListener('change', function () { B.pick = pick.value; rerenderHost(); });
|
|
51
|
+
w.appendChild(el('div', { className: 'bar', style: 'margin-bottom:12px' }, pick));
|
|
52
|
+
var t = d.transforms.filter(function (x) { return x.name === B.pick; })[0];
|
|
53
|
+
if (t) {
|
|
54
|
+
var people = t.people === null ? 'an unknown number of' : fmtNum(t.people);
|
|
55
|
+
w.appendChild(el('div', { className: 'banner ' + (t.uses.length ? 'bad' : 'ok') }, el('b', { text: t.uses.length ? 'Changing "' + t.name + '" affects ' + t.uses.length + ' place' + (t.uses.length === 1 ? '' : 's') : '"' + t.name + '" is not used anywhere IdentityScope can see' }),
|
|
56
|
+
t.uses.length ? el('span', { text: t.people ? ' · identity attributes of ' + people + ' people' : '' }) : null));
|
|
57
|
+
if (t.uses.length) w.appendChild(section('Where "' + t.name + '" is used', t.uses.length, simpleTable(['Used by', 'Where', 'Attribute or field', 'How'], t.uses.map(function (u) {
|
|
58
|
+
return [u.kind, u.where, u.detail || null, u.via.length ? 'through ' + u.via.join(' → ') : 'directly'];
|
|
59
|
+
}), 'Uses of the transform')));
|
|
60
|
+
}
|
|
61
|
+
if (d.unused.length) w.appendChild(section('Used by nothing', d.unused.length, el('p', { className: 'muted', text: d.unused.join(', ') + '. Check rules before deleting: a rule can use a transform in its own code.' })));
|
|
62
|
+
w.appendChild(section('All transforms', d.transforms.length, filteredTable(H, d.transforms, ['Transform', 'Type', 'Used directly', 'All uses', 'People'], function (x) {
|
|
63
|
+
return [el('button', { className: 'linkbtn', text: x.name, onclick: function () { B.pick = x.name; rerenderHost(); } }), x.type, x.direct, x.uses.length ? x.uses.length : pill('not used', 'lose'), x.people === null ? null : x.people];
|
|
64
|
+
}, 'Transforms and their uses')));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Account create preview
|
|
68
|
+
function renderPolicyPreview(w) {
|
|
69
|
+
var P = state.bt.policy;
|
|
70
|
+
if (!P.sources && !P.loading) {
|
|
71
|
+
P.loading = true;
|
|
72
|
+
api('/api/build/sources').then(function (r) { P.sources = r; }, function (e) { P.sourcesError = errorText(e); }).then(function () { P.loading = false; if (state.bt.tab === 'policy') renderBuild(); });
|
|
73
|
+
}
|
|
74
|
+
w.appendChild(el('div', { className: 'note', text: 'What a source\'s create policy would produce for one person, worked out on this computer with the Transform lab engine. Nothing is created. Use it to check a new or changed policy before the next joiner, or why a create failed.' }));
|
|
75
|
+
var src = el('select', { className: 'input', style: 'max-width:320px', 'aria-label': 'Source' }, el('option', { value: '', text: P.sourcesError ? 'Could not read sources' : P.sources ? 'Pick a source...' : 'Reading sources...' }));
|
|
76
|
+
(P.sources || []).forEach(function (s) { src.appendChild(el('option', { value: s.id, text: s.name })); });
|
|
77
|
+
src.value = P.sourceId || '';
|
|
78
|
+
src.addEventListener('change', function () { P.sourceId = src.value; });
|
|
79
|
+
var use = el('select', { className: 'input', style: 'max-width:160px', 'aria-label': 'Policy' });
|
|
80
|
+
['CREATE', 'UPDATE', 'ENABLE', 'DISABLE', 'CHANGE_PASSWORD'].forEach(function (u) { use.appendChild(el('option', { value: u, text: u === 'CREATE' ? 'Create account' : u.charAt(0) + u.slice(1).toLowerCase().replace('_', ' ') })); });
|
|
81
|
+
use.value = P.usageType;
|
|
82
|
+
use.addEventListener('change', function () { P.usageType = use.value; });
|
|
83
|
+
var who = el('input', { className: 'input', value: P.person, placeholder: 'Username, email or display name', style: 'max-width:280px', 'aria-label': 'Person' });
|
|
84
|
+
who.addEventListener('input', function () { P.person = who.value; });
|
|
85
|
+
who.addEventListener('keydown', function (e) { if (e.key === 'Enter') go.click(); });
|
|
86
|
+
var go = el('button', { className: 'btn primary', disabled: !!P.busy, onclick: function () {
|
|
87
|
+
if (!P.sourceId) { toast('Pick a source first'); return; }
|
|
88
|
+
if (!P.person.trim()) { toast('Name the person first'); return; }
|
|
89
|
+
runJobInto(P, '/api/build/policy/run', { sourceId: P.sourceId, usageType: P.usageType, person: P.person }, renderBuild);
|
|
90
|
+
} }, icon('play'), 'Preview');
|
|
91
|
+
w.appendChild(el('div', { className: 'bar', style: 'margin-bottom:14px' }, src, use, who, go));
|
|
92
|
+
if (P.busy) { w.appendChild(busyBox(P.busy)); return; }
|
|
93
|
+
if (P.error) { w.appendChild(el('div', { className: 'error', text: P.error })); return; }
|
|
94
|
+
if (!P.data) return;
|
|
95
|
+
var d = P.data;
|
|
96
|
+
d.warnings.forEach(function (x) { w.appendChild(el('div', { className: 'banner bad' }, el('span', { text: x }))); });
|
|
97
|
+
if (!d.fields.length) return;
|
|
98
|
+
w.appendChild(el('p', { className: 'muted', text: d.source + ' · ' + (d.policy || d.usageType) + (d.person ? ' · for ' + d.person.name : '') }));
|
|
99
|
+
w.appendChild(section('Fields', d.fields.length, simpleTable(['Field', 'Required', 'Value', 'Result', 'Note'], d.fields.map(function (f) {
|
|
100
|
+
return [el('code', { text: f.field }), f.required ? 'yes' : null, f.status === 'ok' || f.status === 'random' ? labValue(f.value) : null,
|
|
101
|
+
f.status === 'none' ? pill('not set here', 'keep-other') : f.status === 'hidden' ? pill('hidden', 'keep-other') : labStatus(f.status), f.error || f.note || null];
|
|
102
|
+
}), 'Account fields')));
|
|
103
|
+
if (d.assumptions.length) w.appendChild(el('div', { className: 'note' }, el('b', { text: 'Assumed: ' }), d.assumptions.join(' · ')));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Workflow health
|
|
107
|
+
function weekBars(weeks) {
|
|
108
|
+
var max = Math.max.apply(null, weeks.map(function (x) { return x.runs; }).concat([1]));
|
|
109
|
+
var label = weeks.map(function (x, i) { return 'week ' + (i + 1) + ': ' + x.failed + ' failed of ' + x.runs; }).join(', ');
|
|
110
|
+
var box = el('span', { className: 'wkbars', role: 'img', 'aria-label': label, title: label });
|
|
111
|
+
weeks.forEach(function (x) {
|
|
112
|
+
var h = x.runs ? Math.max(3, Math.round(22 * x.runs / max)) : 2;
|
|
113
|
+
var bar = el('span', { className: 'wkbar', style: 'height:' + h + 'px' });
|
|
114
|
+
if (x.failed) bar.appendChild(el('span', { className: 'wkfail', style: 'height:' + Math.max(2, Math.round(h * x.failed / x.runs)) + 'px' }));
|
|
115
|
+
box.appendChild(bar);
|
|
116
|
+
});
|
|
117
|
+
return box;
|
|
118
|
+
}
|
|
119
|
+
function renderWorkflowHealth(w) {
|
|
120
|
+
var H = state.bt.health;
|
|
121
|
+
var days = numSelect(H, 'days', [[7, 'Last 7 days'], [30, 'Last 30 days'], [60, 'Last 60 days'], [90, 'Last 90 days']], 'Period');
|
|
122
|
+
w.appendChild(el('div', { className: 'bar', style: 'margin-bottom:14px' },
|
|
123
|
+
el('span', { className: 'muted', style: 'flex:1;min-width:260px', text: 'Runs and failures of every workflow per week, and why runs failed, grouped: the same error with different IDs or names counts as one cause.' }),
|
|
124
|
+
days, el('button', { className: 'btn primary', disabled: !!H.busy, onclick: function () { runJobInto(H, '/api/build/health/run', { days: H.days }, rerenderHost); } }, icon('heart'), H.data ? 'Read again' : 'Check workflow health')));
|
|
125
|
+
if (H.busy) { w.appendChild(busyBox(H.busy)); return; }
|
|
126
|
+
if (H.error) { w.appendChild(el('div', { className: 'error', text: H.error })); return; }
|
|
127
|
+
if (!H.data) return;
|
|
128
|
+
var d = H.data, T = d.totals;
|
|
129
|
+
(d.notes || []).forEach(function (n) { w.appendChild(el('div', { className: 'note', text: n })); });
|
|
130
|
+
var rate = T.runs ? Math.round(1000 * T.failed / T.runs) / 10 : null;
|
|
131
|
+
w.appendChild(el('div', { className: 'bigstats' }, stat(T.runs, 'runs'), stat(T.failed, 'failed', T.failed ? 'lose' : undefined), stat(rate, 'failure rate (%)'), stat(T.failingEveryRun, 'fail every run', T.failingEveryRun ? 'lose' : undefined), stat(T.worse, 'failing more this week', T.worse ? 'lose' : undefined), stat(T.quiet, 'enabled, never ran')));
|
|
132
|
+
w.appendChild(section('Workflows', d.workflows.length, filteredTable(H, d.workflows, ['Workflow', 'Runs', 'Failed', 'Failure rate', 'Per week (grey: runs, red: failed)', 'Last run', 'Flags', 'Most common cause'], function (x) {
|
|
133
|
+
return [el('span', {}, x.name, el('div', { className: 'muted small', text: [x.enabled ? null : 'disabled', x.trigger, x.owner ? 'owner ' + x.owner : null].filter(Boolean).join(' · ') })), x.failedOnly ? '—' : x.runs, x.failed, x.rate === null ? null : x.rate + '%', weekBars(x.weeks), x.lastRun ? x.lastRun.slice(0, 16).replace('T', ' ') + (x.lastStatus ? ' · ' + x.lastStatus : '') : null,
|
|
134
|
+
x.flags.length ? el('span', {}, x.flags.map(function (f) { return el('div', {}, pill(f, /Enabled/.test(f) ? 'keep-other' : 'lose')); })) : null, x.topCause || null];
|
|
135
|
+
}, 'Workflow health')));
|
|
136
|
+
if (d.causes.length) w.appendChild(section('Why runs failed', d.causes.length, simpleTable(['Workflow', 'Step', 'Cause', 'Runs', 'Last'], d.causes.map(function (c) {
|
|
137
|
+
return [c.workflow, c.step || null, el('code', { className: 'small', style: 'white-space:pre-wrap;word-break:break-word', text: c.cause }), c.runs, c.last.slice(0, 16).replace('T', ' ')];
|
|
138
|
+
}), 'Failure causes')));
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// Drift check
|
|
142
|
+
function renderDrift(w) {
|
|
143
|
+
var D = state.bt.drift;
|
|
144
|
+
if (!D.info && !D.loading) {
|
|
145
|
+
D.loading = true;
|
|
146
|
+
api('/api/build/drift').then(function (r) { D.info = r; }, function (e) { D.infoError = errorText(e); }).then(function () { D.loading = false; if (state.bt.tab === 'drift') rerenderHost(); });
|
|
147
|
+
}
|
|
148
|
+
w.appendChild(el('div', { className: 'note', text: 'Approve a configuration snapshot as the baseline (for example the day a release went live), then check at any time what changed since: sources, transforms, identity profiles, roles, access profiles and workflows added, removed or changed outside a release. The baseline is kept on this computer.' }));
|
|
149
|
+
if (D.infoError) { w.appendChild(el('div', { className: 'error', text: D.infoError })); return; }
|
|
150
|
+
if (!D.info) { w.appendChild(busyBox('Reading saved snapshots...')); return; }
|
|
151
|
+
var I = D.info;
|
|
152
|
+
var reload = function () { D.info = null; rerenderHost(); };
|
|
153
|
+
var takeSnap = el('button', { className: 'btn', disabled: !!D.snapBusy, onclick: function () {
|
|
154
|
+
D.snapBusy = 'Taking a snapshot...'; rerenderHost();
|
|
155
|
+
api('/api/changes/snapshot', 'POST', {}).then(function (r) {
|
|
156
|
+
pollJob(r.job, function (p) { D.snapBusy = p; rerenderHost(); }, function () { D.snapBusy = null; toast('Snapshot saved'); reload(); }, function (e) { D.snapBusy = null; toast(e); rerenderHost(); });
|
|
157
|
+
}, function (e) { D.snapBusy = null; toast(errorText(e)); rerenderHost(); });
|
|
158
|
+
} }, icon('save'), D.snapBusy ? D.snapBusy : 'Take a snapshot now');
|
|
159
|
+
if (!I.baseline || D.changing) {
|
|
160
|
+
var card = el('section', { className: 'card' }, el('div', { className: 'card-h' }, el('h3', { text: I.baseline ? 'Change the baseline' : 'Approve a baseline' })));
|
|
161
|
+
if (!I.days.length) {
|
|
162
|
+
card.appendChild(el('p', { className: 'muted', text: 'There is no configuration snapshot yet. Take one now (it reads the configuration; nothing changes in ISC), then approve it.' }));
|
|
163
|
+
card.appendChild(el('div', { className: 'bar' }, takeSnap));
|
|
164
|
+
} else {
|
|
165
|
+
var day = el('select', { className: 'input', style: 'max-width:200px', 'aria-label': 'Snapshot day' });
|
|
166
|
+
I.days.forEach(function (x) { day.appendChild(el('option', { value: x, text: x })); });
|
|
167
|
+
var note = el('input', { className: 'input', placeholder: 'Note, e.g. Release 2026.12 to production', style: 'max-width:360px', 'aria-label': 'Note' });
|
|
168
|
+
card.appendChild(el('div', { className: 'bar' }, day, note,
|
|
169
|
+
el('button', { className: 'btn primary', onclick: function () {
|
|
170
|
+
api('/api/build/drift/baseline', 'POST', { day: day.value, note: note.value }).then(function () { D.changing = false; D.data = null; toast('Baseline approved'); reload(); }, function (e) { toast(errorText(e)); });
|
|
171
|
+
} }, icon('save'), 'Approve as baseline'), takeSnap,
|
|
172
|
+
D.changing ? el('button', { className: 'btn', onclick: function () { D.changing = false; rerenderHost(); } }, 'Cancel') : null));
|
|
173
|
+
}
|
|
174
|
+
w.appendChild(card);
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
var b = I.baseline;
|
|
178
|
+
w.appendChild(el('section', { className: 'card' }, el('div', { className: 'card-h' }, el('h3', { text: 'Baseline: ' + b.day })),
|
|
179
|
+
el('p', { className: 'muted', text: (b.note ? b.note + ' · ' : '') + 'approved by ' + b.by + ' on ' + b.approvedAt.slice(0, 16).replace('T', ' ') }),
|
|
180
|
+
el('div', { className: 'bar' },
|
|
181
|
+
el('button', { className: 'btn primary', disabled: !!D.busy, onclick: function () { runJobInto(D, '/api/build/drift/run', {}, rerenderHost); } }, icon('cols'), 'Check for drift now'),
|
|
182
|
+
el('button', { className: 'btn', onclick: function () { D.changing = true; rerenderHost(); } }, 'Change baseline'),
|
|
183
|
+
el('button', { className: 'btn', onclick: function () { api('/api/build/drift/baseline', 'POST', { day: '' }).then(function () { D.data = null; reload(); }); } }, icon('trash'), 'Remove'))));
|
|
184
|
+
if (D.busy) { w.appendChild(busyBox(D.busy)); return; }
|
|
185
|
+
if (D.error) { w.appendChild(el('div', { className: 'error', text: D.error })); return; }
|
|
186
|
+
if (!D.data) return;
|
|
187
|
+
var d = D.data, T = d.totals, any = T.added + T.removed + T.changed;
|
|
188
|
+
w.appendChild(el('div', { className: 'banner ' + (any ? 'bad' : 'ok') }, el('b', { text: any ? any + ' change' + (any === 1 ? '' : 's') + ' since the baseline' : 'No drift: the configuration matches the baseline' })));
|
|
189
|
+
w.appendChild(el('div', { className: 'bigstats' }, stat(T.added, 'added', T.added ? 'lose' : undefined), stat(T.removed, 'removed', T.removed ? 'lose' : undefined), stat(T.changed, 'changed', T.changed ? 'lose' : undefined), stat(T.same, 'unchanged')));
|
|
190
|
+
d.kinds.forEach(function (k) {
|
|
191
|
+
if (k.error) { w.appendChild(el('div', { className: 'note', text: k.label + ': ' + k.error })); return; }
|
|
192
|
+
var n = k.onlyA.length + k.onlyB.length + k.different.length;
|
|
193
|
+
if (!n) return;
|
|
194
|
+
var body = el('div', {});
|
|
195
|
+
if (k.onlyB.length) body.appendChild(el('p', {}, el('b', { text: 'Added: ' }), k.onlyB.join(', ')));
|
|
196
|
+
if (k.onlyA.length) body.appendChild(el('p', {}, el('b', { text: 'Removed: ' }), k.onlyA.join(', ')));
|
|
197
|
+
if (k.different.length) body.appendChild(simpleTable(['Name', 'Setting', 'At the baseline', 'Now'], k.different.flatMap(function (x) {
|
|
198
|
+
return x.differences.map(function (f, i) { return [i ? '' : x.name, el('code', { text: f.path || '(whole object)' }), f.a, f.b]; });
|
|
199
|
+
}), k.label + ' changed since the baseline'));
|
|
200
|
+
w.appendChild(section(k.label, n, body));
|
|
201
|
+
});
|
|
202
|
+
w.appendChild(el('div', { className: 'bar', style: 'margin-top:10px' }, downloads(D.job)));
|
|
203
|
+
}
|