@tangle-network/agent-integrations 0.53.49 → 0.53.50

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.
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  CONNECTOR_ADAPTER_FACTORIES,
3
3
  adapters_exports
4
- } from "./chunk-H5UCSRF4.js";
4
+ } from "./chunk-2JRYKWYX.js";
5
5
 
6
6
  // src/connectors/bundled-manifests.ts
7
7
  var MANIFEST_PROBE_PREFIX = "tangle-adapter-metadata-";
@@ -131,4 +131,4 @@ export {
131
131
  bundledApiKeyHint,
132
132
  bundledOAuth2Auth
133
133
  };
134
- //# sourceMappingURL=chunk-5UCHLQ3D.js.map
134
+ //# sourceMappingURL=chunk-EP6EDAPV.js.map
@@ -7,7 +7,7 @@ import {
7
7
  bundledAuthMode,
8
8
  bundledOAuth2Auth,
9
9
  getBundledAdapterManifest
10
- } from "./chunk-5UCHLQ3D.js";
10
+ } from "./chunk-EP6EDAPV.js";
11
11
 
12
12
  // src/specs/types.ts
13
13
  function specAuthToConnectorAuth(auth) {
@@ -1584,4 +1584,4 @@ export {
1584
1584
  validateCredentialFormat,
1585
1585
  validateCredentialSet
1586
1586
  };
1587
- //# sourceMappingURL=chunk-ZSXRS7D7.js.map
1587
+ //# sourceMappingURL=chunk-QE4WFYSK.js.map
@@ -7,14 +7,17 @@ import {
7
7
  canonicalIntegrationKind,
8
8
  integrationSpecToConnector,
9
9
  listIntegrationSpecs
10
- } from "./chunk-ZSXRS7D7.js";
10
+ } from "./chunk-QE4WFYSK.js";
11
11
  import {
12
12
  listBundledConnectorAdapters
13
- } from "./chunk-5UCHLQ3D.js";
13
+ } from "./chunk-EP6EDAPV.js";
14
14
  import {
15
15
  CONNECTOR_ADAPTER_FACTORIES,
16
- createOAuthTokenRequestHeaders
17
- } from "./chunk-H5UCSRF4.js";
16
+ createOAuthBasicAuthorizationHeader,
17
+ createOAuthTokenRequestHeaders,
18
+ oauthClientCredentialRedactionValues,
19
+ redactOAuthSensitiveText
20
+ } from "./chunk-2JRYKWYX.js";
18
21
 
19
22
  // src/activepieces-catalog.ts
20
23
  import { readFileSync } from "fs";
@@ -370,12 +373,6 @@ function createConnectorAdapterProvider(options) {
370
373
  const codeVerifier = pkce === "unsupported" ? void 0 : requirePkceVerifier(request.codeVerifier, request.connectorId);
371
374
  if (codeVerifier) body.set("code_verifier", codeVerifier);
372
375
  const headers = createOAuthTokenRequestHeaders(auth.tokenRequestHeaders);
373
- const redactionValues = [
374
- request.code,
375
- client.clientId,
376
- ...client.clientSecret ? [client.clientSecret] : [],
377
- ...codeVerifier ? [codeVerifier] : []
378
- ];
379
376
  if (tokenClientAuthMethod === "none") {
380
377
  body.set(
381
378
  resolveOAuthParameterName(
@@ -403,10 +400,22 @@ function createConnectorAdapterProvider(options) {
403
400
  client.clientSecret
404
401
  );
405
402
  } else {
406
- const authorization = `Basic ${base64Encode(`${client.clientId}:${client.clientSecret}`)}`;
403
+ const authorization = createOAuthBasicAuthorizationHeader(
404
+ client.clientId,
405
+ client.clientSecret,
406
+ base64Encode
407
+ );
407
408
  headers.authorization = authorization;
408
- redactionValues.push(authorization);
409
409
  }
410
+ const redactionValues = [
411
+ request.code,
412
+ ...codeVerifier ? [codeVerifier] : [],
413
+ ...oauthClientCredentialRedactionValues(
414
+ client.clientId,
415
+ client.clientSecret,
416
+ headers.authorization
417
+ )
418
+ ];
410
419
  const tokenUrl = resolveOAuthUrlTemplate(
411
420
  auth.tokenUrl,
412
421
  request.metadata,
@@ -420,7 +429,7 @@ function createConnectorAdapterProvider(options) {
420
429
  body
421
430
  });
422
431
  } catch (cause) {
423
- const detail = redactSensitiveText(
432
+ const detail = redactOAuthSensitiveText(
424
433
  cause?.message ?? "unknown",
425
434
  redactionValues
426
435
  );
@@ -431,10 +440,9 @@ function createConnectorAdapterProvider(options) {
431
440
  }
432
441
  if (!res.ok) {
433
442
  const text = await res.text().catch(() => "");
434
- const detail = redactSensitiveText(
435
- `${res.status} ${res.statusText} \u2014 ${text.slice(0, 200)}`,
436
- redactionValues
437
- );
443
+ const statusText = redactOAuthSensitiveText(res.statusText, redactionValues);
444
+ const redactedText = redactOAuthSensitiveText(text, redactionValues);
445
+ const detail = `${res.status} ${statusText} \u2014 ${redactedText.slice(0, 200)}`;
438
446
  throw new IntegrationError(
439
447
  `OAuth token exchange failed for ${request.connectorId}: ${detail}`,
440
448
  "provider_failure"
@@ -687,12 +695,6 @@ function base64Encode(value) {
687
695
  for (const byte of bytes) binary += String.fromCharCode(byte);
688
696
  return btoa2(binary);
689
697
  }
690
- function redactSensitiveText(text, secrets) {
691
- return secrets.filter((secret) => secret.length > 0).reduce(
692
- (redacted, secret) => redacted.split(secret).join("[REDACTED]"),
693
- text
694
- );
695
- }
696
698
  function resolveOAuthUrlTemplate(template, metadata, connectorId) {
697
699
  const placeholders = [...template.matchAll(/\{([A-Za-z][A-Za-z0-9_]*)\}/g)];
698
700
  let resolved = template;
@@ -4741,4 +4743,4 @@ export {
4741
4743
  signCapability,
4742
4744
  verifyCapabilityToken
4743
4745
  };
4744
- //# sourceMappingURL=chunk-GUZA3U6T.js.map
4746
+ //# sourceMappingURL=chunk-T3WH6MMA.js.map