@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.
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 +118 -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
@@ -0,0 +1,73 @@
1
+ // @generated by protobuf-ts 2.11.1 with parameter client_generic,generate_dependencies
2
+ // @generated from protobuf file "sid/v1/authn/system_integration.proto" (package "sid.v1.authn", syntax proto3)
3
+ // tslint:disable
4
+ import type { RpcTransport } from "@protobuf-ts/runtime-rpc";
5
+ import type { ServiceInfo } from "@protobuf-ts/runtime-rpc";
6
+ import { SystemIntegrationService } from "./system_integration";
7
+ import { stackIntercept } from "@protobuf-ts/runtime-rpc";
8
+ import type { AccountConnection } from "./system_integration";
9
+ import type { GetAccountConnectionRequest } from "./system_integration";
10
+ import type { UnaryCall } from "@protobuf-ts/runtime-rpc";
11
+ import type { RpcOptions } from "@protobuf-ts/runtime-rpc";
12
+ /**
13
+ * SystemIntegrationService gives a system integration's backend its
14
+ * connection details, so an operator never copies issuer handles or client
15
+ * identifiers by hand.
16
+ *
17
+ * Internal only, no HTTP annotation: the account BFF calls it over the
18
+ * deployment's gRPC channel to SID.
19
+ *
20
+ * @generated from protobuf service sid.v1.authn.SystemIntegrationService
21
+ */
22
+ export interface ISystemIntegrationServiceClient {
23
+ /**
24
+ * The connection details of the account integration (SID's own account
25
+ * UI), for its BFF. The request proves possession of one of the account
26
+ * client's registered keys; the answer is public metadata only, no secret
27
+ * is distributed and the private key never leaves the BFF.
28
+ *
29
+ * An invalid, expired, replayed or unregistered proof is UNAUTHENTICATED
30
+ * (TOKEN_INVALID). An integration that is not provisioned, or whose client
31
+ * an administrator disabled, is FAILED_PRECONDITION
32
+ * (SYSTEM_INTEGRATION_UNAVAILABLE): the BFF is not ready and serves no
33
+ * sign-in until it is.
34
+ *
35
+ * @generated from protobuf rpc: GetAccountConnection
36
+ */
37
+ getAccountConnection(input: GetAccountConnectionRequest, options?: RpcOptions): UnaryCall<GetAccountConnectionRequest, AccountConnection>;
38
+ }
39
+ /**
40
+ * SystemIntegrationService gives a system integration's backend its
41
+ * connection details, so an operator never copies issuer handles or client
42
+ * identifiers by hand.
43
+ *
44
+ * Internal only, no HTTP annotation: the account BFF calls it over the
45
+ * deployment's gRPC channel to SID.
46
+ *
47
+ * @generated from protobuf service sid.v1.authn.SystemIntegrationService
48
+ */
49
+ export class SystemIntegrationServiceClient implements ISystemIntegrationServiceClient, ServiceInfo {
50
+ typeName = SystemIntegrationService.typeName;
51
+ methods = SystemIntegrationService.methods;
52
+ options = SystemIntegrationService.options;
53
+ constructor(private readonly _transport: RpcTransport) {
54
+ }
55
+ /**
56
+ * The connection details of the account integration (SID's own account
57
+ * UI), for its BFF. The request proves possession of one of the account
58
+ * client's registered keys; the answer is public metadata only, no secret
59
+ * is distributed and the private key never leaves the BFF.
60
+ *
61
+ * An invalid, expired, replayed or unregistered proof is UNAUTHENTICATED
62
+ * (TOKEN_INVALID). An integration that is not provisioned, or whose client
63
+ * an administrator disabled, is FAILED_PRECONDITION
64
+ * (SYSTEM_INTEGRATION_UNAVAILABLE): the BFF is not ready and serves no
65
+ * sign-in until it is.
66
+ *
67
+ * @generated from protobuf rpc: GetAccountConnection
68
+ */
69
+ getAccountConnection(input: GetAccountConnectionRequest, options?: RpcOptions): UnaryCall<GetAccountConnectionRequest, AccountConnection> {
70
+ const method = this.methods[0], opt = this._transport.mergeOptions(options);
71
+ return stackIntercept<GetAccountConnectionRequest, AccountConnection>("unary", this._transport, method, opt, input);
72
+ }
73
+ }
@@ -0,0 +1,218 @@
1
+ // @generated by protobuf-ts 2.11.1 with parameter client_generic,generate_dependencies
2
+ // @generated from protobuf file "sid/v1/authn/system_integration.proto" (package "sid.v1.authn", syntax proto3)
3
+ // tslint:disable
4
+ import { ServiceType } from "@protobuf-ts/runtime-rpc";
5
+ import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
6
+ import type { IBinaryWriter } from "@protobuf-ts/runtime";
7
+ import { WireType } from "@protobuf-ts/runtime";
8
+ import type { BinaryReadOptions } from "@protobuf-ts/runtime";
9
+ import type { IBinaryReader } from "@protobuf-ts/runtime";
10
+ import { UnknownFieldHandler } from "@protobuf-ts/runtime";
11
+ import type { PartialMessage } from "@protobuf-ts/runtime";
12
+ import { reflectionMergePartial } from "@protobuf-ts/runtime";
13
+ import { MessageType } from "@protobuf-ts/runtime";
14
+ /**
15
+ * @generated from protobuf message sid.v1.authn.GetAccountConnectionRequest
16
+ */
17
+ export interface GetAccountConnectionRequest {
18
+ /**
19
+ * A JWT (RFC 7519) the BFF signs, per request, with the private key of one
20
+ * of the account client's registered keys, named by the JWS `kid` header.
21
+ * Claims: `iss` and `sub` both equal that `kid`; `aud` is the installation
22
+ * URL followed by `/account/connection`; `exp` at most five minutes ahead;
23
+ * a unique `jti`, accepted once. Carries no secret.
24
+ *
25
+ * @generated from protobuf field: string proof = 1
26
+ */
27
+ proof: string;
28
+ }
29
+ /**
30
+ * What the account BFF needs to sign users in and call the account API.
31
+ *
32
+ * @generated from protobuf message sid.v1.authn.AccountConnection
33
+ */
34
+ export interface AccountConnection {
35
+ /**
36
+ * Exact issuer identifier the account client is registered under, the
37
+ * canonical URL `https://<host>/i/<handle>`. The BFF discovers its
38
+ * endpoints at `<issuer>/.well-known/openid-configuration` and accepts only
39
+ * authorization responses and tokens naming this issuer (RFC 9207 §2.4).
40
+ *
41
+ * @generated from protobuf field: string issuer = 1
42
+ */
43
+ issuer: string;
44
+ /**
45
+ * The account web client's `client_id`, assigned at provisioning and never
46
+ * changed; the `iss` and `sub` of its token endpoint assertions.
47
+ *
48
+ * @generated from protobuf field: string client_id = 2
49
+ */
50
+ clientId: string;
51
+ /**
52
+ * Resource indicator of the account API (RFC 8707 §2): the `resource` the
53
+ * BFF requests and the `aud` of the access tokens it obtains.
54
+ *
55
+ * @generated from protobuf field: string resource = 3
56
+ */
57
+ resource: string;
58
+ /**
59
+ * Scopes the BFF requests: sign-in scopes and the account API's.
60
+ *
61
+ * @generated from protobuf field: repeated string scopes = 4
62
+ */
63
+ scopes: string[];
64
+ /**
65
+ * The client's registered redirect URI, the BFF's callback on the account
66
+ * origin; an authorization request naming another is refused.
67
+ *
68
+ * @generated from protobuf field: string redirect_uri = 5
69
+ */
70
+ redirectUri: string;
71
+ /**
72
+ * How the client authenticates at the token endpoint (RFC 7591 §2):
73
+ * always `private_key_jwt`.
74
+ *
75
+ * @generated from protobuf field: string token_endpoint_auth_method = 6
76
+ */
77
+ tokenEndpointAuthMethod: string;
78
+ }
79
+ // @generated message type with reflection information, may provide speed optimized methods
80
+ class GetAccountConnectionRequest$Type extends MessageType<GetAccountConnectionRequest> {
81
+ constructor() {
82
+ super("sid.v1.authn.GetAccountConnectionRequest", [
83
+ { no: 1, name: "proof", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
84
+ ]);
85
+ }
86
+ create(value?: PartialMessage<GetAccountConnectionRequest>): GetAccountConnectionRequest {
87
+ const message = globalThis.Object.create((this.messagePrototype!));
88
+ message.proof = "";
89
+ if (value !== undefined)
90
+ reflectionMergePartial<GetAccountConnectionRequest>(this, message, value);
91
+ return message;
92
+ }
93
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetAccountConnectionRequest): GetAccountConnectionRequest {
94
+ let message = target ?? this.create(), end = reader.pos + length;
95
+ while (reader.pos < end) {
96
+ let [fieldNo, wireType] = reader.tag();
97
+ switch (fieldNo) {
98
+ case /* string proof */ 1:
99
+ message.proof = reader.string();
100
+ break;
101
+ default:
102
+ let u = options.readUnknownField;
103
+ if (u === "throw")
104
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
105
+ let d = reader.skip(wireType);
106
+ if (u !== false)
107
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
108
+ }
109
+ }
110
+ return message;
111
+ }
112
+ internalBinaryWrite(message: GetAccountConnectionRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
113
+ /* string proof = 1; */
114
+ if (message.proof !== "")
115
+ writer.tag(1, WireType.LengthDelimited).string(message.proof);
116
+ let u = options.writeUnknownFields;
117
+ if (u !== false)
118
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
119
+ return writer;
120
+ }
121
+ }
122
+ /**
123
+ * @generated MessageType for protobuf message sid.v1.authn.GetAccountConnectionRequest
124
+ */
125
+ export const GetAccountConnectionRequest = new GetAccountConnectionRequest$Type();
126
+ // @generated message type with reflection information, may provide speed optimized methods
127
+ class AccountConnection$Type extends MessageType<AccountConnection> {
128
+ constructor() {
129
+ super("sid.v1.authn.AccountConnection", [
130
+ { no: 1, name: "issuer", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
131
+ { no: 2, name: "client_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
132
+ { no: 3, name: "resource", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
133
+ { no: 4, name: "scopes", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
134
+ { no: 5, name: "redirect_uri", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
135
+ { no: 6, name: "token_endpoint_auth_method", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
136
+ ]);
137
+ }
138
+ create(value?: PartialMessage<AccountConnection>): AccountConnection {
139
+ const message = globalThis.Object.create((this.messagePrototype!));
140
+ message.issuer = "";
141
+ message.clientId = "";
142
+ message.resource = "";
143
+ message.scopes = [];
144
+ message.redirectUri = "";
145
+ message.tokenEndpointAuthMethod = "";
146
+ if (value !== undefined)
147
+ reflectionMergePartial<AccountConnection>(this, message, value);
148
+ return message;
149
+ }
150
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AccountConnection): AccountConnection {
151
+ let message = target ?? this.create(), end = reader.pos + length;
152
+ while (reader.pos < end) {
153
+ let [fieldNo, wireType] = reader.tag();
154
+ switch (fieldNo) {
155
+ case /* string issuer */ 1:
156
+ message.issuer = reader.string();
157
+ break;
158
+ case /* string client_id */ 2:
159
+ message.clientId = reader.string();
160
+ break;
161
+ case /* string resource */ 3:
162
+ message.resource = reader.string();
163
+ break;
164
+ case /* repeated string scopes */ 4:
165
+ message.scopes.push(reader.string());
166
+ break;
167
+ case /* string redirect_uri */ 5:
168
+ message.redirectUri = reader.string();
169
+ break;
170
+ case /* string token_endpoint_auth_method */ 6:
171
+ message.tokenEndpointAuthMethod = reader.string();
172
+ break;
173
+ default:
174
+ let u = options.readUnknownField;
175
+ if (u === "throw")
176
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
177
+ let d = reader.skip(wireType);
178
+ if (u !== false)
179
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
180
+ }
181
+ }
182
+ return message;
183
+ }
184
+ internalBinaryWrite(message: AccountConnection, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
185
+ /* string issuer = 1; */
186
+ if (message.issuer !== "")
187
+ writer.tag(1, WireType.LengthDelimited).string(message.issuer);
188
+ /* string client_id = 2; */
189
+ if (message.clientId !== "")
190
+ writer.tag(2, WireType.LengthDelimited).string(message.clientId);
191
+ /* string resource = 3; */
192
+ if (message.resource !== "")
193
+ writer.tag(3, WireType.LengthDelimited).string(message.resource);
194
+ /* repeated string scopes = 4; */
195
+ for (let i = 0; i < message.scopes.length; i++)
196
+ writer.tag(4, WireType.LengthDelimited).string(message.scopes[i]);
197
+ /* string redirect_uri = 5; */
198
+ if (message.redirectUri !== "")
199
+ writer.tag(5, WireType.LengthDelimited).string(message.redirectUri);
200
+ /* string token_endpoint_auth_method = 6; */
201
+ if (message.tokenEndpointAuthMethod !== "")
202
+ writer.tag(6, WireType.LengthDelimited).string(message.tokenEndpointAuthMethod);
203
+ let u = options.writeUnknownFields;
204
+ if (u !== false)
205
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
206
+ return writer;
207
+ }
208
+ }
209
+ /**
210
+ * @generated MessageType for protobuf message sid.v1.authn.AccountConnection
211
+ */
212
+ export const AccountConnection = new AccountConnection$Type();
213
+ /**
214
+ * @generated ServiceType for protobuf service sid.v1.authn.SystemIntegrationService
215
+ */
216
+ export const SystemIntegrationService = new ServiceType("sid.v1.authn.SystemIntegrationService", [
217
+ { name: "GetAccountConnection", options: {}, I: GetAccountConnectionRequest, O: AccountConnection }
218
+ ]);