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.
- package/README.md +10 -1
- package/dist/amqp/index.d.cts +3 -2
- package/dist/amqp/index.d.ts +3 -2
- package/dist/{authzCore-BQfX9qxN.d.cts → authzCore-CqXzLNmT.d.cts} +4 -3
- package/dist/{authzCore-BlSHwGnW.d.ts → authzCore-D-hquWSI.d.ts} +4 -3
- package/dist/browser/index.d.cts +8 -7
- package/dist/browser/index.d.ts +8 -7
- package/dist/{client-Putxo-yi.d.ts → client-BMNQi36J.d.ts} +28 -24
- package/dist/{client-7ZKtfXW-.d.cts → client-D34sXV8p.d.cts} +28 -24
- package/dist/{cookieJar-DkGcIr-i.d.cts → cookieJar-C_xPuniu.d.cts} +3 -3
- package/dist/{cookieJar-Cw6Zdeec.d.ts → cookieJar-DcrMe93Q.d.ts} +3 -3
- package/dist/{errors-DMIlw2lN.d.ts → errors-DZ3k8a8i.d.cts} +2 -1
- package/dist/{errors-DMIlw2lN.d.cts → errors-DZ3k8a8i.d.ts} +2 -1
- package/dist/{errors-VpViVRSx.d.ts → errors-RvGlTyUj.d.cts} +3 -2
- package/dist/{errors-CtP_lviy.d.cts → errors-dlGXAsbh.d.ts} +3 -2
- package/dist/grpc/index.d.cts +10 -9
- package/dist/grpc/index.d.ts +10 -9
- package/dist/grpc/index.js +36 -5
- package/dist/grpc/index.js.map +1 -1
- package/dist/grpc/index.mjs +36 -5
- package/dist/grpc/index.mjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +36 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +36 -5
- package/dist/index.mjs.map +1 -1
- package/dist/{jwks-BR55d7-Z.d.cts → jwks-CTVpOWzI.d.cts} +2 -1
- package/dist/{jwks-BR55d7-Z.d.ts → jwks-CTVpOWzI.d.ts} +2 -1
- package/dist/middleware/index.d.cts +13 -12
- package/dist/middleware/index.d.ts +13 -12
- package/dist/middleware/index.js +27 -9
- package/dist/middleware/index.js.map +1 -1
- package/dist/middleware/index.mjs +27 -9
- package/dist/middleware/index.mjs.map +1 -1
- package/dist/nestjs/index.d.cts +5 -4
- package/dist/nestjs/index.d.ts +5 -4
- package/dist/node/index.d.cts +10 -9
- package/dist/node/index.d.ts +10 -9
- package/dist/node/index.js +37 -6
- package/dist/node/index.js.map +1 -1
- package/dist/node/index.mjs +37 -6
- package/dist/node/index.mjs.map +1 -1
- package/dist/{oidcState-Cz6erz0g.d.cts → oidcState-BFIHt7_Y.d.cts} +5 -4
- package/dist/{oidcState-zGt6VU6v.d.ts → oidcState-qoy2vsYG.d.ts} +5 -4
- package/dist/rest/index.d.cts +10 -9
- package/dist/rest/index.d.ts +10 -9
- package/dist/rest/index.js +36 -5
- package/dist/rest/index.js.map +1 -1
- package/dist/rest/index.mjs +36 -5
- package/dist/rest/index.mjs.map +1 -1
- package/dist/{revocationFeed-CDoD7Twr.d.cts → revocationFeed-KQhvMMl8.d.cts} +2 -1
- package/dist/{revocationFeed-CDoD7Twr.d.ts → revocationFeed-KQhvMMl8.d.ts} +2 -1
- package/dist/{session-CeG6P9GO.d.ts → session-BbPFTpMZ.d.ts} +3 -2
- package/dist/{session-BmjEMowX.d.cts → session-C9WlP6DV.d.cts} +3 -2
- package/dist/{telemetry--0DwnNjV.d.cts → telemetry-Du0-zS5f.d.cts} +2 -1
- package/dist/{telemetry--0DwnNjV.d.ts → telemetry-Du0-zS5f.d.ts} +2 -1
- package/dist/{webauthnErrors-fLgfOflO.d.cts → webauthnErrors-m1LZiaRy.d.cts} +2 -1
- package/dist/{webauthnErrors-fLgfOflO.d.ts → webauthnErrors-m1LZiaRy.d.ts} +2 -1
- package/package.json +2 -2
package/dist/node/index.mjs
CHANGED
|
@@ -796,6 +796,9 @@ function installCsrfInterceptor(axiosInstance, session) {
|
|
|
796
796
|
if (session.isForeignHost(config.url)) {
|
|
797
797
|
return config;
|
|
798
798
|
}
|
|
799
|
+
if (isOAuth2Endpoint(config.url, session.baseUrl)) {
|
|
800
|
+
return config;
|
|
801
|
+
}
|
|
799
802
|
const method = (config.method ?? "get").toLowerCase();
|
|
800
803
|
const cookieString = typeof document !== "undefined" ? document.cookie : "";
|
|
801
804
|
const csrfToken = typeof document !== "undefined" ? csrfHeaderForMethod(method, cookieString) : csrfHeaderForMethod(method, session.csrfToken ? `axiam_csrf=${session.csrfToken}` : "");
|
|
@@ -849,23 +852,33 @@ function installRefreshInterceptor(axiosInstance, session) {
|
|
|
849
852
|
}
|
|
850
853
|
);
|
|
851
854
|
}
|
|
852
|
-
function isOAuth2Endpoint(url) {
|
|
855
|
+
function isOAuth2Endpoint(url, baseUrl) {
|
|
853
856
|
if (!url) {
|
|
854
857
|
return false;
|
|
855
858
|
}
|
|
856
|
-
|
|
857
|
-
|
|
859
|
+
try {
|
|
860
|
+
const base = new URL(baseUrl);
|
|
861
|
+
let path = new URL(url, base).pathname;
|
|
862
|
+
const prefix = base.pathname.replace(/\/+$/, "");
|
|
863
|
+
if (prefix !== "" && path.startsWith(`${prefix}/`)) {
|
|
864
|
+
path = path.slice(prefix.length);
|
|
865
|
+
}
|
|
866
|
+
return path.startsWith("/oauth2/");
|
|
867
|
+
} catch {
|
|
868
|
+
return false;
|
|
869
|
+
}
|
|
858
870
|
}
|
|
859
871
|
function installDeviceTokenInterceptor(axiosInstance, session) {
|
|
860
872
|
axiosInstance.interceptors.request.use((config) => {
|
|
861
873
|
const deviceToken = session.deviceAccessToken;
|
|
862
|
-
|
|
874
|
+
const oauth2 = isOAuth2Endpoint(config.url, session.baseUrl);
|
|
875
|
+
if (session.isForeignHost(config.url) || deviceToken === void 0 && !oauth2) {
|
|
863
876
|
return config;
|
|
864
877
|
}
|
|
865
878
|
const noCred = session.noCredentialsConfig();
|
|
866
879
|
Object.assign(config, noCred);
|
|
867
880
|
config.headers = config.headers ?? {};
|
|
868
|
-
if (
|
|
881
|
+
if (oauth2) {
|
|
869
882
|
return config;
|
|
870
883
|
}
|
|
871
884
|
config.headers["Authorization"] = `Bearer ${deviceToken.expose()}`;
|
|
@@ -2745,6 +2758,11 @@ function validateNetwork(network, problems) {
|
|
|
2745
2758
|
problems.push(`network segment ${q(profile.segment)} has more than one profile in the manifest`);
|
|
2746
2759
|
}
|
|
2747
2760
|
profiled.add(profile.segment);
|
|
2761
|
+
if (profile.terminationAction === null) {
|
|
2762
|
+
problems.push(
|
|
2763
|
+
`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)`
|
|
2764
|
+
);
|
|
2765
|
+
}
|
|
2748
2766
|
}
|
|
2749
2767
|
}
|
|
2750
2768
|
function duplicates(kind, keys, problems) {
|
|
@@ -3702,11 +3720,24 @@ function profileDrifted(spec, read) {
|
|
|
3702
3720
|
if (spec.serviceType !== void 0 && !sameOptional(spec.serviceType, read.service_type)) return true;
|
|
3703
3721
|
return false;
|
|
3704
3722
|
}
|
|
3723
|
+
var KNOWN_TERMINATION_ACTIONS = ["default", "radius_request"];
|
|
3724
|
+
var KNOWN_SERVICE_TYPES = ["framed_user"];
|
|
3725
|
+
function refuseUnknownCarried(member, stated, read, known) {
|
|
3726
|
+
if (stated !== void 0 || read == null || known.includes(read)) return;
|
|
3727
|
+
throw new ValidationError(
|
|
3728
|
+
"manifest.plan",
|
|
3729
|
+
400,
|
|
3730
|
+
`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)`,
|
|
3731
|
+
[{ field: member, message: `unknown value ${JSON.stringify(read)} on an unstated member` }]
|
|
3732
|
+
);
|
|
3733
|
+
}
|
|
3705
3734
|
function profileReplaceInput(spec, read) {
|
|
3706
3735
|
const profile = {
|
|
3707
3736
|
dictionary: read.dictionary,
|
|
3708
3737
|
session_timeout_secs: spec.sessionTimeoutSecs
|
|
3709
3738
|
};
|
|
3739
|
+
refuseUnknownCarried("termination_action", spec.terminationAction, read.termination_action, KNOWN_TERMINATION_ACTIONS);
|
|
3740
|
+
refuseUnknownCarried("service_type", spec.serviceType, read.service_type, KNOWN_SERVICE_TYPES);
|
|
3710
3741
|
const termination = spec.terminationAction === void 0 ? read.termination_action : spec.terminationAction;
|
|
3711
3742
|
if (termination != null) profile.termination_action = termination;
|
|
3712
3743
|
const idle = spec.idleTimeoutSecs === void 0 ? read.idle_timeout_secs : spec.idleTimeoutSecs;
|
|
@@ -10799,7 +10830,7 @@ var OidcClient = class {
|
|
|
10799
10830
|
this.#session.axios.interceptors.request.use((config) => {
|
|
10800
10831
|
const adopted = this.#adoptedCredential;
|
|
10801
10832
|
const url = config.url ?? "";
|
|
10802
|
-
if (!adopted || this.#session.isForeignHost(url) || url.
|
|
10833
|
+
if (!adopted || this.#session.isForeignHost(url) || isOAuth2Endpoint(url, this.#session.baseUrl)) {
|
|
10803
10834
|
return config;
|
|
10804
10835
|
}
|
|
10805
10836
|
config.headers = config.headers ?? {};
|