[jira] [Updated] (CASSANDRA-19498) support legacy [plain_text_auth] in credentials file

2024-05-13 Thread Stefan Miklosovic (Jira)


 [ 
https://issues.apache.org/jira/browse/CASSANDRA-19498?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stefan Miklosovic updated CASSANDRA-19498:
--
Description: 
The pylib/cqlshlib/cqlshmain.py code reads data from the credentials file, 
however, it is immediately ignored.

[https://github.com/apache/cassandra/blob/c9625e0102dab66f41d3ef2338c54d499e73a8c5/pylib/cqlshlib/cqlshmain.py#L2070]
{code:java}
    if not options.username:
        credentials = configparser.ConfigParser()
        if options.credentials is not None:
            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    if not options.password:
        rawcredentials = configparser.RawConfigParser()
        if options.credentials is not None:
            rawcredentials.read(options.credentials)        # 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{code}
These corrections have been made in accordance with 
https://issues.apache.org/jira/browse/CASSANDRA-16983 and 
https://issues.apache.org/jira/browse/CASSANDRA-16456.

The documentation does not indicate that AuthProviders can be used in the 
cqlshrc and credentials files.

I propose to return the ability to use the legacy option of specifying the user 
and password in the credentials file in the [plain_text_auth] section.

It is also required to describe the rules for using the credentials file in the 
documentation.

I can make a corresponding pull request.

EDIT by Stefan Miklosovic:

specifying username and password in credentials file works, it is just that 
[plain_text_auth] section does not work in credentials file anymore. This was 
working with CASSANDRA-16983 but it stopped to work by CASSANDRA-16456. Both 
tickets were firstly introduced in 4.1.0 (for the public). I do not think that 
it was ever an intention to stop to support that when CASSANDRA-16456 was 
merged and it was most probably just overlooked.

  was:
The pylib/cqlshlib/cqlshmain.py code reads data from the credentials file, 
however, it is immediately ignored.

[https://github.com/apache/cassandra/blob/c9625e0102dab66f41d3ef2338c54d499e73a8c5/pylib/cqlshlib/cqlshmain.py#L2070]
{code:java}
    if not options.username:
        credentials = configparser.ConfigParser()
        if options.credentials is not None:
            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    if not options.password:
        rawcredentials = configparser.RawConfigParser()
        if options.credentials is not None:
            rawcredentials.read(options.credentials)        # 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{code}
These corrections have been made in accordance with 
https://issues.apache.org/jira/browse/CASSANDRA-16983 and 
https://issues.apache.org/jira/browse/CASSANDRA-16456.

The documentation does not indicate that AuthProviders can be used in the 
cqlshrc and credentials files.

I propose to return the ability to use the legacy option of specifying the user 
and password in the credentials file in the [plain_text_auth] section.

It is also required to describe the rules for using the credentials file in the 
documentation.

I can make a corresponding pull request.

EDIT:

specifying username and password in credentials file works, it is just that 
[plain_text_auth] section does not work in credentials file anymore. This was 
working with CASSANDRA-16983 but it stopped to work by CASSANDRA-16456. Both 
tickets were firstly introduced in 4.1.0 (for the public). I do not think that 
it was ever an intention to stop to support that when CASSANDRA-16456 was 
merged and it was most probably just overlooked.


> support legacy [plain_text_auth] in credentials file
> 
>
> Key: CASSANDRA-19498
> URL: https://issues.apache.org/jira/browse/CASSANDRA-19498
> Project: Cassandra
>  Issue Type: Bug
>  Components: Documentation, Tool/cqlsh
>Reporter: Slava
>Assignee: Stefan Miklosovic
>Priority: Normal
> Fix For: 4.1.x, 5.0.x, 5.x
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> The pylib/cqlshlib/cqlshmain.py code reads data from the credentials file, 

[jira] [Updated] (CASSANDRA-19498) support legacy [plain_text_auth] in credentials file

2024-05-13 Thread Stefan Miklosovic (Jira)


 [ 
https://issues.apache.org/jira/browse/CASSANDRA-19498?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stefan Miklosovic updated CASSANDRA-19498:
--
Reviewers: Brad Schoening, Stefan Miklosovic, Stefan Miklosovic  (was: Brad 
Schoening, Stefan Miklosovic)
   Brad Schoening, Stefan Miklosovic, Stefan Miklosovic  (was: Brad 
Schoening, Stefan Miklosovic)
   Status: Review In Progress  (was: Patch Available)

> support legacy [plain_text_auth] in credentials file
> 
>
> Key: CASSANDRA-19498
> URL: https://issues.apache.org/jira/browse/CASSANDRA-19498
> Project: Cassandra
>  Issue Type: Bug
>  Components: Documentation, Tool/cqlsh
>Reporter: Slava
>Assignee: Stefan Miklosovic
>Priority: Normal
> Fix For: 4.1.x, 5.0.x, 5.x
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> The pylib/cqlshlib/cqlshmain.py code reads data from the credentials file, 
> however, it is immediately ignored.
> [https://github.com/apache/cassandra/blob/c9625e0102dab66f41d3ef2338c54d499e73a8c5/pylib/cqlshlib/cqlshmain.py#L2070]
> {code:java}
>     if not options.username:
>         credentials = configparser.ConfigParser()
>         if options.credentials is not None:
>             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    if not options.password:
>         rawcredentials = configparser.RawConfigParser()
>         if options.credentials is not None:
>             rawcredentials.read(options.credentials)        # 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{code}
> These corrections have been made in accordance with 
> https://issues.apache.org/jira/browse/CASSANDRA-16983 and 
> https://issues.apache.org/jira/browse/CASSANDRA-16456.
> The documentation does not indicate that AuthProviders can be used in the 
> cqlshrc and credentials files.
> I propose to return the ability to use the legacy option of specifying the 
> user and password in the credentials file in the [plain_text_auth] section.
> It is also required to describe the rules for using the credentials file in 
> the documentation.
> I can make a corresponding pull request.
> EDIT:
> specifying username and password in credentials file works, it is just that 
> [plain_text_auth] section does not work in credentials file anymore. This was 
> working with CASSANDRA-16983 but it stopped to work by CASSANDRA-16456. Both 
> tickets were firstly introduced in 4.1.0 (for the public). I do not think 
> that it was ever an intention to stop to support that when CASSANDRA-16456 
> was merged and it was most probably just overlooked.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Updated] (CASSANDRA-19498) support legacy [plain_text_auth] in credentials file

2024-05-13 Thread Stefan Miklosovic (Jira)


 [ 
https://issues.apache.org/jira/browse/CASSANDRA-19498?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stefan Miklosovic updated CASSANDRA-19498:
--
Description: 
The pylib/cqlshlib/cqlshmain.py code reads data from the credentials file, 
however, it is immediately ignored.

[https://github.com/apache/cassandra/blob/c9625e0102dab66f41d3ef2338c54d499e73a8c5/pylib/cqlshlib/cqlshmain.py#L2070]
{code:java}
    if not options.username:
        credentials = configparser.ConfigParser()
        if options.credentials is not None:
            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    if not options.password:
        rawcredentials = configparser.RawConfigParser()
        if options.credentials is not None:
            rawcredentials.read(options.credentials)        # 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{code}
These corrections have been made in accordance with 
https://issues.apache.org/jira/browse/CASSANDRA-16983 and 
https://issues.apache.org/jira/browse/CASSANDRA-16456.

The documentation does not indicate that AuthProviders can be used in the 
cqlshrc and credentials files.

I propose to return the ability to use the legacy option of specifying the user 
and password in the credentials file in the [plain_text_auth] section.

It is also required to describe the rules for using the credentials file in the 
documentation.

I can make a corresponding pull request.

EDIT:

specifying username and password in credentials file works, it is just that 
[plain_text_auth] section does not work in credentials file anymore. This was 
working with CASSANDRA-16983 but it stopped to work by CASSANDRA-16456. Both 
tickets were firstly introduced in 4.1.0 (for the public). I do not think that 
it was ever an intention to stop to support that when CASSANDRA-16456 was 
merged and it was most probably just overlooked.

  was:
The pylib/cqlshlib/cqlshmain.py code reads data from the credentials file, 
however, it is immediately ignored.

https://github.com/apache/cassandra/blob/c9625e0102dab66f41d3ef2338c54d499e73a8c5/pylib/cqlshlib/cqlshmain.py#L2070
{code:java}
    if not options.username:
        credentials = configparser.ConfigParser()
        if options.credentials is not None:
            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    if not options.password:
        rawcredentials = configparser.RawConfigParser()
        if options.credentials is not None:
            rawcredentials.read(options.credentials)        # 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{code}
These corrections have been made in accordance with 
https://issues.apache.org/jira/browse/CASSANDRA-16983 and 
https://issues.apache.org/jira/browse/CASSANDRA-16456.

The documentation does not indicate that AuthProviders can be used in the 
cqlshrc and credentials files.

I propose to return the ability to use the legacy option of specifying the user 
and password in the credentials file in the [plain_text_auth] section.

It is also required to describe the rules for using the credentials file in the 
documentation.

I can make a corresponding pull request.


> support legacy [plain_text_auth] in credentials file
> 
>
> Key: CASSANDRA-19498
> URL: https://issues.apache.org/jira/browse/CASSANDRA-19498
> Project: Cassandra
>  Issue Type: Bug
>  Components: Documentation, Tool/cqlsh
>Reporter: Slava
>Priority: Normal
> Fix For: 4.1.x, 5.0.x, 5.x
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> The pylib/cqlshlib/cqlshmain.py code reads data from the credentials file, 
> however, it is immediately ignored.
> [https://github.com/apache/cassandra/blob/c9625e0102dab66f41d3ef2338c54d499e73a8c5/pylib/cqlshlib/cqlshmain.py#L2070]
> {code:java}
>     if not options.username:
>         credentials = configparser.ConfigParser()
>         if options.credentials is not None:
>             credentials.read(options.credentials)        # use the username 
> from credentials file but fallback to cqlshrc if username is absent from the 
> command line parameters
>         

[jira] [Updated] (CASSANDRA-19498) support legacy [plain_text_auth] in credentials file

2024-05-13 Thread Stefan Miklosovic (Jira)


 [ 
https://issues.apache.org/jira/browse/CASSANDRA-19498?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stefan Miklosovic updated CASSANDRA-19498:
--
Summary: support legacy [plain_text_auth] in credentials file  (was: Error 
reading data from credential file)

> support legacy [plain_text_auth] in credentials file
> 
>
> Key: CASSANDRA-19498
> URL: https://issues.apache.org/jira/browse/CASSANDRA-19498
> Project: Cassandra
>  Issue Type: Bug
>  Components: Documentation, Tool/cqlsh
>Reporter: Slava
>Priority: Normal
> Fix For: 4.1.x, 5.0.x, 5.x
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> The pylib/cqlshlib/cqlshmain.py code reads data from the credentials file, 
> however, it is immediately ignored.
> https://github.com/apache/cassandra/blob/c9625e0102dab66f41d3ef2338c54d499e73a8c5/pylib/cqlshlib/cqlshmain.py#L2070
> {code:java}
>     if not options.username:
>         credentials = configparser.ConfigParser()
>         if options.credentials is not None:
>             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    if not options.password:
>         rawcredentials = configparser.RawConfigParser()
>         if options.credentials is not None:
>             rawcredentials.read(options.credentials)        # 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{code}
> These corrections have been made in accordance with 
> https://issues.apache.org/jira/browse/CASSANDRA-16983 and 
> https://issues.apache.org/jira/browse/CASSANDRA-16456.
> The documentation does not indicate that AuthProviders can be used in the 
> cqlshrc and credentials files.
> I propose to return the ability to use the legacy option of specifying the 
> user and password in the credentials file in the [plain_text_auth] section.
> It is also required to describe the rules for using the credentials file in 
> the documentation.
> I can make a corresponding pull request.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org