sst 2.43.0 → 2.43.2
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/cli/commands/secrets/list.js +1 -1
- package/node/auth/session.d.ts +13 -0
- package/node/auth/session.js +26 -5
- package/node/future/auth/adapter/apple.d.ts +7 -3
- package/node/future/auth/adapter/apple.js +5 -9
- package/node/future/auth/adapter/google.d.ts +2 -17
- package/node/future/auth/adapter/google.js +19 -22
- package/node/future/auth/index.d.ts +1 -3
- package/node/future/auth/index.js +1 -2
- package/node/future/auth/proxy.d.ts +3 -0
- package/node/future/auth/proxy.js +2 -0
- package/node/future/auth/session.js +1 -1
- package/package.json +2 -2
- package/runtime/handlers/node.js +1 -0
- package/support/dotnet8-bootstrap/Program.cs +17 -0
- package/support/dotnet8-bootstrap/dotnet-bootstrap.csproj +12 -0
- package/support/dotnet8-bootstrap/release/Amazon.Lambda.Core.dll +0 -0
- package/support/dotnet8-bootstrap/release/Amazon.Lambda.RuntimeSupport.dll +0 -0
- package/support/dotnet8-bootstrap/release/dotnet-bootstrap +0 -0
- package/support/dotnet8-bootstrap/release/dotnet-bootstrap.deps.json +59 -0
- package/support/dotnet8-bootstrap/release/dotnet-bootstrap.dll +0 -0
- package/support/dotnet8-bootstrap/release/dotnet-bootstrap.pdb +0 -0
- package/support/dotnet8-bootstrap/release/dotnet-bootstrap.runtimeconfig.json +13 -0
|
@@ -30,7 +30,7 @@ export const list = (program) => program.command("list [format]", "Fetch all the
|
|
|
30
30
|
break;
|
|
31
31
|
case "env":
|
|
32
32
|
for (const [key, value] of Object.entries(secrets)) {
|
|
33
|
-
console.log(`${key}=${value.value ||
|
|
33
|
+
console.log(`${key}=${`'${value.value}'` || `'${value.fallback}' #fallback`}`);
|
|
34
34
|
}
|
|
35
35
|
break;
|
|
36
36
|
case "table":
|
package/node/auth/session.d.ts
CHANGED
|
@@ -28,6 +28,18 @@ declare function create<T extends keyof SessionTypes>(input: {
|
|
|
28
28
|
properties: SessionTypes[T];
|
|
29
29
|
options?: Partial<SignerOptions>;
|
|
30
30
|
}): string;
|
|
31
|
+
/**
|
|
32
|
+
* Verifies a session token and returns the session data
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```js
|
|
36
|
+
* Session.verify()
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
declare function verify<T = SessionValue>(token: string): T | {
|
|
40
|
+
type: string;
|
|
41
|
+
properties: {};
|
|
42
|
+
};
|
|
31
43
|
/**
|
|
32
44
|
* Returns a 302 redirect with an auth-token cookie set with the provided session information
|
|
33
45
|
*
|
|
@@ -70,6 +82,7 @@ export declare function parameter<T extends keyof SessionTypes>(input: {
|
|
|
70
82
|
}): APIGatewayProxyStructuredResultV2;
|
|
71
83
|
export declare const Session: {
|
|
72
84
|
create: typeof create;
|
|
85
|
+
verify: typeof verify;
|
|
73
86
|
cookie: typeof cookie;
|
|
74
87
|
parameter: typeof parameter;
|
|
75
88
|
};
|
package/node/auth/session.js
CHANGED
|
@@ -23,11 +23,7 @@ const SessionMemo = /* @__PURE__ */ Context.memo(() => {
|
|
|
23
23
|
if (wsProtocol)
|
|
24
24
|
token = wsProtocol.split(",")[0].trim();
|
|
25
25
|
if (token) {
|
|
26
|
-
|
|
27
|
-
algorithms: ["RS512"],
|
|
28
|
-
key: getPublicKey(),
|
|
29
|
-
})(token);
|
|
30
|
-
return jwt;
|
|
26
|
+
return Session.verify(token);
|
|
31
27
|
}
|
|
32
28
|
return {
|
|
33
29
|
type: "public",
|
|
@@ -64,6 +60,30 @@ function create(input) {
|
|
|
64
60
|
});
|
|
65
61
|
return token;
|
|
66
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Verifies a session token and returns the session data
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```js
|
|
68
|
+
* Session.verify()
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
function verify(token) {
|
|
72
|
+
if (token) {
|
|
73
|
+
try {
|
|
74
|
+
const jwt = createVerifier({
|
|
75
|
+
algorithms: ["RS512"],
|
|
76
|
+
key: getPublicKey(),
|
|
77
|
+
})(token);
|
|
78
|
+
return jwt;
|
|
79
|
+
}
|
|
80
|
+
catch (e) { }
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
type: "public",
|
|
84
|
+
properties: {},
|
|
85
|
+
};
|
|
86
|
+
}
|
|
67
87
|
/**
|
|
68
88
|
* Returns a 302 redirect with an auth-token cookie set with the provided session information
|
|
69
89
|
*
|
|
@@ -116,6 +136,7 @@ export function parameter(input) {
|
|
|
116
136
|
}
|
|
117
137
|
export const Session = {
|
|
118
138
|
create,
|
|
139
|
+
verify,
|
|
119
140
|
cookie,
|
|
120
141
|
parameter,
|
|
121
142
|
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { BaseClient } from "openid-client";
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { BaseClient, Issuer } from "openid-client";
|
|
2
|
+
import { OauthBasicConfig } from "./oauth.js";
|
|
3
|
+
type AppleConfig = OauthBasicConfig & {
|
|
4
|
+
issuer?: Issuer;
|
|
5
|
+
};
|
|
6
|
+
export declare const AppleAdapter: (config: AppleConfig) => () => Promise<{
|
|
4
7
|
type: "success";
|
|
5
8
|
properties: {
|
|
6
9
|
tokenset: import("openid-client").TokenSet;
|
|
@@ -15,3 +18,4 @@ export declare const AppleAdapter: (config: OauthConfig) => () => Promise<{
|
|
|
15
18
|
};
|
|
16
19
|
};
|
|
17
20
|
} | undefined>;
|
|
21
|
+
export {};
|
|
@@ -8,19 +8,15 @@ import { useBody, useCookie, useDomainName, usePathParam, useResponse, } from ".
|
|
|
8
8
|
// Also note that Apple's discover uri does not work for the OAuth flow, as the
|
|
9
9
|
// userinfo_endpoint are not included in the response.
|
|
10
10
|
// await Issuer.discover("https://appleid.apple.com/.well-known/openid-configuration/");
|
|
11
|
-
let
|
|
12
|
-
const issuer = new Proxy({}, {
|
|
13
|
-
get: async function (target, prop) {
|
|
14
|
-
if (!realIssuer) {
|
|
15
|
-
realIssuer = await Issuer.discover("https://appleid.apple.com/.well-known/openid-configuration");
|
|
16
|
-
}
|
|
17
|
-
return realIssuer[prop];
|
|
18
|
-
},
|
|
19
|
-
});
|
|
11
|
+
let issuer;
|
|
20
12
|
export const AppleAdapter =
|
|
21
13
|
/* @__PURE__ */
|
|
22
14
|
(config) => {
|
|
23
15
|
return async function () {
|
|
16
|
+
const doesConfigHasIssuer = config.issuer !== undefined;
|
|
17
|
+
if (!doesConfigHasIssuer && !issuer) {
|
|
18
|
+
issuer = await Issuer.discover("https://appleid.apple.com/.well-known/openid-configuration");
|
|
19
|
+
}
|
|
24
20
|
const step = usePathParam("step");
|
|
25
21
|
const callback = "https://" + useDomainName() + "/callback";
|
|
26
22
|
console.log("callback", callback);
|
|
@@ -11,7 +11,7 @@ type GoogleConfig = (OauthBasicConfig & {
|
|
|
11
11
|
mode: "oidc";
|
|
12
12
|
prompt?: GooglePrompt;
|
|
13
13
|
});
|
|
14
|
-
export declare function GoogleAdapter(config: GoogleConfig): (
|
|
14
|
+
export declare function GoogleAdapter(config: GoogleConfig): () => Promise<{
|
|
15
15
|
type: "success";
|
|
16
16
|
properties: {
|
|
17
17
|
tokenset: import("openid-client").TokenSet;
|
|
@@ -25,24 +25,9 @@ export declare function GoogleAdapter(config: GoogleConfig): (() => Promise<{
|
|
|
25
25
|
location: string;
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
|
-
}>) | (() => Promise<{
|
|
29
|
-
type: "success";
|
|
30
|
-
properties: {
|
|
31
|
-
tokenset: import("openid-client").TokenSet;
|
|
32
|
-
client: BaseClient;
|
|
33
|
-
};
|
|
34
|
-
} | {
|
|
35
|
-
type: "step";
|
|
36
|
-
properties: {
|
|
37
|
-
statusCode: number;
|
|
38
|
-
headers: {
|
|
39
|
-
location: string;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
error?: undefined;
|
|
43
28
|
} | {
|
|
44
29
|
type: "error";
|
|
45
30
|
error: import("./oauth.js").OauthError;
|
|
46
31
|
properties?: undefined;
|
|
47
|
-
} | undefined
|
|
32
|
+
} | undefined>;
|
|
48
33
|
export {};
|
|
@@ -1,30 +1,27 @@
|
|
|
1
1
|
import { Issuer } from "openid-client";
|
|
2
2
|
import { OidcAdapter } from "./oidc.js";
|
|
3
3
|
import { OauthAdapter } from "./oauth.js";
|
|
4
|
-
let
|
|
5
|
-
const issuer = new Proxy({}, {
|
|
6
|
-
get: async function (target, prop) {
|
|
7
|
-
if (!realIssuer) {
|
|
8
|
-
realIssuer = await Issuer.discover("https://accounts.google.com");
|
|
9
|
-
}
|
|
10
|
-
return realIssuer[prop];
|
|
11
|
-
},
|
|
12
|
-
});
|
|
4
|
+
let issuer;
|
|
13
5
|
export function GoogleAdapter(config) {
|
|
14
6
|
/* @__PURE__ */
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
return async function () {
|
|
8
|
+
if (!issuer) {
|
|
9
|
+
issuer = await Issuer.discover("https://accounts.google.com");
|
|
10
|
+
}
|
|
11
|
+
if (config.mode === "oauth") {
|
|
12
|
+
return OauthAdapter({
|
|
13
|
+
issuer: issuer,
|
|
14
|
+
...config,
|
|
15
|
+
params: {
|
|
16
|
+
...(config.accessType && { access_type: config.accessType }),
|
|
17
|
+
...config.params,
|
|
18
|
+
},
|
|
19
|
+
})();
|
|
20
|
+
}
|
|
21
|
+
return OidcAdapter({
|
|
17
22
|
issuer: issuer,
|
|
23
|
+
scope: "openid email profile",
|
|
18
24
|
...config,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
...config.params,
|
|
22
|
-
},
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
return OidcAdapter({
|
|
26
|
-
issuer: issuer,
|
|
27
|
-
scope: "openid email profile",
|
|
28
|
-
...config,
|
|
29
|
-
});
|
|
25
|
+
})();
|
|
26
|
+
};
|
|
30
27
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createSigner, createVerifier } from "fast-jwt";
|
|
2
2
|
import { Context } from "../../../context/context2.js";
|
|
3
3
|
import { useCookie, useHeader } from "../../api/index.js";
|
|
4
|
-
import { Auth } from "
|
|
4
|
+
import { Auth } from "./proxy.js";
|
|
5
5
|
import { Config } from "../../config/index.js";
|
|
6
6
|
import { useContextType } from "../../../context/handler.js";
|
|
7
7
|
const SessionMemo = /* @__PURE__ */ Context.memo(() => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"sideEffects": false,
|
|
3
3
|
"name": "sst",
|
|
4
|
-
"version": "2.43.
|
|
4
|
+
"version": "2.43.2",
|
|
5
5
|
"bin": {
|
|
6
6
|
"sst": "cli/sst.js"
|
|
7
7
|
},
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
"@types/ws": "^8.5.3",
|
|
119
119
|
"@types/yargs": "^17.0.13",
|
|
120
120
|
"archiver": "^5.3.1",
|
|
121
|
-
"astro-sst": "2.43.
|
|
121
|
+
"astro-sst": "2.43.2",
|
|
122
122
|
"async": "^3.2.4",
|
|
123
123
|
"tsx": "^3.12.1",
|
|
124
124
|
"typescript": "^5.2.2",
|
package/runtime/handlers/node.js
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
using System.Reflection;
|
|
2
|
+
using System.Threading.Tasks;
|
|
3
|
+
using Amazon.Lambda.RuntimeSupport;
|
|
4
|
+
|
|
5
|
+
namespace dotnet_bootstrap
|
|
6
|
+
{
|
|
7
|
+
class Program
|
|
8
|
+
{
|
|
9
|
+
static async Task Main(string[] args)
|
|
10
|
+
{
|
|
11
|
+
Assembly asm = Assembly.LoadFrom(args[0]);
|
|
12
|
+
var r = new RuntimeSupportInitializer(args[1]);
|
|
13
|
+
await r.RunLambdaBootstrap();
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<Project Sdk="Microsoft.NET.Sdk">
|
|
2
|
+
|
|
3
|
+
<PropertyGroup>
|
|
4
|
+
<OutputType>Exe</OutputType>
|
|
5
|
+
<TargetFramework>net8.0</TargetFramework>
|
|
6
|
+
<RootNamespace>dotnet_bootstrap</RootNamespace>
|
|
7
|
+
</PropertyGroup>
|
|
8
|
+
<ItemGroup>
|
|
9
|
+
<PackageReference Include="Amazon.Lambda.RuntimeSupport" Version="1.10.0" />
|
|
10
|
+
</ItemGroup>
|
|
11
|
+
|
|
12
|
+
</Project>
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"runtimeTarget": {
|
|
3
|
+
"name": ".NETCoreApp,Version=v8.0",
|
|
4
|
+
"signature": ""
|
|
5
|
+
},
|
|
6
|
+
"compilationOptions": {},
|
|
7
|
+
"targets": {
|
|
8
|
+
".NETCoreApp,Version=v8.0": {
|
|
9
|
+
"dotnet-bootstrap/1.0.0": {
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"Amazon.Lambda.RuntimeSupport": "1.10.0"
|
|
12
|
+
},
|
|
13
|
+
"runtime": {
|
|
14
|
+
"dotnet-bootstrap.dll": {}
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"Amazon.Lambda.Core/2.2.0": {
|
|
18
|
+
"runtime": {
|
|
19
|
+
"lib/net8.0/Amazon.Lambda.Core.dll": {
|
|
20
|
+
"assemblyVersion": "1.0.0.0",
|
|
21
|
+
"fileVersion": "1.0.0.0"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"Amazon.Lambda.RuntimeSupport/1.10.0": {
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"Amazon.Lambda.Core": "2.2.0"
|
|
28
|
+
},
|
|
29
|
+
"runtime": {
|
|
30
|
+
"lib/net8.0/Amazon.Lambda.RuntimeSupport.dll": {
|
|
31
|
+
"assemblyVersion": "1.10.0.0",
|
|
32
|
+
"fileVersion": "1.10.0.0"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"libraries": {
|
|
39
|
+
"dotnet-bootstrap/1.0.0": {
|
|
40
|
+
"type": "project",
|
|
41
|
+
"serviceable": false,
|
|
42
|
+
"sha512": ""
|
|
43
|
+
},
|
|
44
|
+
"Amazon.Lambda.Core/2.2.0": {
|
|
45
|
+
"type": "package",
|
|
46
|
+
"serviceable": true,
|
|
47
|
+
"sha512": "sha512-DHqKeD1CYocP0t1dJC/NaXfu+5k6AoqnQ1Hlu/J2mXpLpCyeJfY+tIqT5fpruDarUlU0NtdIH8zSkCjeinyb1A==",
|
|
48
|
+
"path": "amazon.lambda.core/2.2.0",
|
|
49
|
+
"hashPath": "amazon.lambda.core.2.2.0.nupkg.sha512"
|
|
50
|
+
},
|
|
51
|
+
"Amazon.Lambda.RuntimeSupport/1.10.0": {
|
|
52
|
+
"type": "package",
|
|
53
|
+
"serviceable": true,
|
|
54
|
+
"sha512": "sha512-J1NdaUV24sWALmCjzJJ6vezskeeH2NxJU7ao86rgdzW+AcgnhYjIULuKQNAx6fTl8AP/8acFsq7Jp7k156hh4A==",
|
|
55
|
+
"path": "amazon.lambda.runtimesupport/1.10.0",
|
|
56
|
+
"hashPath": "amazon.lambda.runtimesupport.1.10.0.nupkg.sha512"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"runtimeOptions": {
|
|
3
|
+
"tfm": "net8.0",
|
|
4
|
+
"framework": {
|
|
5
|
+
"name": "Microsoft.NETCore.App",
|
|
6
|
+
"version": "8.0.0"
|
|
7
|
+
},
|
|
8
|
+
"configProperties": {
|
|
9
|
+
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false,
|
|
10
|
+
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|