@tideorg/js 0.13.22 → 0.13.23-staging
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.
|
@@ -4,10 +4,11 @@ export default class AuthRequest {
|
|
|
4
4
|
keyPub: string;
|
|
5
5
|
expiry: bigint;
|
|
6
6
|
sessionId: string;
|
|
7
|
-
|
|
7
|
+
dPoPApproval: string | undefined;
|
|
8
|
+
constructor(keyId: string, purpose: string, keyPub: string, expiry: bigint, sessionId?: string, dPopApproval?: string);
|
|
8
9
|
toUint8Array(): Uint8Array<ArrayBuffer>;
|
|
9
10
|
toString(): string;
|
|
10
|
-
static new(keyId: string, purpose: string, clientKey: string, expiry: bigint, sessionId?: string): AuthRequest;
|
|
11
|
+
static new(keyId: string, purpose: string, clientKey: string, expiry: bigint, sessionId?: string, clientDPoPKey?: string): AuthRequest;
|
|
11
12
|
static from(data: string): AuthRequest;
|
|
12
13
|
}
|
|
13
14
|
//# sourceMappingURL=AuthRequest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthRequest.d.ts","sourceRoot":"","sources":["../../Models/AuthRequest.ts"],"names":[],"mappings":"AAkBA,MAAM,CAAC,OAAO,OAAO,WAAW;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"AuthRequest.d.ts","sourceRoot":"","sources":["../../Models/AuthRequest.ts"],"names":[],"mappings":"AAkBA,MAAM,CAAC,OAAO,OAAO,WAAW;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;gBAErB,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAE,MAAa,EAAE,YAAY,GAAE,MAAa;IASjI,YAAY;IAGZ,QAAQ;IAYR,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAE,MAAa,EAAE,aAAa,GAAC,MAAa;IAInI,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM;CAI3B"}
|
|
@@ -16,12 +16,13 @@
|
|
|
16
16
|
//
|
|
17
17
|
import { StringToUint8Array } from "../Cryptide/Serialization";
|
|
18
18
|
export default class AuthRequest {
|
|
19
|
-
constructor(keyId, purpose, keyPub, expiry, sessionId = null) {
|
|
19
|
+
constructor(keyId, purpose, keyPub, expiry, sessionId = null, dPopApproval = null) {
|
|
20
20
|
this.keyId = keyId;
|
|
21
21
|
this.purpose = purpose;
|
|
22
22
|
this.keyPub = keyPub;
|
|
23
23
|
this.expiry = expiry; // in seconds
|
|
24
24
|
this.sessionId = sessionId;
|
|
25
|
+
this.dPoPApproval = dPopApproval;
|
|
25
26
|
}
|
|
26
27
|
toUint8Array() {
|
|
27
28
|
return StringToUint8Array(this.toString());
|
|
@@ -32,15 +33,16 @@ export default class AuthRequest {
|
|
|
32
33
|
'Purpose': this.purpose,
|
|
33
34
|
'Key': this.keyPub,
|
|
34
35
|
'Expiry': this.expiry.toString(),
|
|
35
|
-
'SessionId': !this.sessionId ? "" : this.sessionId // SessionId is optional (although mandatory for apps like keycloak)
|
|
36
|
+
'SessionId': !this.sessionId ? "" : this.sessionId, // SessionId is optional (although mandatory for apps like keycloak)
|
|
37
|
+
'DPoPApproval': this.dPoPApproval ? this.dPoPApproval : ""
|
|
36
38
|
};
|
|
37
39
|
return JSON.stringify(json);
|
|
38
40
|
}
|
|
39
|
-
static new(keyId, purpose, clientKey, expiry, sessionId = null) {
|
|
40
|
-
return new AuthRequest(keyId, purpose, clientKey, expiry, sessionId); // 30 seconds
|
|
41
|
+
static new(keyId, purpose, clientKey, expiry, sessionId = null, clientDPoPKey = null) {
|
|
42
|
+
return new AuthRequest(keyId, purpose, clientKey, expiry, sessionId, clientDPoPKey); // 30 seconds
|
|
41
43
|
}
|
|
42
44
|
static from(data) {
|
|
43
45
|
const json = JSON.parse(data);
|
|
44
|
-
return new AuthRequest(json.User, json.Purpose, json.Key, BigInt(json.Expiry), json.SessionId);
|
|
46
|
+
return new AuthRequest(json.User, json.Purpose, json.Key, BigInt(json.Expiry), json.SessionId, json.ClientDPoPKey);
|
|
45
47
|
}
|
|
46
48
|
}
|
package/package.json
CHANGED