Skip to content

Commit

Permalink
Using SHA-256 instead of SHA1
Browse files Browse the repository at this point in the history
  • Loading branch information
thachlp committed Sep 10, 2024
1 parent bfbb85f commit 92a0b73
Show file tree
Hide file tree
Showing 12 changed files with 94 additions and 94 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@
<configuration>
<algorithms>
<algorithm>MD5</algorithm>
<algorithm>SHA-1</algorithm>
<algorithm>SHA-256</algorithm>
</algorithms>
</configuration>

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/lettuce/core/RedisNoScriptException.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package io.lettuce.core;

/**
* Exception that gets thrown when Redis indicates absence of a Lua script referenced by its SHA1 digest with a {@code NOSCRIPT}
* error response.
* Exception that gets thrown when Redis indicates absence of a Lua script referenced by its SHA-256 digest with a
* {@code NOSCRIPT} error response.
*
* @author Mark Paluch
* @since 4.5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ public interface RedisScriptingAsyncCommands<K, V> {
<T> RedisFuture<T> evalReadOnly(byte[] script, ScriptOutputType type, K[] keys, V... values);

/**
* Evaluates a script cached on the server side by its SHA1 digest.
* Evaluates a script cached on the server side by its SHA-256 digest.
*
* @param digest SHA1 of the script.
* @param digest SHA-256 of the script.
* @param type the type.
* @param keys the keys.
* @param <T> expected return type.
Expand All @@ -125,7 +125,7 @@ public interface RedisScriptingAsyncCommands<K, V> {
/**
* Execute a Lua script server side.
*
* @param digest SHA1 of the script.
* @param digest SHA-256 of the script.
* @param type the type.
* @param keys the keys.
* @param values the values.
Expand All @@ -137,7 +137,7 @@ public interface RedisScriptingAsyncCommands<K, V> {
/**
* This is a read-only variant of the EVALSHA command that cannot execute commands that modify data.
*
* @param digest SHA1 of the script.
* @param digest SHA-256 of the script.
* @param type the type.
* @param keys the keys.
* @param values the values.
Expand All @@ -151,9 +151,9 @@ public interface RedisScriptingAsyncCommands<K, V> {
* Check existence of scripts in the script cache.
*
* @param digests script digests.
* @return List&lt;Boolean&gt; array-reply The command returns an array of integers that correspond to the specified SHA1
* digest arguments. For every corresponding SHA1 digest of a script that actually exists in the script cache, an 1
* is returned, otherwise 0 is returned.
* @return List&lt;Boolean&gt; array-reply The command returns an array of integers that correspond to the specified SHA-256
* digest arguments. For every corresponding SHA-256 digest of a script that actually exists in the script cache, an
* 1 is returned, otherwise 0 is returned.
*/
RedisFuture<List<Boolean>> scriptExists(String... digests);

Expand Down Expand Up @@ -184,7 +184,7 @@ public interface RedisScriptingAsyncCommands<K, V> {
* Load the specified Lua script into the script cache.
*
* @param script script content.
* @return String bulk-string-reply This command returns the SHA1 digest of the script added into the script cache.
* @return String bulk-string-reply This command returns the SHA-256 digest of the script added into the script cache.
* @since 6.0
*/
RedisFuture<String> scriptLoad(String script);
Expand All @@ -193,25 +193,25 @@ public interface RedisScriptingAsyncCommands<K, V> {
* Load the specified Lua script into the script cache.
*
* @param script script content.
* @return String bulk-string-reply This command returns the SHA1 digest of the script added into the script cache.
* @return String bulk-string-reply This command returns the SHA-256 digest of the script added into the script cache.
* @since 6.0
*/
RedisFuture<String> scriptLoad(byte[] script);

/**
* Create a SHA1 digest from a Lua script.
* Create a SHA-256 digest from a Lua script.
*
* @param script script content.
* @return the SHA1 value.
* @return the SHA-256 value.
* @since 6.0
*/
String digest(String script);

/**
* Create a SHA1 digest from a Lua script.
* Create a SHA-256 digest from a Lua script.
*
* @param script script content.
* @return the SHA1 value.
* @return the SHA-256 value.
* @since 6.0
*/
String digest(byte[] script);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ public interface RedisScriptingReactiveCommands<K, V> {
<T> Flux<T> evalReadOnly(byte[] script, ScriptOutputType type, K[] keys, V... values);

/**
* Evaluates a script cached on the server side by its SHA1 digest.
* Evaluates a script cached on the server side by its SHA-256 digest.
*
* @param digest SHA1 of the script.
* @param digest SHA-256 of the script.
* @param type the type.
* @param keys the keys.
* @param <T> expected return type.
Expand All @@ -124,7 +124,7 @@ public interface RedisScriptingReactiveCommands<K, V> {
/**
* Execute a Lua script server side.
*
* @param digest SHA1 of the script.
* @param digest SHA-256 of the script.
* @param type the type.
* @param keys the keys.
* @param values the values.
Expand All @@ -136,7 +136,7 @@ public interface RedisScriptingReactiveCommands<K, V> {
/**
* This is a read-only variant of the EVALSHA command that cannot execute commands that modify data.
*
* @param digest SHA1 of the script.
* @param digest SHA-256 of the script.
* @param type the type.
* @param keys the keys.
* @param values the values.
Expand All @@ -150,8 +150,8 @@ public interface RedisScriptingReactiveCommands<K, V> {
* Check existence of scripts in the script cache.
*
* @param digests script digests.
* @return Boolean array-reply The command returns an array of integers that correspond to the specified SHA1 digest
* arguments. For every corresponding SHA1 digest of a script that actually exists in the script cache, an 1 is
* @return Boolean array-reply The command returns an array of integers that correspond to the specified SHA-256 digest
* arguments. For every corresponding SHA-256 digest of a script that actually exists in the script cache, an 1 is
* returned, otherwise 0 is returned.
*/
Flux<Boolean> scriptExists(String... digests);
Expand Down Expand Up @@ -183,7 +183,7 @@ public interface RedisScriptingReactiveCommands<K, V> {
* Load the specified Lua script into the script cache.
*
* @param script script content.
* @return String bulk-string-reply This command returns the SHA1 digest of the script added into the script cache.
* @return String bulk-string-reply This command returns the SHA-256 digest of the script added into the script cache.
* @since 6.0
*/
Mono<String> scriptLoad(String script);
Expand All @@ -192,25 +192,25 @@ public interface RedisScriptingReactiveCommands<K, V> {
* Load the specified Lua script into the script cache.
*
* @param script script content.
* @return String bulk-string-reply This command returns the SHA1 digest of the script added into the script cache.
* @return String bulk-string-reply This command returns the SHA-256 digest of the script added into the script cache.
* @since 6.0
*/
Mono<String> scriptLoad(byte[] script);

/**
* Create a SHA1 digest from a Lua script.
* Create a SHA-256 digest from a Lua script.
*
* @param script script content.
* @return the SHA1 value.
* @return the SHA-256 value.
* @since 6.0
*/
String digest(String script);

/**
* Create a SHA1 digest from a Lua script.
* Create a SHA-256 digest from a Lua script.
*
* @param script script content.
* @return the SHA1 value.
* @return the SHA-256 value.
* @since 6.0
*/
String digest(byte[] script);
Expand Down
26 changes: 13 additions & 13 deletions src/main/java/io/lettuce/core/api/sync/RedisScriptingCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ public interface RedisScriptingCommands<K, V> {
<T> T evalReadOnly(byte[] script, ScriptOutputType type, K[] keys, V... values);

/**
* Evaluates a script cached on the server side by its SHA1 digest.
* Evaluates a script cached on the server side by its SHA-256 digest.
*
* @param digest SHA1 of the script.
* @param digest SHA-256 of the script.
* @param type output type.
* @param keys the keys.
* @param <T> expected return type.
Expand All @@ -124,7 +124,7 @@ public interface RedisScriptingCommands<K, V> {
/**
* Execute a Lua script server side.
*
* @param digest SHA1 of the script.
* @param digest SHA-256 of the script.
* @param type output type.
* @param keys the keys.
* @param values the values.
Expand All @@ -136,7 +136,7 @@ public interface RedisScriptingCommands<K, V> {
/**
* This is a read-only variant of the EVALSHA command that cannot execute commands that modify data.
*
* @param digest SHA1 of the script.
* @param digest SHA-256 of the script.
* @param type output type.
* @param keys the keys.
* @param values the values.
Expand All @@ -150,9 +150,9 @@ public interface RedisScriptingCommands<K, V> {
* Check existence of scripts in the script cache.
*
* @param digests script digests.
* @return List&lt;Boolean&gt; array-reply The command returns an array of integers that correspond to the specified SHA1
* digest arguments. For every corresponding SHA1 digest of a script that actually exists in the script cache, an 1
* is returned, otherwise 0 is returned.
* @return List&lt;Boolean&gt; array-reply The command returns an array of integers that correspond to the specified SHA-256
* digest arguments. For every corresponding SHA-256 digest of a script that actually exists in the script cache, an
* 1 is returned, otherwise 0 is returned.
*/
List<Boolean> scriptExists(String... digests);

Expand Down Expand Up @@ -183,7 +183,7 @@ public interface RedisScriptingCommands<K, V> {
* Load the specified Lua script into the script cache.
*
* @param script script content.
* @return String bulk-string-reply This command returns the SHA1 digest of the script added into the script cache.
* @return String bulk-string-reply This command returns the SHA-256 digest of the script added into the script cache.
* @since 6.0
*/
String scriptLoad(String script);
Expand All @@ -192,25 +192,25 @@ public interface RedisScriptingCommands<K, V> {
* Load the specified Lua script into the script cache.
*
* @param script script content.
* @return String bulk-string-reply This command returns the SHA1 digest of the script added into the script cache.
* @return String bulk-string-reply This command returns the SHA-256 digest of the script added into the script cache.
* @since 6.0
*/
String scriptLoad(byte[] script);

/**
* Create a SHA1 digest from a Lua script.
* Create a SHA-256 digest from a Lua script.
*
* @param script script content.
* @return the SHA1 value.
* @return the SHA-256 value.
* @since 6.0
*/
String digest(String script);

/**
* Create a SHA1 digest from a Lua script.
* Create a SHA-256 digest from a Lua script.
*
* @param script script content.
* @return the SHA1 value.
* @return the SHA-256 value.
* @since 6.0
*/
String digest(byte[] script);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ public interface NodeSelectionScriptingAsyncCommands<K, V> {
<T> AsyncExecutions<T> evalReadOnly(byte[] script, ScriptOutputType type, K[] keys, V... values);

/**
* Evaluates a script cached on the server side by its SHA1 digest.
* Evaluates a script cached on the server side by its SHA-256 digest.
*
* @param digest SHA1 of the script.
* @param digest SHA-256 of the script.
* @param type the type.
* @param keys the keys.
* @param <T> expected return type.
Expand All @@ -124,7 +124,7 @@ public interface NodeSelectionScriptingAsyncCommands<K, V> {
/**
* Execute a Lua script server side.
*
* @param digest SHA1 of the script.
* @param digest SHA-256 of the script.
* @param type the type.
* @param keys the keys.
* @param values the values.
Expand All @@ -136,7 +136,7 @@ public interface NodeSelectionScriptingAsyncCommands<K, V> {
/**
* This is a read-only variant of the EVALSHA command that cannot execute commands that modify data.
*
* @param digest SHA1 of the script.
* @param digest SHA-256 of the script.
* @param type the type.
* @param keys the keys.
* @param values the values.
Expand All @@ -150,9 +150,9 @@ public interface NodeSelectionScriptingAsyncCommands<K, V> {
* Check existence of scripts in the script cache.
*
* @param digests script digests.
* @return List&lt;Boolean&gt; array-reply The command returns an array of integers that correspond to the specified SHA1
* digest arguments. For every corresponding SHA1 digest of a script that actually exists in the script cache, an 1
* is returned, otherwise 0 is returned.
* @return List&lt;Boolean&gt; array-reply The command returns an array of integers that correspond to the specified SHA-256
* digest arguments. For every corresponding SHA-256 digest of a script that actually exists in the script cache, an
* 1 is returned, otherwise 0 is returned.
*/
AsyncExecutions<List<Boolean>> scriptExists(String... digests);

Expand Down Expand Up @@ -183,7 +183,7 @@ public interface NodeSelectionScriptingAsyncCommands<K, V> {
* Load the specified Lua script into the script cache.
*
* @param script script content.
* @return String bulk-string-reply This command returns the SHA1 digest of the script added into the script cache.
* @return String bulk-string-reply This command returns the SHA-256 digest of the script added into the script cache.
* @since 6.0
*/
AsyncExecutions<String> scriptLoad(String script);
Expand All @@ -192,7 +192,7 @@ public interface NodeSelectionScriptingAsyncCommands<K, V> {
* Load the specified Lua script into the script cache.
*
* @param script script content.
* @return String bulk-string-reply This command returns the SHA1 digest of the script added into the script cache.
* @return String bulk-string-reply This command returns the SHA-256 digest of the script added into the script cache.
* @since 6.0
*/
AsyncExecutions<String> scriptLoad(byte[] script);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ default AsyncNodeSelection<K, V> all() {
* Load the specified Lua script into the script cache on all cluster nodes.
*
* @param script script content
* @return String bulk-string-reply This command returns the SHA1 digest of the script added into the script cache.
* @return String bulk-string-reply This command returns the SHA-256 digest of the script added into the script cache.
* @since 6.0
*/
RedisFuture<String> scriptLoad(String script);
Expand All @@ -338,7 +338,7 @@ default AsyncNodeSelection<K, V> all() {
* Load the specified Lua script into the script cache on all cluster nodes.
*
* @param script script content
* @return String bulk-string-reply This command returns the SHA1 digest of the script added into the script cache.
* @return String bulk-string-reply This command returns the SHA-256 digest of the script added into the script cache.
* @since 6.0
*/
RedisFuture<String> scriptLoad(byte[] script);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public interface RedisAdvancedClusterReactiveCommands<K, V> extends RedisCluster
* Load the specified Lua script into the script cache on all cluster nodes.
*
* @param script script content
* @return String bulk-string-reply This command returns the SHA1 digest of the script added into the script cache.
* @return String bulk-string-reply This command returns the SHA-256 digest of the script added into the script cache.
* @since 6.0
*/
Mono<String> scriptLoad(String script);
Expand All @@ -232,7 +232,7 @@ public interface RedisAdvancedClusterReactiveCommands<K, V> extends RedisCluster
* Load the specified Lua script into the script cache on all cluster nodes.
*
* @param script script content
* @return String bulk-string-reply This command returns the SHA1 digest of the script added into the script cache.
* @return String bulk-string-reply This command returns the SHA-256 digest of the script added into the script cache.
* @since 6.0
*/
Mono<String> scriptLoad(byte[] script);
Expand Down
Loading

0 comments on commit 92a0b73

Please sign in to comment.