itrm-tools 1.3.16-beta.11 → 1.3.16-beta.13
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.
|
@@ -32,8 +32,7 @@ class ServiceSessionManager {
|
|
|
32
32
|
if (await this.checkKeys()) {
|
|
33
33
|
if (this.authToken) {
|
|
34
34
|
const response = await RequestAxiosCall_1.RequestAxiosCall.post(`${this.sessionServiceUrl}/service/validate/token`, {
|
|
35
|
-
payload: this.encryptPayload(this.authToken),
|
|
36
|
-
name: this.service
|
|
35
|
+
payload: this.encryptPayload(`${this.application}:${this.service}:${this.authToken}`),
|
|
37
36
|
}, this.buildHeaders({
|
|
38
37
|
authorization: `${this.application} ${this.apiKeySigner.sign({
|
|
39
38
|
method: APIRequest_1.RequestMethod.POST,
|
|
@@ -46,24 +45,27 @@ class ServiceSessionManager {
|
|
|
46
45
|
Referer: this.encryptPayload(this.serviceReferer),
|
|
47
46
|
Authorization: `Bearer ${this.authToken}`,
|
|
48
47
|
Platform: this.platform,
|
|
49
|
-
|
|
48
|
+
Application: this.application,
|
|
49
|
+
Service: this.service,
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
const response = await RequestAxiosCall_1.RequestAxiosCall.get(`${this.sessionServiceUrl}/service/token?role=${encodeURIComponent(this.role)}&application=${encodeURIComponent(this.application)}&platform=${encodeURIComponent(this.platform)}&
|
|
54
|
+
const response = await RequestAxiosCall_1.RequestAxiosCall.get(`${this.sessionServiceUrl}/service/token?role=${encodeURIComponent(this.role)}&application=${encodeURIComponent(this.application)}&platform=${encodeURIComponent(this.platform)}&service=${encodeURIComponent(this.service)}`, this.buildHeaders({
|
|
55
55
|
authorization: `${this.application} ${this.apiKeySigner.sign({
|
|
56
56
|
method: APIRequest_1.RequestMethod.GET,
|
|
57
|
-
path: `/service/token?role=${encodeURIComponent(this.role)}&application=${encodeURIComponent(this.application)}&platform=${encodeURIComponent(this.platform)}&
|
|
57
|
+
path: `/service/token?role=${encodeURIComponent(this.role)}&application=${encodeURIComponent(this.application)}&platform=${encodeURIComponent(this.platform)}&service=${encodeURIComponent(this.service)}`,
|
|
58
58
|
}, this.keys)}`
|
|
59
59
|
}));
|
|
60
60
|
if (response.success) {
|
|
61
61
|
this.authToken = response.payload;
|
|
62
62
|
return {
|
|
63
63
|
headers: {
|
|
64
|
+
Referer: this.encryptPayload(this.serviceReferer),
|
|
64
65
|
Authorization: `Bearer ${response.payload}`,
|
|
65
66
|
Platform: this.platform,
|
|
66
|
-
|
|
67
|
+
Application: this.application,
|
|
68
|
+
Service: this.service,
|
|
67
69
|
},
|
|
68
70
|
};
|
|
69
71
|
}
|
|
@@ -77,15 +79,14 @@ class ServiceSessionManager {
|
|
|
77
79
|
return this.keys !== undefined;
|
|
78
80
|
}
|
|
79
81
|
async requestKeys() {
|
|
80
|
-
const response = await RequestAxiosCall_1.RequestAxiosCall.get(`${this.sessionServiceUrl}/service/credentials?
|
|
82
|
+
const response = await RequestAxiosCall_1.RequestAxiosCall.get(`${this.sessionServiceUrl}/service/credentials?service=${encodeURIComponent(this.service)}&application=${encodeURIComponent(this.application)}`, this.buildHeaders());
|
|
81
83
|
if (response.success)
|
|
82
84
|
this.keys = JSON.parse(this.decryptPayload(response.payload));
|
|
83
85
|
return this.keys;
|
|
84
86
|
}
|
|
85
87
|
async isCurrentKeysValid() {
|
|
86
88
|
const response = await RequestAxiosCall_1.RequestAxiosCall.post(`${this.sessionServiceUrl}/service/validate/credentials`, {
|
|
87
|
-
payload: this.encryptPayload(this.keys?.publicKey
|
|
88
|
-
name: this.service,
|
|
89
|
+
payload: this.encryptPayload(`${this.application}:${this.service}:${this.keys?.publicKey}`),
|
|
89
90
|
}, this.buildHeaders());
|
|
90
91
|
return response.success && response.payload;
|
|
91
92
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServiceSessionManager.js","sourceRoot":"","sources":["../../../../../src/api/request/crud/common/ServiceSessionManager.ts"],"names":[],"mappings":";;;AACA,oGAAiG;AACjG,6EAA0E;AAE1E,6DAA0D;AAE1D,oDAAoD;AAEpD,MAAa,qBAAqB;IACf,kBAAkB,CAAwB;IAC1C,YAAY,CAAe;IAC3B,cAAc,CAAS;IACvB,gBAAgB,CAAS;IACzB,iBAAiB,CAAS;IAC1B,OAAO,CAAS;IAChB,IAAI,CAAS;IACb,WAAW,CAAS;IACpB,QAAQ,CAAS;IAC1B,IAAI,CAAoB;IACxB,SAAS,CAAU;IAE3B,YACE,OAAe,EACf,IAAY,EACZ,WAAmB,EACnB,QAAgB,EAChB,OAAe,EACf,SAAiB,EACjB,iBAAyB;QAEzB,IAAI,CAAC,kBAAkB,GAAG,IAAI,6CAAqB,EAAE,CAAC;QACtD,IAAI,CAAC,YAAY,GAAG,IAAI,2BAAY,EAAE,CAAC;QACvC,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;QAC9B,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAC;QAClC,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC3C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAEM,KAAK,CAAC,cAAc;QACzB,IAAI,MAAM,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC;YAC3B,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;gBACnB,MAAM,QAAQ,GAAG,MAAM,mCAAgB,CAAC,IAAI,CAC1C,GAAG,IAAI,CAAC,iBAAiB,yBAAyB,EAClD;oBACE,OAAO,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"ServiceSessionManager.js","sourceRoot":"","sources":["../../../../../src/api/request/crud/common/ServiceSessionManager.ts"],"names":[],"mapp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