sst 2.43.0 → 2.43.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.
@@ -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 || `${value.fallback} #fallback`}`);
33
+ console.log(`${key}=${`'${value.value}'` || `'${value.fallback}' #fallback`}`);
34
34
  }
35
35
  break;
36
36
  case "table":
@@ -1,6 +1,9 @@
1
- import { BaseClient } from "openid-client";
2
- import { OauthConfig } from "./oauth.js";
3
- export declare const AppleAdapter: (config: OauthConfig) => () => Promise<{
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 realIssuer;
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): (() => Promise<{
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 realIssuer;
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
- if (config.mode === "oauth") {
16
- return OauthAdapter({
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
- params: {
20
- ...(config.accessType && { access_type: config.accessType }),
21
- ...config.params,
22
- },
23
- });
24
- }
25
- return OidcAdapter({
26
- issuer: issuer,
27
- scope: "openid email profile",
28
- ...config,
29
- });
25
+ })();
26
+ };
30
27
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "sideEffects": false,
3
3
  "name": "sst",
4
- "version": "2.43.0",
4
+ "version": "2.43.1",
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.0",
121
+ "astro-sst": "2.43.1",
122
122
  "async": "^3.2.4",
123
123
  "tsx": "^3.12.1",
124
124
  "typescript": "^5.2.2",
@@ -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>
@@ -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
+ }
@@ -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
+ }