Skip to content

fix(login): clear MAS tokens from config when using token login#605

Merged
craicoverflow merged 2 commits intoredhat-developer:mainfrom
craicoverflow:better-token-error
Apr 20, 2021
Merged

fix(login): clear MAS tokens from config when using token login#605
craicoverflow merged 2 commits intoredhat-developer:mainfrom
craicoverflow:better-token-error

Conversation

@craicoverflow
Copy link
Contributor

Closes #594

Verification Steps

  1. Log in using an offline token: rhoas login --token=$TOKEN
  2. Run rhoas kafka topic list.
  3. You should get the following error message:
Error: not logged in to MAS-SSO. Run "rhoas login" to authenticate. Note: token-based login is not supported by the Kafka admin commands.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation change
  • Other (please specify)

Checklist

  • Documentation added for the feature
  • CI and all relevant tests are passing
  • Code Review completed
  • Verified independently by reviewer

@craicoverflow craicoverflow requested a review from wtrocki April 20, 2021 10:44
@wtrocki
Copy link
Collaborator

wtrocki commented Apr 20, 2021

Amazing change! really needed!


[connection.error.notLoggedInMASError]
one = 'not logged in to MAS-SSO. Run "rhoas login" to authenticate'
one = 'not logged in to MAS-SSO. Run "rhoas login" to authenticate. Note: token-based login is not supported by the Kafka admin commands.'
Copy link
Collaborator

@wtrocki wtrocki Apr 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not clear what are kafka admin commands. As user I would go and look rhoas kafka admin but we do mix admin commands with control plane ones. It feels that we need to list them to make it more clear.

Something like this: (although you might have better idea how to do it)

Suggested change
one = 'not logged in to MAS-SSO. Run "rhoas login" to authenticate. Note: token-based login is not supported by the Kafka admin commands.'
one = 'not logged in to MAS-SSO. Run "rhoas login" to authenticate. Note: token-based login is not supported by the Kafka topics and consumergroup commands.'

Copy link
Collaborator

@wtrocki wtrocki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified. Minor improvement in message is required

@craicoverflow craicoverflow merged commit da6fed1 into redhat-developer:main Apr 20, 2021
@craicoverflow craicoverflow deleted the better-token-error branch April 20, 2021 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When logging using login --token kafka topic commands are not available

2 participants