@structured-id/ui-core 1.1.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.
- package/README.md +9 -5
- package/dist/browser-vp/index.d.cts +0 -11
- package/dist/browser-vp/index.d.ts +0 -11
- package/dist/index.cjs +13721 -9514
- package/dist/index.d.cts +4362 -2375
- package/dist/index.d.ts +4362 -2375
- package/dist/index.js +13937 -9730
- package/package.json +3 -3
- package/src/browser-vp/crypto.ts +0 -1
- package/src/browser-vp/index.ts +0 -2
- package/src/browser-vp/prf.ts +0 -2
- package/src/browser-vp/storage.ts +0 -2
- package/src/browser-vp/types.ts +0 -2
- package/src/browser-vp/vp.ts +0 -2
- package/src/composables/index.ts +6 -1
- package/src/composables/useAccountTransport.test.ts +121 -0
- package/src/composables/useAccountTransport.ts +69 -0
- package/src/composables/useBffAuth.ts +44 -34
- package/src/generated/google/api/httpbody.ts +159 -0
- package/src/generated/google/protobuf/any.ts +326 -0
- package/src/generated/google/rpc/error_details.ts +1386 -0
- package/src/generated/google/rpc/status.ts +127 -0
- package/src/generated/sid/v1/account/account.ts +1 -1
- package/src/generated/sid/v1/admin/admin.client.ts +15 -12
- package/src/generated/sid/v1/admin/admin.ts +24 -89
- package/src/generated/sid/v1/admin/enrollment.client.ts +24 -12
- package/src/generated/sid/v1/admin/enrollment.ts +65 -3
- package/src/generated/sid/v1/admin/events.client.ts +8 -8
- package/src/generated/sid/v1/admin/flow.ts +1 -1
- package/src/generated/sid/v1/admin/keys.ts +1 -1
- package/src/generated/sid/v1/admin/notifications.client.ts +12 -6
- package/src/generated/sid/v1/admin/notifications.ts +11 -70
- package/src/generated/sid/v1/admin/operations.ts +20 -35
- package/src/generated/sid/v1/admin/organizations.client.ts +2 -2
- package/src/generated/sid/v1/admin/organizations.ts +15 -32
- package/src/generated/sid/v1/admin/provisioning.client.ts +232 -0
- package/src/generated/sid/v1/admin/provisioning.ts +1383 -0
- package/src/generated/sid/v1/admin/scopes.ts +1 -1
- package/src/generated/sid/v1/admin/security.client.ts +22 -24
- package/src/generated/sid/v1/admin/security.ts +13 -22
- package/src/generated/sid/v1/admin/settings.client.ts +29 -18
- package/src/generated/sid/v1/admin/settings.ts +2 -82
- package/src/generated/sid/v1/attestation/attestation.client.ts +6 -6
- package/src/generated/sid/v1/attestation/attestation.ts +8 -8
- package/src/generated/sid/v1/authn/auth.client.ts +101 -58
- package/src/generated/sid/v1/authn/auth.ts +842 -414
- package/src/generated/sid/v1/authn/flows.ts +0 -12
- package/src/generated/sid/v1/authn/issuer.client.ts +489 -0
- package/src/generated/sid/v1/authn/issuer.ts +1600 -0
- package/src/generated/sid/v1/authn/password_history.client.ts +57 -0
- package/src/generated/sid/v1/authn/password_history.ts +578 -0
- package/src/generated/sid/v1/authn/system_integration.client.ts +73 -0
- package/src/generated/sid/v1/authn/system_integration.ts +218 -0
- package/src/generated/sid/v1/authz/authz.ts +1498 -317
- package/src/generated/sid/v1/authz/forward_auth.client.ts +97 -0
- package/src/generated/sid/v1/authz/forward_auth.ts +79 -0
- package/src/generated/sid/v1/authz/governance.client.ts +2 -2
- package/src/generated/sid/v1/authz/governance.ts +61 -4
- package/src/generated/sid/v1/common/errors.ts +532 -6
- package/src/generated/sid/v1/events/event_stream.client.ts +2 -2
- package/src/generated/sid/v1/events/event_stream.ts +2 -1
- package/src/generated/sid/v1/identity/identity.ts +98 -58
- package/src/generated/sid/v1/ids/ids.ts +395 -0
- package/src/generated/sid/v1/machine/machine_user.ts +0 -36
- package/src/generated/sid/v1/machine/pat.client.ts +2 -19
- package/src/generated/sid/v1/machine/pat.ts +1 -186
- package/src/generated/sid/v1/projects/projects.client.ts +137 -19
- package/src/generated/sid/v1/projects/projects.ts +2105 -405
- package/src/generated/sid/v1/scim/scim.client.ts +248 -2
- package/src/generated/sid/v1/scim/scim.ts +153 -14
- package/src/generated/sid/v1/test/test.ts +1 -1
- package/src/i18n/index.ts +0 -11
- package/src/index.ts +36 -2
- package/src/package-exports.test.ts +18 -0
- package/src/profile/components/SidLoginForm.vue +5 -2
- package/src/profile/components/SidRegistrationForm.test.ts +58 -1
- package/src/profile/components/SidRegistrationForm.vue +118 -12
- package/src/profile/components/index.ts +4 -0
- package/src/profile/composables/index.ts +2 -1
- package/src/profile/composables/useAccountApi.ts +20 -7
- package/src/profile/composables/useAuth.test.ts +453 -0
- package/src/profile/composables/useAuth.ts +414 -0
- package/src/profile/composables/useAuthApi.opaque.test.ts +18 -0
- package/src/profile/composables/useAuthApi.ts +188 -20
- package/src/profile/composables/useEnrollmentApi.test.ts +33 -0
- package/src/profile/composables/useEnrollmentApi.ts +26 -0
- package/src/profile/composables/useIdentityApi.ts +17 -7
- package/src/profile/composables/useLoginSuccess.test.ts +97 -3
- package/src/profile/composables/useLoginSuccess.ts +80 -22
- package/src/profile/composables/useSecurityLevel.test.ts +10 -3
- package/src/profile/composables/useSecurityLevel.ts +12 -3
- package/src/quasar/SidPrincipalInput.vue +4 -7
- package/src/utils/normalizePrincipal.test.ts +19 -5
- package/src/utils/normalizePrincipal.ts +7 -9
- package/src/utils/rpcRefusal.test.ts +151 -0
- package/src/utils/rpcRefusal.ts +252 -0
- package/src/utils/validators.test.ts +9 -0
- package/src/utils/validators.ts +14 -2
- package/src/composables/useAuth.ts +0 -40
- package/src/profile/composables/useOpaqueAuth.test.ts +0 -290
- 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** -- `
|
|
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 {
|
|
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
|
|
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/ #
|
|
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
|