@camunda8/sdk 8.9.0-alpha.5 → 8.9.0-alpha.7
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/AGENT.md +417 -101
- package/CHANGELOG.md +25 -0
- package/MAINTAINER.md +205 -0
- package/dist/admin/lib/AdminApiClient.d.ts +146 -0
- package/dist/admin/lib/AdminApiClient.js +281 -0
- package/dist/admin/lib/AdminApiClient.js.map +1 -1
- package/dist/admin/lib/AdminDto.d.ts +133 -0
- package/dist/lib/GotErrors.d.ts +7 -0
- package/dist/lib/GotErrors.js +31 -1
- package/dist/lib/GotErrors.js.map +1 -1
- package/dist/oauth/lib/OAuthProvider.d.ts +1 -0
- package/dist/oauth/lib/OAuthProvider.js +126 -34
- package/dist/oauth/lib/OAuthProvider.js.map +1 -1
- package/dist/zeebe/lib/ZBWorkerBase.js +3 -0
- package/dist/zeebe/lib/ZBWorkerBase.js.map +1 -1
- package/dist/zeebe/lib/cancelProcesses.js +5 -5
- package/dist/zeebe/lib/cancelProcesses.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdminApiClient.js","sourceRoot":"","sources":["../../../src/admin/lib/AdminApiClient.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAqB;AACrB,8CAAqB;AAErB,mCAWkB;AAKlB,MAAM,KAAK,GAAG,IAAA,eAAC,EAAC,sBAAsB,CAAC,CAAA;AAEvC;;;GAGG;AACH,MAAa,cAAc;IAK1B,YAAY,OAGX;QACA,MAAM,MAAM,GAAG,oCAA8B,CAAC,0BAA0B,CACvE,OAAO,EAAE,MAAM,IAAI,EAAE,CACrB,CAAA;QACD,MAAM,SAAS,GAAG,IAAA,0BAAoB,EACrC,MAAM,CAAC,wBAAwB,EAC/B,0BAA0B,CAC1B,CAAA;QAED,IAAI,CAAC,aAAa;YACjB,OAAO,EAAE,aAAa;gBACtB,IAAA,4BAAsB,EAAC,MAAM,EAAE;o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|
|
|
96
96
|
roles: OrganizationRole[];
|
|
97
97
|
invitePending: boolean;
|
|
98
98
|
}
|
|
99
|
+
export interface MetaDto {
|
|
100
|
+
'web-modeler': string[];
|
|
101
|
+
}
|
|
102
|
+
export type CamundaClusterStage = 'dev' | 'test' | 'stage' | 'prod';
|
|
103
|
+
export interface UpdateClusterBody {
|
|
104
|
+
name?: string;
|
|
105
|
+
description?: string;
|
|
106
|
+
stageLabel?: CamundaClusterStage;
|
|
107
|
+
numberOfAllocatedHwPackages?: number;
|
|
108
|
+
}
|
|
109
|
+
export interface GenerationUpgradeForClusterDto {
|
|
110
|
+
cluster: {
|
|
111
|
+
id: string;
|
|
112
|
+
name: string;
|
|
113
|
+
};
|
|
114
|
+
oldGeneration: {
|
|
115
|
+
id: string;
|
|
116
|
+
name: string;
|
|
117
|
+
};
|
|
118
|
+
newGeneration: {
|
|
119
|
+
id: string;
|
|
120
|
+
name: string;
|
|
121
|
+
};
|
|
122
|
+
orgId: string;
|
|
123
|
+
}
|
|
124
|
+
export interface IpAllowListEntry {
|
|
125
|
+
description: string;
|
|
126
|
+
ip: string;
|
|
127
|
+
}
|
|
128
|
+
export interface ActivateSecureConnectivityBody {
|
|
129
|
+
allowedPrincipals: string[];
|
|
130
|
+
allowedRegions: string[];
|
|
131
|
+
}
|
|
132
|
+
export interface SecureConnectivityEndpointConnection {
|
|
133
|
+
state: string;
|
|
134
|
+
serviceId: string;
|
|
135
|
+
owner: string;
|
|
136
|
+
endpointId: string;
|
|
137
|
+
creationTimestamp: string;
|
|
138
|
+
}
|
|
139
|
+
export interface SecureConnectivityCondition {
|
|
140
|
+
lastTransitionTime: string;
|
|
141
|
+
observedGeneration: number;
|
|
142
|
+
message: string;
|
|
143
|
+
reason: string;
|
|
144
|
+
status: string;
|
|
145
|
+
type: string;
|
|
146
|
+
}
|
|
147
|
+
export interface SecureConnectivityDto {
|
|
148
|
+
status: {
|
|
149
|
+
urls: Record<string, unknown>;
|
|
150
|
+
observedGeneration: number;
|
|
151
|
+
endpointConnections: SecureConnectivityEndpointConnection[];
|
|
152
|
+
endpointConnectionCount: number;
|
|
153
|
+
endpoint: {
|
|
154
|
+
privateDnsName: string;
|
|
155
|
+
type: string;
|
|
156
|
+
serviceName: string;
|
|
157
|
+
region: string;
|
|
158
|
+
};
|
|
159
|
+
conditions: SecureConnectivityCondition[];
|
|
160
|
+
};
|
|
161
|
+
metadata: {
|
|
162
|
+
name: string;
|
|
163
|
+
labels: {
|
|
164
|
+
orgId: string;
|
|
165
|
+
};
|
|
166
|
+
namespace: string;
|
|
167
|
+
};
|
|
168
|
+
spec: {
|
|
169
|
+
allowedPrincipals: string[];
|
|
170
|
+
allowedRegions: string[];
|
|
171
|
+
cluster: {
|
|
172
|
+
id: string;
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
export interface SecureConnectivityStatusResponse {
|
|
177
|
+
status: SecureConnectivityDto | Record<string, never>;
|
|
178
|
+
}
|
|
179
|
+
export interface MonitoringClient {
|
|
180
|
+
uuid: string;
|
|
181
|
+
name: string;
|
|
182
|
+
username: string;
|
|
183
|
+
created: string;
|
|
184
|
+
lastUsed: string;
|
|
185
|
+
createdBy: string;
|
|
186
|
+
createdByName: string;
|
|
187
|
+
}
|
|
188
|
+
export interface CreatedMonitoringClient extends MonitoringClient {
|
|
189
|
+
password: string;
|
|
190
|
+
}
|
|
191
|
+
export interface MonitoringMetricsEndpoint {
|
|
192
|
+
target: string;
|
|
193
|
+
scheme: string;
|
|
194
|
+
path: string;
|
|
195
|
+
}
|
|
196
|
+
export interface MonitoringStatus {
|
|
197
|
+
metricsEndpoint: MonitoringMetricsEndpoint;
|
|
198
|
+
conditions: unknown[];
|
|
199
|
+
}
|
|
200
|
+
export interface MonitoringClientsResponse {
|
|
201
|
+
clients: MonitoringClient[];
|
|
202
|
+
status: MonitoringStatus | Record<string, never>;
|
|
203
|
+
}
|
|
204
|
+
export type BackupStatus = 'In progress' | 'Failed' | 'Complete' | '-';
|
|
205
|
+
export interface Backup {
|
|
206
|
+
uuid: string;
|
|
207
|
+
name: string;
|
|
208
|
+
created: string;
|
|
209
|
+
completed: string;
|
|
210
|
+
status: BackupStatus;
|
|
211
|
+
zeebeStatus: BackupStatus;
|
|
212
|
+
tasklistStatus: BackupStatus;
|
|
213
|
+
operateStatus: BackupStatus;
|
|
214
|
+
optimizeStatus: BackupStatus;
|
|
215
|
+
}
|
|
216
|
+
export type AuditType = 'c' | 'r' | 'u' | 'd';
|
|
217
|
+
export interface AuditEvent {
|
|
218
|
+
service: string;
|
|
219
|
+
orgId: string;
|
|
220
|
+
timestamp: number;
|
|
221
|
+
audit: string;
|
|
222
|
+
auditType: AuditType;
|
|
223
|
+
entity: string;
|
|
224
|
+
entityId: string;
|
|
225
|
+
userId: string;
|
|
226
|
+
parentEntity?: string;
|
|
227
|
+
parentEntityId?: string;
|
|
228
|
+
entityAttribute?: string;
|
|
229
|
+
entityAttributeValueFrom?: string;
|
|
230
|
+
entityAttributeValueTo?: string;
|
|
231
|
+
}
|
package/dist/lib/GotErrors.d.ts
CHANGED
|
@@ -18,6 +18,13 @@ export declare class HTTPError extends Got.HTTPError implements CamundaRestError
|
|
|
18
18
|
url?: string;
|
|
19
19
|
message: string;
|
|
20
20
|
});
|
|
21
|
+
/**
|
|
22
|
+
* Provides a rich string representation including method, URL, and response
|
|
23
|
+
* detail for debugging (e.g. console.log, uncaught exception traces) while
|
|
24
|
+
* keeping error.message static for error-monitoring grouping (Sentry, etc.).
|
|
25
|
+
* See: https://github.com/camunda/camunda-8-js-sdk/issues/658
|
|
26
|
+
*/
|
|
27
|
+
toString(): string;
|
|
21
28
|
}
|
|
22
29
|
export type RestError = HTTPError | Got.RequestError | Got.ReadError | Got.ParseError | Got.TimeoutError | Got.CancelError | Got.CacheError | Got.MaxRedirectsError | Got.UnsupportedProtocolError; /**
|
|
23
30
|
* This function adds the call point to the error stack trace of got errors.
|
package/dist/lib/GotErrors.js
CHANGED
|
@@ -71,6 +71,22 @@ class HTTPError extends Got.HTTPError {
|
|
|
71
71
|
this.message += ` - ${response.body}`;
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Provides a rich string representation including method, URL, and response
|
|
76
|
+
* detail for debugging (e.g. console.log, uncaught exception traces) while
|
|
77
|
+
* keeping error.message static for error-monitoring grouping (Sentry, etc.).
|
|
78
|
+
* See: https://github.com/camunda/camunda-8-js-sdk/issues/658
|
|
79
|
+
*/
|
|
80
|
+
toString() {
|
|
81
|
+
const parts = [this.message];
|
|
82
|
+
if (this.method || this.url) {
|
|
83
|
+
parts.push(`(${this.method ?? ''} ${this.url ?? ''})`);
|
|
84
|
+
}
|
|
85
|
+
if (this.detail) {
|
|
86
|
+
parts.push(this.detail);
|
|
87
|
+
}
|
|
88
|
+
return parts.join(' ');
|
|
89
|
+
}
|
|
74
90
|
}
|
|
75
91
|
exports.HTTPError = HTTPError;
|
|
76
92
|
const gotBeforeErrorHook = (config) => (error) => {
|
|
@@ -96,7 +112,18 @@ const gotBeforeErrorHook = (config) => (error) => {
|
|
|
96
112
|
}
|
|
97
113
|
const enhancedStack = error.options.context.stack?.split('\n');
|
|
98
114
|
error.source = enhancedStack ?? ['No enhanced stack trace available'];
|
|
99
|
-
|
|
115
|
+
// Attach request context as structured properties so error-monitoring
|
|
116
|
+
// tools (Sentry, Datadog, etc.) can group by the static error.message.
|
|
117
|
+
// See: https://github.com/camunda/camunda-8-js-sdk/issues/658
|
|
118
|
+
if (!(error instanceof HTTPError)) {
|
|
119
|
+
// HTTPError already has these from its constructor; for plain
|
|
120
|
+
// RequestErrors we attach them here.
|
|
121
|
+
;
|
|
122
|
+
error.method = method;
|
|
123
|
+
error.url = url;
|
|
124
|
+
error.detail =
|
|
125
|
+
typeof detail === 'string' ? detail : JSON.stringify(detail);
|
|
126
|
+
}
|
|
100
127
|
if (enhancedStack) {
|
|
101
128
|
error.message += `. Enhanced stack trace available as error.source.`;
|
|
102
129
|
}
|
|
@@ -141,6 +168,9 @@ const gotBeforeErrorHook = (config) => (error) => {
|
|
|
141
168
|
GotHooks_1.supportLogger.log({
|
|
142
169
|
code: error.code,
|
|
143
170
|
message: error.message,
|
|
171
|
+
method,
|
|
172
|
+
url,
|
|
173
|
+
detail,
|
|
144
174
|
stack: error.stack, // replaced stack
|
|
145
175
|
originalStack: error
|
|
146
176
|
.originalStack,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GotErrors.js","sourceRoot":"","sources":["../../src/lib/GotErrors.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA0B;AAC1B,6BAA8E;AAK9E,yCAA0C;AAE1C,MAAM,QAAQ,GAAqB;IAClC,MAAM,EAAE,CAAC;IACT,KAAK,EAAE,EAAE;IACT,MAAM,EAAE,EAAE;IACV,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE,aAAsB;CAC5B,CAAA;AACD,MAAa,SAAU,SAAQ,GAAG,CAAC,SAAS;IAU3C,YAAY,EACX,QAAQ,EACR,MAAM,EACN,GAAG,EACH,OAAO,GAMP;QACA,KAAK,CAAC,QAAQ,CAAC,CAAA;QAhBhB,SAAI,GAAG,aAAsB,CAAA;QAiB5B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,eAAe,GAAG,OAAO,CAAA;QAC9B,IAAI,OAAO,GAAG,QAAQ,CAAA;QACtB,IAAI,CAAC;YACJ,OAAO,GAAG,IAAI,CAAC,KAAK,CAAE,QAAQ,EAAE,IAAe,IAAI,IAAI,CAAC,CAAA;QACzD,CAAC;QAAC,MAAM,CAAC;YACR,2BAA2B;QAC5B,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,MAAM,CAAA;QAChC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAA;QAC1B,IAAI,CAAC,MAAM,GAAG,OAA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AO,IAAI,sDAAsD,CAAA;gBACxE,CAAC;YACF,CAAC;QACF,CAAC;IACF,CAAC;IAED,uDAAuD;IACvD,wBAAa,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAA;IAC3D,wBAAa,CAAC,GAAG,CAAC;QACjB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,MAAM;QACN,GAAG;QACH,MAAM;QACN,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,iBAAiB;QACrC,aAAa,EAAG,KAAmD;aACjE,aAAa;QACf,cAAc,EAAE,KAAK,CAAC,OAAO,EAAE,OAAO;QACtC,MAAM,EAAE,KAAK,CAAC,MAAM;KACpB,CAAC,CAAA;IACF,OAAO,KAAK,CAAA;AACb,CAAC,CAAA;AAjHW,QAAA,kBAAkB,sBAiH7B"}
|
|
@@ -81,6 +81,7 @@ export declare class OAuthProvider implements IHeadersProvider {
|
|
|
81
81
|
private getCachedTokenFileName;
|
|
82
82
|
private getAudience;
|
|
83
83
|
private addBearer;
|
|
84
|
+
private redactClientSecret;
|
|
84
85
|
static SAAS_401_COOLDOWN_MS: number;
|
|
85
86
|
/**
|
|
86
87
|
* Known Camunda SaaS OAuth hosts. Used for centralised SaaS detection.
|
|
@@ -49,6 +49,7 @@ const lib_1 = require("../../lib");
|
|
|
49
49
|
const trace = (0, debug_1.debug)('camunda:oauth');
|
|
50
50
|
const homedir = os.homedir();
|
|
51
51
|
const BACKOFF_TOKEN_ENDPOINT_FAILURE = 1000;
|
|
52
|
+
const TOKEN_ENDPOINT_REQUEST_TIMEOUT_MS = 30000;
|
|
52
53
|
/**
|
|
53
54
|
* The `OAuthProvider` class is an implementation of the {@link IHeadersProvider}
|
|
54
55
|
* interface that uses the OAuth 2.0 client credentials grant to authenticate
|
|
@@ -95,11 +96,10 @@ class OAuthProvider {
|
|
|
95
96
|
this.memoized401 = {};
|
|
96
97
|
/** Persistent tarpit flag files for SaaS 401 (keyed by clientId+secret+audience) */
|
|
97
98
|
this.tarpit401 = new Set();
|
|
98
|
-
this.getCacheKey = (audience) => `${
|
|
99
|
-
this.getCachedTokenFileName = (clientId, audience) =>
|
|
99
|
+
this.getCacheKey = (clientId, audience) => `${clientId}-${audience}`;
|
|
100
|
+
this.getCachedTokenFileName = (clientId, audience) => path_1.default.join(this.cacheDir, `oauth-token-${clientId}-${audience}.json`);
|
|
100
101
|
const config = lib_1.CamundaEnvironmentConfigurator.mergeConfigWithEnvironment(options?.config ?? {});
|
|
101
102
|
this.log = (0, C8Logger_1.getLogger)(config);
|
|
102
|
-
this.log = (0, C8Logger_1.getLogger)(config);
|
|
103
103
|
this.authServerUrl = (0, lib_1.RequireConfiguration)(config.CAMUNDA_OAUTH_URL, 'CAMUNDA_OAUTH_URL');
|
|
104
104
|
this.clientId = config.ZEEBE_CLIENT_ID;
|
|
105
105
|
this.clientSecret = config.ZEEBE_CLIENT_SECRET;
|
|
@@ -131,6 +131,9 @@ class OAuthProvider {
|
|
|
131
131
|
}
|
|
132
132
|
this.rest = (0, lib_1.GetCustomCertificateBuffer)(config).then((certificateAuthority) => got_1.default.extend({
|
|
133
133
|
retry: lib_1.GotRetryConfig,
|
|
134
|
+
timeout: {
|
|
135
|
+
request: TOKEN_ENDPOINT_REQUEST_TIMEOUT_MS,
|
|
136
|
+
},
|
|
134
137
|
https: {
|
|
135
138
|
certificateAuthority,
|
|
136
139
|
},
|
|
@@ -161,10 +164,28 @@ class OAuthProvider {
|
|
|
161
164
|
if (this.useFileCache) {
|
|
162
165
|
try {
|
|
163
166
|
if (!fs.existsSync(this.cacheDir)) {
|
|
167
|
+
// Mode 0o700: only the current user may read, write, or list the
|
|
168
|
+
// cached token files. See #737. (POSIX-only; Node ignores mode on
|
|
169
|
+
// Windows, where per-user profile ACLs already restrict access.)
|
|
164
170
|
fs.mkdirSync(this.cacheDir, {
|
|
165
171
|
recursive: true,
|
|
172
|
+
mode: 0o700,
|
|
166
173
|
});
|
|
167
174
|
}
|
|
175
|
+
else if (process.platform !== 'win32') {
|
|
176
|
+
// Tighten an existing cache directory that was created by an older
|
|
177
|
+
// SDK version (or by another process) with a wider mode. Only
|
|
178
|
+
// strip group/other bits — never widen the user's existing mode.
|
|
179
|
+
try {
|
|
180
|
+
const current = fs.statSync(this.cacheDir).mode;
|
|
181
|
+
if (current & 0o077) {
|
|
182
|
+
fs.chmodSync(this.cacheDir, current & ~0o077);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
catch (_) {
|
|
186
|
+
/* best-effort */
|
|
187
|
+
}
|
|
188
|
+
}
|
|
168
189
|
// Try to write a temporary file to the directory
|
|
169
190
|
const tempfilename = path_1.default.join(this.cacheDir, `${(0, crypto_1.randomUUID)()}.tmp`);
|
|
170
191
|
if (fs.existsSync(tempfilename)) {
|
|
@@ -197,7 +218,7 @@ class OAuthProvider {
|
|
|
197
218
|
OAuthProvider.instances.push(this);
|
|
198
219
|
}
|
|
199
220
|
async getHeaders(audienceType) {
|
|
200
|
-
(
|
|
221
|
+
trace(`Token request for ${audienceType}`);
|
|
201
222
|
// We use the Console credential set if it we are requesting from
|
|
202
223
|
// the SaaS OAuth endpoint, and it is a Modeler or Admin Console token.
|
|
203
224
|
// Otherwise we use the application credential set, unless a Console credential set exists.
|
|
@@ -210,12 +231,12 @@ class OAuthProvider {
|
|
|
210
231
|
const clientSecretToUse = requestingFromSaaSConsole
|
|
211
232
|
? (0, lib_1.RequireConfiguration)(this.consoleClientSecret, 'CAMUNDA_CONSOLE_CLIENT_SECRET')
|
|
212
233
|
: (0, lib_1.RequireConfiguration)(this.clientSecret, 'ZEEBE_CLIENT_SECRET');
|
|
213
|
-
const key = this.getCacheKey(audienceType);
|
|
234
|
+
const key = this.getCacheKey(clientIdToUse, audienceType);
|
|
214
235
|
if (this.tokenCache[key]) {
|
|
215
236
|
const token = this.tokenCache[key];
|
|
216
237
|
// check expiry and evict in-memory and file cache if expired
|
|
217
238
|
if (this.isExpired(token)) {
|
|
218
|
-
this.evictFromMemoryCache(audienceType);
|
|
239
|
+
this.evictFromMemoryCache(audienceType, clientIdToUse);
|
|
219
240
|
trace(`In-memory token ${token.audience} is expired`);
|
|
220
241
|
}
|
|
221
242
|
else {
|
|
@@ -324,13 +345,33 @@ class OAuthProvider {
|
|
|
324
345
|
this.tokenCache = {};
|
|
325
346
|
}
|
|
326
347
|
flushFileCache() {
|
|
327
|
-
if (this.useFileCache) {
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
348
|
+
if (!this.useFileCache) {
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
try {
|
|
352
|
+
fs.readdirSync(this.cacheDir)
|
|
353
|
+
.filter((file) => file.startsWith('oauth-token-') && file.endsWith('.json'))
|
|
354
|
+
.forEach((file) => {
|
|
355
|
+
const filePath = path_1.default.join(this.cacheDir, file);
|
|
356
|
+
try {
|
|
357
|
+
fs.unlinkSync(filePath);
|
|
358
|
+
}
|
|
359
|
+
catch (e) {
|
|
360
|
+
const err = e;
|
|
361
|
+
if (err.code !== 'ENOENT') {
|
|
362
|
+
this.log.warn(`Failed to delete token cache file ${filePath}`);
|
|
363
|
+
this.log.warn(err.message, err);
|
|
364
|
+
}
|
|
331
365
|
}
|
|
332
366
|
});
|
|
333
367
|
}
|
|
368
|
+
catch (e) {
|
|
369
|
+
const err = e;
|
|
370
|
+
if (err.code !== 'ENOENT') {
|
|
371
|
+
this.log.warn(`Failed to list OAuth token cache dir ${this.cacheDir}`);
|
|
372
|
+
this.log.warn(err.message, err);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
334
375
|
}
|
|
335
376
|
/** Camunda SaaS needs an audience for a Modeler token request, and Self-Managed does not. */
|
|
336
377
|
addAudienceIfNeeded(audienceType) {
|
|
@@ -367,7 +408,10 @@ class OAuthProvider {
|
|
|
367
408
|
};
|
|
368
409
|
trace(`Making token request to the token endpoint: `);
|
|
369
410
|
trace(` ${this.authServerUrl}`);
|
|
370
|
-
trace(
|
|
411
|
+
trace({
|
|
412
|
+
...options,
|
|
413
|
+
body: this.redactClientSecret(bodyWithScope),
|
|
414
|
+
});
|
|
371
415
|
return this.rest.then((rest) => rest
|
|
372
416
|
.post(this.authServerUrl, options)
|
|
373
417
|
.then((res) => {
|
|
@@ -380,18 +424,18 @@ class OAuthProvider {
|
|
|
380
424
|
})
|
|
381
425
|
.catch((e) => {
|
|
382
426
|
e.message = `Error requesting token for Client Id ${clientIdToUse}: ${e.message}`;
|
|
383
|
-
this.log.error(`Error requesting token for Client Id ${clientIdToUse}`);
|
|
384
427
|
this.log.error(e);
|
|
385
428
|
throw e;
|
|
386
429
|
})
|
|
387
430
|
.then((t) => {
|
|
388
|
-
trace(`Got token for Client Id ${clientIdToUse}: ${JSON.stringify(t, null, 2)}`);
|
|
431
|
+
trace(`Got token for Client Id ${clientIdToUse}: ${JSON.stringify({ ...t, access_token: '[REDACTED]' }, null, 2)}`);
|
|
389
432
|
const isTokenError = (t) => !!t.error;
|
|
390
433
|
if (isTokenError(t)) {
|
|
391
434
|
throw new Error(`Failed to get token: ${t.error} - ${t.error_description}`);
|
|
392
435
|
}
|
|
393
436
|
if (t.access_token === undefined) {
|
|
394
|
-
|
|
437
|
+
this.log.error(`Failed to get token: no access_token in response for audience ${audienceType}`);
|
|
438
|
+
this.log.error(JSON.stringify(t));
|
|
395
439
|
throw new Error('Failed to get token: no access_token in response');
|
|
396
440
|
}
|
|
397
441
|
const token = { ...t, audience: audienceType };
|
|
@@ -402,23 +446,27 @@ class OAuthProvider {
|
|
|
402
446
|
clientId: clientIdToUse,
|
|
403
447
|
});
|
|
404
448
|
}
|
|
405
|
-
this.sendToMemoryCache({
|
|
449
|
+
this.sendToMemoryCache({
|
|
450
|
+
audience: audienceType,
|
|
451
|
+
token,
|
|
452
|
+
clientId: clientIdToUse,
|
|
453
|
+
});
|
|
406
454
|
return this.addBearer(token.access_token);
|
|
407
455
|
}));
|
|
408
456
|
}
|
|
409
|
-
sendToMemoryCache({ audience, token, }) {
|
|
410
|
-
const key = this.getCacheKey(audience);
|
|
457
|
+
sendToMemoryCache({ audience, token, clientId, }) {
|
|
458
|
+
const key = this.getCacheKey(clientId, audience);
|
|
411
459
|
try {
|
|
412
460
|
const decoded = (0, jwt_decode_1.jwtDecode)(token.access_token);
|
|
413
461
|
// Keeping this in the code base to help with debugging
|
|
414
462
|
// trace(`Caching token in memory: ${JSON.stringify(decoded, null, 2)}`)
|
|
415
463
|
trace(`Caching token for ${audience} in memory. Expiry: ${decoded.exp}`);
|
|
416
|
-
|
|
417
|
-
this.tokenCache[key] = token;
|
|
464
|
+
this.tokenCache[key] = { ...token, expiry: decoded.exp ?? 0 };
|
|
418
465
|
}
|
|
419
466
|
catch (e) {
|
|
420
|
-
|
|
421
|
-
|
|
467
|
+
const err = e;
|
|
468
|
+
this.log.error(`Failed to cache token in memory for audience ${audience}`);
|
|
469
|
+
this.log.error(err.message, err);
|
|
422
470
|
throw e;
|
|
423
471
|
}
|
|
424
472
|
}
|
|
@@ -432,39 +480,80 @@ class OAuthProvider {
|
|
|
432
480
|
}
|
|
433
481
|
try {
|
|
434
482
|
trace(`Reading file cached token for ${audience}`);
|
|
435
|
-
|
|
483
|
+
// If the file was created by an older SDK with a wider mode (e.g.
|
|
484
|
+
// 0o644), tighten it now. Only strip group/other bits — never widen
|
|
485
|
+
// the user's existing mode. POSIX-only. See #737.
|
|
486
|
+
if (process.platform !== 'win32') {
|
|
487
|
+
try {
|
|
488
|
+
const current = fs.statSync(tokenFileName).mode;
|
|
489
|
+
if (current & 0o077) {
|
|
490
|
+
fs.chmodSync(tokenFileName, current & ~0o077);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
catch (_) {
|
|
494
|
+
/* best-effort */
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
token = JSON.parse(fs.readFileSync(tokenFileName, 'utf8'));
|
|
436
498
|
trace(`Retrieved token from file cache`);
|
|
437
499
|
if (this.isExpired(token)) {
|
|
438
500
|
trace(`File cached token is expired`);
|
|
439
501
|
return null;
|
|
440
502
|
}
|
|
441
|
-
this.sendToMemoryCache({ audience, token });
|
|
503
|
+
this.sendToMemoryCache({ audience, token, clientId });
|
|
442
504
|
return token;
|
|
443
505
|
}
|
|
444
|
-
catch (
|
|
506
|
+
catch (e) {
|
|
507
|
+
const err = e;
|
|
508
|
+
trace(`Failed to read token from file cache for audience ${audience}: ${err.message}`);
|
|
509
|
+
this.log.warn(`Failed to read token from file cache for audience ${audience}. Ignoring cache entry.`);
|
|
510
|
+
this.log.warn(err.message, err);
|
|
445
511
|
return null;
|
|
446
512
|
}
|
|
447
513
|
}
|
|
448
514
|
sendToFileCache({ audience, token, clientId, }) {
|
|
449
515
|
const file = this.getCachedTokenFileName(clientId, audience);
|
|
450
|
-
|
|
516
|
+
let decoded;
|
|
517
|
+
try {
|
|
518
|
+
decoded = (0, jwt_decode_1.jwtDecode)(token.access_token);
|
|
519
|
+
}
|
|
520
|
+
catch (e) {
|
|
521
|
+
const err = e;
|
|
522
|
+
this.log.warn(`Failed to decode OAuth token before writing to file cache for audience ${audience}`);
|
|
523
|
+
this.log.warn(err.message, err);
|
|
524
|
+
return;
|
|
525
|
+
}
|
|
451
526
|
fs.writeFile(file, JSON.stringify({
|
|
452
527
|
...token,
|
|
453
528
|
expiry: decoded.exp ?? 0,
|
|
454
|
-
}),
|
|
529
|
+
}),
|
|
530
|
+
// Mode 0o600: bearer tokens are confidentiality-class secrets and
|
|
531
|
+
// must not be readable by other local users. See #737.
|
|
532
|
+
{ mode: 0o600 }, (e) => {
|
|
455
533
|
if (!e) {
|
|
456
534
|
trace(`Wrote OAuth token to file ${file}`);
|
|
535
|
+
// If the file already existed with a wider mode (older SDK or
|
|
536
|
+
// external process), {mode} on writeFile only affects creation.
|
|
537
|
+
// Strip group/other bits without widening user bits. POSIX-only.
|
|
538
|
+
if (process.platform !== 'win32') {
|
|
539
|
+
try {
|
|
540
|
+
const current = fs.statSync(file).mode;
|
|
541
|
+
if (current & 0o077) {
|
|
542
|
+
fs.chmodSync(file, current & ~0o077);
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
catch (_) {
|
|
546
|
+
/* best-effort */
|
|
547
|
+
}
|
|
548
|
+
}
|
|
457
549
|
return;
|
|
458
550
|
}
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
// tslint:disable-next-line
|
|
462
|
-
console.error(e);
|
|
551
|
+
this.log.error(`Error writing OAuth token to file ${file}`);
|
|
552
|
+
this.log.error(e.message, e);
|
|
463
553
|
});
|
|
464
554
|
}
|
|
465
555
|
isExpired(token) {
|
|
466
|
-
const
|
|
467
|
-
const currentTime = d.setSeconds(d.getSeconds());
|
|
556
|
+
const currentTime = Date.now();
|
|
468
557
|
// token.expiry is seconds since Unix Epoch
|
|
469
558
|
// The Date constructor expects milliseconds since Unix Epoch
|
|
470
559
|
const tokenExpiryMs = token.expiry * 1000;
|
|
@@ -477,8 +566,8 @@ class OAuthProvider {
|
|
|
477
566
|
const tokenIsExpired = currentTime >= tokenExpiryMs - this.refreshWindow;
|
|
478
567
|
return tokenIsExpired;
|
|
479
568
|
}
|
|
480
|
-
evictFromMemoryCache(audience) {
|
|
481
|
-
const key = this.getCacheKey(audience);
|
|
569
|
+
evictFromMemoryCache(audience, clientId) {
|
|
570
|
+
const key = this.getCacheKey(clientId, audience);
|
|
482
571
|
delete this.tokenCache[key];
|
|
483
572
|
}
|
|
484
573
|
evictFromFileCache({ audienceType, clientId, }) {
|
|
@@ -493,6 +582,9 @@ class OAuthProvider {
|
|
|
493
582
|
addBearer(token) {
|
|
494
583
|
return { authorization: `Bearer ${token}` };
|
|
495
584
|
}
|
|
585
|
+
redactClientSecret(body) {
|
|
586
|
+
return body.replace(/(client_secret=)[^&]*/g, '$1[REDACTED]');
|
|
587
|
+
}
|
|
496
588
|
/**
|
|
497
589
|
* Determines whether the given OAuth URL belongs to a Camunda SaaS environment.
|
|
498
590
|
* Normalises the URL by stripping trailing slashes, query params, and fragments
|