Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update fork #7

Merged
merged 42 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
74ed28e
Fix broken link in readme (#228)
AravinthsamySekar Nov 9, 2022
01dc3b4
Bump up Kafka version (#232)
mohitpali Nov 9, 2022
68a62a8
Add a new module for Serde with msk-iam auth (#239)
awsalialem Jan 31, 2023
5381480
Add Shade plugin
awsalialem Feb 9, 2023
4b79cc2
Merge pull request #244 from awsalialem/add-shade-plugin
YangSan0622 Feb 15, 2023
9fc69bd
Upgrade version to 1.1.15 (#249)
YangSan0622 Mar 6, 2023
c77e70c
Fix build failure on windows runners. (#251)
NersesAM Mar 8, 2023
c1da66a
Fixes #247 (#248)
NersesAM Mar 8, 2023
c07bf26
Build with JDK 17. Remove outdated 9 and 13 (#254)
NersesAM Mar 13, 2023
c14f0a0
Add property to provide a http proxy url to connect to glue registry …
abhilash47 Apr 12, 2023
88c1a53
Update wire
strokyl Dec 6, 2022
e87e343
Merge pull request #230 from conduktor/update_square_wire_schema_to_4…
YangSan0622 May 12, 2023
c1f4818
Update dependencies to resolve vulnerabilities from transitive depend…
YangSan0622 Jul 18, 2023
a8b3d0a
Merge pull request #276 from awslabs/release-1.1.16
YangSan0622 Jul 20, 2023
85c279e
Bump to version v1.1.16
YangSan0622 Jul 23, 2023
1b9a064
Merge pull request #278 from awslabs/version-bump-v1.1.16
YangSan0622 Jul 24, 2023
2d87616
Bump guava from 30.0-jre to 32.0.0-jre (#270)
dependabot[bot] Jul 26, 2023
0966ddd
Bump guava from 30.0-jre to 32.0.0-jre in /common (#269)
dependabot[bot] Jul 26, 2023
6c10769
Update to the latest everit-json-schema (#262)
pwhittlesea Jul 26, 2023
0736ef2
Bump com.squareup.okio:okio in /serializer-deserializer (#277)
dependabot[bot] Jul 26, 2023
b21541f
Update docker-compose.yml (#284)
mohitpali Jul 31, 2023
f93442a
Use default region provider chain (#280)
singhbaljit Aug 28, 2023
a4923d4
Update kafka dependencies version and bump library version to v1.1.17…
vanessapinto257 Oct 6, 2023
9c54f46
Bump org.apache.avro:avro from 1.11.1 to 1.11.3 (#300)
dependabot[bot] Oct 18, 2023
58f8515
Bump org.apache.avro:avro from 1.11.1 to 1.11.3 in /common (#299)
dependabot[bot] Oct 18, 2023
4b483ed
Bump org.apache.avro:avro from 1.11.1 to 1.11.3 in /integration-tests…
dependabot[bot] Oct 18, 2023
7a8c74f
Add a dummy class in the serializer-deserializer-msk-iam module for j…
YangSan0622 Oct 18, 2023
40c551c
Bump org.json:json from 20230618 to 20231013 (#304)
dependabot[bot] Oct 18, 2023
5737442
Update the target scala version to 2.13 for mbknor-jackson-jsonschema…
junyuche Nov 14, 2023
d74f2fa
Merge pull request #310 from junyuc25/update-scala-version
YangSan0622 Dec 13, 2023
fb7e721
Revert "Update the target scala version to 2.13 for mbknor-jackson-js…
blacktooth Dec 15, 2023
240c2fd
Bump the AWS SDK version to 2.22.12 and 1.12.633 to fix all vulnerabi…
YangSan0622 Jan 16, 2024
a69e28c
Merge pull request #323 from awslabs/aws-sdk-version-update
YangSan0622 Jan 16, 2024
6613a93
Bump library version to 1.1.18
YangSan0622 Jan 16, 2024
7151905
Merge pull request #324 from awslabs/bump-version-1.1.18
YangSan0622 Jan 17, 2024
19d34bb
Update SDK version to remove ION dependencies
Feb 26, 2024
3276e59
Remove ion dependencies from root pom
Feb 26, 2024
1cdc4fc
Merge pull request #334 from awslabs/remove-ion
YangSan0622 Feb 27, 2024
70c7cd9
Bump library version to 1.1.19
Feb 28, 2024
8596e42
Merge pull request #335 from awslabs/bump-version-1.1.19
YangSan0622 Feb 28, 2024
2c79afe
Remove commons compression at project level. (#344)
blacktooth May 17, 2024
b27359e
Bump library version to 1.1.20 (#345)
blacktooth May 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 9 additions & 15 deletions .github/workflows/MavenCI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ on:
pull_request:
branches: [ master ]
release:
branches: [ master ]
types: [ created ]
branches: [ master ]
types: [ created ]

jobs:
build:
runs-on: ${{ matrix.operating-system }}
Expand All @@ -19,31 +19,25 @@ jobs:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
java-version: ['8', '9', '11', '13']
java-version: ['8', '11', '17']

steps:
- uses: actions/checkout@v2

- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java-version }}

- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: install build-tools
run: mvn --file build-tools/pom.xml clean install

- name: Clean, build and install

- name: Clean, build and install
run: mvn --file pom.xml clean install

- name: Run tests
run: mvn --file pom.xml test


- name: Build package
run: mvn -B package --file pom.xml
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
#Ignore IntelliJ files
.idea/
.DS_Store
*.iml

#Ignore Maven files
**/target

**/.settings
**/*.project
**/*.classpath
**/*.factorypath
**/dependency-reduced-pom.xml
23 changes: 22 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,25 @@ GlueSchemaRegistryKafkaSerializer/GlueSchemaRegistryKafkaDeserializer.

## Release 1.1.14
* Upgraded Protobuf dependency version to prevent a CVE
* Upgraded everit-json-schema dependency version to prevent a CVE
* Upgraded everit-json-schema dependency version to prevent a CVE

## Release 1.1.15
* Upgrade Avro, Apicurio and Localhost utils versions

## Release 1.1.16
* Upgraded Wire version
* Excluded some transitive dependencies that are having vulnerabilities

## Release 1.1.17
* Upgraded kafka dependencies version

## Release 1.1.18
* Add a dummy class in the serializer-deserializer-msk-iam module for javadoc and source jar generation
* Upgraded Avro and Json dependencies version
* Upgraded AWS SDK v1 and v2 versions to fix vulnerabilities

## Release 1.1.19
* Upgraded dependency versions to remove ION dependencies

## Release 1.1.20
* Upgrade the dependency version to remove commons:compress dependency
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ The recommended way to use the AWS Glue Schema Registry Library for Java is to c
<dependency>
<groupId>software.amazon.glue</groupId>
<artifactId>schema-registry-serde</artifactId>
<version>1.1.14</version>
<version>1.1.20</version>
</dependency>
```
### Code Example
Expand Down Expand Up @@ -381,7 +381,7 @@ Alternatively, a schema registry naming strategy implementation can be provided.
properties.put(AWSSchemaRegistryConstants.SCHEMA_NAMING_GENERATION_CLASS,
"com.amazonaws.services.schemaregistry.serializers.avro.CustomerProvidedSchemaNamingStrategy");
```
An example test implementation class is [here](https://github.com/awslabs/aws-glue-schema-registry/blob/master/avro-serializer-deserializer/src/test/java/com/amazonaws/services/schemaregistry/serializers/avro/CustomerProvidedSchemaNamingStrategy.java).
An example test implementation class is [here](https://github.com/awslabs/aws-glue-schema-registry/blob/master/serializer-deserializer/src/test/java/com/amazonaws/services/schemaregistry/serializers/avro/CustomerProvidedSchemaNamingStrategy.java).

### Providing Registry Description

Expand Down Expand Up @@ -490,7 +490,7 @@ It should look like this
* If using bash, run the below commands to set-up your CLASSPATH in your bash_profile. (For any other shell, update the environment accordingly.)
```bash
echo 'export GSR_LIB_BASE_DIR=<>' >>~/.bash_profile
echo 'export GSR_LIB_VERSION=1.1.14' >>~/.bash_profile
echo 'export GSR_LIB_VERSION=1.1.20' >>~/.bash_profile
echo 'export KAFKA_HOME=<your kafka installation directory>' >>~/.bash_profile
echo 'export CLASSPATH=$CLASSPATH:$GSR_LIB_BASE_DIR/avro-kafkaconnect-converter/target/schema-registry-kafkaconnect-converter-$GSR_LIB_VERSION.jar:$GSR_LIB_BASE_DIR/common/target/schema-registry-common-$GSR_LIB_VERSION.jar:$GSR_LIB_BASE_DIR/avro-serializer-deserializer/target/schema-registry-serde-$GSR_LIB_VERSION.jar' >>~/.bash_profile
source ~/.bash_profile
Expand Down Expand Up @@ -549,7 +549,7 @@ It should look like this
<dependency>
<groupId>software.amazon.glue</groupId>
<artifactId>schema-registry-kafkastreams-serde</artifactId>
<version>1.1.14</version>
<version>1.1.20</version>
</dependency>
```

Expand Down Expand Up @@ -587,7 +587,7 @@ repository for the latest support: [Avro SerializationSchema and Deserialization
<dependency>
<groupId>software.amazon.glue</groupId>
<artifactId>schema-registry-flink-serde</artifactId>
<version>1.1.14</version>
<version>1.1.20</version>
</dependency>
```
### Code Example
Expand Down
4 changes: 2 additions & 2 deletions avro-flink-serde/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ inside Amazon VPC.](https://docs.aws.amazon.com/kinesisanalytics/latest/java/vpc
<dependency>
<groupId>software.amazon.glue</groupId>
<artifactId>schema-registry-flink-serde</artifactId>
<version>1.1.8/version>
<version>1.1.20/version>
</dependency>
```
### Code Example
Expand Down Expand Up @@ -67,4 +67,4 @@ inside Amazon VPC.](https://docs.aws.amazon.com/kinesisanalytics/latest/java/vpc
GlueSchemaRegistryAvroDeserializationSchema.forGeneric(schema, configs),
properties);
DataStream<GenericRecord> stream = env.addSource(consumer);
```
```
18 changes: 10 additions & 8 deletions avro-flink-serde/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<groupId>software.amazon.glue</groupId>
<artifactId>schema-registry-flink-serde</artifactId>
<version>1.1.14</version>
<version>1.1.20</version>
<name>AWS Glue Schema Registry Flink Avro Serialization Deserialization Schema</name>
<description>The AWS Glue Schema Registry Library for Apache Flink enables Java developers to easily integrate
their Apache Flink applications with AWS Glue Schema Registry
Expand Down Expand Up @@ -66,7 +66,13 @@
<dependency>
<groupId>software.amazon.glue</groupId>
<artifactId>schema-registry-serde</artifactId>
<version>1.1.14</version>
<version>1.1.20</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.26</version>
<scope>provided</scope>
</dependency>

<dependency>
Expand Down Expand Up @@ -143,11 +149,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.21</version>
</dependency>

<dependency>
<groupId>org.apache.flink</groupId>
Expand Down Expand Up @@ -181,6 +182,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
Expand Down Expand Up @@ -217,7 +219,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.5</version>
<version>0.8.8</version>
<executions>
<execution>
<goals>
Expand Down
6 changes: 5 additions & 1 deletion avro-kafkaconnect-converter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<parent>
<groupId>software.amazon.glue</groupId>
<artifactId>schema-registry-parent</artifactId>
<version>1.1.14</version>
<version>1.1.20</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down Expand Up @@ -69,6 +69,10 @@
<groupId>org.apache.kafka</groupId>
<artifactId>connect-api</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions build-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>software.amazon.glue</groupId>
<artifactId>schema-registry-parent</artifactId>
<version>1.1.14</version>
<version>1.1.20</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down Expand Up @@ -62,7 +62,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.5</version>
<version>0.8.8</version>
<executions>
<execution>
<phase>verify</phase>
Expand Down
10 changes: 1 addition & 9 deletions common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>software.amazon.glue</groupId>
<artifactId>schema-registry-parent</artifactId>
<version>1.1.14</version>
<version>1.1.20</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down Expand Up @@ -89,10 +89,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
Expand All @@ -109,10 +105,6 @@
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-utils</artifactId>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import software.amazon.awssdk.core.interceptor.ExecutionAttributes;
import software.amazon.awssdk.core.interceptor.ExecutionInterceptor;
import software.amazon.awssdk.core.retry.RetryPolicy;
import software.amazon.awssdk.http.urlconnection.ProxyConfiguration;
import software.amazon.awssdk.http.urlconnection.UrlConnectionHttpClient;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.glue.GlueClient;
Expand Down Expand Up @@ -89,12 +90,18 @@ public AWSSchemaRegistryClient(@NonNull AwsCredentialsProvider credentialsProvid
.retryPolicy(retryPolicy)
.addExecutionInterceptor(new UserAgentRequestInterceptor())
.build();
UrlConnectionHttpClient.Builder urlConnectionHttpClientBuilder = UrlConnectionHttpClient.builder();
if (glueSchemaRegistryConfiguration.getProxyUrl() != null) {
log.debug("Creating http client using proxy {}", glueSchemaRegistryConfiguration.getProxyUrl().toString());
ProxyConfiguration proxy = ProxyConfiguration.builder().endpoint(glueSchemaRegistryConfiguration.getProxyUrl()).build();
urlConnectionHttpClientBuilder.proxyConfiguration(proxy);
}

GlueClientBuilder glueClientBuilder = GlueClient
.builder()
.credentialsProvider(credentialsProvider)
.overrideConfiguration(overrideConfiguration)
.httpClient(UrlConnectionHttpClient.builder().build())
.httpClient(urlConnectionHttpClientBuilder.build())
.region(Region.of(glueSchemaRegistryConfiguration.getRegion()));

if (glueSchemaRegistryConfiguration.getEndPoint() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.EnumUtils;
import software.amazon.awssdk.core.exception.SdkClientException;
import software.amazon.awssdk.regions.providers.DefaultAwsRegionProviderChain;
import software.amazon.awssdk.services.glue.model.Compatibility;

import java.net.URI;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -54,6 +57,7 @@ public class GlueSchemaRegistryConfiguration {
private Map<String, String> tags = new HashMap<>();
private Map<String, String> metadata;
private String secondaryDeserializer;
private URI proxyUrl;

/**
* Name of the application using the serializer/deserializer.
Expand Down Expand Up @@ -99,6 +103,7 @@ private void buildSchemaRegistryConfigs(Map<String, ?> configs) {
validateAndSetMetadata(configs);
validateAndSetUserAgent(configs);
validateAndSetSecondaryDeserializer(configs);
validateAndSetProxyUrl(configs);
}

private void validateAndSetSecondaryDeserializer(Map<String, ?> configs) {
Expand Down Expand Up @@ -147,7 +152,15 @@ private void validateAndSetAWSRegion(Map<String, ?> configs) {
if (isPresent(configs, AWSSchemaRegistryConstants.AWS_REGION)) {
this.region = String.valueOf(configs.get(AWSSchemaRegistryConstants.AWS_REGION));
} else {
throw new AWSSchemaRegistryException("Region is not defined in the properties");
try {
this.region = DefaultAwsRegionProviderChain
.builder()
.build()
.getRegion()
.id();
} catch (SdkClientException ex) {
throw new AWSSchemaRegistryException("Region is not defined in the properties", ex);
}
}
}

Expand Down Expand Up @@ -183,6 +196,18 @@ private void validateAndSetAWSEndpoint(Map<String, ?> configs) {
}
}

private void validateAndSetProxyUrl(Map<String, ?> configs) {
if (isPresent(configs, AWSSchemaRegistryConstants.PROXY_URL)) {
String value = (String) configs.get(AWSSchemaRegistryConstants.PROXY_URL);
try {
this.proxyUrl = URI.create(value);
} catch (IllegalArgumentException e) {
String message = String.format("Proxy URL property is not a valid URL: %s", value);
throw new AWSSchemaRegistryException(message, e);
}
}
}

private void validateAndSetDescription(Map<String, ?> configs) throws AWSSchemaRegistryException {
if (isPresent(configs, AWSSchemaRegistryConstants.DESCRIPTION)) {
this.description = String.valueOf(configs.get(AWSSchemaRegistryConstants.DESCRIPTION));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
import software.amazon.awssdk.services.glue.model.Compatibility;

public final class AWSSchemaRegistryConstants {
/**
* Proxy URL to use while connecting to AWS endpoint.
*/
public static final String PROXY_URL = "proxyUrl";
/**
* AWS endpoint to use while initializing the client for service.
*/
Expand Down
Loading
Loading