Merge branch 'cassandra-5.0' into trunk

This commit is contained in:
Stefan Miklosovic 2024-05-14 11:33:05 +02:00
commit 7579454057
No known key found for this signature in database
GPG Key ID: 32F35CB2F546D93E
4 changed files with 24 additions and 3 deletions

View File

@ -77,6 +77,7 @@ Merged from 5.0:
* Fix resource cleanup after SAI query timeouts (CASSANDRA-19177)
* Suppress CVE-2023-6481 (CASSANDRA-19184)
Merged from 4.1:
* Support legacy plain_text_auth section in credentials file removed unintentionally (CASSANDRA-19498)
* Make queries visible to the "system_views.queries" virtual table at the coordinator level (CASSANDRA-19577)
* Fix hints delivery for a node going down repeatedly (CASSANDRA-19495)
* Do not go to disk for reading hints file sizes (CASSANDRA-19477)

View File

@ -17,7 +17,18 @@
;
; Sample ~/.cassandra/credentials file.
;
; Please ensure this file is owned by the user and is not readable by group and other users
; The section name must match the classname from the cqlshrc file
; For example, if cqlshrc contains settings
;
; [auth_provider]
; module = cassandra.auth
; classname = PlainTextAuthProvider
;
; then the credentials file should contain a [PlainTextAuthProvider] section with the username and password parameters, as indicated in this example.
;
; For backward compatibility, it is also possible to specify [plain_text_auth] as a header.
;
; Please ensure this file is owned by the user and is not readable by group and other users.
[PlainTextAuthProvider]
; username = fred

View File

@ -44,6 +44,16 @@ Example config values and documentation can be found in the
You can also view the latest version of the
https://github.com/apache/cassandra/blob/trunk/conf/cqlshrc.sample[cqlshrc file online].
[[credentials]]
== credentials
The credentials file contains a user-name and a password for cqlsh.
A user-name and a password must be located in a section whose name matches the classname from the `[auth_provider]` section of the cqlshrc file.
The credentials file must be owned by the user and no one else has permission to read the file.
Example config values and documentation can be found in the
`conf/credentials.sample` file of a tarball installation.
[[cql_history]]
== cql history

View File

@ -2073,7 +2073,7 @@ def read_options(cmdlineargs, parser, config_file, cql_dir, environment=os.envir
credentials.read(options.credentials)
# use the username from credentials file but fallback to cqlshrc if username is absent from the command line parameters
options.username = username_from_cqlshrc
options.username = option_with_default(credentials.get, 'plain_text_auth', 'username', username_from_cqlshrc)
if not options.password:
rawcredentials = configparser.RawConfigParser()
@ -2082,7 +2082,6 @@ def read_options(cmdlineargs, parser, config_file, cql_dir, environment=os.envir
# handling password in the same way as username, priority cli > credentials > cqlshrc
options.password = option_with_default(rawcredentials.get, 'plain_text_auth', 'password', password_from_cqlshrc)
options.password = password_from_cqlshrc
elif not options.insecure_password_without_warning:
print("\nWarning: Using a password on the command line interface can be insecure."
"\nRecommendation: use the credentials file to securely provide the password.\n", file=sys.stderr)