Skip to content

Commit db62414

Browse files
authored
fixes #127 add lambda-utility and schema-validator to share with native (#128)
1 parent 2a1c6d7 commit db62414

25 files changed

Lines changed: 1117 additions & 30 deletions

File tree

custom-runtime/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<groupId>com.networknt</groupId>
2323
<artifactId>light-aws-lambda</artifactId>
2424
<version>2.1.35-SNAPSHOT</version>
25-
<relativePath>..</relativePath>
25+
<relativePath>../pom.xml</relativePath>
2626
</parent>
2727

2828
<artifactId>custom-runtime</artifactId>

env-config/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<groupId>com.networknt</groupId>
2323
<artifactId>light-aws-lambda</artifactId>
2424
<version>2.1.35-SNAPSHOT</version>
25-
<relativePath>..</relativePath>
25+
<relativePath>../pom.xml</relativePath>
2626
</parent>
2727

2828
<artifactId>env-config</artifactId>

lambda-interceptor/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<groupId>com.networknt</groupId>
2323
<artifactId>light-aws-lambda</artifactId>
2424
<version>2.1.35-SNAPSHOT</version>
25-
<relativePath>..</relativePath>
25+
<relativePath>../pom.xml</relativePath>
2626
</parent>
2727

2828
<artifactId>lambda-interceptor</artifactId>

lambda-invoker/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<groupId>com.networknt</groupId>
2323
<artifactId>light-aws-lambda</artifactId>
2424
<version>2.1.35-SNAPSHOT</version>
25-
<relativePath>..</relativePath>
25+
<relativePath>../pom.xml</relativePath>
2626
</parent>
2727

2828
<artifactId>lambda-invoker</artifactId>

lambda-utility/pom.xml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<!--
2+
~ Copyright (c) 2016 Network New Technologies Inc.
3+
~
4+
~ Licensed under the Apache License, Version 2.0 (the "License");
5+
~ you may not use this file except in compliance with the License.
6+
~ You may obtain a copy of the License at
7+
~
8+
~ http://www.apache.org/licenses/LICENSE-2.0
9+
~
10+
~ Unless required by applicable law or agreed to in writing, software
11+
~ distributed under the License is distributed on an "AS IS" BASIS,
12+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
~ See the License for the specific language governing permissions and
14+
~ limitations under the License.
15+
-->
16+
17+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
18+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
19+
<modelVersion>4.0.0</modelVersion>
20+
21+
<parent>
22+
<groupId>com.networknt</groupId>
23+
<artifactId>light-aws-lambda</artifactId>
24+
<version>2.1.35-SNAPSHOT</version>
25+
<relativePath>../pom.xml</relativePath>
26+
</parent>
27+
28+
<artifactId>lambda-utility</artifactId>
29+
<packaging>jar</packaging>
30+
<description>Lambda function utility module</description>
31+
32+
<dependencies>
33+
<dependency>
34+
<groupId>com.networknt</groupId>
35+
<artifactId>utility</artifactId>
36+
</dependency>
37+
<dependency>
38+
<groupId>org.slf4j</groupId>
39+
<artifactId>slf4j-api</artifactId>
40+
</dependency>
41+
<dependency>
42+
<groupId>ch.qos.logback</groupId>
43+
<artifactId>logback-classic</artifactId>
44+
</dependency>
45+
46+
<dependency>
47+
<groupId>org.junit.jupiter</groupId>
48+
<artifactId>junit-jupiter-api</artifactId>
49+
<scope>test</scope>
50+
</dependency>
51+
<dependency>
52+
<groupId>org.junit.jupiter</groupId>
53+
<artifactId>junit-jupiter-engine</artifactId>
54+
<scope>test</scope>
55+
</dependency>
56+
</dependencies>
57+
58+
</project>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.networknt.aws.lambda.utility;
2+
3+
public class HeaderKey {
4+
5+
/* unique header keys used by light-4j */
6+
public static final String TRACEABILITY = "X-Traceability-Id";
7+
public static final String CORRELATION = "X-Correlation-Id";
8+
public static final String AUTHORIZATION = "Authorization";
9+
public static final String SCOPE_TOKEN = "X-Scope-Token";
10+
/* common header keys */
11+
public static final String CONTENT_TYPE = "Content-Type";
12+
public static final String WWW_AUTHENTICATE = "WWW-Authenticate";
13+
/* Amazon header keys */
14+
public static final String PARAMETER_SECRET_TOKEN = "X-Aws-Parameters-Secrets-Token";
15+
public static final String AMZ_TARGET = "X-Amz-Target";
16+
17+
public static final String SERVICE_ID = "service_id";
18+
public static final String SERVICE_URL = "service_url";
19+
20+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.networknt.aws.lambda.utility;
2+
3+
public class HeaderValue {
4+
5+
public static final String APPLICATION_JSON = "application/json";
6+
public static final String APPLICATION_AMZ = "application/x-amz-json-1.1";
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.networknt.aws.lambda.utility;
2+
3+
public class LambdaEnvVariables {
4+
public static final String LAMBDA_SESSION_TOKEN = "AWS_SESSION_TOKEN";
5+
public static final String AWS_REGION = "AWS_REGION";
6+
public static final String CLEAR_AWS_DYNAMO_DB_TABLES = "CLEAR_AWS_DYNAMO_DB_TABLES";
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.networknt.aws.lambda.utility;
2+
3+
public class LoggerKey {
4+
public static final String TRACEABILITY = "tid";
5+
public static final String CORRELATION = "cid";
6+
7+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package com.networknt.aws.lambda.utility;
2+
3+
import org.junit.jupiter.api.Test;
4+
5+
public class HeaderKeyTest {
6+
@Test
7+
public void testHeaderKey() {
8+
assert HeaderKey.TRACEABILITY.equals("X-Traceability-Id");
9+
}
10+
}

0 commit comments

Comments
 (0)