@infoxchange/make-it-so 2.10.0-internal-testing-vdt-199-add-oidc-auth.2 → 2.10.0-internal-testing-vdt-199-add-oidc-auth.3
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/dist/cdk-constructs/CloudWatchOidcAuth/index.d.ts.map +1 -1
- package/dist/cdk-constructs/CloudWatchOidcAuth/index.js +2 -2
- package/dist/lib/utils/source-code.d.ts +1 -1
- package/dist/lib/utils/source-code.d.ts.map +1 -1
- package/dist/lib/utils/source-code.js +1 -12
- package/package.json +1 -1
- package/src/cdk-constructs/CloudWatchOidcAuth/index.ts +2 -4
- package/src/lib/utils/source-code.ts +0 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cdk-constructs/CloudWatchOidcAuth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cdk-constructs/CloudWatchOidcAuth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AASvC,OAAO,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAI1E,KAAK,cAAc,GAAG,qBAAqB,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AACjE,KAAK,WAAW,GAAG,qBAAqB,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AAE9D,KAAK,OAAO,CAAC,CAAC,IAAI;IAChB,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAC/B,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,qBAAa,kBAAmB,SAAQ,SAAS;IAC/C,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;gBAER,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK;IAQhE,2BAA2B,CACzB,iBAAiB,SAAS,4BAA4B,EAEtD,KAAK,EAAE,cAAc,EACrB,EACE,sBAAsB,EACtB,MAAgB,GACjB,EAAE;QAAE,sBAAsB,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;IA6C5E,OAAO,CAAC,sBAAsB;IAyH9B,OAAO,CAAC,sBAAsB;CA0E/B"}
|
|
@@ -4,11 +4,11 @@ import CloudFront from "aws-cdk-lib/aws-cloudfront";
|
|
|
4
4
|
import CDK from "aws-cdk-lib";
|
|
5
5
|
import CdkCustomResources from "aws-cdk-lib/custom-resources";
|
|
6
6
|
import Lambda from "aws-cdk-lib/aws-lambda";
|
|
7
|
-
import { getFileContentsWithoutTypes } from "../../lib/utils/source-code.js";
|
|
8
7
|
import * as SST from "sst/constructs";
|
|
9
8
|
import { Config as SSTInternalConfig } from "sst/config.js";
|
|
10
9
|
import CloudFrontOrigins from "aws-cdk-lib/aws-cloudfront-origins";
|
|
11
10
|
import path from "node:path";
|
|
11
|
+
import fs from "node:fs";
|
|
12
12
|
export class CloudWatchOidcAuth extends Construct {
|
|
13
13
|
oidcIssuerUrl;
|
|
14
14
|
oidcClientId;
|
|
@@ -127,7 +127,7 @@ export class CloudWatchOidcAuth extends Construct {
|
|
|
127
127
|
}
|
|
128
128
|
fn.addEnvironment("NODE_OPTIONS", "--require=@aws-sdk/signature-v4-crt");
|
|
129
129
|
const edgeFuncAuthCheck = new CloudFront.Function(scope, `${this.id}EdgeFunctionAuthCheck`, {
|
|
130
|
-
code: CloudFront.FunctionCode.fromInline(
|
|
130
|
+
code: CloudFront.FunctionCode.fromInline(fs.readFileSync(path.join(import.meta.dirname, "auth-check.js"), "utf8").replace("__placeholder-for-jwt-secret-key__", key)),
|
|
131
131
|
runtime: CloudFront.FunctionRuntime.JS_2_0,
|
|
132
132
|
keyValueStore: cfKeyValueStore,
|
|
133
133
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
|
2
2
|
//# sourceMappingURL=source-code.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-code.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/source-code.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"source-code.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/source-code.ts"],"names":[],"mappings":""}
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import fs from "fs";
|
|
3
|
-
export function getFileContentsWithoutTypes(filePath) {
|
|
4
|
-
const source = fs.readFileSync(filePath, "utf8");
|
|
5
|
-
const result = ts.transpileModule(source, {
|
|
6
|
-
compilerOptions: {
|
|
7
|
-
module: ts.ModuleKind.ESNext,
|
|
8
|
-
target: ts.ScriptTarget.ES2020,
|
|
9
|
-
},
|
|
10
|
-
});
|
|
11
|
-
return result.outputText;
|
|
12
|
-
}
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infoxchange/make-it-so",
|
|
3
|
-
"version": "2.10.0-internal-testing-vdt-199-add-oidc-auth.
|
|
3
|
+
"version": "2.10.0-internal-testing-vdt-199-add-oidc-auth.3",
|
|
4
4
|
"description": "Makes deploying services to IX infra easy",
|
|
5
5
|
"repository": "github:infoxchange/make-it-so",
|
|
6
6
|
"type": "module",
|
|
@@ -4,12 +4,12 @@ import CloudFront from "aws-cdk-lib/aws-cloudfront";
|
|
|
4
4
|
import CDK from "aws-cdk-lib";
|
|
5
5
|
import CdkCustomResources from "aws-cdk-lib/custom-resources";
|
|
6
6
|
import Lambda from "aws-cdk-lib/aws-lambda";
|
|
7
|
-
import { getFileContentsWithoutTypes } from "../../lib/utils/source-code.js";
|
|
8
7
|
import * as SST from "sst/constructs";
|
|
9
8
|
import { Config as SSTInternalConfig } from "sst/config.js";
|
|
10
9
|
import CloudFrontOrigins from "aws-cdk-lib/aws-cloudfront-origins";
|
|
11
10
|
import { BaseSiteCdkDistributionProps } from "sst/constructs/BaseSite.js";
|
|
12
11
|
import path from "node:path";
|
|
12
|
+
import fs from "node:fs";
|
|
13
13
|
|
|
14
14
|
type ConstructScope = ConstructorParameters<typeof Construct>[0];
|
|
15
15
|
type ConstructId = ConstructorParameters<typeof Construct>[1];
|
|
@@ -198,9 +198,7 @@ export class CloudWatchOidcAuth extends Construct {
|
|
|
198
198
|
`${this.id}EdgeFunctionAuthCheck`,
|
|
199
199
|
{
|
|
200
200
|
code: CloudFront.FunctionCode.fromInline(
|
|
201
|
-
|
|
202
|
-
path.join(import.meta.dirname, "auth-check.ts"),
|
|
203
|
-
).replace("__placeholder-for-jwt-secret-key__", key),
|
|
201
|
+
fs.readFileSync(path.join(import.meta.dirname, "auth-check.js"), "utf8").replace("__placeholder-for-jwt-secret-key__", key),
|
|
204
202
|
),
|
|
205
203
|
runtime: CloudFront.FunctionRuntime.JS_2_0,
|
|
206
204
|
keyValueStore: cfKeyValueStore,
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import ts from "typescript";
|
|
2
|
-
import fs from "fs";
|
|
3
|
-
|
|
4
|
-
export function getFileContentsWithoutTypes(filePath: string): string {
|
|
5
|
-
const source = fs.readFileSync(filePath, "utf8");
|
|
6
|
-
|
|
7
|
-
const result = ts.transpileModule(source, {
|
|
8
|
-
compilerOptions: {
|
|
9
|
-
module: ts.ModuleKind.ESNext,
|
|
10
|
-
target: ts.ScriptTarget.ES2020,
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
return result.outputText;
|
|
14
|
-
}
|