Skip to content

Commit 94b807c

Browse files
authored
fixes #81 add pre-commit hook and apply it (#82)
1 parent 91c74f6 commit 94b807c

File tree

15 files changed

+29
-19
lines changed

15 files changed

+29
-19
lines changed

.pre-commit-config.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v3.2.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
args: ["--unsafe"]
9+
- id: check-added-large-files
10+
- repo: https://github.com/networknt/pre-commit-hook-keyword
11+
rev: f17c4de14fc24420f6768c19cad06ba03af06d86
12+
hooks:
13+
- id: keywordscan
14+
args: ["--keywords=c3VubGlmZQ==,Y2liYw==,c3VuIGxpZmU="]
15+
types: ["text"]

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Aws lambda authorizer, middleware handlers and extensions for cross-cutting conc
33

44
### authorizer
55

6-
The authorizer is a lambda function and it will be configured on the AWS API Gateway to be invoked as a custom authorizer.
6+
The authorizer is a lambda function and it will be configured on the AWS API Gateway to be invoked as a custom authorizer.
77

88

99
### middleware handlers
@@ -29,6 +29,3 @@ This is a Lambda extersion that will collect the logs of the Lambda function and
2929
##### Metrics
3030

3131
This is a Lambda extension that will collect the metrics of the Lambda function and send to a time series database.
32-
33-
34-

ccc-lambda/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
This is a Lambda function that address cross-cutting concerns for business Lambda functions. It is a Lambda function that can be used to build business Lambda functions.
2-

ccc-lambda/middleware-function/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### Test with Main
22

3-
We have provided a Main class in the src folder for testing all the middleware handlers with a sample request. You can run the Main class within your IDE with debug mode to see how each middleware handler works.
3+
We have provided a Main class in the src folder for testing all the middleware handlers with a sample request. You can run the Main class within your IDE with debug mode to see how each middleware handler works.
44

55
Before running the Main class, you need to disable the DynamoDbCacheManager as it depends on the AWS environment. To do that you need to common out the service.yml section in the values.yml
66

@@ -20,7 +20,7 @@ client.tokenKeyServerUrl: https://networknt.oktapreview.com
2020
client.tokenKeyUri: /oauth2/aus66u5cybTrCsbZs1d6/v1/keys
2121
```
2222

23-
If everything works fine, you should see the following error that indicate all middleware handlers are passed and the AWS Lambda invocation is failed. This is because we are testing without AWS environment.
23+
If everything works fine, you should see the following error that indicate all middleware handlers are passed and the AWS Lambda invocation is failed. This is because we are testing without AWS environment.
2424

2525
```
2626
22:38:36.103 [main] DEBUG software.amazon.awssdk.auth.credentials.AwsCredentialsProviderChain -- Unable to load credentials from SystemPropertyCredentialsProvider(): Unable to load credentials from system settings. Access key must be specified either via environment variable (AWS_ACCESS_KEY_ID) or system property (aws.accessKeyId).

ccc-lambda/middleware-function/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<maven.compiler.source>${java.version}</maven.compiler.source>
1313
<maven.compiler.target>${java.version}</maven.compiler.target>
1414
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15-
<version.light-4j>2.1.31-SNAPSHOT</version.light-4j>
15+
<version.light-4j>2.1.32-SNAPSHOT</version.light-4j>
1616
<version.http-client>1.0.6</version.http-client>
1717
<version.jackson>2.15.2</version.jackson>
1818
<version.slf4j>2.0.9</version.slf4j>

ccc-lambda/middleware-function/resource-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
],
99
"excludes": [
1010
]
11-
}
11+
}
1212
}

ccc-lambda/middleware-function/src/main/resources/config/lambda-proxy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ metricsName: ${lambda-proxy.metricsName:}
77
lambdaAppId: ${lambda-proxy.lambdaAppId:}
88
requestChain: ${lambda-proxy.requestChain:}
99
responseChain: ${lambda-proxy.responseChain:}
10-
enableDynamoDbCache: ${lambda-proxy.enableDynamoDbCache:false}
10+
enableDynamoDbCache: ${lambda-proxy.enableDynamoDbCache:false}

ccc-lambda/middleware-function/src/main/resources/config/pooled-chain-executor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ corePoolSize: ${pooled-chain-executor.corePoolSize:10}
33
keepAliveTime: ${pooled-chain-executor.keepAliveTime:0}
44
maxChainSize: ${pooled-chain-executor.maxChainSize:20}
55
forceSynchronousExecution: ${pooled-chain-executor.forceSynchronousExecution:false}
6-
exitOnMiddlewareInstanceCreationFailure: ${pooled-chain-executor.exitOnMiddlewareInstanceCreationFailure:true}
6+
exitOnMiddlewareInstanceCreationFailure: ${pooled-chain-executor.exitOnMiddlewareInstanceCreationFailure:true}

ccc-lambda/middleware-function/src/test/java/com/networknt/aws/lambda/TestContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,4 @@ public void log(byte[] bytes) {
132132
System.err.println(new String(bytes, StandardCharsets.UTF_8));
133133
}
134134
}
135-
}
135+
}

ccc-lambda/middleware-function/src/test/java/com/networknt/aws/lambda/middleware/TestAsynchronousMiddleware.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,3 @@ public void getCachedConfigurations() {
3939

4040
}
4141
}
42-

0 commit comments

Comments
 (0)