@cauthyhq/node 1.3.0 → 1.3.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/CHANGELOG.md +15 -12
- package/README.md +0 -5
- package/dist/{cauthy-CsWUgyv_.d.mts → cauthy-DHRZLndK.d.mts} +0 -13
- package/dist/{cauthy-DHLBEuqP.d.ts → cauthy-JSYh7J2o.d.ts} +0 -13
- package/dist/express.d.mts +1 -1
- package/dist/express.d.ts +1 -1
- package/dist/fastify.d.mts +1 -1
- package/dist/fastify.d.ts +1 -1
- package/dist/hono.d.mts +1 -1
- package/dist/hono.d.ts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +0 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +0 -10
- package/dist/index.mjs.map +1 -1
- package/dist/next.d.mts +1 -1
- package/dist/next.d.ts +1 -1
- package/dist/testing.d.mts +3 -3
- package/dist/testing.d.ts +3 -3
- package/dist/testing.js +4 -4
- package/dist/testing.js.map +1 -1
- package/dist/testing.mjs +4 -4
- package/dist/testing.mjs.map +1 -1
- package/package.json +1 -2
package/dist/index.mjs
CHANGED
|
@@ -2044,15 +2044,6 @@ function redirect(location, cookies = []) {
|
|
|
2044
2044
|
function conditionalOf(c) {
|
|
2045
2045
|
return { resource: String(c?.resource ?? ""), action: String(c?.action ?? ""), effect: c?.effect === "deny" ? "deny" : "allow" };
|
|
2046
2046
|
}
|
|
2047
|
-
function refuseContracts(given) {
|
|
2048
|
-
const options = given;
|
|
2049
|
-
const set = [
|
|
2050
|
-
...["contract", "keys", "rootKey", "rootKeyPrevious"].filter((name) => options[name] !== void 0).map((name) => `the ${name} option`),
|
|
2051
|
-
...["PACT_ROOT_KEY", "PACT_ROOT_KEY_PREVIOUS"].filter((name) => (env3(name) ?? "") !== "")
|
|
2052
|
-
];
|
|
2053
|
-
if (set.length === 0) return;
|
|
2054
|
-
throw new CauthyConfigError(`contracts are retired: run on CAUTHY_KEY alone, and remove ${set.join(", ")}. An application without a key makes it on its card in Cauthy's dashboard; the same key keeps its people signed in. Protect sign-in with the "Protect sign-in" switches on that card. Sessions sealed with PACT_ROOT_KEY are no longer read.`);
|
|
2055
|
-
}
|
|
2056
2047
|
function byKey(given) {
|
|
2057
2048
|
const text = given.key ?? env3("CAUTHY_KEY");
|
|
2058
2049
|
if (text === void 0 || text === "") return void 0;
|
|
@@ -2105,7 +2096,6 @@ function toldUnopened() {
|
|
|
2105
2096
|
console.warn("@cauthyhq/node: a session cookie arrived that no key of this application opens; it was cleared and the person is signed out. Moving to CAUTHY_KEY, keep the secret that sealed the old sessions (CAUTHY_SECRET) beside it for the rotation window; rotating the key, set CAUTHY_KEY_PREVIOUS.");
|
|
2106
2097
|
}
|
|
2107
2098
|
function createCauthy(given = {}) {
|
|
2108
|
-
refuseContracts(given);
|
|
2109
2099
|
const keyed = byKey(given);
|
|
2110
2100
|
const issuer = withoutTrailingSlashes(keyed?.key.issuer ?? given.issuer ?? env3("CAUTHY_ISSUER") ?? "");
|
|
2111
2101
|
const clientId = keyed?.key.clientId ?? given.clientId ?? env3("CAUTHY_CLIENT_ID") ?? "";
|