@miradorlabs/web-grpc 4.38.1 → 4.39.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/package.json +1 -1
- package/proto/gateway/web/v1/account_gateway.ts +251 -0
- package/proto/gateway/web/v1/account_gateway_grpc_pb.js +37 -0
- package/proto/gateway/web/v1/account_gateway_pb.js +466 -0
- package/proto/gateway/web/v1/desktop_auth_gateway.ts +516 -0
- package/proto/gateway/web/v1/desktop_auth_gateway_grpc_pb.js +74 -0
- package/proto/gateway/web/v1/desktop_auth_gateway_pb.js +932 -0
package/package.json
CHANGED
|
@@ -1112,6 +1112,27 @@ export interface AuthorizeCliLoginResponse {
|
|
|
1112
1112
|
expiresAt: Date | undefined;
|
|
1113
1113
|
}
|
|
1114
1114
|
|
|
1115
|
+
export interface AuthorizeUserLoginRequest {
|
|
1116
|
+
/** code_challenge is the base64url-encoded SHA-256 of the client's PKCE verifier. */
|
|
1117
|
+
codeChallenge: string;
|
|
1118
|
+
/**
|
|
1119
|
+
* redirect_port is the loopback port the client is listening on (1024 to 65535). The browser page builds the redirect
|
|
1120
|
+
* from it rather than accepting a caller-supplied URL.
|
|
1121
|
+
*/
|
|
1122
|
+
redirectPort: number;
|
|
1123
|
+
/** Names the session in the machines list; truncated to 128 bytes. */
|
|
1124
|
+
label: string;
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
export interface AuthorizeUserLoginResponse {
|
|
1128
|
+
status:
|
|
1129
|
+
| ResponseStatus
|
|
1130
|
+
| undefined;
|
|
1131
|
+
/** Single use, redeemable only with the challenge's verifier and the same redirect_port. */
|
|
1132
|
+
code: string;
|
|
1133
|
+
expiresAt: Date | undefined;
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1115
1136
|
export interface ListCliSessionsRequest {
|
|
1116
1137
|
organizationId: string;
|
|
1117
1138
|
}
|
|
@@ -10202,6 +10223,222 @@ export const AuthorizeCliLoginResponse: MessageFns<AuthorizeCliLoginResponse> =
|
|
|
10202
10223
|
},
|
|
10203
10224
|
};
|
|
10204
10225
|
|
|
10226
|
+
function createBaseAuthorizeUserLoginRequest(): AuthorizeUserLoginRequest {
|
|
10227
|
+
return { codeChallenge: "", redirectPort: 0, label: "" };
|
|
10228
|
+
}
|
|
10229
|
+
|
|
10230
|
+
export const AuthorizeUserLoginRequest: MessageFns<AuthorizeUserLoginRequest> = {
|
|
10231
|
+
encode(message: AuthorizeUserLoginRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
10232
|
+
if (message.codeChallenge !== "") {
|
|
10233
|
+
writer.uint32(10).string(message.codeChallenge);
|
|
10234
|
+
}
|
|
10235
|
+
if (message.redirectPort !== 0) {
|
|
10236
|
+
writer.uint32(16).int32(message.redirectPort);
|
|
10237
|
+
}
|
|
10238
|
+
if (message.label !== "") {
|
|
10239
|
+
writer.uint32(26).string(message.label);
|
|
10240
|
+
}
|
|
10241
|
+
return writer;
|
|
10242
|
+
},
|
|
10243
|
+
|
|
10244
|
+
decode(input: BinaryReader | Uint8Array, length?: number): AuthorizeUserLoginRequest {
|
|
10245
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
10246
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
10247
|
+
if (previousRecursionDepth >= 100) {
|
|
10248
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
10249
|
+
}
|
|
10250
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
10251
|
+
try {
|
|
10252
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
10253
|
+
const message = createBaseAuthorizeUserLoginRequest();
|
|
10254
|
+
while (reader.pos < end) {
|
|
10255
|
+
const tag = reader.uint32();
|
|
10256
|
+
switch (tag >>> 3) {
|
|
10257
|
+
case 1: {
|
|
10258
|
+
if (tag !== 10) {
|
|
10259
|
+
break;
|
|
10260
|
+
}
|
|
10261
|
+
|
|
10262
|
+
message.codeChallenge = reader.string();
|
|
10263
|
+
continue;
|
|
10264
|
+
}
|
|
10265
|
+
case 2: {
|
|
10266
|
+
if (tag !== 16) {
|
|
10267
|
+
break;
|
|
10268
|
+
}
|
|
10269
|
+
|
|
10270
|
+
message.redirectPort = reader.int32();
|
|
10271
|
+
continue;
|
|
10272
|
+
}
|
|
10273
|
+
case 3: {
|
|
10274
|
+
if (tag !== 26) {
|
|
10275
|
+
break;
|
|
10276
|
+
}
|
|
10277
|
+
|
|
10278
|
+
message.label = reader.string();
|
|
10279
|
+
continue;
|
|
10280
|
+
}
|
|
10281
|
+
}
|
|
10282
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
10283
|
+
break;
|
|
10284
|
+
}
|
|
10285
|
+
reader.skip(tag & 7);
|
|
10286
|
+
}
|
|
10287
|
+
return message;
|
|
10288
|
+
} finally {
|
|
10289
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
10290
|
+
}
|
|
10291
|
+
},
|
|
10292
|
+
|
|
10293
|
+
fromJSON(object: any): AuthorizeUserLoginRequest {
|
|
10294
|
+
return {
|
|
10295
|
+
codeChallenge: isSet(object.codeChallenge)
|
|
10296
|
+
? globalThis.String(object.codeChallenge)
|
|
10297
|
+
: isSet(object.code_challenge)
|
|
10298
|
+
? globalThis.String(object.code_challenge)
|
|
10299
|
+
: "",
|
|
10300
|
+
redirectPort: isSet(object.redirectPort)
|
|
10301
|
+
? globalThis.Number(object.redirectPort)
|
|
10302
|
+
: isSet(object.redirect_port)
|
|
10303
|
+
? globalThis.Number(object.redirect_port)
|
|
10304
|
+
: 0,
|
|
10305
|
+
label: isSet(object.label) ? globalThis.String(object.label) : "",
|
|
10306
|
+
};
|
|
10307
|
+
},
|
|
10308
|
+
|
|
10309
|
+
toJSON(message: AuthorizeUserLoginRequest): unknown {
|
|
10310
|
+
const obj: any = {};
|
|
10311
|
+
if (message.codeChallenge !== "") {
|
|
10312
|
+
obj.codeChallenge = message.codeChallenge;
|
|
10313
|
+
}
|
|
10314
|
+
if (message.redirectPort !== 0) {
|
|
10315
|
+
obj.redirectPort = Math.round(message.redirectPort);
|
|
10316
|
+
}
|
|
10317
|
+
if (message.label !== "") {
|
|
10318
|
+
obj.label = message.label;
|
|
10319
|
+
}
|
|
10320
|
+
return obj;
|
|
10321
|
+
},
|
|
10322
|
+
|
|
10323
|
+
create<I extends Exact<DeepPartial<AuthorizeUserLoginRequest>, I>>(base?: I): AuthorizeUserLoginRequest {
|
|
10324
|
+
return AuthorizeUserLoginRequest.fromPartial(base ?? ({} as any));
|
|
10325
|
+
},
|
|
10326
|
+
fromPartial<I extends Exact<DeepPartial<AuthorizeUserLoginRequest>, I>>(object: I): AuthorizeUserLoginRequest {
|
|
10327
|
+
const message = createBaseAuthorizeUserLoginRequest();
|
|
10328
|
+
message.codeChallenge = object.codeChallenge ?? "";
|
|
10329
|
+
message.redirectPort = object.redirectPort ?? 0;
|
|
10330
|
+
message.label = object.label ?? "";
|
|
10331
|
+
return message;
|
|
10332
|
+
},
|
|
10333
|
+
};
|
|
10334
|
+
|
|
10335
|
+
function createBaseAuthorizeUserLoginResponse(): AuthorizeUserLoginResponse {
|
|
10336
|
+
return { status: undefined, code: "", expiresAt: undefined };
|
|
10337
|
+
}
|
|
10338
|
+
|
|
10339
|
+
export const AuthorizeUserLoginResponse: MessageFns<AuthorizeUserLoginResponse> = {
|
|
10340
|
+
encode(message: AuthorizeUserLoginResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
10341
|
+
if (message.status !== undefined) {
|
|
10342
|
+
ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
|
|
10343
|
+
}
|
|
10344
|
+
if (message.code !== "") {
|
|
10345
|
+
writer.uint32(18).string(message.code);
|
|
10346
|
+
}
|
|
10347
|
+
if (message.expiresAt !== undefined) {
|
|
10348
|
+
Timestamp.encode(toTimestamp(message.expiresAt), writer.uint32(26).fork()).join();
|
|
10349
|
+
}
|
|
10350
|
+
return writer;
|
|
10351
|
+
},
|
|
10352
|
+
|
|
10353
|
+
decode(input: BinaryReader | Uint8Array, length?: number): AuthorizeUserLoginResponse {
|
|
10354
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
10355
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
10356
|
+
if (previousRecursionDepth >= 100) {
|
|
10357
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
10358
|
+
}
|
|
10359
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
10360
|
+
try {
|
|
10361
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
10362
|
+
const message = createBaseAuthorizeUserLoginResponse();
|
|
10363
|
+
while (reader.pos < end) {
|
|
10364
|
+
const tag = reader.uint32();
|
|
10365
|
+
switch (tag >>> 3) {
|
|
10366
|
+
case 1: {
|
|
10367
|
+
if (tag !== 10) {
|
|
10368
|
+
break;
|
|
10369
|
+
}
|
|
10370
|
+
|
|
10371
|
+
message.status = ResponseStatus.decode(reader, reader.uint32());
|
|
10372
|
+
continue;
|
|
10373
|
+
}
|
|
10374
|
+
case 2: {
|
|
10375
|
+
if (tag !== 18) {
|
|
10376
|
+
break;
|
|
10377
|
+
}
|
|
10378
|
+
|
|
10379
|
+
message.code = reader.string();
|
|
10380
|
+
continue;
|
|
10381
|
+
}
|
|
10382
|
+
case 3: {
|
|
10383
|
+
if (tag !== 26) {
|
|
10384
|
+
break;
|
|
10385
|
+
}
|
|
10386
|
+
|
|
10387
|
+
message.expiresAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
10388
|
+
continue;
|
|
10389
|
+
}
|
|
10390
|
+
}
|
|
10391
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
10392
|
+
break;
|
|
10393
|
+
}
|
|
10394
|
+
reader.skip(tag & 7);
|
|
10395
|
+
}
|
|
10396
|
+
return message;
|
|
10397
|
+
} finally {
|
|
10398
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
10399
|
+
}
|
|
10400
|
+
},
|
|
10401
|
+
|
|
10402
|
+
fromJSON(object: any): AuthorizeUserLoginResponse {
|
|
10403
|
+
return {
|
|
10404
|
+
status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
|
|
10405
|
+
code: isSet(object.code) ? globalThis.String(object.code) : "",
|
|
10406
|
+
expiresAt: isSet(object.expiresAt)
|
|
10407
|
+
? fromJsonTimestamp(object.expiresAt)
|
|
10408
|
+
: isSet(object.expires_at)
|
|
10409
|
+
? fromJsonTimestamp(object.expires_at)
|
|
10410
|
+
: undefined,
|
|
10411
|
+
};
|
|
10412
|
+
},
|
|
10413
|
+
|
|
10414
|
+
toJSON(message: AuthorizeUserLoginResponse): unknown {
|
|
10415
|
+
const obj: any = {};
|
|
10416
|
+
if (message.status !== undefined) {
|
|
10417
|
+
obj.status = ResponseStatus.toJSON(message.status);
|
|
10418
|
+
}
|
|
10419
|
+
if (message.code !== "") {
|
|
10420
|
+
obj.code = message.code;
|
|
10421
|
+
}
|
|
10422
|
+
if (message.expiresAt !== undefined) {
|
|
10423
|
+
obj.expiresAt = message.expiresAt.toISOString();
|
|
10424
|
+
}
|
|
10425
|
+
return obj;
|
|
10426
|
+
},
|
|
10427
|
+
|
|
10428
|
+
create<I extends Exact<DeepPartial<AuthorizeUserLoginResponse>, I>>(base?: I): AuthorizeUserLoginResponse {
|
|
10429
|
+
return AuthorizeUserLoginResponse.fromPartial(base ?? ({} as any));
|
|
10430
|
+
},
|
|
10431
|
+
fromPartial<I extends Exact<DeepPartial<AuthorizeUserLoginResponse>, I>>(object: I): AuthorizeUserLoginResponse {
|
|
10432
|
+
const message = createBaseAuthorizeUserLoginResponse();
|
|
10433
|
+
message.status = (object.status !== undefined && object.status !== null)
|
|
10434
|
+
? ResponseStatus.fromPartial(object.status)
|
|
10435
|
+
: undefined;
|
|
10436
|
+
message.code = object.code ?? "";
|
|
10437
|
+
message.expiresAt = object.expiresAt ?? undefined;
|
|
10438
|
+
return message;
|
|
10439
|
+
},
|
|
10440
|
+
};
|
|
10441
|
+
|
|
10205
10442
|
function createBaseListCliSessionsRequest(): ListCliSessionsRequest {
|
|
10206
10443
|
return { organizationId: "" };
|
|
10207
10444
|
}
|
|
@@ -11669,6 +11906,13 @@ export interface AccountGatewayService {
|
|
|
11669
11906
|
AuthorizeCliLogin(request: AuthorizeCliLoginRequest, metadata?: Metadata): Promise<AuthorizeCliLoginResponse>;
|
|
11670
11907
|
ListCliSessions(request: ListCliSessionsRequest, metadata?: Metadata): Promise<ListCliSessionsResponse>;
|
|
11671
11908
|
RevokeCliSession(request: RevokeCliSessionRequest, metadata?: Metadata): Promise<RevokeCliSessionResponse>;
|
|
11909
|
+
/**
|
|
11910
|
+
* AuthorizeUserLogin is the browser approval of a user session: one person in this deployment's product, with no
|
|
11911
|
+
* organization; it covers the caller's current and future memberships in the product. The caller comes from the
|
|
11912
|
+
* verified session token. Refusals: VALIDATION_ERROR with reason USER_SESSIONS_DISABLED (user sessions are off) or
|
|
11913
|
+
* ACCOUNT_REQUIRED (no account yet: sign in to the web app first).
|
|
11914
|
+
*/
|
|
11915
|
+
AuthorizeUserLogin(request: AuthorizeUserLoginRequest, metadata?: Metadata): Promise<AuthorizeUserLoginResponse>;
|
|
11672
11916
|
/**
|
|
11673
11917
|
* MCP authorization (docs/plans/mcp-oauth.md). The consent page's calls: each forwards the verified Clerk
|
|
11674
11918
|
* subject, never a body field, and the request is bound to the first subject that opens it.
|
|
@@ -11730,6 +11974,7 @@ export class AccountGatewayServiceClientImpl implements AccountGatewayService {
|
|
|
11730
11974
|
this.AuthorizeCliLogin = this.AuthorizeCliLogin.bind(this);
|
|
11731
11975
|
this.ListCliSessions = this.ListCliSessions.bind(this);
|
|
11732
11976
|
this.RevokeCliSession = this.RevokeCliSession.bind(this);
|
|
11977
|
+
this.AuthorizeUserLogin = this.AuthorizeUserLogin.bind(this);
|
|
11733
11978
|
this.GetMcpAuthorizationRequest = this.GetMcpAuthorizationRequest.bind(this);
|
|
11734
11979
|
this.ApproveMcpAuthorization = this.ApproveMcpAuthorization.bind(this);
|
|
11735
11980
|
this.DenyMcpAuthorization = this.DenyMcpAuthorization.bind(this);
|
|
@@ -11956,6 +12201,12 @@ export class AccountGatewayServiceClientImpl implements AccountGatewayService {
|
|
|
11956
12201
|
return promise.then((data) => RevokeCliSessionResponse.decode(new BinaryReader(data)));
|
|
11957
12202
|
}
|
|
11958
12203
|
|
|
12204
|
+
AuthorizeUserLogin(request: AuthorizeUserLoginRequest, metadata?: Metadata): Promise<AuthorizeUserLoginResponse> {
|
|
12205
|
+
const data = AuthorizeUserLoginRequest.encode(request).finish();
|
|
12206
|
+
const promise = this.rpc.request(this.service, "AuthorizeUserLogin", data, metadata);
|
|
12207
|
+
return promise.then((data) => AuthorizeUserLoginResponse.decode(new BinaryReader(data)));
|
|
12208
|
+
}
|
|
12209
|
+
|
|
11959
12210
|
GetMcpAuthorizationRequest(
|
|
11960
12211
|
request: GetMcpAuthorizationRequestRequest,
|
|
11961
12212
|
metadata?: Metadata,
|
|
@@ -95,6 +95,28 @@ function deserialize_gateway_web_v1_AuthorizeCliLoginResponse(buffer_arg) {
|
|
|
95
95
|
return proto_gateway_web_v1_account_gateway_pb.AuthorizeCliLoginResponse.deserializeBinary(new Uint8Array(buffer_arg));
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
+
function serialize_gateway_web_v1_AuthorizeUserLoginRequest(arg) {
|
|
99
|
+
if (!(arg instanceof proto_gateway_web_v1_account_gateway_pb.AuthorizeUserLoginRequest)) {
|
|
100
|
+
throw new Error('Expected argument of type gateway.web.v1.AuthorizeUserLoginRequest');
|
|
101
|
+
}
|
|
102
|
+
return Buffer.from(arg.serializeBinary());
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function deserialize_gateway_web_v1_AuthorizeUserLoginRequest(buffer_arg) {
|
|
106
|
+
return proto_gateway_web_v1_account_gateway_pb.AuthorizeUserLoginRequest.deserializeBinary(new Uint8Array(buffer_arg));
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function serialize_gateway_web_v1_AuthorizeUserLoginResponse(arg) {
|
|
110
|
+
if (!(arg instanceof proto_gateway_web_v1_account_gateway_pb.AuthorizeUserLoginResponse)) {
|
|
111
|
+
throw new Error('Expected argument of type gateway.web.v1.AuthorizeUserLoginResponse');
|
|
112
|
+
}
|
|
113
|
+
return Buffer.from(arg.serializeBinary());
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function deserialize_gateway_web_v1_AuthorizeUserLoginResponse(buffer_arg) {
|
|
117
|
+
return proto_gateway_web_v1_account_gateway_pb.AuthorizeUserLoginResponse.deserializeBinary(new Uint8Array(buffer_arg));
|
|
118
|
+
}
|
|
119
|
+
|
|
98
120
|
function serialize_gateway_web_v1_CreateOrganizationRequest(arg) {
|
|
99
121
|
if (!(arg instanceof proto_gateway_web_v1_account_gateway_pb.CreateOrganizationRequest)) {
|
|
100
122
|
throw new Error('Expected argument of type gateway.web.v1.CreateOrganizationRequest');
|
|
@@ -1281,6 +1303,21 @@ authorizeCliLogin: {
|
|
|
1281
1303
|
responseSerialize: serialize_gateway_web_v1_RevokeCliSessionResponse,
|
|
1282
1304
|
responseDeserialize: deserialize_gateway_web_v1_RevokeCliSessionResponse,
|
|
1283
1305
|
},
|
|
1306
|
+
// AuthorizeUserLogin is the browser approval of a user session: one person in this deployment's product, with no
|
|
1307
|
+
// organization; it covers the caller's current and future memberships in the product. The caller comes from the
|
|
1308
|
+
// verified session token. Refusals: VALIDATION_ERROR with reason USER_SESSIONS_DISABLED (user sessions are off) or
|
|
1309
|
+
// ACCOUNT_REQUIRED (no account yet: sign in to the web app first).
|
|
1310
|
+
authorizeUserLogin: {
|
|
1311
|
+
path: '/gateway.web.v1.AccountGatewayService/AuthorizeUserLogin',
|
|
1312
|
+
requestStream: false,
|
|
1313
|
+
responseStream: false,
|
|
1314
|
+
requestType: proto_gateway_web_v1_account_gateway_pb.AuthorizeUserLoginRequest,
|
|
1315
|
+
responseType: proto_gateway_web_v1_account_gateway_pb.AuthorizeUserLoginResponse,
|
|
1316
|
+
requestSerialize: serialize_gateway_web_v1_AuthorizeUserLoginRequest,
|
|
1317
|
+
requestDeserialize: deserialize_gateway_web_v1_AuthorizeUserLoginRequest,
|
|
1318
|
+
responseSerialize: serialize_gateway_web_v1_AuthorizeUserLoginResponse,
|
|
1319
|
+
responseDeserialize: deserialize_gateway_web_v1_AuthorizeUserLoginResponse,
|
|
1320
|
+
},
|
|
1284
1321
|
// MCP authorization (docs/plans/mcp-oauth.md). The consent page's calls: each forwards the verified Clerk
|
|
1285
1322
|
// subject, never a body field, and the request is bound to the first subject that opens it.
|
|
1286
1323
|
getMcpAuthorizationRequest: {
|