Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: awslabs/aws-elasticache-cluster-client-memcached-for-java
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: infinispan/memcached-client
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: infinispan_release
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 10 commits
  • 46 files changed
  • 1 contributor

Commits on Jan 16, 2024

  1. Copy the full SHA
    aa7c5ea View commit details
  2. SASL authentication fixes

    * Reuse SaslClient across all steps of an authentication
    * Allow passing a server name through AuthDescriptor
    * Allow passing SASL client properties through AuthDescriptor
    tristantarrant committed Jan 16, 2024
    Copy the full SHA
    c95dc5f View commit details
  3. Copy the full SHA
    1156258 View commit details
  4. Copy the full SHA
    e5e4aeb View commit details
  5. Fix javadocs

    tristantarrant committed Jan 16, 2024
    Copy the full SHA
    c008bb8 View commit details
  6. Copy the full SHA
    2c1a70c View commit details
  7. Fixing issue where an NPE would occur if a authDescriptor was sent in…

    …to the memcached instance, found while trying to implement SASL for customers to have a way to secure their memcached instances.
    tristantarrant committed Jan 16, 2024
    Copy the full SHA
    e8d566c View commit details
  8. 1.2.2

    tristantarrant committed Jan 16, 2024
    Copy the full SHA
    efa174b View commit details
  9. 1.2.3-SNAPSHOT

    tristantarrant committed Jan 16, 2024
    Copy the full SHA
    0718546 View commit details
  10. Copy the full SHA
    ea31d15 View commit details
Showing with 697 additions and 249 deletions.
  1. +24 −11 README.markdown
  2. +3 −5 SECURITY.md
  3. +8 −8 build.xml
  4. +2 −2 ivy.xml
  5. +164 −48 pom.xml
  6. +9 −0 src/it/java/net/spy/memcached/ProtocolBaseCase.java
  7. +1 −1 src/main/java/net/spy/memcached/CASMutator.java
  8. +5 −4 src/main/java/net/spy/memcached/DefaultConnectionFactory.java
  9. +1 −1 src/main/java/net/spy/memcached/KetamaNodeLocator.java
  10. +9 −9 src/main/java/net/spy/memcached/MemcachedClient.java
  11. +1 −1 src/main/java/net/spy/memcached/MemcachedConnection.java
  12. +1 −1 src/main/java/net/spy/memcached/MemcachedNode.java
  13. +3 −5 src/main/java/net/spy/memcached/OperationFactory.java
  14. +127 −0 src/main/java/net/spy/memcached/auth/AsciiAuthThread.java
  15. +41 −1 src/main/java/net/spy/memcached/auth/AuthDescriptor.java
  16. +12 −10 src/main/java/net/spy/memcached/auth/AuthThreadMonitor.java
  17. +32 −18 src/main/java/net/spy/memcached/auth/{AuthThread.java → BinaryAuthThread.java}
  18. +69 −0 src/main/java/net/spy/memcached/auth/SaslUtils.java
  19. +1 −1 src/main/java/net/spy/memcached/auth/package.html
  20. +1 −1 src/main/java/net/spy/memcached/compat/log/package.html
  21. +1 −1 src/main/java/net/spy/memcached/compat/package.html
  22. +4 −7 src/main/java/net/spy/memcached/config/NodeEndPoint.java
  23. +2 −2 src/main/java/net/spy/memcached/internal/OperationFuture.java
  24. +1 −1 src/main/java/net/spy/memcached/internal/package.html
  25. +1 −1 src/main/java/net/spy/memcached/ops/package.html
  26. +1 −1 src/main/java/net/spy/memcached/overview.html
  27. +1 −1 src/main/java/net/spy/memcached/package.html
  28. +3 −3 src/main/java/net/spy/memcached/protocol/ascii/AsciiMemcachedNodeImpl.java
  29. +12 −7 src/main/java/net/spy/memcached/protocol/ascii/AsciiOperationFactory.java
  30. +14 −25 src/main/java/net/spy/memcached/protocol/ascii/BaseGetOpImpl.java
  31. +19 −3 src/main/java/net/spy/memcached/protocol/ascii/GetAndTouchOperationImpl.java
  32. +8 −1 src/main/java/net/spy/memcached/protocol/ascii/GetlOperationImpl.java
  33. +1 −1 src/main/java/net/spy/memcached/protocol/ascii/package.html
  34. +9 −11 src/main/java/net/spy/memcached/protocol/binary/BinaryOperationFactory.java
  35. +6 −11 src/main/java/net/spy/memcached/protocol/binary/SASLAuthOperationImpl.java
  36. +11 −25 src/main/java/net/spy/memcached/protocol/binary/SASLBaseOperationImpl.java
  37. +6 −10 src/main/java/net/spy/memcached/protocol/binary/SASLStepOperationImpl.java
  38. +1 −1 src/main/java/net/spy/memcached/protocol/binary/package.html
  39. +1 −1 src/main/java/net/spy/memcached/protocol/package.html
  40. +0 −1 src/main/java/net/spy/memcached/spring/MemcachedClientFactoryBean.java
  41. +1 −1 src/main/java/net/spy/memcached/transcoders/package.html
  42. +1 −1 src/main/java/net/spy/memcached/util/package.html
  43. +1 −1 src/test/java/net/spy/memcached/protocol/ascii/AsciiToStringTest.java
  44. +2 −2 src/test/java/net/spy/memcached/protocol/binary/BinaryToStringTest.java
  45. +73 −0 src/test/manual/net/spy/memcached/test/AsciiAuthTest.java
  46. +3 −3 src/test/manual/net/spy/memcached/test/{AuthTest.java → BinaryAuthTest.java}
35 changes: 24 additions & 11 deletions README.markdown
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
# Amazon ElastiCache Cluster Client
# Memcached Cluster Client

[![Build Status](https://travis-ci.org/awslabs/aws-elasticache-cluster-client-memcached-for-java.svg?branch=master)](https://travis-ci.org/awslabs/aws-elasticache-cluster-client-memcached-for-java)
Memcached Cluster Client is an enhanced Java library to connect to ElastiCache clusters. This client library has been built upon Spymemcached and is released under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0).

Amazon ElastiCache Cluster Client is an enhanced Java library to connect to ElastiCache clusters. This client library has been built upon Spymemcached and is released under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0).
# Maven coordinates

Artifacts published from this repository are available from Maven central using the following coordinates:

```xml
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>memcached-client</artifactId>
<version>1.2.1-SNAPSHOT</version>
</dependency>
```

# Building

Amazon ElastiCache Cluster Client can be compiled using Apache Ant by running the following
Memcached Cluster Client can be compiled using Apache Ant by running the following
command:

ant
@@ -16,10 +26,11 @@ directory of the project.

# Configuring the client in TLS mode

As memcached supports TLS since version 1.5.13, Amazon ElastiCache Cluster Client added TLS support for better security.
As memcached supports TLS since version 1.5.13, Memcached Cluster Client added TLS support for better security.

In order to create a client in TLS mode, do the following to initialize the client with the appropriate SSLContext:

```java
import java.security.cert.CertificateFactory;
import java.security.KeyStore;
import javax.net.ssl.SSLContext;
@@ -46,9 +57,11 @@ In order to create a client in TLS mode, do the following to initialize the clie
client.set("theKey", 3600, "This is the data value");
}
}
```

To create the TLS mode client with customized TLS certificate, initialize the SSLContext as follows:

```java
InputStream inputStream = new FileInputStream("/tmp/my_certificate");
KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
ks.load(null);
@@ -57,12 +70,13 @@ To create the TLS mode client with customized TLS certificate, initialize the SS
tmf.init(ks);
SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(null, tmf.getTrustManagers(), null);
```

The rest of the logic to create the client follows.

# Testing

The latest version of Amazon ElastiCache Cluster Client supports unit tests and integration tests.
The latest version of Memcached Cluster Client supports unit tests and integration tests.

## Unit Tests
Unit tests do not require any running memcached servers, and can be run using Apache Ant by the following command:
@@ -100,11 +114,10 @@ This argument is used to specify the type of your testing server. Supported opti
This argument is used to specify the folder of the 2 certificates for starting memcached server with TLS enabled. Named those 2 certificates as _private.cert_ and _public.cert_. This is mandatory if you want to run integration tests with TLS mode.
Besides, your testing server should be built with TLS capability. See instruction: https://github.com/memcached/memcached/wiki/TLS

# More Information for Amazon ElastiCache Cluster Client
Github link: https://github.com/amazonwebservices/aws-elasticache-cluster-client-memcached-for-java.
This repository is a fork of the spymemcached Java client for connecting to memcached (specifically the https://github.com/dustin/java-memcached-client repo).

Additional changes have been made to support Amazon ElastiCache Auto Discovery. To read more about Auto Discovery, please go here: https://docs.aws.amazon.com/AmazonElastiCache/latest/mem-ug/AutoDiscovery.html.
# More Information for Memcached Cluster Client
Github link: https://github.com/infinispan/memcached-client.
This repository is a fork of the spymemcached Java client for connecting to memcached (specifically the https://github.com/dustin/java-memcached-client repo),
including the changes added by AWS to support Memcached Auto Discovery. To read more about Auto Discovery, please go here: https://docs.aws.amazon.com/AmazonElastiCache/latest/mem-ug/AutoDiscovery.html.

For more information about Spymemcached see the link below:

8 changes: 3 additions & 5 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -6,11 +6,9 @@ Use this section to tell people about which versions of your project are
currently being supported with security updates.

| Version | Supported |
| ------- | ------------------ |
| 5.1.x | :white_check_mark: |
| 5.0.x | :x: |
| 4.0.x | :white_check_mark: |
| < 4.0 | :x: |
|---------| ------------------ |
| 1.2.x | :white_check_mark: |
| < 1.2.0 | :x: |

## Reporting a Vulnerability

16 changes: 8 additions & 8 deletions build.xml
Original file line number Diff line number Diff line change
@@ -356,8 +356,8 @@
destdir="${build.test.classes}"
debug="${javac.debug}"
includeantruntime="false"
target="1.6"
source="1.6">
target="8"
source="8">
<classpath>
<path refid="test.classpath"/>
</classpath>
@@ -374,8 +374,8 @@
destdir="${build.it.classes}"
debug="${javac.debug}"
includeantruntime="false"
target="1.6"
source="1.6">
target="8"
source="8">
<classpath>
<path refid="it.classpath"/>
</classpath>
@@ -507,8 +507,8 @@
debug="${javac.debug}"
deprecation="${javac.deprecation}"
includeantruntime="false"
target="1.6"
source="1.6">
target="8"
source="8">
<classpath refid="${name}.common.classpath" />
</javac>

@@ -520,8 +520,8 @@
debug="${javac.debug}"
deprecation="${javac.deprecation}"
includeantruntime="false"
target="1.6"
source="1.6">
target="8"
source="8">
<classpath refid="${name}.common.classpath"/>
</javac>
<move file="${build.src.dir}/net/spy/memcached/changelog.txt"
4 changes: 2 additions & 2 deletions ivy.xml
Original file line number Diff line number Diff line change
@@ -48,8 +48,8 @@ SOFTWARE.
</publications>

<dependencies defaultconfmapping="sources->sources(),%->default" defaultconf="default,sources">
<dependency org="org.apache.logging.log4j" name="log4j-api" rev="2.13.3" conf="common->master" />
<dependency org="org.apache.logging.log4j" name="log4j-core" rev="2.13.3" conf="common->master" />
<dependency org="org.apache.logging.log4j" name="log4j-api" rev="2.20.0" conf="common->master" />
<dependency org="org.apache.logging.log4j" name="log4j-core" rev="2.20.0" conf="common->master" />
<dependency org="jmock" name="jmock" rev="${jmock.version}"
conf="common->master" />
<dependency org="junit" name="junit" rev="${junit.version}"
212 changes: 164 additions & 48 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,75 +1,79 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.amazonaws</groupId>
<artifactId>elasticache-java-cluster-client</artifactId>
<version>1.2.2</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>6</source>
<target>6</target>
</configuration>
</plugin>
</plugins>
</build>
<name>ElastiCacheJavaClusterClient</name>
<description>Amazon ElastiCache Cluster Client is an enhanced Java library to connect to ElastiCache clusters. This client library has been built upon Spymemcached and is released under the Apache 2.0 License.</description>
<url>https://aws.amazon.com/documentation/elasticache/</url>

<groupId>org.infinispan</groupId>
<artifactId>memcached-client</artifactId>
<version>1.2.3-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
</build>
<name>Memcached Client</name>
<description>Memcached Client is an enhanced Java library to connect to Memcached clusters. This client library has been built upon Spymemcached and is released under the Apache 2.0 License.</description>
<url>https://github.com/infinispan/memcached-client</url>
<dependencies>
<!-- Optional Dependencies at Runtime -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
<version>2.13.3</version>
<optional>true</optional>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
<version>2.19.0</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
<optional>true</optional>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.36</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>5.3.18</version>
<optional>true</optional>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>5.3.20</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.codahale.metrics</groupId>
<artifactId>metrics-core</artifactId>
<version>3.0.1</version>
<optional>true</optional>
<groupId>com.codahale.metrics</groupId>
<artifactId>metrics-core</artifactId>
<version>3.0.1</version>
<optional>true</optional>
</dependency>

<!-- Test Dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>test</scope>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jmock</groupId>
<artifactId>jmock</artifactId>
<version>1.2.0</version>
<scope>test</scope>
<groupId>jmock</groupId>
<artifactId>jmock</artifactId>
<version>1.2.0</version>
<scope>test</scope>
</dependency>
</dependencies>

<licenses>
<license>
<name>Apache 2.0 License</name>
<url>https://www.apache.org/licenses/LICENSE-2.0</url>
</license>
</licenses>
<scm>
<connection>scm:git:git@github.com:amazonwebservices/aws-elasticache-cluster-client-memcached-for-java.git</connection>
<url>https://github.com/amazonwebservices/aws-elasticache-cluster-client-memcached-for-java.git</url>
<connection>scm:git:git@github.com:infinispan/memcached-client.git</connection>
<url>https://github.com/infinispan/memcached-client</url>
</scm>
<developers>
<developer>
@@ -80,6 +84,118 @@
<role>developer</role>
</roles>
</developer>
<developer>
<id>infinispan</id>
<organization>Infinispan</organization>
<organizationUrl>https://infinispan.org</organizationUrl>
<roles>
<role>developer</role>
</roles>
</developer>
</developers>

<profiles>
<profile>
<id>release</id>
<properties>
<!-- maven repository urls -->
<maven.releases.nexus.url>https://s01.oss.sonatype.org/</maven.releases.nexus.url>
<maven.releases.repo.id>ossrh</maven.releases.repo.id>
<maven.releases.repo.url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</maven.releases.repo.url>
<maven.snapshots.repo.id>ossrh</maven.snapshots.repo.id>
<maven.snapshots.repo.url>https://s01.oss.sonatype.org/content/repositories/snapshots</maven.snapshots.repo.url>
</properties>
<distributionManagement>
<snapshotRepository>
<id>${maven.snapshots.repo.id}</id>
<url>${maven.snapshots.repo.url}</url>
</snapshotRepository>
<repository>
<id>${maven.releases.repo.id}</id>
<url>${maven.releases.repo.url}</url>
</repository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<id>javadoc</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<source>8</source>
<doclint>none</doclint>
<detectLinks>false</detectLinks>
<detectOfflineLinks>false</detectOfflineLinks>
<links>
<link>http://docs.oracle.com/javase/8/docs/api/</link>
</links>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.13</version>
<extensions>true</extensions>
<configuration>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
<stagingDescription>Memcached Client ${project.version} release</stagingDescription>
<nexusUrl>${maven.releases.nexus.url}</nexusUrl>
<serverId>${maven.releases.repo.id}</serverId>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<passphraseServerId>gpg.passphrase</passphraseServerId>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>1.13.0</version>
<configuration>
<tag>${project.version}</tag>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Loading