@ibgib/web-gib 0.0.60 → 0.0.61

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 (60) hide show
  1. package/dist/AUTO-GENERATED-version.d.mts +1 -1
  2. package/dist/AUTO-GENERATED-version.mjs +1 -1
  3. package/dist/helpers.d.mts.map +1 -1
  4. package/dist/helpers.mjs +1 -0
  5. package/dist/helpers.mjs.map +1 -1
  6. package/dist/identity/device-delegate-helper.d.mts +43 -0
  7. package/dist/identity/device-delegate-helper.d.mts.map +1 -0
  8. package/dist/identity/device-delegate-helper.mjs +106 -0
  9. package/dist/identity/device-delegate-helper.mjs.map +1 -0
  10. package/dist/identity/device-delegate.respec.d.mts +2 -0
  11. package/dist/identity/device-delegate.respec.d.mts.map +1 -0
  12. package/dist/identity/device-delegate.respec.mjs +106 -0
  13. package/dist/identity/device-delegate.respec.mjs.map +1 -0
  14. package/dist/identity/keystone-sync-service.d.mts +18 -0
  15. package/dist/identity/keystone-sync-service.d.mts.map +1 -1
  16. package/dist/identity/keystone-sync-service.mjs +77 -1
  17. package/dist/identity/keystone-sync-service.mjs.map +1 -1
  18. package/dist/index.d.mts +1 -1
  19. package/dist/index.d.mts.map +1 -1
  20. package/dist/index.mjs +1 -2
  21. package/dist/index.mjs.map +1 -1
  22. package/dist/storage/storage-helpers.web.d.mts +9 -0
  23. package/dist/storage/storage-helpers.web.d.mts.map +1 -1
  24. package/dist/storage/storage-helpers.web.mjs +42 -0
  25. package/dist/storage/storage-helpers.web.mjs.map +1 -1
  26. package/dist/ui/component/identity/add-device/add-device.d.mts.map +1 -1
  27. package/dist/ui/component/identity/add-device/add-device.mjs +30 -43
  28. package/dist/ui/component/identity/add-device/add-device.mjs.map +1 -1
  29. package/dist/ui/component/identity/keystone-creator/keystone-creator.d.mts.map +1 -1
  30. package/dist/ui/component/identity/keystone-creator/keystone-creator.mjs +41 -57
  31. package/dist/ui/component/identity/keystone-creator/keystone-creator.mjs.map +1 -1
  32. package/dist/ui/component/identity/keystone-details/keystone-details.d.mts +3 -0
  33. package/dist/ui/component/identity/keystone-details/keystone-details.d.mts.map +1 -1
  34. package/dist/ui/component/identity/keystone-details/keystone-details.mjs +307 -46
  35. package/dist/ui/component/identity/keystone-details/keystone-details.mjs.map +1 -1
  36. package/dist/ui/ui-constants.d.mts +1 -0
  37. package/dist/ui/ui-constants.d.mts.map +1 -1
  38. package/dist/ui/ui-constants.mjs +1 -0
  39. package/dist/ui/ui-constants.mjs.map +1 -1
  40. package/dist/ui/ui-types.d.mts +5 -0
  41. package/dist/ui/ui-types.d.mts.map +1 -1
  42. package/package.json +2 -2
  43. package/src/AUTO-GENERATED-version.mts +1 -1
  44. package/src/helpers.mts +1 -0
  45. package/src/identity/custodian-delegate-helper.mts.bak +7 -0
  46. package/src/identity/device-delegate-helper.mts +135 -0
  47. package/src/identity/device-delegate.respec.mts +125 -0
  48. package/src/identity/keystone-sync-service.mts +95 -2
  49. package/src/index.mts +1 -2
  50. package/src/storage/storage-helpers.web.mts +47 -0
  51. package/src/ui/component/identity/add-device/add-device.mts +36 -48
  52. package/src/ui/component/identity/keystone-creator/keystone-creator.mts +48 -65
  53. package/src/ui/component/identity/keystone-details/keystone-details.mts +317 -49
  54. package/src/ui/ui-constants.mts +1 -0
  55. package/src/ui/ui-types.mts +6 -0
  56. package/dist/identity/custodian-delegate-helper.d.mts +0 -22
  57. package/dist/identity/custodian-delegate-helper.d.mts.map +0 -1
  58. package/dist/identity/custodian-delegate-helper.mjs +0 -67
  59. package/dist/identity/custodian-delegate-helper.mjs.map +0 -1
  60. package/src/identity/custodian-delegate-helper.mts +0 -86
@@ -1,86 +0,0 @@
1
- /**
2
- * @module identity/custodian-delegate-helper
3
- *
4
- * Client-side helper functions for deriving and storing local cryptographic delegate secrets
5
- * for full-custodian / passwordless identities.
6
- */
7
-
8
- import { getUUID, hash, HashAlgorithm, extractErrorMsg } from "@ibgib/helper-gib/dist/helpers/utils-helper.mjs";
9
- import { storageGet, storagePut } from "../storage/storage-helpers.web.mjs";
10
- import { getGlobalDbName, getGlobalStoreName } from "../helpers.web.mjs";
11
-
12
- const LOCAL_STORAGE_PREFIX = 'ibgib_custodian_delegate_secret_';
13
-
14
- /**
15
- * Retrieves or generates a high-entropy local delegate secret for a passwordless custodian identity.
16
- * Stored locally in `localStorage` keyed by `primaryTjpAddr`.
17
- *
18
- * @param primaryTjpAddr The primary identity keystone TJP address (`ib^gib`).
19
- */
20
- export async function deriveLocalCustodianDelegateSecret({
21
- primaryTjpAddr,
22
- }: {
23
- primaryTjpAddr: string;
24
- }): Promise<string> {
25
- const lc = `[${deriveLocalCustodianDelegateSecret.name}]`;
26
- try {
27
- if (!primaryTjpAddr) {
28
- throw new Error('primaryTjpAddr is required to derive local custodian delegate secret (E: a1b2c3d4e5f67890123456789a000101)');
29
- }
30
-
31
- const key = `${LOCAL_STORAGE_PREFIX}${primaryTjpAddr}`;
32
-
33
- const dbName = getGlobalDbName();
34
- const storeName = getGlobalStoreName();
35
-
36
- // debugger; // what are the dbName and storeName?
37
-
38
-
39
- const existingSecret = await storageGet({ dbName, storeName, key });
40
- if (existingSecret) {
41
- return existingSecret;
42
- }
43
-
44
- // Generate high-entropy 512-bit SHA hash secret from fresh UUIDs
45
- const rawEntropy = await getUUID(32);
46
- const newSecret = await hash({
47
- s: rawEntropy,
48
- algorithm: HashAlgorithm.sha_512
49
- });
50
- await storagePut({ dbName, storeName, key, value: newSecret });
51
-
52
- return newSecret;
53
-
54
-
55
- // const existingSecret = localStorage.getItem(key);
56
- // if (existingSecret) {
57
- // return existingSecret;
58
- // }
59
-
60
- // // Generate high-entropy 512-bit SHA hash secret from fresh UUIDs
61
- // const rawEntropy = `${await getUUID()}-${await getUUID()}-${await getUUID()}-${Date.now()}`;
62
- // const newSecret = await hash({
63
- // s: rawEntropy,
64
- // algorithm: HashAlgorithm.sha_512
65
- // });
66
-
67
- // localStorage.setItem(key, newSecret);
68
- // return newSecret;
69
- } catch (error) {
70
- console.error(`${lc} ${extractErrorMsg(error)}`);
71
- throw error;
72
- }
73
- }
74
-
75
- /**
76
- * Removes the stored local delegate secret for a custodian identity.
77
- */
78
- export function clearLocalCustodianDelegateSecret({
79
- primaryTjpAddr,
80
- }: {
81
- primaryTjpAddr: string;
82
- }): void {
83
- if (!primaryTjpAddr) { return; }
84
- const key = `${LOCAL_STORAGE_PREFIX}${primaryTjpAddr}`;
85
- localStorage.removeItem(key);
86
- }