@ibgib/web-gib 0.0.57 → 0.0.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AUTO-GENERATED-version.d.mts +1 -1
- package/dist/AUTO-GENERATED-version.mjs +1 -1
- package/dist/api/ibgib-api-bridge.d.mts +63 -1
- package/dist/api/ibgib-api-bridge.d.mts.map +1 -1
- package/dist/api/ibgib-api-bridge.mjs +135 -0
- package/dist/api/ibgib-api-bridge.mjs.map +1 -1
- package/dist/identity/custodian-delegate-helper.d.mts +22 -0
- package/dist/identity/custodian-delegate-helper.d.mts.map +1 -0
- package/dist/identity/custodian-delegate-helper.mjs +50 -0
- package/dist/identity/custodian-delegate-helper.mjs.map +1 -0
- package/dist/identity/sso-popup-helper.d.mts +33 -0
- package/dist/identity/sso-popup-helper.d.mts.map +1 -0
- package/dist/identity/sso-popup-helper.mjs +124 -0
- package/dist/identity/sso-popup-helper.mjs.map +1 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +3 -0
- package/dist/index.mjs.map +1 -1
- package/dist/ui/component/identity/add-device/add-device.d.mts.map +1 -1
- package/dist/ui/component/identity/add-device/add-device.mjs +5 -1
- package/dist/ui/component/identity/add-device/add-device.mjs.map +1 -1
- package/dist/ui/component/identity/identity-header/identity-header.d.mts.map +1 -1
- package/dist/ui/component/identity/identity-header/identity-header.mjs +2 -1
- package/dist/ui/component/identity/identity-header/identity-header.mjs.map +1 -1
- package/dist/ui/component/identity/keystone-creator/keystone-creator.css +109 -23
- package/dist/ui/component/identity/keystone-creator/keystone-creator.d.mts +22 -0
- package/dist/ui/component/identity/keystone-creator/keystone-creator.d.mts.map +1 -1
- package/dist/ui/component/identity/keystone-creator/keystone-creator.html +122 -60
- package/dist/ui/component/identity/keystone-creator/keystone-creator.mjs +445 -73
- package/dist/ui/component/identity/keystone-creator/keystone-creator.mjs.map +1 -1
- package/dist/ui/component/identity/keystone-details/keystone-details.d.mts.map +1 -1
- package/dist/ui/component/identity/keystone-details/keystone-details.mjs +10 -53
- package/dist/ui/component/identity/keystone-details/keystone-details.mjs.map +1 -1
- package/package.json +4 -4
- package/src/AUTO-GENERATED-version.mts +1 -1
- package/src/api/ibgib-api-bridge.mts +195 -1
- package/src/identity/custodian-delegate-helper.mts +61 -0
- package/src/identity/sso-popup-helper.mts +155 -0
- package/src/index.mts +3 -0
- package/src/ui/component/identity/add-device/add-device.mts +5 -1
- package/src/ui/component/identity/identity-header/identity-header.mts +2 -1
- package/src/ui/component/identity/keystone-creator/keystone-creator.css +109 -23
- package/src/ui/component/identity/keystone-creator/keystone-creator.html +122 -60
- package/src/ui/component/identity/keystone-creator/keystone-creator.mts +507 -77
- package/src/ui/component/identity/keystone-details/keystone-details.mts +10 -62
- package/tools/auto-generated-agent-skills/skills/ibgib-implementation-plan/SKILL.md +3 -0
|
@@ -22,6 +22,7 @@ import { getKeystoneSyncService } from "../../../../identity/keystone-sync-servi
|
|
|
22
22
|
import { updateSpecialIndex } from "@ibgib/core-gib/dist/timeline/timeline-api.mjs";
|
|
23
23
|
import { getTjpAddr, toDto } from "@ibgib/core-gib/dist/common/other/ibgib-helper.mjs";
|
|
24
24
|
import { parseSpaceIb } from "@ibgib/core-gib/dist/witness/space/space-helper.mjs";
|
|
25
|
+
import { executeSsoOAuthPopup } from "../../../../identity/sso-popup-helper.mjs";
|
|
25
26
|
|
|
26
27
|
import { getComponentCtorArg } from "../../../../app-bootstrap/init-orchestration.mjs";
|
|
27
28
|
import { promptForSecret } from "../../../../helpers.web.mjs";
|
|
@@ -403,7 +404,7 @@ export class KeystoneDetailsComponentInstance
|
|
|
403
404
|
|
|
404
405
|
await this.updateFrameDetailsView();
|
|
405
406
|
} catch (error) {
|
|
406
|
-
console.error(`${lc} ${extractErrorMsg(error)}`);
|
|
407
|
+
console.error(`${lc} Registered identity keystone address ${this.ibGibAddr} not found in local browser space: ${extractErrorMsg(error)} (E: a123456789abcdef0123456789c0003)`);
|
|
407
408
|
throw error;
|
|
408
409
|
} finally {
|
|
409
410
|
if (logalot) { console.log(`${lc} complete.`); }
|
|
@@ -1039,70 +1040,17 @@ export class KeystoneDetailsComponentInstance
|
|
|
1039
1040
|
this.setSSOStatus(`Linking ${providerId}...`, "info");
|
|
1040
1041
|
|
|
1041
1042
|
try {
|
|
1042
|
-
|
|
1043
|
-
const res = await fetch('/api/identity/sso/config');
|
|
1044
|
-
if (!res.ok) {
|
|
1045
|
-
throw new Error(`Failed to fetch SSO config from server: ${res.statusText}`);
|
|
1046
|
-
}
|
|
1047
|
-
const data = await res.json();
|
|
1048
|
-
if (!data.success || !data.providers) {
|
|
1049
|
-
throw new Error(`SSO configuration fetch failed: ${data.message || 'unknown error'}`);
|
|
1050
|
-
}
|
|
1051
|
-
|
|
1052
|
-
const providerConfig = data.providers.find((p: any) => p.providerId === providerId);
|
|
1053
|
-
if (!providerConfig) {
|
|
1054
|
-
throw new Error(`SSO provider '${providerId}' is not configured on the server.`);
|
|
1055
|
-
}
|
|
1056
|
-
|
|
1057
|
-
// 2. Generate a secure, high-entropy user nonce
|
|
1058
|
-
const userNonce = (Math.random().toString(36).substring(2) + Math.random().toString(36).substring(2)).substring(0, 32);
|
|
1059
|
-
|
|
1060
|
-
// 3. Construct state payload
|
|
1061
|
-
const stateObj = {
|
|
1043
|
+
const resPopup = await executeSsoOAuthPopup({
|
|
1062
1044
|
providerId,
|
|
1063
|
-
parentTjpAddr: this.ibGibAddr
|
|
1064
|
-
|
|
1065
|
-
};
|
|
1066
|
-
const state = btoa(JSON.stringify(stateObj));
|
|
1067
|
-
|
|
1068
|
-
// 4. Construct Auth URL
|
|
1069
|
-
const authUrl = `${providerConfig.authUrl}?client_id=${providerConfig.clientId}&redirect_uri=${encodeURIComponent(providerConfig.redirectUri)}&response_type=code&scope=${encodeURIComponent(providerConfig.scope)}&state=${encodeURIComponent(state)}`;
|
|
1070
|
-
|
|
1071
|
-
// 5. Open popup window
|
|
1072
|
-
const popup = window.open(
|
|
1073
|
-
authUrl,
|
|
1074
|
-
'sso-oauth-popup',
|
|
1075
|
-
'width=600,height=700,status=yes,toolbar=no,menubar=no,location=yes'
|
|
1076
|
-
);
|
|
1077
|
-
if (!popup) {
|
|
1078
|
-
throw new Error("Popup blocked by browser. Please enable popups for this site.");
|
|
1079
|
-
}
|
|
1045
|
+
parentTjpAddr: this.ibGibAddr
|
|
1046
|
+
});
|
|
1080
1047
|
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
const callbackData = event.data;
|
|
1086
|
-
if (callbackData && callbackData.type === 'sso-oauth-callback') {
|
|
1087
|
-
window.removeEventListener('message', messageListener);
|
|
1088
|
-
clearInterval(checkClosedInterval);
|
|
1089
|
-
await this.handleSSOLinkCallback(callbackData.code, stateObj, providerConfig.redirectUri);
|
|
1090
|
-
}
|
|
1091
|
-
};
|
|
1092
|
-
window.addEventListener('message', messageListener);
|
|
1093
|
-
|
|
1094
|
-
// 7. Poll for manual closure of the popup window
|
|
1095
|
-
checkClosedInterval = setInterval(() => {
|
|
1096
|
-
if (popup.closed) {
|
|
1097
|
-
clearInterval(checkClosedInterval);
|
|
1098
|
-
window.removeEventListener('message', messageListener);
|
|
1099
|
-
const statusEl = this.elements!.ssoStatusMsgEl;
|
|
1100
|
-
if (statusEl.textContent && statusEl.textContent.startsWith('Linking')) {
|
|
1101
|
-
this.setSSOStatus('Linking cancelled (window closed).', 'error');
|
|
1102
|
-
}
|
|
1103
|
-
}
|
|
1104
|
-
}, 500);
|
|
1048
|
+
if (!resPopup.success || !resPopup.code) {
|
|
1049
|
+
this.setSSOStatus(resPopup.message || `Linking cancelled.`, "error");
|
|
1050
|
+
return;
|
|
1051
|
+
}
|
|
1105
1052
|
|
|
1053
|
+
await this.handleSSOLinkCallback(resPopup.code, resPopup.stateObj, resPopup.redirectUri!);
|
|
1106
1054
|
} catch (error) {
|
|
1107
1055
|
console.error(`${lc} SSO link initiation failed: ${extractErrorMsg(error)}`);
|
|
1108
1056
|
this.setSSOStatus(`Link failed: ${extractErrorMsg(error)}`, "error");
|
|
@@ -67,6 +67,9 @@ Break the work into small, incremental, independently verifiable steps:
|
|
|
67
67
|
|
|
68
68
|
## 🧪 Testing & Verification Strategy
|
|
69
69
|
|
|
70
|
+
> [!IMPORTANT]
|
|
71
|
+
> Always review and follow [`docs/RESPEC_GIB_GUIDANCE.md`](file:///c:/Users/billm/antigravity/ibgib/docs/RESPEC_GIB_GUIDANCE.md) for respec testing patterns, including the strict use of `ifWeMight` blocks, avoiding artificial delays, and proper error handling.
|
|
72
|
+
|
|
70
73
|
* **Unit & Integration Tests**: `respec-gib` test commands (`npm run test:core-gib`) and specific `ifWeMight` focus instructions.
|
|
71
74
|
* **Manual & E2E Checks**: Step-by-step verification steps in browser or CLI environment.
|
|
72
75
|
|