Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add token command #1517

Closed

Conversation

ajaypratap003
Copy link

@ajaypratap003 ajaypratap003 commented Apr 9, 2022

Closes # https://issues.redhat.com/browse/MGDSTRM-8103

Verification Steps

Run the following command

##Generate current user auth token
rhoas auth-token

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

@ajaypratap003 ajaypratap003 requested a review from wtrocki April 9, 2022 19:29
}

cmd := &cobra.Command{
Use: "token",
Copy link
Collaborator

@wtrocki wtrocki Apr 10, 2022

Choose a reason for hiding this comment

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

@rkpattnaik780 once we merge this we have whoami and token commands now.
Maybe it is worth to introduce auth and keep two commands there?

I'm worried about too many commands in root of cli.

Otherwise we can do

Suggested change
Use: "token",
Use: "auth-token",

Copy link
Collaborator

Choose a reason for hiding this comment

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

Alternatively we can put token as hidden command

Copy link
Author

@ajaypratap003 ajaypratap003 Apr 10, 2022

Choose a reason for hiding this comment

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

@wtrocki I updated cmd name as auth-token but build is failing due to test failing, seems validator_test is failing.
If I'm not wrong validator_test.go rules doesn't allow to use - dash in cmd name.

Copy link
Collaborator

Choose a reason for hiding this comment

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

That was actually bad advice on my side. I will wait for @rkpattnaik780 opinion about the command name and we can merge it.

Copy link
Contributor

Choose a reason for hiding this comment

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

whoami command looks good where it is right now, I dont feel good about introducing "auth".

Copy link
Contributor

Choose a reason for hiding this comment

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

@wtrocki I updated cmd name as auth-token but build is failing due to test failing, seems validator_test is failing. If I'm not wrong validator_test.go rules doesn't allow to use - dash in cmd name.

Examples need to be updated.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Command name is not going to pass validation. @rkpattnaik780 do you mind adjusting name to authtoken or maybe we can have separate group for whoami and token?

Copy link
Contributor

Choose a reason for hiding this comment

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

do you mind adjusting name to authtoken or maybe we can have separate group for whoami and token?

authtoken seems a better name. I strongly feel whoami should be at root.

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.

World class work! Thank you so much.

@wtrocki
Copy link
Collaborator

wtrocki commented Apr 10, 2022

FYI token we return is control plane token.
We could support dataplane token as well but I think it doesnt make sense now since we migrating out of that sso instance

Copy link
Contributor

@rkpattnaik780 rkpattnaik780 left a comment

Choose a reason for hiding this comment

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

Looks great! :D

@wtrocki
Copy link
Collaborator

wtrocki commented Apr 11, 2022

Changing name in separate PR. All changes will be merged

@wtrocki wtrocki closed this Apr 11, 2022
@wtrocki wtrocki mentioned this pull request Apr 11, 2022
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.

3 participants