@structured-id/ui-core 1.2.0 → 1.3.0

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 (101) hide show
  1. package/README.md +9 -5
  2. package/dist/browser-vp/index.d.cts +0 -11
  3. package/dist/browser-vp/index.d.ts +0 -11
  4. package/dist/index.cjs +13721 -9514
  5. package/dist/index.d.cts +4362 -2375
  6. package/dist/index.d.ts +4362 -2375
  7. package/dist/index.js +13937 -9730
  8. package/package.json +3 -3
  9. package/src/browser-vp/crypto.ts +0 -1
  10. package/src/browser-vp/index.ts +0 -2
  11. package/src/browser-vp/prf.ts +0 -2
  12. package/src/browser-vp/storage.ts +0 -2
  13. package/src/browser-vp/types.ts +0 -2
  14. package/src/browser-vp/vp.ts +0 -2
  15. package/src/composables/index.ts +6 -1
  16. package/src/composables/useAccountTransport.test.ts +121 -0
  17. package/src/composables/useAccountTransport.ts +69 -0
  18. package/src/composables/useBffAuth.ts +44 -34
  19. package/src/generated/google/api/httpbody.ts +159 -0
  20. package/src/generated/google/protobuf/any.ts +326 -0
  21. package/src/generated/google/rpc/error_details.ts +1386 -0
  22. package/src/generated/google/rpc/status.ts +127 -0
  23. package/src/generated/sid/v1/account/account.ts +1 -1
  24. package/src/generated/sid/v1/admin/admin.client.ts +15 -12
  25. package/src/generated/sid/v1/admin/admin.ts +24 -89
  26. package/src/generated/sid/v1/admin/enrollment.client.ts +24 -12
  27. package/src/generated/sid/v1/admin/enrollment.ts +65 -3
  28. package/src/generated/sid/v1/admin/events.client.ts +8 -8
  29. package/src/generated/sid/v1/admin/flow.ts +1 -1
  30. package/src/generated/sid/v1/admin/keys.ts +1 -1
  31. package/src/generated/sid/v1/admin/notifications.client.ts +12 -6
  32. package/src/generated/sid/v1/admin/notifications.ts +11 -70
  33. package/src/generated/sid/v1/admin/operations.ts +20 -35
  34. package/src/generated/sid/v1/admin/organizations.client.ts +2 -2
  35. package/src/generated/sid/v1/admin/organizations.ts +15 -32
  36. package/src/generated/sid/v1/admin/provisioning.client.ts +232 -0
  37. package/src/generated/sid/v1/admin/provisioning.ts +1383 -0
  38. package/src/generated/sid/v1/admin/scopes.ts +1 -1
  39. package/src/generated/sid/v1/admin/security.client.ts +22 -24
  40. package/src/generated/sid/v1/admin/security.ts +13 -22
  41. package/src/generated/sid/v1/admin/settings.client.ts +29 -18
  42. package/src/generated/sid/v1/admin/settings.ts +2 -82
  43. package/src/generated/sid/v1/attestation/attestation.client.ts +6 -6
  44. package/src/generated/sid/v1/attestation/attestation.ts +8 -8
  45. package/src/generated/sid/v1/authn/auth.client.ts +101 -58
  46. package/src/generated/sid/v1/authn/auth.ts +842 -414
  47. package/src/generated/sid/v1/authn/flows.ts +0 -12
  48. package/src/generated/sid/v1/authn/issuer.client.ts +489 -0
  49. package/src/generated/sid/v1/authn/issuer.ts +1600 -0
  50. package/src/generated/sid/v1/authn/password_history.client.ts +57 -0
  51. package/src/generated/sid/v1/authn/password_history.ts +578 -0
  52. package/src/generated/sid/v1/authn/system_integration.client.ts +73 -0
  53. package/src/generated/sid/v1/authn/system_integration.ts +218 -0
  54. package/src/generated/sid/v1/authz/authz.ts +1498 -317
  55. package/src/generated/sid/v1/authz/forward_auth.client.ts +97 -0
  56. package/src/generated/sid/v1/authz/forward_auth.ts +79 -0
  57. package/src/generated/sid/v1/authz/governance.client.ts +2 -2
  58. package/src/generated/sid/v1/authz/governance.ts +61 -4
  59. package/src/generated/sid/v1/common/errors.ts +532 -6
  60. package/src/generated/sid/v1/events/event_stream.client.ts +2 -2
  61. package/src/generated/sid/v1/events/event_stream.ts +2 -1
  62. package/src/generated/sid/v1/identity/identity.ts +98 -58
  63. package/src/generated/sid/v1/ids/ids.ts +395 -0
  64. package/src/generated/sid/v1/machine/machine_user.ts +0 -36
  65. package/src/generated/sid/v1/machine/pat.client.ts +2 -19
  66. package/src/generated/sid/v1/machine/pat.ts +1 -186
  67. package/src/generated/sid/v1/projects/projects.client.ts +137 -19
  68. package/src/generated/sid/v1/projects/projects.ts +2105 -405
  69. package/src/generated/sid/v1/scim/scim.client.ts +248 -2
  70. package/src/generated/sid/v1/scim/scim.ts +153 -14
  71. package/src/generated/sid/v1/test/test.ts +1 -1
  72. package/src/i18n/index.ts +0 -11
  73. package/src/index.ts +36 -2
  74. package/src/package-exports.test.ts +18 -0
  75. package/src/profile/components/SidLoginForm.vue +5 -2
  76. package/src/profile/components/SidRegistrationForm.test.ts +58 -1
  77. package/src/profile/components/SidRegistrationForm.vue +110 -12
  78. package/src/profile/components/index.ts +4 -0
  79. package/src/profile/composables/index.ts +2 -1
  80. package/src/profile/composables/useAccountApi.ts +20 -7
  81. package/src/profile/composables/useAuth.test.ts +453 -0
  82. package/src/profile/composables/useAuth.ts +414 -0
  83. package/src/profile/composables/useAuthApi.opaque.test.ts +18 -0
  84. package/src/profile/composables/useAuthApi.ts +188 -20
  85. package/src/profile/composables/useEnrollmentApi.test.ts +33 -0
  86. package/src/profile/composables/useEnrollmentApi.ts +26 -0
  87. package/src/profile/composables/useIdentityApi.ts +17 -7
  88. package/src/profile/composables/useLoginSuccess.test.ts +97 -3
  89. package/src/profile/composables/useLoginSuccess.ts +80 -22
  90. package/src/profile/composables/useSecurityLevel.test.ts +10 -3
  91. package/src/profile/composables/useSecurityLevel.ts +12 -3
  92. package/src/quasar/SidPrincipalInput.vue +4 -7
  93. package/src/utils/normalizePrincipal.test.ts +19 -5
  94. package/src/utils/normalizePrincipal.ts +7 -9
  95. package/src/utils/rpcRefusal.test.ts +151 -0
  96. package/src/utils/rpcRefusal.ts +252 -0
  97. package/src/utils/validators.test.ts +9 -0
  98. package/src/utils/validators.ts +14 -2
  99. package/src/composables/useAuth.ts +0 -40
  100. package/src/profile/composables/useOpaqueAuth.test.ts +0 -290
  101. package/src/profile/composables/useOpaqueAuth.ts +0 -191
package/README.md CHANGED
@@ -5,18 +5,22 @@ Shared UI package for StructuredID applications. Provides Vue 3 composables, Pin
5
5
  ## What's Inside
6
6
 
7
7
  - **Proto clients** -- gRPC-Web clients generated from [proto](https://github.com/structured-id/proto) via protobuf-ts
8
- - **Composables** -- `useAuth`, `useAuthApi`, `useAccountApi`, `useIdentityApi`, `useSecurityLevel`, `useOpaqueAuth`
8
+ - **Composables** -- `createAuth` (password ceremonies over an injected ZKPP client), `useAuthApi`, `useAccountApi`, `useIdentityApi`, `useSecurityLevel`
9
9
  - **Components** -- `SidLoginForm`, `SidRegistrationForm`, `SidMfaChallenge`, `SidPrincipalInput`, profile management pages
10
10
  - **Utilities** -- `normalizePrincipal`, `detectLoginInputType`, validators, formatters
11
11
 
12
12
  ## Usage
13
13
 
14
14
  ```ts
15
- import { useAuth, getTransport, initGrpc } from "@structured-id/ui-core";
16
- import { SidLoginForm } from "@structured-id/ui-core/profile";
15
+ import { getTransport, initGrpc } from "@structured-id/ui-core";
16
+ import { SidLoginForm, createAuth } from "@structured-id/ui-core/profile";
17
+ import { loadZkppClient } from "@structured-id/opaque-zkpp";
17
18
 
18
19
  // Initialize gRPC transport
19
20
  initGrpc({ baseUrl: "http://localhost:9080" });
21
+
22
+ // Password ceremonies (register, login, change, reset) on the app's client
23
+ const { login } = createAuth(() => loadZkppClient());
20
24
  ```
21
25
 
22
26
  ## Development
@@ -32,11 +36,11 @@ yarn typecheck # vue-tsc --noEmit
32
36
 
33
37
  ```
34
38
  src/
35
- composables/ # Vue 3 composition API (useAuth, useAuthApi)
39
+ composables/ # Vue 3 composition API
36
40
  stores/ # Pinia stores (auth)
37
41
  profile/ # Profile components and composables
38
42
  components/ # SidLoginForm, SidRegistrationForm, SidMfaChallenge
39
- composables/ # useOpaqueAuth, useAccountApi, useIdentityApi
43
+ composables/ # createAuth, useAuthApi, useAccountApi, useIdentityApi
40
44
  utils/ # normalizePrincipal, validators, formatters
41
45
  generated/ # protobuf-ts generated clients (do not edit)
42
46
  proto/ # Proto definitions submodule
@@ -1,7 +1,5 @@
1
1
  /**
2
2
  * Browser VP types.
3
- *
4
- * See arch/auth/browser-vp.md for full specification.
5
3
  */
6
4
  /** VP strategy — automatically selected based on browser capabilities. */
7
5
  type VpStrategy = "prf" | "device-key";
@@ -88,8 +86,6 @@ interface BrowserVpContext {
88
86
  * PRF (Pseudo-Random Function) extension allows deriving
89
87
  * deterministic secrets from a passkey. Same passkey on any
90
88
  * synced device produces the same PRF output → same keys.
91
- *
92
- * See arch/auth/browser-vp.md § Strategy A: Passkey-Derived PPK.
93
89
  */
94
90
  /**
95
91
  * Detect whether the browser supports WebAuthn PRF extension.
@@ -125,7 +121,6 @@ declare function createPasskeyWithPrf(userId: ArrayBuffer, userName: string, rpN
125
121
  * Cryptographic primitives for Browser VP.
126
122
  *
127
123
  * All operations use Web Crypto API. Keys are non-extractable.
128
- * See arch/auth/browser-vp.md § Key derivation.
129
124
  */
130
125
 
131
126
  /**
@@ -188,8 +183,6 @@ declare function sha256(data: ArrayBuffer): Promise<string>;
188
183
  * Database: sid-browser-vp
189
184
  * ├── bindings — per-service binding entries (key: service_sector)
190
185
  * └── profile-state — profile state + encrypted blob (key: profile_id)
191
- *
192
- * See arch/auth/browser-vp.md § IndexedDB Storage Schema.
193
186
  */
194
187
 
195
188
  /** Save or update profile state. */
@@ -218,8 +211,6 @@ declare function isIndexedDbAvailable(): boolean;
218
211
  *
219
212
  * Builds and signs VPs using cached keys and profile blob.
220
213
  * VP creation is fully offline (~50ms with biometric cache).
221
- *
222
- * See arch/auth/browser-vp.md § VP Creation.
223
214
  */
224
215
 
225
216
  /**
@@ -256,8 +247,6 @@ declare function getExpiringSoon(): Promise<Array<{
256
247
  * - **Strategy B (device-key):** Random WebCrypto key, wrapped for sync.
257
248
  * Each browser = separate device. Fallback for non-PRF browsers.
258
249
  *
259
- * See arch/auth/browser-vp.md for full specification.
260
- *
261
250
  * Reference: Prudnikov, D. (2026). "Client-Side Verifiable Presentation System
262
251
  * with Passkey-Derived Persistent Keys and Pairwise Service Bindings."
263
252
  * doi:10.5281/zenodo.19387768 — https://doi.org/10.5281/zenodo.19387768
@@ -1,7 +1,5 @@
1
1
  /**
2
2
  * Browser VP types.
3
- *
4
- * See arch/auth/browser-vp.md for full specification.
5
3
  */
6
4
  /** VP strategy — automatically selected based on browser capabilities. */
7
5
  type VpStrategy = "prf" | "device-key";
@@ -88,8 +86,6 @@ interface BrowserVpContext {
88
86
  * PRF (Pseudo-Random Function) extension allows deriving
89
87
  * deterministic secrets from a passkey. Same passkey on any
90
88
  * synced device produces the same PRF output → same keys.
91
- *
92
- * See arch/auth/browser-vp.md § Strategy A: Passkey-Derived PPK.
93
89
  */
94
90
  /**
95
91
  * Detect whether the browser supports WebAuthn PRF extension.
@@ -125,7 +121,6 @@ declare function createPasskeyWithPrf(userId: ArrayBuffer, userName: string, rpN
125
121
  * Cryptographic primitives for Browser VP.
126
122
  *
127
123
  * All operations use Web Crypto API. Keys are non-extractable.
128
- * See arch/auth/browser-vp.md § Key derivation.
129
124
  */
130
125
 
131
126
  /**
@@ -188,8 +183,6 @@ declare function sha256(data: ArrayBuffer): Promise<string>;
188
183
  * Database: sid-browser-vp
189
184
  * ├── bindings — per-service binding entries (key: service_sector)
190
185
  * └── profile-state — profile state + encrypted blob (key: profile_id)
191
- *
192
- * See arch/auth/browser-vp.md § IndexedDB Storage Schema.
193
186
  */
194
187
 
195
188
  /** Save or update profile state. */
@@ -218,8 +211,6 @@ declare function isIndexedDbAvailable(): boolean;
218
211
  *
219
212
  * Builds and signs VPs using cached keys and profile blob.
220
213
  * VP creation is fully offline (~50ms with biometric cache).
221
- *
222
- * See arch/auth/browser-vp.md § VP Creation.
223
214
  */
224
215
 
225
216
  /**
@@ -256,8 +247,6 @@ declare function getExpiringSoon(): Promise<Array<{
256
247
  * - **Strategy B (device-key):** Random WebCrypto key, wrapped for sync.
257
248
  * Each browser = separate device. Fallback for non-PRF browsers.
258
249
  *
259
- * See arch/auth/browser-vp.md for full specification.
260
- *
261
250
  * Reference: Prudnikov, D. (2026). "Client-Side Verifiable Presentation System
262
251
  * with Passkey-Derived Persistent Keys and Pairwise Service Bindings."
263
252
  * doi:10.5281/zenodo.19387768 — https://doi.org/10.5281/zenodo.19387768