Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-19498

Error reading data from credential file

    XMLWordPrintableJSON

Details

    • Code - Bug - Unclear Impact
    • Normal
    • Normal
    • User Report
    • All
    • None
    • Hide

      ci

      Show
      ci

    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

          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

      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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              slavavrn Slava
              Brad Schoening, Stefan Miklosovic
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 10m
                  10m