@structured-id/proto 0.9.0 → 0.10.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/CHANGELOG.md +8 -0
- package/dist/generated/sid/v1/admin/security.d.ts +17 -0
- package/dist/generated/sid/v1/admin/security.js +17 -1
- package/dist/generated/sid/v1/admin/security.js.map +1 -1
- package/dist/generated/sid/v1/authn/application_session.client.d.ts +45 -2
- package/dist/generated/sid/v1/authn/application_session.client.js +25 -1
- package/dist/generated/sid/v1/authn/application_session.client.js.map +1 -1
- package/dist/generated/sid/v1/authn/application_session.d.ts +24 -0
- package/dist/generated/sid/v1/authn/application_session.js +49 -2
- package/dist/generated/sid/v1/authn/application_session.js.map +1 -1
- package/dist/generated/sid/v1/authn/auth.client.d.ts +24 -32
- package/dist/generated/sid/v1/authn/auth.client.js +72 -78
- package/dist/generated/sid/v1/authn/auth.client.js.map +1 -1
- package/dist/generated/sid/v1/authn/auth.d.ts +102 -160
- package/dist/generated/sid/v1/authn/auth.js +77 -260
- package/dist/generated/sid/v1/authn/auth.js.map +1 -1
- package/dist/generated/sid/v1/authn/native_session.d.ts +189 -0
- package/dist/generated/sid/v1/authn/native_session.js +265 -0
- package/dist/generated/sid/v1/authn/native_session.js.map +1 -0
- package/dist/generated/sid/v1/ids/ids.d.ts +2 -0
- package/dist/generated/sid/v1/ids/ids.js +1 -0
- package/dist/generated/sid/v1/ids/ids.js.map +1 -1
- package/dist/totp.d.ts +16 -0
- package/dist/totp.js +64 -0
- package/dist/totp.js.map +1 -0
- package/package.json +6 -2
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
|
|
2
|
+
import type { IBinaryWriter } from "@protobuf-ts/runtime";
|
|
3
|
+
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
|
|
4
|
+
import type { IBinaryReader } from "@protobuf-ts/runtime";
|
|
5
|
+
import type { PartialMessage } from "@protobuf-ts/runtime";
|
|
6
|
+
import { MessageType } from "@protobuf-ts/runtime";
|
|
7
|
+
/**
|
|
8
|
+
* One generation of a native session's refresh credentials, delivered in
|
|
9
|
+
* `sid-native-credentials-bin` response metadata by a native ceremony
|
|
10
|
+
* completion, a refresh and a redelivery of that refresh. The client
|
|
11
|
+
* replaces its stored generation with this one as a whole: credentials of
|
|
12
|
+
* different generations are never mixed.
|
|
13
|
+
*
|
|
14
|
+
* @generated from protobuf message sid.v1.authn.NativeCredentialSet
|
|
15
|
+
*/
|
|
16
|
+
export interface NativeCredentialSet {
|
|
17
|
+
/**
|
|
18
|
+
* The generation's refresh credentials, opaque bearer secrets of equal
|
|
19
|
+
* standing bound to the application key: any one of them, with a fresh
|
|
20
|
+
* proof by that key, refreshes the session once. Their number is the
|
|
21
|
+
* issuer's session policy (`native_refresh_generation_size`); a client
|
|
22
|
+
* accepts any count from 1 up to 16 and refuses a set outside it.
|
|
23
|
+
*
|
|
24
|
+
* @generated from protobuf field: repeated string refresh_credentials = 1
|
|
25
|
+
*/
|
|
26
|
+
refreshCredentials: string[];
|
|
27
|
+
/**
|
|
28
|
+
* Seconds until these credentials expire, counted from the response.
|
|
29
|
+
* Never beyond the session's absolute end or a source deadline.
|
|
30
|
+
*
|
|
31
|
+
* @generated from protobuf field: int64 expires_in = 2
|
|
32
|
+
*/
|
|
33
|
+
expiresIn: bigint;
|
|
34
|
+
/**
|
|
35
|
+
* Seconds after a refresh commits during which a retry of the same
|
|
36
|
+
* exchange with another credential of the presented generation receives
|
|
37
|
+
* this same set again (the issuer's `native_redelivery_window_seconds`).
|
|
38
|
+
* After it, the presented generation is retired.
|
|
39
|
+
*
|
|
40
|
+
* @generated from protobuf field: int64 redelivery_window = 3
|
|
41
|
+
*/
|
|
42
|
+
redeliveryWindow: bigint;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The claims of a SID native proof (JWS header `typ: "sid-native+jwt"`,
|
|
46
|
+
* `jwk`: the application key's public JWK, `alg`: an asymmetric algorithm
|
|
47
|
+
* of RFC 9449 §4.2). Signature, key, `jti`, `htm`, `htu` and `iat` follow
|
|
48
|
+
* RFC 9449 §4.2 and §4.3: `htu` and `htm` name the request as the client
|
|
49
|
+
* actually addressed it (the issuer URL and gRPC method path for a direct
|
|
50
|
+
* gRPC call, the HTTP route for an HTTP call), and each `jti` is admitted
|
|
51
|
+
* once by the issuer. The SID claims below bind what standard DPoP does not
|
|
52
|
+
* (RFC 9449 §11.7): `ath` keeps its access-token meaning and is not used.
|
|
53
|
+
* This message documents the claim set; the proof is the JWS, not this
|
|
54
|
+
* message.
|
|
55
|
+
*
|
|
56
|
+
* @generated from protobuf message sid.v1.authn.NativeProofClaims
|
|
57
|
+
*/
|
|
58
|
+
export interface NativeProofClaims {
|
|
59
|
+
/**
|
|
60
|
+
* RFC 9449 §4.2: unique identifier of this proof; a proof is used once.
|
|
61
|
+
*
|
|
62
|
+
* @generated from protobuf field: string jti = 1
|
|
63
|
+
*/
|
|
64
|
+
jti: string;
|
|
65
|
+
/**
|
|
66
|
+
* RFC 9449 §4.2: the HTTP method of the request ("POST").
|
|
67
|
+
*
|
|
68
|
+
* @generated from protobuf field: string htm = 2
|
|
69
|
+
*/
|
|
70
|
+
htm: string;
|
|
71
|
+
/**
|
|
72
|
+
* RFC 9449 §4.2: the request URI without query and fragment, as the
|
|
73
|
+
* client addressed it.
|
|
74
|
+
*
|
|
75
|
+
* @generated from protobuf field: string htu = 3
|
|
76
|
+
*/
|
|
77
|
+
htu: string;
|
|
78
|
+
/**
|
|
79
|
+
* RFC 9449 §4.2: creation time, seconds since the epoch.
|
|
80
|
+
*
|
|
81
|
+
* @generated from protobuf field: int64 iat = 4
|
|
82
|
+
*/
|
|
83
|
+
iat: bigint;
|
|
84
|
+
/**
|
|
85
|
+
* On RefreshNativeSession: base64url (no padding) SHA-256 of the
|
|
86
|
+
* presented refresh credential's ASCII form. A proof for one credential
|
|
87
|
+
* presents no other.
|
|
88
|
+
*
|
|
89
|
+
* @generated from protobuf field: string sid_rt = 5
|
|
90
|
+
*/
|
|
91
|
+
sidRt: string;
|
|
92
|
+
/**
|
|
93
|
+
* On RefreshNativeSession: base64url (no padding) of the request's
|
|
94
|
+
* `exchange`. A retry of the same exchange keeps it under a new proof.
|
|
95
|
+
*
|
|
96
|
+
* @generated from protobuf field: string sid_ex = 6
|
|
97
|
+
*/
|
|
98
|
+
sidEx: string;
|
|
99
|
+
/**
|
|
100
|
+
* On a ceremony completion: base64url (no padding) SHA-256 of the
|
|
101
|
+
* ceremony reference that completion echoes, as the completing method
|
|
102
|
+
* documents it (for OpaqueLoginFinish the 16 bytes of its `login_id`). Binds
|
|
103
|
+
* the application key to that one authenticated ceremony.
|
|
104
|
+
*
|
|
105
|
+
* @generated from protobuf field: string sid_cer = 7
|
|
106
|
+
*/
|
|
107
|
+
sidCer: string;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Refresh a native session, or receive again the generation a lost response
|
|
111
|
+
* carried. Presented credential in `sid-native-refresh`, proof in
|
|
112
|
+
* `sid-native-proof`; the access token in `authorization` and the next
|
|
113
|
+
* generation in `sid-native-credentials-bin` response metadata.
|
|
114
|
+
*
|
|
115
|
+
* @generated from protobuf message sid.v1.authn.RefreshNativeSessionRequest
|
|
116
|
+
*/
|
|
117
|
+
export interface RefreshNativeSessionRequest {
|
|
118
|
+
/**
|
|
119
|
+
* The logical exchange: 16 random bytes the client chooses for one refresh
|
|
120
|
+
* and keeps across its retries. Retrying an exchange within the
|
|
121
|
+
* redelivery window, with any credential of the generation it rotated and
|
|
122
|
+
* a fresh proof, answers the generation it committed; it grants no
|
|
123
|
+
* authority by itself.
|
|
124
|
+
*
|
|
125
|
+
* @generated from protobuf field: bytes exchange = 1
|
|
126
|
+
*/
|
|
127
|
+
exchange: Uint8Array;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* The refreshed session. Its credentials are in the response metadata.
|
|
131
|
+
*
|
|
132
|
+
* @generated from protobuf message sid.v1.authn.RefreshNativeSessionResponse
|
|
133
|
+
*/
|
|
134
|
+
export interface RefreshNativeSessionResponse {
|
|
135
|
+
/**
|
|
136
|
+
* Server-assigned session identifier (UUIDv7) of the refreshed session:
|
|
137
|
+
* the same session, never a new one. Not a credential.
|
|
138
|
+
*
|
|
139
|
+
* @generated from protobuf field: string session_id = 1
|
|
140
|
+
*/
|
|
141
|
+
sessionId: string;
|
|
142
|
+
/**
|
|
143
|
+
* Seconds until the delivered access token expires.
|
|
144
|
+
*
|
|
145
|
+
* @generated from protobuf field: int64 expires_in = 2
|
|
146
|
+
*/
|
|
147
|
+
expiresIn: bigint;
|
|
148
|
+
}
|
|
149
|
+
declare class NativeCredentialSet$Type extends MessageType<NativeCredentialSet> {
|
|
150
|
+
constructor();
|
|
151
|
+
create(value?: PartialMessage<NativeCredentialSet>): NativeCredentialSet;
|
|
152
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NativeCredentialSet): NativeCredentialSet;
|
|
153
|
+
internalBinaryWrite(message: NativeCredentialSet, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* @generated MessageType for protobuf message sid.v1.authn.NativeCredentialSet
|
|
157
|
+
*/
|
|
158
|
+
export declare const NativeCredentialSet: NativeCredentialSet$Type;
|
|
159
|
+
declare class NativeProofClaims$Type extends MessageType<NativeProofClaims> {
|
|
160
|
+
constructor();
|
|
161
|
+
create(value?: PartialMessage<NativeProofClaims>): NativeProofClaims;
|
|
162
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NativeProofClaims): NativeProofClaims;
|
|
163
|
+
internalBinaryWrite(message: NativeProofClaims, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* @generated MessageType for protobuf message sid.v1.authn.NativeProofClaims
|
|
167
|
+
*/
|
|
168
|
+
export declare const NativeProofClaims: NativeProofClaims$Type;
|
|
169
|
+
declare class RefreshNativeSessionRequest$Type extends MessageType<RefreshNativeSessionRequest> {
|
|
170
|
+
constructor();
|
|
171
|
+
create(value?: PartialMessage<RefreshNativeSessionRequest>): RefreshNativeSessionRequest;
|
|
172
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RefreshNativeSessionRequest): RefreshNativeSessionRequest;
|
|
173
|
+
internalBinaryWrite(message: RefreshNativeSessionRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* @generated MessageType for protobuf message sid.v1.authn.RefreshNativeSessionRequest
|
|
177
|
+
*/
|
|
178
|
+
export declare const RefreshNativeSessionRequest: RefreshNativeSessionRequest$Type;
|
|
179
|
+
declare class RefreshNativeSessionResponse$Type extends MessageType<RefreshNativeSessionResponse> {
|
|
180
|
+
constructor();
|
|
181
|
+
create(value?: PartialMessage<RefreshNativeSessionResponse>): RefreshNativeSessionResponse;
|
|
182
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RefreshNativeSessionResponse): RefreshNativeSessionResponse;
|
|
183
|
+
internalBinaryWrite(message: RefreshNativeSessionResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* @generated MessageType for protobuf message sid.v1.authn.RefreshNativeSessionResponse
|
|
187
|
+
*/
|
|
188
|
+
export declare const RefreshNativeSessionResponse: RefreshNativeSessionResponse$Type;
|
|
189
|
+
export {};
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import { WireType } from "@protobuf-ts/runtime";
|
|
2
|
+
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
|
|
3
|
+
import { reflectionMergePartial } from "@protobuf-ts/runtime";
|
|
4
|
+
import { MessageType } from "@protobuf-ts/runtime";
|
|
5
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
6
|
+
class NativeCredentialSet$Type extends MessageType {
|
|
7
|
+
constructor() {
|
|
8
|
+
super("sid.v1.authn.NativeCredentialSet", [
|
|
9
|
+
{ no: 1, name: "refresh_credentials", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
|
|
10
|
+
{ no: 2, name: "expires_in", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
|
|
11
|
+
{ no: 3, name: "redelivery_window", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }
|
|
12
|
+
]);
|
|
13
|
+
}
|
|
14
|
+
create(value) {
|
|
15
|
+
const message = globalThis.Object.create((this.messagePrototype));
|
|
16
|
+
message.refreshCredentials = [];
|
|
17
|
+
message.expiresIn = 0n;
|
|
18
|
+
message.redeliveryWindow = 0n;
|
|
19
|
+
if (value !== undefined)
|
|
20
|
+
reflectionMergePartial(this, message, value);
|
|
21
|
+
return message;
|
|
22
|
+
}
|
|
23
|
+
internalBinaryRead(reader, length, options, target) {
|
|
24
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
25
|
+
while (reader.pos < end) {
|
|
26
|
+
let [fieldNo, wireType] = reader.tag();
|
|
27
|
+
switch (fieldNo) {
|
|
28
|
+
case /* repeated string refresh_credentials */ 1:
|
|
29
|
+
message.refreshCredentials.push(reader.string());
|
|
30
|
+
break;
|
|
31
|
+
case /* int64 expires_in */ 2:
|
|
32
|
+
message.expiresIn = reader.int64().toBigInt();
|
|
33
|
+
break;
|
|
34
|
+
case /* int64 redelivery_window */ 3:
|
|
35
|
+
message.redeliveryWindow = reader.int64().toBigInt();
|
|
36
|
+
break;
|
|
37
|
+
default:
|
|
38
|
+
let u = options.readUnknownField;
|
|
39
|
+
if (u === "throw")
|
|
40
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
41
|
+
let d = reader.skip(wireType);
|
|
42
|
+
if (u !== false)
|
|
43
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return message;
|
|
47
|
+
}
|
|
48
|
+
internalBinaryWrite(message, writer, options) {
|
|
49
|
+
/* repeated string refresh_credentials = 1; */
|
|
50
|
+
for (let i = 0; i < message.refreshCredentials.length; i++)
|
|
51
|
+
writer.tag(1, WireType.LengthDelimited).string(message.refreshCredentials[i]);
|
|
52
|
+
/* int64 expires_in = 2; */
|
|
53
|
+
if (message.expiresIn !== 0n)
|
|
54
|
+
writer.tag(2, WireType.Varint).int64(message.expiresIn);
|
|
55
|
+
/* int64 redelivery_window = 3; */
|
|
56
|
+
if (message.redeliveryWindow !== 0n)
|
|
57
|
+
writer.tag(3, WireType.Varint).int64(message.redeliveryWindow);
|
|
58
|
+
let u = options.writeUnknownFields;
|
|
59
|
+
if (u !== false)
|
|
60
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
61
|
+
return writer;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* @generated MessageType for protobuf message sid.v1.authn.NativeCredentialSet
|
|
66
|
+
*/
|
|
67
|
+
export const NativeCredentialSet = new NativeCredentialSet$Type();
|
|
68
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
69
|
+
class NativeProofClaims$Type extends MessageType {
|
|
70
|
+
constructor() {
|
|
71
|
+
super("sid.v1.authn.NativeProofClaims", [
|
|
72
|
+
{ no: 1, name: "jti", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
73
|
+
{ no: 2, name: "htm", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
74
|
+
{ no: 3, name: "htu", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
75
|
+
{ no: 4, name: "iat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
|
|
76
|
+
{ no: 5, name: "sid_rt", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
77
|
+
{ no: 6, name: "sid_ex", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
78
|
+
{ no: 7, name: "sid_cer", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
|
|
79
|
+
]);
|
|
80
|
+
}
|
|
81
|
+
create(value) {
|
|
82
|
+
const message = globalThis.Object.create((this.messagePrototype));
|
|
83
|
+
message.jti = "";
|
|
84
|
+
message.htm = "";
|
|
85
|
+
message.htu = "";
|
|
86
|
+
message.iat = 0n;
|
|
87
|
+
message.sidRt = "";
|
|
88
|
+
message.sidEx = "";
|
|
89
|
+
message.sidCer = "";
|
|
90
|
+
if (value !== undefined)
|
|
91
|
+
reflectionMergePartial(this, message, value);
|
|
92
|
+
return message;
|
|
93
|
+
}
|
|
94
|
+
internalBinaryRead(reader, length, options, target) {
|
|
95
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
96
|
+
while (reader.pos < end) {
|
|
97
|
+
let [fieldNo, wireType] = reader.tag();
|
|
98
|
+
switch (fieldNo) {
|
|
99
|
+
case /* string jti */ 1:
|
|
100
|
+
message.jti = reader.string();
|
|
101
|
+
break;
|
|
102
|
+
case /* string htm */ 2:
|
|
103
|
+
message.htm = reader.string();
|
|
104
|
+
break;
|
|
105
|
+
case /* string htu */ 3:
|
|
106
|
+
message.htu = reader.string();
|
|
107
|
+
break;
|
|
108
|
+
case /* int64 iat */ 4:
|
|
109
|
+
message.iat = reader.int64().toBigInt();
|
|
110
|
+
break;
|
|
111
|
+
case /* string sid_rt */ 5:
|
|
112
|
+
message.sidRt = reader.string();
|
|
113
|
+
break;
|
|
114
|
+
case /* string sid_ex */ 6:
|
|
115
|
+
message.sidEx = reader.string();
|
|
116
|
+
break;
|
|
117
|
+
case /* string sid_cer */ 7:
|
|
118
|
+
message.sidCer = reader.string();
|
|
119
|
+
break;
|
|
120
|
+
default:
|
|
121
|
+
let u = options.readUnknownField;
|
|
122
|
+
if (u === "throw")
|
|
123
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
124
|
+
let d = reader.skip(wireType);
|
|
125
|
+
if (u !== false)
|
|
126
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return message;
|
|
130
|
+
}
|
|
131
|
+
internalBinaryWrite(message, writer, options) {
|
|
132
|
+
/* string jti = 1; */
|
|
133
|
+
if (message.jti !== "")
|
|
134
|
+
writer.tag(1, WireType.LengthDelimited).string(message.jti);
|
|
135
|
+
/* string htm = 2; */
|
|
136
|
+
if (message.htm !== "")
|
|
137
|
+
writer.tag(2, WireType.LengthDelimited).string(message.htm);
|
|
138
|
+
/* string htu = 3; */
|
|
139
|
+
if (message.htu !== "")
|
|
140
|
+
writer.tag(3, WireType.LengthDelimited).string(message.htu);
|
|
141
|
+
/* int64 iat = 4; */
|
|
142
|
+
if (message.iat !== 0n)
|
|
143
|
+
writer.tag(4, WireType.Varint).int64(message.iat);
|
|
144
|
+
/* string sid_rt = 5; */
|
|
145
|
+
if (message.sidRt !== "")
|
|
146
|
+
writer.tag(5, WireType.LengthDelimited).string(message.sidRt);
|
|
147
|
+
/* string sid_ex = 6; */
|
|
148
|
+
if (message.sidEx !== "")
|
|
149
|
+
writer.tag(6, WireType.LengthDelimited).string(message.sidEx);
|
|
150
|
+
/* string sid_cer = 7; */
|
|
151
|
+
if (message.sidCer !== "")
|
|
152
|
+
writer.tag(7, WireType.LengthDelimited).string(message.sidCer);
|
|
153
|
+
let u = options.writeUnknownFields;
|
|
154
|
+
if (u !== false)
|
|
155
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
156
|
+
return writer;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* @generated MessageType for protobuf message sid.v1.authn.NativeProofClaims
|
|
161
|
+
*/
|
|
162
|
+
export const NativeProofClaims = new NativeProofClaims$Type();
|
|
163
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
164
|
+
class RefreshNativeSessionRequest$Type extends MessageType {
|
|
165
|
+
constructor() {
|
|
166
|
+
super("sid.v1.authn.RefreshNativeSessionRequest", [
|
|
167
|
+
{ no: 1, name: "exchange", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }
|
|
168
|
+
]);
|
|
169
|
+
}
|
|
170
|
+
create(value) {
|
|
171
|
+
const message = globalThis.Object.create((this.messagePrototype));
|
|
172
|
+
message.exchange = new Uint8Array(0);
|
|
173
|
+
if (value !== undefined)
|
|
174
|
+
reflectionMergePartial(this, message, value);
|
|
175
|
+
return message;
|
|
176
|
+
}
|
|
177
|
+
internalBinaryRead(reader, length, options, target) {
|
|
178
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
179
|
+
while (reader.pos < end) {
|
|
180
|
+
let [fieldNo, wireType] = reader.tag();
|
|
181
|
+
switch (fieldNo) {
|
|
182
|
+
case /* bytes exchange */ 1:
|
|
183
|
+
message.exchange = reader.bytes();
|
|
184
|
+
break;
|
|
185
|
+
default:
|
|
186
|
+
let u = options.readUnknownField;
|
|
187
|
+
if (u === "throw")
|
|
188
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
189
|
+
let d = reader.skip(wireType);
|
|
190
|
+
if (u !== false)
|
|
191
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return message;
|
|
195
|
+
}
|
|
196
|
+
internalBinaryWrite(message, writer, options) {
|
|
197
|
+
/* bytes exchange = 1; */
|
|
198
|
+
if (message.exchange.length)
|
|
199
|
+
writer.tag(1, WireType.LengthDelimited).bytes(message.exchange);
|
|
200
|
+
let u = options.writeUnknownFields;
|
|
201
|
+
if (u !== false)
|
|
202
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
203
|
+
return writer;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* @generated MessageType for protobuf message sid.v1.authn.RefreshNativeSessionRequest
|
|
208
|
+
*/
|
|
209
|
+
export const RefreshNativeSessionRequest = new RefreshNativeSessionRequest$Type();
|
|
210
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
211
|
+
class RefreshNativeSessionResponse$Type extends MessageType {
|
|
212
|
+
constructor() {
|
|
213
|
+
super("sid.v1.authn.RefreshNativeSessionResponse", [
|
|
214
|
+
{ no: 1, name: "session_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
215
|
+
{ no: 2, name: "expires_in", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }
|
|
216
|
+
]);
|
|
217
|
+
}
|
|
218
|
+
create(value) {
|
|
219
|
+
const message = globalThis.Object.create((this.messagePrototype));
|
|
220
|
+
message.sessionId = "";
|
|
221
|
+
message.expiresIn = 0n;
|
|
222
|
+
if (value !== undefined)
|
|
223
|
+
reflectionMergePartial(this, message, value);
|
|
224
|
+
return message;
|
|
225
|
+
}
|
|
226
|
+
internalBinaryRead(reader, length, options, target) {
|
|
227
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
228
|
+
while (reader.pos < end) {
|
|
229
|
+
let [fieldNo, wireType] = reader.tag();
|
|
230
|
+
switch (fieldNo) {
|
|
231
|
+
case /* string session_id */ 1:
|
|
232
|
+
message.sessionId = reader.string();
|
|
233
|
+
break;
|
|
234
|
+
case /* int64 expires_in */ 2:
|
|
235
|
+
message.expiresIn = reader.int64().toBigInt();
|
|
236
|
+
break;
|
|
237
|
+
default:
|
|
238
|
+
let u = options.readUnknownField;
|
|
239
|
+
if (u === "throw")
|
|
240
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
241
|
+
let d = reader.skip(wireType);
|
|
242
|
+
if (u !== false)
|
|
243
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
return message;
|
|
247
|
+
}
|
|
248
|
+
internalBinaryWrite(message, writer, options) {
|
|
249
|
+
/* string session_id = 1; */
|
|
250
|
+
if (message.sessionId !== "")
|
|
251
|
+
writer.tag(1, WireType.LengthDelimited).string(message.sessionId);
|
|
252
|
+
/* int64 expires_in = 2; */
|
|
253
|
+
if (message.expiresIn !== 0n)
|
|
254
|
+
writer.tag(2, WireType.Varint).int64(message.expiresIn);
|
|
255
|
+
let u = options.writeUnknownFields;
|
|
256
|
+
if (u !== false)
|
|
257
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
258
|
+
return writer;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* @generated MessageType for protobuf message sid.v1.authn.RefreshNativeSessionResponse
|
|
263
|
+
*/
|
|
264
|
+
export const RefreshNativeSessionResponse = new RefreshNativeSessionResponse$Type();
|
|
265
|
+
//# sourceMappingURL=native_session.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native_session.js","sourceRoot":"","sources":["../../../../../src/generated/sid/v1/authn/native_session.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGhD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AA+InD,2FAA2F;AAC3F,MAAM,wBAAyB,SAAQ,WAAgC;IACnE;QACI,KAAK,CAAC,kCAAkC,EAAE;YACtC,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,qBAAqB,EAAE,IAAI,EAAE,QAAQ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,CAAC,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC5D,IAAI,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC;QACnC,IAAI,CAAC,KAAK,KAAK;YACX,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QAClF,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AACD;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,iCAAiC,EAAE,CAAC","sourcesContent":["// @generated by protobuf-ts 2.11.1 with parameter client_generic,generate_dependencies,ts_nocheck\n// @generated from protobuf file \"sid/v1/authn/native_session.proto\" (package \"sid.v1.authn\", syntax proto3)\n// tslint:disable\n// @ts-nocheck\nimport type { BinaryWriteOptions } from \"@protobuf-ts/runtime\";\nimport type { IBinaryWriter } from \"@protobuf-ts/runtime\";\nimport { WireType } from \"@protobuf-ts/runtime\";\nimport type { BinaryReadOptions } from \"@protobuf-ts/runtime\";\nimport type { IBinaryReader } from \"@protobuf-ts/runtime\";\nimport { UnknownFieldHandler } from \"@protobuf-ts/runtime\";\nimport type { PartialMessage } from \"@protobuf-ts/runtime\";\nimport { reflectionMergePartial } from \"@protobuf-ts/runtime\";\nimport { MessageType } from \"@protobuf-ts/runtime\";\n/**\n * One generation of a native session's refresh credentials, delivered in\n * `sid-native-credentials-bin` response metadata by a native ceremony\n * completion, a refresh and a redelivery of that refresh. The client\n * replaces its stored generation with this one as a whole: credentials of\n * different generations are never mixed.\n *\n * @generated from protobuf message sid.v1.authn.NativeCredentialSet\n */\nexport interface NativeCredentialSet {\n /**\n * The generation's refresh credentials, opaque bearer secrets of equal\n * standing bound to the application key: any one of them, with a fresh\n * proof by that key, refreshes the session once. Their number is the\n * issuer's session policy (`native_refresh_generation_size`); a client\n * accepts any count from 1 up to 16 and refuses a set outside it.\n *\n * @generated from protobuf field: repeated string refresh_credentials = 1\n */\n refreshCredentials: string[];\n /**\n * Seconds until these credentials expire, counted from the response.\n * Never beyond the session's absolute end or a source deadline.\n *\n * @generated from protobuf field: int64 expires_in = 2\n */\n expiresIn: bigint;\n /**\n * Seconds after a refresh commits during which a retry of the same\n * exchange with another credential of the presented generation receives\n * this same set again (the issuer's `native_redelivery_window_seconds`).\n * After it, the presented generation is retired.\n *\n * @generated from protobuf field: int64 redelivery_window = 3\n */\n redeliveryWindow: bigint;\n}\n/**\n * The claims of a SID native proof (JWS header `typ: \"sid-native+jwt\"`,\n * `jwk`: the application key's public JWK, `alg`: an asymmetric algorithm\n * of RFC 9449 §4.2). Signature, key, `jti`, `htm`, `htu` and `iat` follow\n * RFC 9449 §4.2 and §4.3: `htu` and `htm` name the request as the client\n * actually addressed it (the issuer URL and gRPC method path for a direct\n * gRPC call, the HTTP route for an HTTP call), and each `jti` is admitted\n * once by the issuer. The SID claims below bind what standard DPoP does not\n * (RFC 9449 §11.7): `ath` keeps its access-token meaning and is not used.\n * This message documents the claim set; the proof is the JWS, not this\n * message.\n *\n * @generated from protobuf message sid.v1.authn.NativeProofClaims\n */\nexport interface NativeProofClaims {\n /**\n * RFC 9449 §4.2: unique identifier of this proof; a proof is used once.\n *\n * @generated from protobuf field: string jti = 1\n */\n jti: string;\n /**\n * RFC 9449 §4.2: the HTTP method of the request (\"POST\").\n *\n * @generated from protobuf field: string htm = 2\n */\n htm: string;\n /**\n * RFC 9449 §4.2: the request URI without query and fragment, as the\n * client addressed it.\n *\n * @generated from protobuf field: string htu = 3\n */\n htu: string;\n /**\n * RFC 9449 §4.2: creation time, seconds since the epoch.\n *\n * @generated from protobuf field: int64 iat = 4\n */\n iat: bigint;\n /**\n * On RefreshNativeSession: base64url (no padding) SHA-256 of the\n * presented refresh credential's ASCII form. A proof for one credential\n * presents no other.\n *\n * @generated from protobuf field: string sid_rt = 5\n */\n sidRt: string;\n /**\n * On RefreshNativeSession: base64url (no padding) of the request's\n * `exchange`. A retry of the same exchange keeps it under a new proof.\n *\n * @generated from protobuf field: string sid_ex = 6\n */\n sidEx: string;\n /**\n * On a ceremony completion: base64url (no padding) SHA-256 of the\n * ceremony reference that completion echoes, as the completing method\n * documents it (for OpaqueLoginFinish the 16 bytes of its `login_id`). Binds\n * the application key to that one authenticated ceremony.\n *\n * @generated from protobuf field: string sid_cer = 7\n */\n sidCer: string;\n}\n/**\n * Refresh a native session, or receive again the generation a lost response\n * carried. Presented credential in `sid-native-refresh`, proof in\n * `sid-native-proof`; the access token in `authorization` and the next\n * generation in `sid-native-credentials-bin` response metadata.\n *\n * @generated from protobuf message sid.v1.authn.RefreshNativeSessionRequest\n */\nexport interface RefreshNativeSessionRequest {\n /**\n * The logical exchange: 16 random bytes the client chooses for one refresh\n * and keeps across its retries. Retrying an exchange within the\n * redelivery window, with any credential of the generation it rotated and\n * a fresh proof, answers the generation it committed; it grants no\n * authority by itself.\n *\n * @generated from protobuf field: bytes exchange = 1\n */\n exchange: Uint8Array;\n}\n/**\n * The refreshed session. Its credentials are in the response metadata.\n *\n * @generated from protobuf message sid.v1.authn.RefreshNativeSessionResponse\n */\nexport interface RefreshNativeSessionResponse {\n /**\n * Server-assigned session identifier (UUIDv7) of the refreshed session:\n * the same session, never a new one. Not a credential.\n *\n * @generated from protobuf field: string session_id = 1\n */\n sessionId: string;\n /**\n * Seconds until the delivered access token expires.\n *\n * @generated from protobuf field: int64 expires_in = 2\n */\n expiresIn: bigint;\n}\n// @generated message type with reflection information, may provide speed optimized methods\nclass NativeCredentialSet$Type extends MessageType<NativeCredentialSet> {\n constructor() {\n super(\"sid.v1.authn.NativeCredentialSet\", [\n { no: 1, name: \"refresh_credentials\", kind: \"scalar\", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },\n { no: 2, name: \"expires_in\", kind: \"scalar\", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },\n { no: 3, name: \"redelivery_window\", kind: \"scalar\", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }\n ]);\n }\n create(value?: PartialMessage<NativeCredentialSet>): NativeCredentialSet {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.refreshCredentials = [];\n message.expiresIn = 0n;\n message.redeliveryWindow = 0n;\n if (value !== undefined)\n reflectionMergePartial<NativeCredentialSet>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NativeCredentialSet): NativeCredentialSet {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* repeated string refresh_credentials */ 1:\n message.refreshCredentials.push(reader.string());\n break;\n case /* int64 expires_in */ 2:\n message.expiresIn = reader.int64().toBigInt();\n break;\n case /* int64 redelivery_window */ 3:\n message.redeliveryWindow = reader.int64().toBigInt();\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: NativeCredentialSet, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* repeated string refresh_credentials = 1; */\n for (let i = 0; i < message.refreshCredentials.length; i++)\n writer.tag(1, WireType.LengthDelimited).string(message.refreshCredentials[i]);\n /* int64 expires_in = 2; */\n if (message.expiresIn !== 0n)\n writer.tag(2, WireType.Varint).int64(message.expiresIn);\n /* int64 redelivery_window = 3; */\n if (message.redeliveryWindow !== 0n)\n writer.tag(3, WireType.Varint).int64(message.redeliveryWindow);\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message sid.v1.authn.NativeCredentialSet\n */\nexport const NativeCredentialSet = new NativeCredentialSet$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass NativeProofClaims$Type extends MessageType<NativeProofClaims> {\n constructor() {\n super(\"sid.v1.authn.NativeProofClaims\", [\n { no: 1, name: \"jti\", kind: \"scalar\", T: 9 /*ScalarType.STRING*/ },\n { no: 2, name: \"htm\", kind: \"scalar\", T: 9 /*ScalarType.STRING*/ },\n { no: 3, name: \"htu\", kind: \"scalar\", T: 9 /*ScalarType.STRING*/ },\n { no: 4, name: \"iat\", kind: \"scalar\", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },\n { no: 5, name: \"sid_rt\", kind: \"scalar\", T: 9 /*ScalarType.STRING*/ },\n { no: 6, name: \"sid_ex\", kind: \"scalar\", T: 9 /*ScalarType.STRING*/ },\n { no: 7, name: \"sid_cer\", kind: \"scalar\", T: 9 /*ScalarType.STRING*/ }\n ]);\n }\n create(value?: PartialMessage<NativeProofClaims>): NativeProofClaims {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.jti = \"\";\n message.htm = \"\";\n message.htu = \"\";\n message.iat = 0n;\n message.sidRt = \"\";\n message.sidEx = \"\";\n message.sidCer = \"\";\n if (value !== undefined)\n reflectionMergePartial<NativeProofClaims>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NativeProofClaims): NativeProofClaims {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* string jti */ 1:\n message.jti = reader.string();\n break;\n case /* string htm */ 2:\n message.htm = reader.string();\n break;\n case /* string htu */ 3:\n message.htu = reader.string();\n break;\n case /* int64 iat */ 4:\n message.iat = reader.int64().toBigInt();\n break;\n case /* string sid_rt */ 5:\n message.sidRt = reader.string();\n break;\n case /* string sid_ex */ 6:\n message.sidEx = reader.string();\n break;\n case /* string sid_cer */ 7:\n message.sidCer = reader.string();\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: NativeProofClaims, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* string jti = 1; */\n if (message.jti !== \"\")\n writer.tag(1, WireType.LengthDelimited).string(message.jti);\n /* string htm = 2; */\n if (message.htm !== \"\")\n writer.tag(2, WireType.LengthDelimited).string(message.htm);\n /* string htu = 3; */\n if (message.htu !== \"\")\n writer.tag(3, WireType.LengthDelimited).string(message.htu);\n /* int64 iat = 4; */\n if (message.iat !== 0n)\n writer.tag(4, WireType.Varint).int64(message.iat);\n /* string sid_rt = 5; */\n if (message.sidRt !== \"\")\n writer.tag(5, WireType.LengthDelimited).string(message.sidRt);\n /* string sid_ex = 6; */\n if (message.sidEx !== \"\")\n writer.tag(6, WireType.LengthDelimited).string(message.sidEx);\n /* string sid_cer = 7; */\n if (message.sidCer !== \"\")\n writer.tag(7, WireType.LengthDelimited).string(message.sidCer);\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message sid.v1.authn.NativeProofClaims\n */\nexport const NativeProofClaims = new NativeProofClaims$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass RefreshNativeSessionRequest$Type extends MessageType<RefreshNativeSessionRequest> {\n constructor() {\n super(\"sid.v1.authn.RefreshNativeSessionRequest\", [\n { no: 1, name: \"exchange\", kind: \"scalar\", T: 12 /*ScalarType.BYTES*/ }\n ]);\n }\n create(value?: PartialMessage<RefreshNativeSessionRequest>): RefreshNativeSessionRequest {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.exchange = new Uint8Array(0);\n if (value !== undefined)\n reflectionMergePartial<RefreshNativeSessionRequest>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RefreshNativeSessionRequest): RefreshNativeSessionRequest {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* bytes exchange */ 1:\n message.exchange = reader.bytes();\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: RefreshNativeSessionRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* bytes exchange = 1; */\n if (message.exchange.length)\n writer.tag(1, WireType.LengthDelimited).bytes(message.exchange);\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message sid.v1.authn.RefreshNativeSessionRequest\n */\nexport const RefreshNativeSessionRequest = new RefreshNativeSessionRequest$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass RefreshNativeSessionResponse$Type extends MessageType<RefreshNativeSessionResponse> {\n constructor() {\n super(\"sid.v1.authn.RefreshNativeSessionResponse\", [\n { no: 1, name: \"session_id\", kind: \"scalar\", T: 9 /*ScalarType.STRING*/ },\n { no: 2, name: \"expires_in\", kind: \"scalar\", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }\n ]);\n }\n create(value?: PartialMessage<RefreshNativeSessionResponse>): RefreshNativeSessionResponse {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.sessionId = \"\";\n message.expiresIn = 0n;\n if (value !== undefined)\n reflectionMergePartial<RefreshNativeSessionResponse>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RefreshNativeSessionResponse): RefreshNativeSessionResponse {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* string session_id */ 1:\n message.sessionId = reader.string();\n break;\n case /* int64 expires_in */ 2:\n message.expiresIn = reader.int64().toBigInt();\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: RefreshNativeSessionResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* string session_id = 1; */\n if (message.sessionId !== \"\")\n writer.tag(1, WireType.LengthDelimited).string(message.sessionId);\n /* int64 expires_in = 2; */\n if (message.expiresIn !== 0n)\n writer.tag(2, WireType.Varint).int64(message.expiresIn);\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message sid.v1.authn.RefreshNativeSessionResponse\n */\nexport const RefreshNativeSessionResponse = new RefreshNativeSessionResponse$Type();\n"]}
|
|
@@ -4,6 +4,8 @@ export declare const BindingId: MessageType<wire.BindingId>;
|
|
|
4
4
|
export type BindingId = wire.BindingId;
|
|
5
5
|
export declare const PasswordOperationId: MessageType<wire.PasswordOperationId>;
|
|
6
6
|
export type PasswordOperationId = wire.PasswordOperationId;
|
|
7
|
+
export declare const OpaqueLoginId: MessageType<wire.OpaqueLoginId>;
|
|
8
|
+
export type OpaqueLoginId = wire.OpaqueLoginId;
|
|
7
9
|
export declare const MachineUserId: MessageType<wire.MachineUserId>;
|
|
8
10
|
export type MachineUserId = wire.MachineUserId;
|
|
9
11
|
export declare const ProvisioningConnectorId: MessageType<wire.ProvisioningConnectorId>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { wire } from "@structured-id/ids";
|
|
2
2
|
export const BindingId = wire.BindingId;
|
|
3
3
|
export const PasswordOperationId = wire.PasswordOperationId;
|
|
4
|
+
export const OpaqueLoginId = wire.OpaqueLoginId;
|
|
4
5
|
export const MachineUserId = wire.MachineUserId;
|
|
5
6
|
export const ProvisioningConnectorId = wire.ProvisioningConnectorId;
|
|
6
7
|
export const ResourceId = wire.ResourceId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids.js","sourceRoot":"","sources":["../../../../../src/generated/sid/v1/ids/ids.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,MAAM,CAAC,MAAM,SAAS,GAAgC,IAAI,CAAC,SAAS,CAAC;AAErE,MAAM,CAAC,MAAM,mBAAmB,GAA0C,IAAI,CAAC,mBAAmB,CAAC;AAEnG,MAAM,CAAC,MAAM,aAAa,GAAoC,IAAI,CAAC,aAAa,CAAC;AAEjF,MAAM,CAAC,MAAM,uBAAuB,GAA8C,IAAI,CAAC,uBAAuB,CAAC;AAE/G,MAAM,CAAC,MAAM,UAAU,GAAiC,IAAI,CAAC,UAAU,CAAC;AAExE,MAAM,CAAC,MAAM,wBAAwB,GAA+C,IAAI,CAAC,wBAAwB,CAAC","sourcesContent":["// The sid.v1.ids messages are owned by @structured-id/ids; this module\n// re-exports its objects so generated messages that carry an identifier\n// share them instead of a second generated copy.\nimport type { MessageType } from \"@protobuf-ts/runtime\";\nimport { wire } from \"@structured-id/ids\";\n\nexport const BindingId: MessageType<wire.BindingId> = wire.BindingId;\nexport type BindingId = wire.BindingId;\nexport const PasswordOperationId: MessageType<wire.PasswordOperationId> = wire.PasswordOperationId;\nexport type PasswordOperationId = wire.PasswordOperationId;\nexport const MachineUserId: MessageType<wire.MachineUserId> = wire.MachineUserId;\nexport type MachineUserId = wire.MachineUserId;\nexport const ProvisioningConnectorId: MessageType<wire.ProvisioningConnectorId> = wire.ProvisioningConnectorId;\nexport type ProvisioningConnectorId = wire.ProvisioningConnectorId;\nexport const ResourceId: MessageType<wire.ResourceId> = wire.ResourceId;\nexport type ResourceId = wire.ResourceId;\nexport const ProvisioningCredentialId: MessageType<wire.ProvisioningCredentialId> = wire.ProvisioningCredentialId;\nexport type ProvisioningCredentialId = wire.ProvisioningCredentialId;\n"]}
|
|
1
|
+
{"version":3,"file":"ids.js","sourceRoot":"","sources":["../../../../../src/generated/sid/v1/ids/ids.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,MAAM,CAAC,MAAM,SAAS,GAAgC,IAAI,CAAC,SAAS,CAAC;AAErE,MAAM,CAAC,MAAM,mBAAmB,GAA0C,IAAI,CAAC,mBAAmB,CAAC;AAEnG,MAAM,CAAC,MAAM,aAAa,GAAoC,IAAI,CAAC,aAAa,CAAC;AAEjF,MAAM,CAAC,MAAM,aAAa,GAAoC,IAAI,CAAC,aAAa,CAAC;AAEjF,MAAM,CAAC,MAAM,uBAAuB,GAA8C,IAAI,CAAC,uBAAuB,CAAC;AAE/G,MAAM,CAAC,MAAM,UAAU,GAAiC,IAAI,CAAC,UAAU,CAAC;AAExE,MAAM,CAAC,MAAM,wBAAwB,GAA+C,IAAI,CAAC,wBAAwB,CAAC","sourcesContent":["// The sid.v1.ids messages are owned by @structured-id/ids; this module\n// re-exports its objects so generated messages that carry an identifier\n// share them instead of a second generated copy.\nimport type { MessageType } from \"@protobuf-ts/runtime\";\nimport { wire } from \"@structured-id/ids\";\n\nexport const BindingId: MessageType<wire.BindingId> = wire.BindingId;\nexport type BindingId = wire.BindingId;\nexport const PasswordOperationId: MessageType<wire.PasswordOperationId> = wire.PasswordOperationId;\nexport type PasswordOperationId = wire.PasswordOperationId;\nexport const OpaqueLoginId: MessageType<wire.OpaqueLoginId> = wire.OpaqueLoginId;\nexport type OpaqueLoginId = wire.OpaqueLoginId;\nexport const MachineUserId: MessageType<wire.MachineUserId> = wire.MachineUserId;\nexport type MachineUserId = wire.MachineUserId;\nexport const ProvisioningConnectorId: MessageType<wire.ProvisioningConnectorId> = wire.ProvisioningConnectorId;\nexport type ProvisioningConnectorId = wire.ProvisioningConnectorId;\nexport const ResourceId: MessageType<wire.ResourceId> = wire.ResourceId;\nexport type ResourceId = wire.ResourceId;\nexport const ProvisioningCredentialId: MessageType<wire.ProvisioningCredentialId> = wire.ProvisioningCredentialId;\nexport type ProvisioningCredentialId = wire.ProvisioningCredentialId;\n"]}
|
package/dist/totp.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Presentation of a TOTP enrollment. The server sends the raw shared secret
|
|
3
|
+
* and its parameters (`TotpEnrollmentChallenge`); an authenticator app takes
|
|
4
|
+
* the Base32 secret typed in, or the `otpauth://totp` URI behind a QR code.
|
|
5
|
+
*/
|
|
6
|
+
import { type TotpEnrollmentChallenge } from "./generated/sid/v1/authn/auth.js";
|
|
7
|
+
/** `bytes` in Base32 (RFC 4648 §6), without padding. */
|
|
8
|
+
export declare function base32(bytes: Uint8Array): string;
|
|
9
|
+
/**
|
|
10
|
+
* The `otpauth://totp/<issuer>:<account>` URI of `challenge` (Key URI
|
|
11
|
+
* Format), with issuer and account percent-encoded so neither can split the
|
|
12
|
+
* label or add a parameter. Throws when the challenge lacks the secret or a
|
|
13
|
+
* parameter the app needs (a guess would enroll codes the server refuses),
|
|
14
|
+
* or when issuer or account holds the colon the label separates them with.
|
|
15
|
+
*/
|
|
16
|
+
export declare function otpauthUri(challenge: TotpEnrollmentChallenge): string;
|
package/dist/totp.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Presentation of a TOTP enrollment. The server sends the raw shared secret
|
|
3
|
+
* and its parameters (`TotpEnrollmentChallenge`); an authenticator app takes
|
|
4
|
+
* the Base32 secret typed in, or the `otpauth://totp` URI behind a QR code.
|
|
5
|
+
*/
|
|
6
|
+
import { TotpAlgorithm } from "./generated/sid/v1/authn/auth.js";
|
|
7
|
+
const ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
|
|
8
|
+
/** `bytes` in Base32 (RFC 4648 §6), without padding. */
|
|
9
|
+
export function base32(bytes) {
|
|
10
|
+
let out = "";
|
|
11
|
+
let buffer = 0;
|
|
12
|
+
let bits = 0;
|
|
13
|
+
for (const byte of bytes) {
|
|
14
|
+
buffer = ((buffer << 8) | byte) & 0xffff;
|
|
15
|
+
bits += 8;
|
|
16
|
+
while (bits >= 5) {
|
|
17
|
+
bits -= 5;
|
|
18
|
+
out += ALPHABET[(buffer >> bits) & 0x1f];
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
if (bits > 0) {
|
|
22
|
+
out += ALPHABET[(buffer << (5 - bits)) & 0x1f];
|
|
23
|
+
}
|
|
24
|
+
return out;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* `text` percent-encoded as a URI component: only RFC 3986 §2.3 unreserved
|
|
28
|
+
* characters stay, as the Rust client encodes it.
|
|
29
|
+
*/
|
|
30
|
+
function component(text) {
|
|
31
|
+
return encodeURIComponent(text).replace(/[!'()*]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`);
|
|
32
|
+
}
|
|
33
|
+
const ALGORITHMS = {
|
|
34
|
+
[TotpAlgorithm.SHA1]: "SHA1",
|
|
35
|
+
[TotpAlgorithm.SHA256]: "SHA256",
|
|
36
|
+
[TotpAlgorithm.SHA512]: "SHA512",
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* The `otpauth://totp/<issuer>:<account>` URI of `challenge` (Key URI
|
|
40
|
+
* Format), with issuer and account percent-encoded so neither can split the
|
|
41
|
+
* label or add a parameter. Throws when the challenge lacks the secret or a
|
|
42
|
+
* parameter the app needs (a guess would enroll codes the server refuses),
|
|
43
|
+
* or when issuer or account holds the colon the label separates them with.
|
|
44
|
+
*/
|
|
45
|
+
export function otpauthUri(challenge) {
|
|
46
|
+
const algorithm = ALGORITHMS[challenge.algorithm];
|
|
47
|
+
if (algorithm === undefined ||
|
|
48
|
+
challenge.digits === 0 ||
|
|
49
|
+
challenge.periodSeconds === 0 ||
|
|
50
|
+
challenge.sharedSecret.length === 0) {
|
|
51
|
+
throw new Error("the TOTP enrollment names no secret, algorithm, digits or period");
|
|
52
|
+
}
|
|
53
|
+
// Key URI Format, Label: the colon separates issuer and account, literal
|
|
54
|
+
// or %3A, so neither may contain one.
|
|
55
|
+
if (challenge.issuer.includes(":") || challenge.accountName.includes(":")) {
|
|
56
|
+
throw new Error("a TOTP issuer or account cannot contain a colon");
|
|
57
|
+
}
|
|
58
|
+
const issuer = component(challenge.issuer);
|
|
59
|
+
const label = `${issuer}:${component(challenge.accountName)}`;
|
|
60
|
+
return (`otpauth://totp/${label}?secret=${base32(challenge.sharedSecret)}` +
|
|
61
|
+
`&issuer=${issuer}&algorithm=${algorithm}` +
|
|
62
|
+
`&digits=${challenge.digits}&period=${challenge.periodSeconds}`);
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=totp.js.map
|
package/dist/totp.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"totp.js","sourceRoot":"","sources":["../src/totp.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,aAAa,EAAgC,MAAM,kCAAkC,CAAC;AAE/F,MAAM,QAAQ,GAAG,kCAAkC,CAAC;AAEpD,wDAAwD;AACxD,MAAM,UAAU,MAAM,CAAC,KAAiB;IACtC,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,KAAK,MAAM,IAAI,IAAI,KAAK,EA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C;QACD,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAC;IACtF,CAAC;IACD,yEAAyE;IACzE,sCAAsC;IACtC,IAAI,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC1E,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;IACrE,CAAC;IACD,MAAM,MAAM,GAAG,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC3C,MAAM,KAAK,GAAG,GAAG,MAAM,IAAI,SAAS,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,CAAC;IAC9D,OAAO,CACL,kBAAkB,KAAK,WAAW,MAAM,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE;QAClE,WAAW,MAAM,cAAc,SAAS,EAAE;QAC1C,WAAW,SAAS,CAAC,MAAM,WAAW,SAAS,CAAC,aAAa,EAAE,CAChE,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Presentation of a TOTP enrollment. The server sends the raw shared secret\n * and its parameters (`TotpEnrollmentChallenge`); an authenticator app takes\n * the Base32 secret typed in, or the `otpauth://totp` URI behind a QR code.\n */\nimport { TotpAlgorithm, type TotpEnrollmentChallenge } from \"./generated/sid/v1/authn/auth.js\";\n\nconst ALPHABET = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567\";\n\n/** `bytes` in Base32 (RFC 4648 §6), without padding. */\nexport function base32(bytes: Uint8Array): string {\n let out = \"\";\n let buffer = 0;\n let bits = 0;\n for (const byte of bytes) {\n buffer = ((buffer << 8) | byte) & 0xffff;\n bits += 8;\n while (bits >= 5) {\n bits -= 5;\n out += ALPHABET[(buffer >> bits) & 0x1f];\n }\n }\n if (bits > 0) {\n out += ALPHABET[(buffer << (5 - bits)) & 0x1f];\n }\n return out;\n}\n\n/**\n * `text` percent-encoded as a URI component: only RFC 3986 §2.3 unreserved\n * characters stay, as the Rust client encodes it.\n */\nfunction component(text: string): string {\n return encodeURIComponent(text).replace(\n /[!'()*]/g,\n (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`,\n );\n}\n\nconst ALGORITHMS: Partial<Record<TotpAlgorithm, string>> = {\n [TotpAlgorithm.SHA1]: \"SHA1\",\n [TotpAlgorithm.SHA256]: \"SHA256\",\n [TotpAlgorithm.SHA512]: \"SHA512\",\n};\n\n/**\n * The `otpauth://totp/<issuer>:<account>` URI of `challenge` (Key URI\n * Format), with issuer and account percent-encoded so neither can split the\n * label or add a parameter. Throws when the challenge lacks the secret or a\n * parameter the app needs (a guess would enroll codes the server refuses),\n * or when issuer or account holds the colon the label separates them with.\n */\nexport function otpauthUri(challenge: TotpEnrollmentChallenge): string {\n const algorithm = ALGORITHMS[challenge.algorithm];\n if (\n algorithm === undefined ||\n challenge.digits === 0 ||\n challenge.periodSeconds === 0 ||\n challenge.sharedSecret.length === 0\n ) {\n throw new Error(\"the TOTP enrollment names no secret, algorithm, digits or period\");\n }\n // Key URI Format, Label: the colon separates issuer and account, literal\n // or %3A, so neither may contain one.\n if (challenge.issuer.includes(\":\") || challenge.accountName.includes(\":\")) {\n throw new Error(\"a TOTP issuer or account cannot contain a colon\");\n }\n const issuer = component(challenge.issuer);\n const label = `${issuer}:${component(challenge.accountName)}`;\n return (\n `otpauth://totp/${label}?secret=${base32(challenge.sharedSecret)}` +\n `&issuer=${issuer}&algorithm=${algorithm}` +\n `&digits=${challenge.digits}&period=${challenge.periodSeconds}`\n );\n}\n"]}
|