-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
AWS CDK Team
committed
Mar 30, 2023
1 parent
b97eb78
commit 180ec7f
Showing
12,973 changed files
with
199,088 additions
and
311,857 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{ | ||
"name": "@aws-cdk-testing/framework-integ", | ||
"description": "Integration tests for aws-cdk-lib", | ||
"private": true, | ||
"version": "0.0.0", | ||
"scripts": { | ||
"build": "cdk-build", | ||
"watch": "cdk-watch", | ||
"lint": "cdk-lint", | ||
"pkglint": "pkglint -f", | ||
"test": "cdk-test", | ||
"package": "cdk-package", | ||
"build+test": "yarn build && yarn test", | ||
"build+extract": "yarn build", | ||
"build+test+package": "yarn build+test && yarn package", | ||
"build+test+extract": "yarn build+test" | ||
}, | ||
"pkglint": { | ||
"exclude": [ | ||
"package-info/repository", | ||
"dependencies/cdk-point-dependencies" | ||
] | ||
}, | ||
"author": { | ||
"name": "Amazon Web Services", | ||
"url": "https://aws.amazon.com", | ||
"organization": true | ||
}, | ||
"license": "Apache-2.0", | ||
"devDependencies": { | ||
"@aws-cdk/cdk-build-tools": "0.0.0", | ||
"delay": "5.0.0", | ||
"@aws-cdk/pkglint": "0.0.0" | ||
}, | ||
"dependencies": { | ||
"@aws-cdk/lambda-layer-kubectl-v24": "^2.0.100", | ||
"aws-cdk-lib": "0.0.0", | ||
"aws-sdk": "^2.1317.0", | ||
"aws-sdk-mock": "5.6.0", | ||
"cdk8s": "^2.7.15", | ||
"cdk8s-plus-24": "2.4.40", | ||
"constructs": "^10.0.0", | ||
"@aws-cdk/integ-tests-alpha": "0.0.0" | ||
}, | ||
"repository": { | ||
"url": "https://github.com/aws/aws-cdk.git", | ||
"type": "git", | ||
"directory": "packages/@aws-cdk-testing/framework-integ" | ||
}, | ||
"keywords": [ | ||
"aws", | ||
"cdk" | ||
], | ||
"homepage": "https://github.com/aws/aws-cdk", | ||
"engines": { | ||
"node": ">= 14.15.0" | ||
}, | ||
"stability": "experimental", | ||
"maturity": "experimental", | ||
"publishConfig": { | ||
"tag": "latest" | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions
8
...t/authorizers/integ.cognito-authorizer.ts → ...t/authorizers/integ.cognito-authorizer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
60 changes: 60 additions & 0 deletions
60
...ting/framework-integ/test/aws-apigateway/test/authorizers/integ.request-authorizer.lit.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import * as path from 'path'; | ||
import * as lambda from 'aws-cdk-lib/aws-lambda'; | ||
import { App, Stack } from 'aws-cdk-lib'; | ||
import { MockIntegration, PassthroughBehavior, RestApi, RequestAuthorizer, IdentitySource } from 'aws-cdk-lib/aws-apigateway'; | ||
|
||
// Against the RestApi endpoint from the stack output, run | ||
// `curl -s -o /dev/null -w "%{http_code}" <url>` should return 401 | ||
// `curl -s -o /dev/null -w "%{http_code}" -H 'Authorization: deny' <url>?allow=yes` should return 403 | ||
// `curl -s -o /dev/null -w "%{http_code}" -H 'Authorization: allow' <url>?allow=yes` should return 200 | ||
|
||
const app = new App(); | ||
const stack = new Stack(app, 'RequestAuthorizerInteg'); | ||
|
||
const authorizerFn = new lambda.Function(stack, 'MyAuthorizerFunction', { | ||
runtime: lambda.Runtime.NODEJS_14_X, | ||
handler: 'index.handler', | ||
code: lambda.AssetCode.fromAsset(path.join(__dirname, 'integ.request-authorizer.handler')), | ||
}); | ||
|
||
const restapi = new RestApi(stack, 'MyRestApi', { cloudWatchRole: true }); | ||
|
||
const authorizer = new RequestAuthorizer(stack, 'MyAuthorizer', { | ||
handler: authorizerFn, | ||
identitySources: [IdentitySource.header('Authorization'), IdentitySource.queryString('allow')], | ||
}); | ||
|
||
const secondAuthorizer = new RequestAuthorizer(stack, 'MySecondAuthorizer', { | ||
handler: authorizerFn, | ||
identitySources: [IdentitySource.header('Authorization'), IdentitySource.queryString('allow')], | ||
}); | ||
|
||
restapi.root.addMethod('ANY', new MockIntegration({ | ||
integrationResponses: [ | ||
{ statusCode: '200' }, | ||
], | ||
passthroughBehavior: PassthroughBehavior.NEVER, | ||
requestTemplates: { | ||
'application/json': '{ "statusCode": 200 }', | ||
}, | ||
}), { | ||
methodResponses: [ | ||
{ statusCode: '200' }, | ||
], | ||
authorizer, | ||
}); | ||
|
||
restapi.root.resourceForPath('auth').addMethod('ANY', new MockIntegration({ | ||
integrationResponses: [ | ||
{ statusCode: '200' }, | ||
], | ||
passthroughBehavior: PassthroughBehavior.NEVER, | ||
requestTemplates: { | ||
'application/json': '{ "statusCode": 200 }', | ||
}, | ||
}), { | ||
methodResponses: [ | ||
{ statusCode: '200' }, | ||
], | ||
authorizer: secondAuthorizer, | ||
}); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions
10
...rizers/integ.token-authorizer-iam-role.ts → ...rizers/integ.token-authorizer-iam-role.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.