axiam-sdk 1.1.0 → 1.1.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.
Files changed (60) hide show
  1. package/README.md +10 -1
  2. package/dist/amqp/index.d.cts +3 -2
  3. package/dist/amqp/index.d.ts +3 -2
  4. package/dist/{authzCore-BQfX9qxN.d.cts → authzCore-CqXzLNmT.d.cts} +4 -3
  5. package/dist/{authzCore-BlSHwGnW.d.ts → authzCore-D-hquWSI.d.ts} +4 -3
  6. package/dist/browser/index.d.cts +8 -7
  7. package/dist/browser/index.d.ts +8 -7
  8. package/dist/{client-Putxo-yi.d.ts → client-BMNQi36J.d.ts} +28 -24
  9. package/dist/{client-7ZKtfXW-.d.cts → client-D34sXV8p.d.cts} +28 -24
  10. package/dist/{cookieJar-DkGcIr-i.d.cts → cookieJar-C_xPuniu.d.cts} +3 -3
  11. package/dist/{cookieJar-Cw6Zdeec.d.ts → cookieJar-DcrMe93Q.d.ts} +3 -3
  12. package/dist/{errors-DMIlw2lN.d.ts → errors-DZ3k8a8i.d.cts} +2 -1
  13. package/dist/{errors-DMIlw2lN.d.cts → errors-DZ3k8a8i.d.ts} +2 -1
  14. package/dist/{errors-VpViVRSx.d.ts → errors-RvGlTyUj.d.cts} +3 -2
  15. package/dist/{errors-CtP_lviy.d.cts → errors-dlGXAsbh.d.ts} +3 -2
  16. package/dist/grpc/index.d.cts +10 -9
  17. package/dist/grpc/index.d.ts +10 -9
  18. package/dist/grpc/index.js +36 -5
  19. package/dist/grpc/index.js.map +1 -1
  20. package/dist/grpc/index.mjs +36 -5
  21. package/dist/grpc/index.mjs.map +1 -1
  22. package/dist/index.d.cts +6 -6
  23. package/dist/index.d.ts +6 -6
  24. package/dist/index.js +36 -5
  25. package/dist/index.js.map +1 -1
  26. package/dist/index.mjs +36 -5
  27. package/dist/index.mjs.map +1 -1
  28. package/dist/{jwks-BR55d7-Z.d.cts → jwks-CTVpOWzI.d.cts} +2 -1
  29. package/dist/{jwks-BR55d7-Z.d.ts → jwks-CTVpOWzI.d.ts} +2 -1
  30. package/dist/middleware/index.d.cts +13 -12
  31. package/dist/middleware/index.d.ts +13 -12
  32. package/dist/middleware/index.js +27 -9
  33. package/dist/middleware/index.js.map +1 -1
  34. package/dist/middleware/index.mjs +27 -9
  35. package/dist/middleware/index.mjs.map +1 -1
  36. package/dist/nestjs/index.d.cts +5 -4
  37. package/dist/nestjs/index.d.ts +5 -4
  38. package/dist/node/index.d.cts +10 -9
  39. package/dist/node/index.d.ts +10 -9
  40. package/dist/node/index.js +37 -6
  41. package/dist/node/index.js.map +1 -1
  42. package/dist/node/index.mjs +37 -6
  43. package/dist/node/index.mjs.map +1 -1
  44. package/dist/{oidcState-Cz6erz0g.d.cts → oidcState-BFIHt7_Y.d.cts} +5 -4
  45. package/dist/{oidcState-zGt6VU6v.d.ts → oidcState-qoy2vsYG.d.ts} +5 -4
  46. package/dist/rest/index.d.cts +10 -9
  47. package/dist/rest/index.d.ts +10 -9
  48. package/dist/rest/index.js +36 -5
  49. package/dist/rest/index.js.map +1 -1
  50. package/dist/rest/index.mjs +36 -5
  51. package/dist/rest/index.mjs.map +1 -1
  52. package/dist/{revocationFeed-CDoD7Twr.d.cts → revocationFeed-KQhvMMl8.d.cts} +2 -1
  53. package/dist/{revocationFeed-CDoD7Twr.d.ts → revocationFeed-KQhvMMl8.d.ts} +2 -1
  54. package/dist/{session-CeG6P9GO.d.ts → session-BbPFTpMZ.d.ts} +3 -2
  55. package/dist/{session-BmjEMowX.d.cts → session-C9WlP6DV.d.cts} +3 -2
  56. package/dist/{telemetry--0DwnNjV.d.cts → telemetry-Du0-zS5f.d.cts} +2 -1
  57. package/dist/{telemetry--0DwnNjV.d.ts → telemetry-Du0-zS5f.d.ts} +2 -1
  58. package/dist/{webauthnErrors-fLgfOflO.d.cts → webauthnErrors-m1LZiaRy.d.cts} +2 -1
  59. package/dist/{webauthnErrors-fLgfOflO.d.ts → webauthnErrors-m1LZiaRy.d.ts} +2 -1
  60. package/package.json +2 -2
@@ -779,6 +779,9 @@ function installCsrfInterceptor(axiosInstance, session) {
779
779
  if (session.isForeignHost(config.url)) {
780
780
  return config;
781
781
  }
782
+ if (isOAuth2Endpoint(config.url, session.baseUrl)) {
783
+ return config;
784
+ }
782
785
  const method = (config.method ?? "get").toLowerCase();
783
786
  const cookieString = typeof document !== "undefined" ? document.cookie : "";
784
787
  const csrfToken = typeof document !== "undefined" ? csrfHeaderForMethod(method, cookieString) : csrfHeaderForMethod(method, session.csrfToken ? `axiam_csrf=${session.csrfToken}` : "");
@@ -832,23 +835,33 @@ function installRefreshInterceptor(axiosInstance, session) {
832
835
  }
833
836
  );
834
837
  }
835
- function isOAuth2Endpoint(url) {
838
+ function isOAuth2Endpoint(url, baseUrl) {
836
839
  if (!url) {
837
840
  return false;
838
841
  }
839
- const path = url.split(/[?#]/, 1)[0] ?? "";
840
- return path.includes("/oauth2/");
842
+ try {
843
+ const base = new URL(baseUrl);
844
+ let path = new URL(url, base).pathname;
845
+ const prefix = base.pathname.replace(/\/+$/, "");
846
+ if (prefix !== "" && path.startsWith(`${prefix}/`)) {
847
+ path = path.slice(prefix.length);
848
+ }
849
+ return path.startsWith("/oauth2/");
850
+ } catch {
851
+ return false;
852
+ }
841
853
  }
842
854
  function installDeviceTokenInterceptor(axiosInstance, session) {
843
855
  axiosInstance.interceptors.request.use((config) => {
844
856
  const deviceToken = session.deviceAccessToken;
845
- if (session.isForeignHost(config.url) || deviceToken === void 0) {
857
+ const oauth2 = isOAuth2Endpoint(config.url, session.baseUrl);
858
+ if (session.isForeignHost(config.url) || deviceToken === void 0 && !oauth2) {
846
859
  return config;
847
860
  }
848
861
  const noCred = session.noCredentialsConfig();
849
862
  Object.assign(config, noCred);
850
863
  config.headers = config.headers ?? {};
851
- if (isOAuth2Endpoint(config.url)) {
864
+ if (oauth2) {
852
865
  return config;
853
866
  }
854
867
  config.headers["Authorization"] = `Bearer ${deviceToken.expose()}`;
@@ -2754,6 +2767,11 @@ function validateNetwork(network, problems) {
2754
2767
  problems.push(`network segment ${q(profile.segment)} has more than one profile in the manifest`);
2755
2768
  }
2756
2769
  profiled.add(profile.segment);
2770
+ if (profile.terminationAction === null) {
2771
+ problems.push(
2772
+ `network profile of segment ${q(profile.segment)} states terminationAction as null; it has no "none" in a manifest (leave it out to keep the server default)`
2773
+ );
2774
+ }
2757
2775
  }
2758
2776
  }
2759
2777
  function duplicates(kind, keys, problems) {
@@ -3711,11 +3729,24 @@ function profileDrifted(spec, read) {
3711
3729
  if (spec.serviceType !== void 0 && !sameOptional(spec.serviceType, read.service_type)) return true;
3712
3730
  return false;
3713
3731
  }
3732
+ var KNOWN_TERMINATION_ACTIONS = ["default", "radius_request"];
3733
+ var KNOWN_SERVICE_TYPES = ["framed_user"];
3734
+ function refuseUnknownCarried(member, stated, read, known) {
3735
+ if (stated !== void 0 || read == null || known.includes(read)) return;
3736
+ throw new ValidationError(
3737
+ "manifest.plan",
3738
+ 400,
3739
+ `network profile: ${member} was read as ${JSON.stringify(read)}, a value this SDK does not know, and the manifest does not state it; state ${member} to update this profile (CONTRACT.md \xA727.6.2 item 4)`,
3740
+ [{ field: member, message: `unknown value ${JSON.stringify(read)} on an unstated member` }]
3741
+ );
3742
+ }
3714
3743
  function profileReplaceInput(spec, read) {
3715
3744
  const profile = {
3716
3745
  dictionary: read.dictionary,
3717
3746
  session_timeout_secs: spec.sessionTimeoutSecs
3718
3747
  };
3748
+ refuseUnknownCarried("termination_action", spec.terminationAction, read.termination_action, KNOWN_TERMINATION_ACTIONS);
3749
+ refuseUnknownCarried("service_type", spec.serviceType, read.service_type, KNOWN_SERVICE_TYPES);
3719
3750
  const termination = spec.terminationAction === void 0 ? read.termination_action : spec.terminationAction;
3720
3751
  if (termination != null) profile.termination_action = termination;
3721
3752
  const idle = spec.idleTimeoutSecs === void 0 ? read.idle_timeout_secs : spec.idleTimeoutSecs;