@akdev1l/constructs 0.0.1 → 0.0.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/build/{src/github/GithubAccessProvider.d.ts → dist/github/access-provider.d.ts} +1 -1
- package/build/dist/github/access-provider.d.ts.map +1 -0
- package/build/{src/github/GithubAccessProvider.js → dist/github/access-provider.js} +1 -1
- package/build/dist/github/access-provider.js.map +1 -0
- package/build/dist/github/index.d.ts +2 -0
- package/build/dist/github/index.d.ts.map +1 -0
- package/build/dist/github/index.js +2 -0
- package/build/dist/github/index.js.map +1 -0
- package/build/dist/index.d.ts +2 -0
- package/build/{src → dist}/index.d.ts.map +1 -1
- package/build/dist/index.js +2 -0
- package/build/dist/index.js.map +1 -0
- package/package.json +21 -2
- package/build/src/github/GithubAccessProvider.d.ts.map +0 -1
- package/build/src/github/GithubAccessProvider.js.map +0 -1
- package/build/src/index.d.ts +0 -2
- package/build/src/index.js +0 -3
- package/build/src/index.js.map +0 -1
- package/build/test/index.test.d.ts +0 -2
- package/build/test/index.test.d.ts.map +0 -1
- package/build/test/index.test.js +0 -6
- package/build/test/index.test.js.map +0 -1
- package/jest.config.js +0 -17
- package/src/github/GithubAccessProvider.ts +0 -42
- package/src/index.ts +0 -3
- package/test/index.test.ts +0 -6
- package/tsconfig.json +0 -44
|
@@ -9,4 +9,4 @@ export declare class GithubAccessProvider extends Construct {
|
|
|
9
9
|
readonly role: iam.Role;
|
|
10
10
|
constructor(scope: Construct, id: string, props: GithubAccessProviderProps);
|
|
11
11
|
}
|
|
12
|
-
//# sourceMappingURL=
|
|
12
|
+
//# sourceMappingURL=access-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"access-provider.d.ts","sourceRoot":"","sources":["../../../src/github/access-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,OAAO,IAAI,GAAG,EACf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,SAAS,EAA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,IAAI,CAAC,IAAI,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,mBAAmB,EAAE;YAClD,QAAQ,EAAE,eAAe;YACzB,SAAS,EAAE,IAAI,GAAG,CAAC,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,wBAAwB,EAAE,UAAU,CAAC;YAC3F,WAAW,EAAE,mCAAmC,KAAK,CAAC,IAAI,EAAE;YAC5D,kBAAkB,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;SACtC,CAAC,CAAC;IACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/github/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/github/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akdev1l/constructs",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "CDK Constructs",
|
|
5
5
|
"private": false,
|
|
6
|
+
"files": [
|
|
7
|
+
"build/dist"
|
|
8
|
+
],
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./build/dist/index.d.ts",
|
|
12
|
+
"import": "./build/dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
6
15
|
"keywords": [
|
|
7
16
|
"cdk",
|
|
8
17
|
"construct"
|
|
@@ -20,16 +29,26 @@
|
|
|
20
29
|
"type": "module",
|
|
21
30
|
"main": "build/index.js",
|
|
22
31
|
"scripts": {
|
|
32
|
+
"prepublish": "npm run release",
|
|
33
|
+
"release": "npm run build",
|
|
34
|
+
"lint": "eslint",
|
|
35
|
+
"format": "eslint --fix",
|
|
23
36
|
"test": "jest",
|
|
24
37
|
"build": "tsc",
|
|
38
|
+
"prebuild": "eslint && jest",
|
|
25
39
|
"clean": "rm -rf build/*"
|
|
26
40
|
},
|
|
27
41
|
"devDependencies": {
|
|
42
|
+
"@eslint/js": "^9.39.2",
|
|
28
43
|
"@types/jest": "^30.0.0",
|
|
29
44
|
"aws-cdk": "^2.1104.0",
|
|
45
|
+
"eslint": "^9.39.2",
|
|
46
|
+
"globals": "^17.2.0",
|
|
30
47
|
"jest": "^30.2.0",
|
|
48
|
+
"jiti": "^2.6.1",
|
|
31
49
|
"ts-jest": "^29.4.6",
|
|
32
|
-
"typescript": "^5.9.3"
|
|
50
|
+
"typescript": "^5.9.3",
|
|
51
|
+
"typescript-eslint": "^8.54.0"
|
|
33
52
|
},
|
|
34
53
|
"dependencies": {
|
|
35
54
|
"aws-cdk-lib": "^2.236.0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GithubAccessProvider.d.ts","sourceRoot":"","sources":["../../../src/github/GithubAccessProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,OAAO,IAAI,GAAG,EACf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qBAAa,oBAAqB,SAAQ,SAAS;IACjD,OAAO,CAAC,MAAM,CAAC,aAAa,CAAiD;IAE7E,Q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,IAAI,CAAC,QAAQ,CAAC,wBAAwB,EAAE,UAAU,CAAC;YAC3F,WAAW,EAAE,mCAAmC,KAAK,CAAC,IAAI,EAAE;YAC5D,kBAAkB,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;SACtC,CAAC,CAAC;IACL,CAAC"}
|
package/build/src/index.d.ts
DELETED
package/build/src/index.js
DELETED
package/build/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,aAAa,CAAC;AAEnC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../test/index.test.ts"],"names":[],"mappings":""}
|
package/build/test/index.test.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../test/index.test.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE7C,IAAI,CAAC,aAAa,EAAE,GAAG,EAAE;IACvB,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
|
package/jest.config.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { createDefaultPreset } from "ts-jest";
|
|
2
|
-
|
|
3
|
-
const tsJestTransformCfg = createDefaultPreset({
|
|
4
|
-
useESM: true,
|
|
5
|
-
}).transform;
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
testEnvironment: "node",
|
|
9
|
-
extensionsToTreatAsEsm: [".ts"],
|
|
10
|
-
roots: ['<rootDir>/test'],
|
|
11
|
-
moduleNameMapper: {
|
|
12
|
-
'^@akdev1l/constructs$': '<rootDir>/src/index.ts'
|
|
13
|
-
},
|
|
14
|
-
transform: {
|
|
15
|
-
...tsJestTransformCfg,
|
|
16
|
-
},
|
|
17
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Duration,
|
|
3
|
-
aws_iam as iam,
|
|
4
|
-
} from 'aws-cdk-lib';
|
|
5
|
-
import { Construct } from 'constructs';
|
|
6
|
-
|
|
7
|
-
export interface GithubAccessProviderProps {
|
|
8
|
-
repo: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export class GithubAccessProvider extends Construct {
|
|
12
|
-
private static GITHUB_DOMAIN = 'https://token.actions.githubusercontent.com';
|
|
13
|
-
|
|
14
|
-
readonly provider: iam.OpenIdConnectProvider;
|
|
15
|
-
readonly role: iam.Role;
|
|
16
|
-
|
|
17
|
-
constructor(scope: Construct, id: string, props: GithubAccessProviderProps) {
|
|
18
|
-
super(scope, id);
|
|
19
|
-
|
|
20
|
-
this.provider = new iam.OpenIdConnectProvider(this, 'GithubActionsProvider', {
|
|
21
|
-
url: GithubAccessProvider.GITHUB_DOMAIN,
|
|
22
|
-
clientIds: ['sts.amazonaws.com'],
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
const conditions: iam.Conditions = {
|
|
26
|
-
StringLike: {
|
|
27
|
-
[`${GithubAccessProvider.GITHUB_DOMAIN}:sub`]: `repo:${props.repo}`,
|
|
28
|
-
},
|
|
29
|
-
ForAllValuesStringEquals: {
|
|
30
|
-
'token.actions.githubusercontent.com:iss': 'https://token.actions.githubusercontent.com',
|
|
31
|
-
'token.actions.githubusercontent.com:aud': 'sts.amazonaws.com',
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
this.role = new iam.Role(this, 'GithubActionsRole', {
|
|
36
|
-
roleName: 'GithubActions',
|
|
37
|
-
assumedBy: new iam.WebIdentityPrincipal(this.provider.openIdConnectProviderArn, conditions),
|
|
38
|
-
description: `Access for deployment from repo ${props.repo}`,
|
|
39
|
-
maxSessionDuration: Duration.hours(2),
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
}
|
package/src/index.ts
DELETED
package/test/index.test.ts
DELETED
package/tsconfig.json
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
// Visit https://aka.ms/tsconfig to read more about this file
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
// File Layout
|
|
5
|
-
//"rootDir": "./src",
|
|
6
|
-
"outDir": "./build",
|
|
7
|
-
|
|
8
|
-
// Environment Settings
|
|
9
|
-
// See also https://aka.ms/tsconfig/module
|
|
10
|
-
"module": "nodenext",
|
|
11
|
-
"target": "esnext",
|
|
12
|
-
"types": [],
|
|
13
|
-
// For nodejs:
|
|
14
|
-
// "lib": ["esnext"],
|
|
15
|
-
// "types": ["node"],
|
|
16
|
-
// and npm install -D @types/node
|
|
17
|
-
|
|
18
|
-
// Other Outputs
|
|
19
|
-
"sourceMap": true,
|
|
20
|
-
"declaration": true,
|
|
21
|
-
"declarationMap": true,
|
|
22
|
-
|
|
23
|
-
// Stricter Typechecking Options
|
|
24
|
-
"noUncheckedIndexedAccess": true,
|
|
25
|
-
"exactOptionalPropertyTypes": true,
|
|
26
|
-
|
|
27
|
-
// Style Options
|
|
28
|
-
// "noImplicitReturns": true,
|
|
29
|
-
// "noImplicitOverride": true,
|
|
30
|
-
// "noUnusedLocals": true,
|
|
31
|
-
// "noUnusedParameters": true,
|
|
32
|
-
// "noFallthroughCasesInSwitch": true,
|
|
33
|
-
// "noPropertyAccessFromIndexSignature": true,
|
|
34
|
-
|
|
35
|
-
// Recommended Options
|
|
36
|
-
"strict": true,
|
|
37
|
-
"jsx": "react-jsx",
|
|
38
|
-
"verbatimModuleSyntax": true,
|
|
39
|
-
"isolatedModules": true,
|
|
40
|
-
"noUncheckedSideEffectImports": true,
|
|
41
|
-
"moduleDetection": "force",
|
|
42
|
-
"skipLibCheck": true,
|
|
43
|
-
}
|
|
44
|
-
}
|