@orangecheck/me-client 0.41.0 → 0.42.0
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/server.d.mts +12 -1
- package/dist/server.d.ts +12 -1
- package/dist/server.js +16 -0
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +18 -3
- package/dist/server.mjs.map +1 -1
- package/package.json +2 -2
package/dist/server.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { verifyOcToken as verifyOcToken$1,
|
|
1
|
+
import { verifyOcToken as verifyOcToken$1, checkOcToken as checkOcToken$1, readOcSessionToken, SAFE_METHODS, integratorRevocationCheck, bondMeets, readBondClaim } from '@orangecheck/auth-core';
|
|
2
2
|
export { bondMeets, readBondClaim } from '@orangecheck/auth-core';
|
|
3
3
|
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -870,6 +870,21 @@ async function verifyOcToken(token, options = {}) {
|
|
|
870
870
|
}
|
|
871
871
|
return session;
|
|
872
872
|
}
|
|
873
|
+
async function checkOcToken(token, options = {}) {
|
|
874
|
+
if (options === null || typeof options !== "object") {
|
|
875
|
+
throw new TypeError("@orangecheck/me-client: options must be an object");
|
|
876
|
+
}
|
|
877
|
+
const { requireHandle, ...core } = options;
|
|
878
|
+
checkRequireHandle(requireHandle);
|
|
879
|
+
const checked = await checkOcToken$1(token, core);
|
|
880
|
+
if (checked.status === "unavailable") return { status: "unavailable", reason: "key_set_unavailable" };
|
|
881
|
+
if (checked.status === "invalid") return { status: "invalid" };
|
|
882
|
+
if (lacksHandle(checked.session, requireHandle)) {
|
|
883
|
+
warnNoHandle(checked.session);
|
|
884
|
+
return { status: "invalid", reason: "no_session_handle" };
|
|
885
|
+
}
|
|
886
|
+
return { status: "valid", session: checked.session };
|
|
887
|
+
}
|
|
873
888
|
var sessionChecks = /* @__PURE__ */ new Map();
|
|
874
889
|
var warnedUnchecked = false;
|
|
875
890
|
function revocationFor(options) {
|
|
@@ -909,7 +924,7 @@ async function checkOcSession(headers, options = {}) {
|
|
|
909
924
|
const { issuer, jwksCacheTtlMs, jwksMaxStaleMs, audience } = options;
|
|
910
925
|
const token = readOcSessionToken(headers);
|
|
911
926
|
if (!token) return { status: "signed_out" };
|
|
912
|
-
const verified = await checkOcToken(token, { issuer, jwksCacheTtlMs, jwksMaxStaleMs, audience });
|
|
927
|
+
const verified = await checkOcToken$1(token, { issuer, jwksCacheTtlMs, jwksMaxStaleMs, audience });
|
|
913
928
|
if (verified.status === "unavailable") return { status: "unavailable", reason: "key_set_unavailable" };
|
|
914
929
|
if (verified.status === "invalid") {
|
|
915
930
|
if (options.audience === void 0) warnIfAudienceMissing(headers);
|
|
@@ -1161,6 +1176,6 @@ function ocAuthHono(options = {}) {
|
|
|
1161
1176
|
};
|
|
1162
1177
|
}
|
|
1163
1178
|
|
|
1164
|
-
export { BACK_ACCOUNT_URL, CONNECT_CONSENT_BLURB, CONNECT_CONSENT_LABEL, MemoryJtiStore, _resetSessionChecksForTests, checkOcSession, connectClaimLink, connectDelete, connectProvision, getOcSession, identity, ocAuthExpress, ocAuthHono, refreshEnvelopeJwks, revokeToken, spendOnce, verifyActivityAttestation, verifyOcToken, withOcAuth };
|
|
1179
|
+
export { BACK_ACCOUNT_URL, CONNECT_CONSENT_BLURB, CONNECT_CONSENT_LABEL, MemoryJtiStore, _resetSessionChecksForTests, checkOcSession, checkOcToken, connectClaimLink, connectDelete, connectProvision, getOcSession, identity, ocAuthExpress, ocAuthHono, refreshEnvelopeJwks, revokeToken, spendOnce, verifyActivityAttestation, verifyOcToken, withOcAuth };
|
|
1165
1180
|
//# sourceMappingURL=server.mjs.map
|
|
1166
1181
|
//# sourceMappingURL=server.mjs.map
|