@unito/integration-cli 0.61.3 → 0.62.1
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/dist/boilerplate/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
lts/iron
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
# Build
|
|
5
5
|
#
|
|
6
6
|
|
|
7
|
-
FROM --platform=$BUILDPLATFORM public.ecr.aws/docker/library/node:20
|
|
7
|
+
FROM --platform=$BUILDPLATFORM public.ecr.aws/docker/library/node:20-alpine as build
|
|
8
8
|
|
|
9
9
|
WORKDIR /build
|
|
10
10
|
|
|
@@ -19,7 +19,7 @@ RUN npm run compile
|
|
|
19
19
|
# Runtime
|
|
20
20
|
#
|
|
21
21
|
|
|
22
|
-
FROM --platform=$TARGETPLATFORM public.ecr.aws/docker/library/node:20
|
|
22
|
+
FROM --platform=$TARGETPLATFORM public.ecr.aws/docker/library/node:20-alpine as runtime
|
|
23
23
|
|
|
24
24
|
WORKDIR /app
|
|
25
25
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "integration-boilerplate",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0
|
|
4
|
+
"version": "0.1.0",
|
|
5
5
|
"description": "Integration Boilerplate",
|
|
6
6
|
"license": "LicenseRef-LICENSE",
|
|
7
7
|
"scripts": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"email": "hello@unito.io"
|
|
21
21
|
},
|
|
22
22
|
"engines": {
|
|
23
|
-
"node": "20
|
|
23
|
+
"node": ">=20"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@unito/integration-sdk": "^1.x"
|
|
@@ -120,6 +120,11 @@ class OAuth2Service {
|
|
|
120
120
|
...(this.clientId && { client_id: this.clientId }),
|
|
121
121
|
...(this.clientSecret && { client_secret: this.clientSecret }),
|
|
122
122
|
};
|
|
123
|
+
if (this.grantType === configurationTypes_1.GrantType.JWT_BEARER && this.clientSecret) {
|
|
124
|
+
tokenRequestPayload.client_assertion = this.clientSecret;
|
|
125
|
+
tokenRequestPayload.client_assertion_type = 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer';
|
|
126
|
+
tokenRequestPayload.assertion = req.query.code;
|
|
127
|
+
}
|
|
123
128
|
const tokenRequestHeaders = {
|
|
124
129
|
'Content-Type': this.requestContentType,
|
|
125
130
|
...Object.fromEntries(Object.entries(this.tokenRequestParameters?.header ?? {}).map(([key, value]) => [
|
|
@@ -195,6 +200,12 @@ class OAuth2Service {
|
|
|
195
200
|
if (this.clientSecret) {
|
|
196
201
|
bodyData.client_secret = this.clientSecret;
|
|
197
202
|
}
|
|
203
|
+
if (this.grantType === configurationTypes_1.GrantType.JWT_BEARER && this.clientSecret) {
|
|
204
|
+
bodyData.client_assertion = this.clientSecret;
|
|
205
|
+
bodyData.assertion = refreshToken;
|
|
206
|
+
bodyData.client_assertion_type = 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer';
|
|
207
|
+
bodyData.redirect_uri = `${IntegrationsPlatformClient.Servers[this.environment]}/credentials/new/oauth2/callback-cli`;
|
|
208
|
+
}
|
|
198
209
|
try {
|
|
199
210
|
const tokenResponse = await fetch(this.tokenUrl, {
|
|
200
211
|
headers: {
|
package/oclif.manifest.json
CHANGED