@aloma.io/integration-sdk 3.6.5 → 3.7.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/build/builder/index.d.mts +1 -1
- package/build/builder/index.mjs +13 -16
- package/build/builder/runtime-context.mjs +3 -2
- package/build/cli.mjs +15 -4
- package/build/internal/dispatcher/index.d.mts +11 -17
- package/build/internal/dispatcher/index.mjs +12 -1
- package/build/internal/fetcher/fetcher.d.mts +15 -0
- package/build/internal/fetcher/fetcher.mjs +97 -0
- package/build/internal/fetcher/index.d.mts +1 -0
- package/build/internal/fetcher/index.mjs +1 -0
- package/build/internal/fetcher/oauth-fetcher.d.mts +32 -0
- package/build/internal/fetcher/oauth-fetcher.mjs +114 -0
- package/build/internal/index.d.mts +8 -7
- package/build/internal/index.mjs +14 -241
- package/build/internal/util/index.d.mts +5 -0
- package/build/internal/util/index.mjs +45 -0
- package/build/internal/util/jwe/index.d.mts +5 -8
- package/build/internal/util/jwe/index.mjs +3 -0
- package/build/transform/index.d.mts +5 -0
- package/build/transform/index.mjs +79 -0
- package/package.json +1 -1
- package/src/builder/index.mts +14 -17
- package/src/builder/runtime-context.mts +4 -1
- package/src/cli.mts +19 -4
- package/src/internal/dispatcher/{index.mjs → index.mts} +14 -2
- package/src/internal/fetcher/fetcher.mts +126 -0
- package/src/internal/fetcher/oauth-fetcher.mts +147 -0
- package/src/internal/{index.mjs → index.mts} +18 -317
- package/src/internal/util/index.mts +57 -0
- package/src/internal/util/jwe/{index.mjs → index.mts} +7 -4
- /package/src/internal/util/jwe/{cli.mjs → cli.mts} +0 -0
- /package/src/{builder/transform → transform}/index.mts +0 -0
@@ -1,6 +1,9 @@
|
|
1
1
|
import * as jose from "jose";
|
2
2
|
|
3
3
|
class JWE {
|
4
|
+
issuer: string;
|
5
|
+
algorithm: string;
|
6
|
+
pair?: jose.GenerateKeyPairResult<jose.KeyLike>;
|
4
7
|
constructor({ algorithm = "PS256" }) {
|
5
8
|
this.issuer = "home.aloma.io";
|
6
9
|
this.algorithm = algorithm;
|
@@ -12,8 +15,8 @@ class JWE {
|
|
12
15
|
|
13
16
|
async exportPair() {
|
14
17
|
return {
|
15
|
-
publicKey: await jose.exportSPKI(this.pair
|
16
|
-
privateKey: await jose.exportPKCS8(this.pair
|
18
|
+
publicKey: await jose.exportSPKI(this.pair!.publicKey),
|
19
|
+
privateKey: await jose.exportPKCS8(this.pair!.privateKey),
|
17
20
|
};
|
18
21
|
}
|
19
22
|
|
@@ -53,13 +56,13 @@ class JWE {
|
|
53
56
|
|
54
57
|
if (expiration && expiration !== "none") item.setExpirationTime(expiration);
|
55
58
|
|
56
|
-
return await item.encrypt(this.pair
|
59
|
+
return await item.encrypt(this.pair!.publicKey);
|
57
60
|
}
|
58
61
|
|
59
62
|
async decrypt(what, audience) {
|
60
63
|
const { payload, protectedHeader } = await jose.jwtDecrypt(
|
61
64
|
what,
|
62
|
-
this.pair
|
65
|
+
this.pair!.privateKey,
|
63
66
|
{
|
64
67
|
issuer: this.issuer,
|
65
68
|
audience,
|
File without changes
|
File without changes
|