Skip to content

Commit 5ed2092

Browse files
authored
fix: Tools-2826 don't check for read-write privlege, allows ldap users to connect correctly. (#45)
* build: update aerospike java client to version 7.2.1 * fix: don't check for read-write role, let the server handle role violations. this fixes an issue where LDAP auth would fail the role check * build: bump asloader version to 4.0.2 * docs: remove options from readme, link to website instead * docs: show the --usage command in readme * build: bump version to 4.0.2
1 parent c712b0d commit 5ed2092

File tree

4 files changed

+20
-64
lines changed

4 files changed

+20
-64
lines changed

README.md

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -56,41 +56,20 @@ If you downloaded the source. Use **run_loader** script along with options and d
5656

5757
"data file name(s)/directory" can either be space delimited files or a directory name containing data files. See "Data Files" section for more details.
5858

59-
__Options__:
60-
61-
``` java
62-
-h,--hosts <arg> List of seed hosts (default: localhost)
63-
-p,--port <arg> Server port (default: 3000)
64-
-U,--user <arg> User name
65-
-P,--password <arg> Password
66-
-n,--namespace <arg> Namespace (default: test)
67-
-c,--config <arg> Column definition file in JSON format
68-
-g,--max-throughput <arg> Set a target max transactions per second for the loader (default: 0 (don`t limit TPS)).
69-
-T,--transaction-timeout <arg> Transaction timeout in milliseconds for write (default: no timeout)
70-
-e,--expiration-time <arg> Time to expire of a record in seconds (default: never expire)
71-
-tz,--timezone <arg> TimeZone of source where datadump is taken (default: local timeZone)
72-
-ec,--abort-Error-Count<arg> Abort when error occurs more than this value (default: 0 (don`t abort))
73-
-wa,--write-Action <arg> Write action if key already exists (default: update)
74-
-tls,--tls-enable Use TLS/SSL sockets(default: False)
75-
-tp,--tls-protocols Allow TLS protocols. Values: TLSv1,TLSv1.1,TLSv1.2 separated by comma (default: TLSv1.2)
76-
-tlsCiphers,--tls-cipher-suite Allow TLS cipher suites. Values: cipher names defined by JVM separated by comma (default: null (default cipher list provided by JVM))
77-
-tr,--tls-revoke Revoke certificates identified by their serial number. Values: serial numbers separated by comma (default: null (Do not revoke certificates))
78-
-uk,--send-user-key Send user defined key in addition to hash digest to store on the server. (default: userKey is not sent to reduce meta-data overhead)
79-
-um,--unorderedMaps If this flag is present write all maps as unordered maps.
80-
-u,--usage Print usage.
81-
-v,--verbose Verbose mode for debug logging (default: INFO)
82-
-V,--version Print version
83-
```
59+
For available options and their descriptions run with asloader's --usage option.
60+
61+
$ java -cp aerospike-load-*-jar-with-dependencies.jar com.aerospike.load.AerospikeLoad --usage
62+
$ ./run_loader --usage
8463

85-
For more details, refer to [Options](doc/options.md).
64+
For more details, refer to [Options](https://aerospike.com/docs/tools/asloader/options).
8665

8766
### Some extra info about internal working:
8867

8968
* There are 2 types of threads:
9069
* reader threads (reads CSV files) (The number of reader threads = either number of CPUs or number of files in the directory, whichever one is lower.)
9170
* writer threads (writes to the cluster) (The number of writer threads = number of CPUs * 5 (5 is scaleFactor))
9271

93-
### Sample usage of all options:
72+
### Sample usage of common options:
9473

9574
$ ./run_loader -h nodex -p 3000 -n test -T 3000 -e 2592000 -ec 100 -tz PST -wa update -c ~/pathto/config.json datafiles/
9675

doc/releasenotes.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,14 @@
9191
## Aerospike Loader [4.0.1] Release Date [7 Aug 2023]
9292
## Security:
9393
* [Snyk] Security upgrade com.aerospike:aerospike-client from 6.1.7 to 7.0.0 by @arrowplum in https://github.com/aerospike/aerospike-loader/pull/40
94-
* TOOLS-2640 fix [CVE-2023](https://aerospike.atlassian.net/browse/TOOLS-2640)
94+
* TOOLS-2640 fix [CVE-2023](https://aerospike.atlassian.net/browse/TOOLS-2640)
95+
96+
## Aerospike Loader [4.0.2] Release Date [15 Jan 2024]
97+
## Security
98+
* [Snyk] Upgrade org.apache.logging.log4j:log4j-api from 2.20.0 to 2.21.0
99+
* [Snyk] Upgrade org.apache.logging.log4j:log4j-core from 2.20.0 to 2.21.0
100+
* [Snyk] Upgrade commons-cli:commons-cli from 1.5.0 to 1.6.0
101+
102+
## Bug Fixes:
103+
* TOOLS-2826 \(ASLOADER\) Fixed an issue where ldap users fail read-write role validation.
104+
Asloader no longer checks if the Aerospike user has read-write permissions before beginning writes.

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.aerospike</groupId>
55
<artifactId>aerospike-load</artifactId>
6-
<version>4.0.1</version>
6+
<version>4.0.2</version>
77
<name>Aerospike DSV Loader</name>
88
<packaging>jar</packaging>
99

@@ -32,7 +32,7 @@
3232
<dependency>
3333
<groupId>com.aerospike</groupId>
3434
<artifactId>aerospike-client</artifactId>
35-
<version>7.0.0</version>
35+
<version>7.2.1</version>
3636
</dependency>
3737
<!-- Apache command line parser. -->
3838
<dependency>

src/main/java/com/aerospike/load/AerospikeLoad.java

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -60,30 +60,7 @@
6060
*
6161
* It will import multiple Data Dump files concurrently
6262
*
63-
* To run: java -jar aerospike-import-<version> <options> <file names>
64-
* The options are:
65-
* -h,--hosts <arg> List of seed hosts (default: localhost)
66-
* -p,--port <arg> Server port (default: 3000)
67-
* -U,--user <arg> User name
68-
* -P,--password <arg> Password
69-
* -n,--namespace <arg> Namespace (default: test)
70-
* -c,--config <arg> Column definition file in JSON format
71-
* -g,--max-throughput <arg> Set a target transactions per second for the loader. The loader should not exceed this average throughput.
72-
* -T,--transaction-timeout <arg> Transaction timeout in milliseconds for write (default: no timeout)
73-
* -e,--expiration-time <arg> Time to expire of a record in seconds(default: never expire)
74-
* -tz,--timezone <arg> TimeZone of source where datadump is taken (default: local timeZone)
75-
* -ec,--abort-Error-Count<arg> Abort when error occurs more than this value(default: 0(don't abort))
76-
* -wa,--write-Action <arg> Write action if key already exists (default: update)
77-
* -tls,--tls-enable Use TLS/SSL sockets(default: False)
78-
* -tp,--tls-protocols Allow TLS protocols. Values: TLSv1,TLSv1.1,TLSv1.2 separated by comma (default: TLSv1.2)
79-
* -tlsCiphers,--tls-cipher-suite Allow TLS cipher suites. Values: cipher names defined by JVM separated by comma (default: null (default cipher list provided by JVM))
80-
* -tr,--tls-revoke Revoke certificates identified by their serial number. Values: serial numbers separated by comma (default: null (Do not revoke certificates))
81-
* -uk,--send-user-key Send user defined key in addition to hash digest to store on the server. (default: userKey is not sent to reduce meta-data overhead)
82-
* -u,--usage Print usage.
83-
* -v,--verbose Verbose mode for debug logging (default: INFO)
84-
* -um,--unordered-map Write maps as unorderd (default: false)
85-
* The file names can be a series of file names or directories.
86-
*
63+
* To run: java -jar aerospike-import-<version> <options> <file names> *
8764
* @author Aerospike
8865
*
8966
*/
@@ -273,16 +250,6 @@ private static AerospikeClient getAerospikeClient(CommandLine cl) {
273250
log.error("Client is not able to connect:" + params.hosts);
274251
return null;
275252
}
276-
try {
277-
// Check read-write role is given to user.
278-
if (!client.queryUser(null, clientPolicy.user).roles.contains(Role.ReadWrite)) {
279-
log.error("User role:" + client.queryUser(null, clientPolicy.user).roles.toString() + " Expected:" + Role.ReadWrite);
280-
return null;
281-
}
282-
}
283-
catch (AerospikeException e) {
284-
// Ignore if security is not enabled.
285-
}
286253
return client;
287254
}
288255

0 commit comments

Comments
 (0)