@eventuras/fides-auth 0.3.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/LICENSE +21 -0
- package/README.md +311 -0
- package/dist/build-CNL3v39v.js +977 -0
- package/dist/decode_jwt-1J26fl4I.js +25 -0
- package/dist/decrypt-Cahlu_6Y.js +92 -0
- package/dist/deflate-koSuX7FB.js +1015 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/logger.d.ts +83 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +46 -0
- package/dist/oauth-browser.d.ts +62 -0
- package/dist/oauth-browser.d.ts.map +1 -0
- package/dist/oauth-browser.js +49 -0
- package/dist/oauth.d.ts +145 -0
- package/dist/oauth.d.ts.map +1 -0
- package/dist/oauth.js +165 -0
- package/dist/providers/vipps/client.d.ts +62 -0
- package/dist/providers/vipps/client.d.ts.map +1 -0
- package/dist/providers/vipps/index.d.ts +11 -0
- package/dist/providers/vipps/index.d.ts.map +1 -0
- package/dist/providers/vipps/index.js +120 -0
- package/dist/providers/vipps/types.d.ts +107 -0
- package/dist/providers/vipps/types.d.ts.map +1 -0
- package/dist/rate-limit.d.ts +28 -0
- package/dist/rate-limit.d.ts.map +1 -0
- package/dist/rate-limit.js +26 -0
- package/dist/session-refresh.d.ts +13 -0
- package/dist/session-refresh.d.ts.map +1 -0
- package/dist/session-refresh.js +27 -0
- package/dist/session-validation-BxObT3wC.js +66 -0
- package/dist/session-validation.d.ts +24 -0
- package/dist/session-validation.d.ts.map +1 -0
- package/dist/session-validation.js +2 -0
- package/dist/silent-login.d.ts +103 -0
- package/dist/silent-login.d.ts.map +1 -0
- package/dist/silent-login.js +50 -0
- package/dist/types.d.ts +24 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +0 -0
- package/dist/utils-ByMRF7b2.js +379 -0
- package/dist/utils.d.ts +83 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +2 -0
- package/package.json +101 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { S as e, T as t, l as n, x as r } from "./deflate-koSuX7FB.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/jose@6.2.2/node_modules/jose/dist/webapi/util/decode_jwt.js
|
|
3
|
+
function i(i) {
|
|
4
|
+
if (typeof i != "string") throw new r("JWTs must use Compact JWS serialization, JWT must be a string");
|
|
5
|
+
let { 1: a, length: o } = i.split(".");
|
|
6
|
+
if (o === 5) throw new r("Only JWTs using Compact JWS serialization can be decoded");
|
|
7
|
+
if (o !== 3) throw new r("Invalid JWT");
|
|
8
|
+
if (!a) throw new r("JWTs must contain a payload");
|
|
9
|
+
let s;
|
|
10
|
+
try {
|
|
11
|
+
s = e(a);
|
|
12
|
+
} catch {
|
|
13
|
+
throw new r("Failed to base64url decode the payload");
|
|
14
|
+
}
|
|
15
|
+
let c;
|
|
16
|
+
try {
|
|
17
|
+
c = JSON.parse(t.decode(s));
|
|
18
|
+
} catch {
|
|
19
|
+
throw new r("Failed to parse the decoded payload as JSON");
|
|
20
|
+
}
|
|
21
|
+
if (!n(c)) throw new r("Invalid JWT Claims Set");
|
|
22
|
+
return c;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { i as t };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { E as e, S as t, T as n, _ as r, a as i, c as a, d as o, g as s, h as c, i as l, l as u, n as d, p as f, r as p, s as m, v as h, w as g } from "./deflate-koSuX7FB.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/jose@6.2.2/node_modules/jose/dist/webapi/lib/validate_algorithms.js
|
|
3
|
+
function _(e, t) {
|
|
4
|
+
if (t !== void 0 && (!Array.isArray(t) || t.some((e) => typeof e != "string"))) throw TypeError(`"${e}" option must be an array of strings`);
|
|
5
|
+
if (t) return new Set(t);
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region ../../node_modules/.pnpm/jose@6.2.2/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js
|
|
9
|
+
async function v(v, y, b) {
|
|
10
|
+
if (!u(v)) throw new h("Flattened JWE must be an object");
|
|
11
|
+
if (v.protected === void 0 && v.header === void 0 && v.unprotected === void 0) throw new h("JOSE Header missing");
|
|
12
|
+
if (v.iv !== void 0 && typeof v.iv != "string") throw new h("JWE Initialization Vector incorrect type");
|
|
13
|
+
if (typeof v.ciphertext != "string") throw new h("JWE Ciphertext missing or incorrect type");
|
|
14
|
+
if (v.tag !== void 0 && typeof v.tag != "string") throw new h("JWE Authentication Tag incorrect type");
|
|
15
|
+
if (v.protected !== void 0 && typeof v.protected != "string") throw new h("JWE Protected Header incorrect type");
|
|
16
|
+
if (v.encrypted_key !== void 0 && typeof v.encrypted_key != "string") throw new h("JWE Encrypted Key incorrect type");
|
|
17
|
+
if (v.aad !== void 0 && typeof v.aad != "string") throw new h("JWE AAD incorrect type");
|
|
18
|
+
if (v.header !== void 0 && !u(v.header)) throw new h("JWE Shared Unprotected Header incorrect type");
|
|
19
|
+
if (v.unprotected !== void 0 && !u(v.unprotected)) throw new h("JWE Per-Recipient Unprotected Header incorrect type");
|
|
20
|
+
let x;
|
|
21
|
+
if (v.protected) try {
|
|
22
|
+
let e = t(v.protected);
|
|
23
|
+
x = JSON.parse(n.decode(e));
|
|
24
|
+
} catch {
|
|
25
|
+
throw new h("JWE Protected Header is invalid");
|
|
26
|
+
}
|
|
27
|
+
if (!a(x, v.header, v.unprotected)) throw new h("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");
|
|
28
|
+
let S = {
|
|
29
|
+
...x,
|
|
30
|
+
...v.header,
|
|
31
|
+
...v.unprotected
|
|
32
|
+
};
|
|
33
|
+
if (l(h, /* @__PURE__ */ new Map(), b?.crit, x, S), S.zip !== void 0 && S.zip !== "DEF") throw new r("Unsupported JWE \"zip\" (Compression Algorithm) Header Parameter value.");
|
|
34
|
+
if (S.zip !== void 0 && !x?.zip) throw new h("JWE \"zip\" (Compression Algorithm) Header Parameter MUST be in a protected header.");
|
|
35
|
+
let { alg: C, enc: w } = S;
|
|
36
|
+
if (typeof C != "string" || !C) throw new h("missing JWE Algorithm (alg) in JWE Header");
|
|
37
|
+
if (typeof w != "string" || !w) throw new h("missing JWE Encryption Algorithm (enc) in JWE Header");
|
|
38
|
+
let T = b && _("keyManagementAlgorithms", b.keyManagementAlgorithms), E = b && _("contentEncryptionAlgorithms", b.contentEncryptionAlgorithms);
|
|
39
|
+
if (T && !T.has(C) || !T && C.startsWith("PBES2")) throw new s("\"alg\" (Algorithm) Header Parameter value not allowed");
|
|
40
|
+
if (E && !E.has(w)) throw new s("\"enc\" (Encryption Algorithm) Header Parameter value not allowed");
|
|
41
|
+
let D;
|
|
42
|
+
v.encrypted_key !== void 0 && (D = o(v.encrypted_key, "encrypted_key", h));
|
|
43
|
+
let O = !1;
|
|
44
|
+
typeof y == "function" && (y = await y(x, v), O = !0), p(C === "dir" ? w : C, y, "decrypt");
|
|
45
|
+
let k = await m(y, C), A;
|
|
46
|
+
try {
|
|
47
|
+
A = await i(C, k, D, S, b);
|
|
48
|
+
} catch (e) {
|
|
49
|
+
if (e instanceof TypeError || e instanceof h || e instanceof r) throw e;
|
|
50
|
+
A = c(w);
|
|
51
|
+
}
|
|
52
|
+
let j, M;
|
|
53
|
+
v.iv !== void 0 && (j = o(v.iv, "iv", h)), v.tag !== void 0 && (M = o(v.tag, "tag", h));
|
|
54
|
+
let N = v.protected === void 0 ? new Uint8Array() : e(v.protected), P;
|
|
55
|
+
P = v.aad === void 0 ? N : g(N, e("."), e(v.aad));
|
|
56
|
+
let F = o(v.ciphertext, "ciphertext", h), I = await f(w, A, F, j, M, P), L = { plaintext: I };
|
|
57
|
+
if (S.zip === "DEF") {
|
|
58
|
+
let e = b?.maxDecompressedLength ?? 25e4;
|
|
59
|
+
if (e === 0) throw new r("JWE \"zip\" (Compression Algorithm) Header Parameter is not supported.");
|
|
60
|
+
if (e !== Infinity && (!Number.isSafeInteger(e) || e < 1)) throw TypeError("maxDecompressedLength must be 0, a positive safe integer, or Infinity");
|
|
61
|
+
L.plaintext = await d(I, e).catch((e) => {
|
|
62
|
+
throw e instanceof h ? e : new h("Failed to decompress plaintext", { cause: e });
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return v.protected !== void 0 && (L.protectedHeader = x), v.aad !== void 0 && (L.additionalAuthenticatedData = o(v.aad, "aad", h)), v.unprotected !== void 0 && (L.sharedUnprotectedHeader = v.unprotected), v.header !== void 0 && (L.unprotectedHeader = v.header), O ? {
|
|
66
|
+
...L,
|
|
67
|
+
key: k
|
|
68
|
+
} : L;
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region ../../node_modules/.pnpm/jose@6.2.2/node_modules/jose/dist/webapi/jwe/compact/decrypt.js
|
|
72
|
+
async function y(e, t, r) {
|
|
73
|
+
if (e instanceof Uint8Array && (e = n.decode(e)), typeof e != "string") throw new h("Compact JWE must be a string or Uint8Array");
|
|
74
|
+
let { 0: i, 1: a, 2: o, 3: s, 4: c, length: l } = e.split(".");
|
|
75
|
+
if (l !== 5) throw new h("Invalid Compact JWE");
|
|
76
|
+
let u = await v({
|
|
77
|
+
ciphertext: s,
|
|
78
|
+
iv: o || void 0,
|
|
79
|
+
protected: i,
|
|
80
|
+
tag: c || void 0,
|
|
81
|
+
encrypted_key: a || void 0
|
|
82
|
+
}, t, r), d = {
|
|
83
|
+
plaintext: u.plaintext,
|
|
84
|
+
protectedHeader: u.protectedHeader
|
|
85
|
+
};
|
|
86
|
+
return typeof t == "function" ? {
|
|
87
|
+
...d,
|
|
88
|
+
key: u.key
|
|
89
|
+
} : d;
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
export { y as t };
|